본문으로 건너뛰기
Skillpedia
에이전트35k · #7923

exploiting-sql-injection-vulnerabilities

하는 일

이 도구는 웹사이트에서 ‘SQL 인젝션’이라 불리는 보안 결함을 찾아 악용하는 데 도움을 줍니다. 항상 허가를 받은 상태에서, 입력 양식에 악성 명령을 넣어 데이터베이스 정보에 접근하거나 바꿀 수 있는지 확인합니다.

사용하는 경우

  • ✓웹사이트를 공개하기 전에 보안을 테스트할 때.
  • ✓웹사이트에 입력한 정보가 올바르게 보호되는지 확인할 때.
  • ✓웹사이트가 해킹되어 데이터가 도난당할 위험을 보여 줄 때.

스킬 링크

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-sql-injection-vulnerabilities/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-sql-injection-vulnerabilities/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 웹사이트의 로그인 양식이 SQL 인젝션에 취약한지 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 도구는 웹사이트의 여러 부분(텍스트 입력란과 URL 등)에 작은 명령을 넣어, 데이터베이스가 예상치 못하게 반응하는지 살펴봅니다. 그렇다면 취약점이 있다는 뜻입니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Exploiting SQL Injection Vulnerabilities

When to Use

  • Testing web application input parameters for SQL injection vulnerabilities during an authorized penetration test
  • Validating that parameterized queries and input sanitization are properly implemented across all database interactions
  • Demonstrating the business impact of a confirmed SQL injection vulnerability by extracting sensitive data
  • Verifying that WAF rules and input validation controls effectively block SQL injection payloads
  • Testing stored procedures, dynamic SQL, and ORM bypass scenarios in enterprise applications

Do not use against databases without written authorization, for extracting or exfiltrating actual customer data beyond what is needed for proof of concept, or against production databases where exploitation could corrupt data integrity.

Prerequisites

  • Written authorization specifying the target application and permissible level of exploitation (detection only vs. full exploitation)
  • Burp Suite Professional configured as an intercepting proxy to capture and modify HTTP requests
  • sqlmap installed with current version for automated detection and exploitation
  • Knowledge of the target database engine (MySQL, PostgreSQL, MSSQL, Oracle) or ability to fingerprint it
  • Test accounts at various privilege levels to test injection in authenticated contexts

Workflow

Step 1: Injection Point Discovery

Identify parameters that interact with the database:

  • Map all input vectors: Catalog every parameter in URLs (GET), request bodies (POST), HTTP headers (Cookie, Referer, User-Agent, X-Forwarded-For), and JSON/XML API payloads
  • Error-based detection: Inject a single quote (') into each parameter and observe the response. SQL errors (e.g., "You have an error in your SQL syntax", "unterminated quoted string", "ORA-01756") confirm the parameter reaches the database unsanitized.
  • Boolean-based detection: Inject ' AND 1=1-- (true condition) and ' AND 1=2-- (false condition). If the responses differ (different content length, different data returned, different HTTP status), the parameter is injectable.
  • Time-based detection: Inject '; WAITFOR DELAY '0:0:5'-- (MSSQL), ' AND SLEEP(5)-- (MySQL), or '; SELECT pg_sleep(5)-- (PostgreSQL). A 5-second response delay confirms injection.
  • Out-of-band detection: Use payloads that trigger DNS or HTTP requests to a Burp Collaborator domain to confirm injection in scenarios where responses are not directly observable.
  • Second-order injection: Test for injection where input is stored and later used in a different SQL query (e.g., username stored at registration, used in a query on the profile page).

Step 2: Database Fingerprinting

Determine the database engine and version to select appropriate exploitation techniques:

  • Error-based fingerprinting: Each database produces distinctive error messages. MySQL includes "MySQL", MSSQL mentions "SQL Server", PostgreSQL references "PG", Oracle contains "ORA-".
  • Function-based fingerprinting: Inject database-specific functions:
    • MySQL: ' AND VERSION()-- or ' AND @@version--
    • MSSQL: ' AND @@version-- or ' AND DB_NAME()--
    • PostgreSQL: ' AND version()--
    • Oracle: ' AND banner FROM v$version--
  • String concatenation differences: MySQL uses CONCAT('a','b') or 'a' 'b', MSSQL uses 'a'+'b', PostgreSQL uses 'a'||'b', Oracle uses 'a'||'b'
  • Comment syntax: MySQL supports # and -- , MSSQL uses -- , PostgreSQL uses -- , Oracle uses --

Step 3: Manual Exploitation Techniques

Exploit confirmed injection points using technique-appropriate methods:

  • UNION-based extraction: Determine the number of columns with ORDER BY incrementing (' ORDER BY 1--, ' ORDER BY 2--, etc. until an error occurs). Then construct UNION SELECT to extract data:
    ' UNION SELECT NULL,username,password,NULL FROM users--
    
  • Error-based extraction (MySQL): Use EXTRACTVALUE or UPDATEXML to force data into error messages:
    ' AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT @@version),0x7e))--
    
  • Blind boolean extraction: Extract data one character at a time by testing character values:
    ' AND SUBSTRING((SELECT password FROM users WHERE username='admin'),1,1)='a'--
    
  • Time-based blind extraction: Same character-by-character approach using time delays:
    
    

…

자주 묻는 질문

SQL 인젝션이란 무엇인가요?

공격자가 웹사이트 입력란에 악성 명령을 넣는 공격 유형입니다. 웹사이트가 보호되지 않으면 이 명령이 데이터베이스에서 실행되어, 공격자가 정보를 보거나, 바꾸거나, 훔칠 수 있습니다.

이 도구를 사용하려면 허가가 필요한가요?

네, 테스트를 하기 전에 웹사이트 소유자의 서면 허가가 필수입니다. 허가 없이 사용하면 불법입니다.

이 도구가 웹사이트를 손상시킬 수 있나요?

잘못 사용하거나 허가 없이 사용하면 그럴 수 있습니다. 이 도구는 통제된 보안 테스트를 위해 설계되었으며, 명시적인 허가 없이 운영 중인 웹사이트에서 사용하면 데이터가 손상될 수 있으므로 사용하면 안 됩니다.

상세 정보

작성자의 원본 설명

Identifies and exploits SQL injection vulnerabilities in web applications during authorized penetration tests using manual techniques and automated tools like sqlmap. The tester detects injection points through error-based, union-based, blind boolean, and time-based blind techniques across all major database engines (MySQL, PostgreSQL, MSSQL, Oracle) to demonstrate data extraction, authentication

repo: mukul975/Anthropic-Cybersecurity-Skills

인기도

GitHub 스타
35k
순위
#7923
라이선스
Apache-2.0
업데이트
2026. 8. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬