@wazir-dev/cli 1.0.0

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 (629) hide show
  1. package/AGENTS.md +111 -0
  2. package/CHANGELOG.md +14 -0
  3. package/CONTRIBUTING.md +101 -0
  4. package/LICENSE +21 -0
  5. package/README.md +314 -0
  6. package/assets/composition-engine.mmd +34 -0
  7. package/assets/demo-script.sh +17 -0
  8. package/assets/logo-dark.svg +14 -0
  9. package/assets/logo.svg +14 -0
  10. package/assets/pipeline.mmd +39 -0
  11. package/assets/record-demo.sh +51 -0
  12. package/docs/README.md +51 -0
  13. package/docs/adapters/context-mode.md +60 -0
  14. package/docs/concepts/architecture.md +87 -0
  15. package/docs/concepts/artifact-model.md +60 -0
  16. package/docs/concepts/composition-engine.md +36 -0
  17. package/docs/concepts/indexing-and-recall.md +160 -0
  18. package/docs/concepts/observability.md +41 -0
  19. package/docs/concepts/roles-and-workflows.md +59 -0
  20. package/docs/concepts/terminology-policy.md +27 -0
  21. package/docs/getting-started/01-installation.md +78 -0
  22. package/docs/getting-started/02-first-run.md +102 -0
  23. package/docs/getting-started/03-adding-to-project.md +15 -0
  24. package/docs/getting-started/04-host-setup.md +15 -0
  25. package/docs/guides/ci-integration.md +15 -0
  26. package/docs/guides/creating-skills.md +15 -0
  27. package/docs/guides/expertise-module-authoring.md +15 -0
  28. package/docs/guides/hook-development.md +15 -0
  29. package/docs/guides/memory-and-learnings.md +34 -0
  30. package/docs/guides/multi-host-export.md +15 -0
  31. package/docs/guides/troubleshooting.md +101 -0
  32. package/docs/guides/writing-custom-roles.md +15 -0
  33. package/docs/plans/2026-03-15-cli-pipeline-integration-design.md +592 -0
  34. package/docs/plans/2026-03-15-cli-pipeline-integration-plan.md +598 -0
  35. package/docs/plans/2026-03-15-docs-enforcement-plan.md +238 -0
  36. package/docs/readmes/INDEX.md +99 -0
  37. package/docs/readmes/features/expertise/README.md +171 -0
  38. package/docs/readmes/features/exports/README.md +222 -0
  39. package/docs/readmes/features/hooks/README.md +103 -0
  40. package/docs/readmes/features/hooks/loop-cap-guard.md +133 -0
  41. package/docs/readmes/features/hooks/post-tool-capture.md +121 -0
  42. package/docs/readmes/features/hooks/post-tool-lint.md +130 -0
  43. package/docs/readmes/features/hooks/pre-compact-summary.md +122 -0
  44. package/docs/readmes/features/hooks/pre-tool-capture-route.md +100 -0
  45. package/docs/readmes/features/hooks/protected-path-write-guard.md +128 -0
  46. package/docs/readmes/features/hooks/session-start.md +119 -0
  47. package/docs/readmes/features/hooks/stop-handoff-harvest.md +125 -0
  48. package/docs/readmes/features/roles/README.md +157 -0
  49. package/docs/readmes/features/roles/clarifier.md +152 -0
  50. package/docs/readmes/features/roles/content-author.md +190 -0
  51. package/docs/readmes/features/roles/designer.md +193 -0
  52. package/docs/readmes/features/roles/executor.md +184 -0
  53. package/docs/readmes/features/roles/learner.md +210 -0
  54. package/docs/readmes/features/roles/planner.md +182 -0
  55. package/docs/readmes/features/roles/researcher.md +164 -0
  56. package/docs/readmes/features/roles/reviewer.md +184 -0
  57. package/docs/readmes/features/roles/specifier.md +162 -0
  58. package/docs/readmes/features/roles/verifier.md +215 -0
  59. package/docs/readmes/features/schemas/README.md +178 -0
  60. package/docs/readmes/features/skills/README.md +63 -0
  61. package/docs/readmes/features/skills/brainstorming.md +96 -0
  62. package/docs/readmes/features/skills/debugging.md +148 -0
  63. package/docs/readmes/features/skills/design.md +120 -0
  64. package/docs/readmes/features/skills/prepare-next.md +109 -0
  65. package/docs/readmes/features/skills/run-audit.md +159 -0
  66. package/docs/readmes/features/skills/scan-project.md +109 -0
  67. package/docs/readmes/features/skills/self-audit.md +176 -0
  68. package/docs/readmes/features/skills/tdd.md +137 -0
  69. package/docs/readmes/features/skills/using-skills.md +92 -0
  70. package/docs/readmes/features/skills/verification.md +120 -0
  71. package/docs/readmes/features/skills/writing-plans.md +104 -0
  72. package/docs/readmes/features/tooling/README.md +320 -0
  73. package/docs/readmes/features/workflows/README.md +186 -0
  74. package/docs/readmes/features/workflows/author.md +181 -0
  75. package/docs/readmes/features/workflows/clarify.md +154 -0
  76. package/docs/readmes/features/workflows/design-review.md +171 -0
  77. package/docs/readmes/features/workflows/design.md +169 -0
  78. package/docs/readmes/features/workflows/discover.md +162 -0
  79. package/docs/readmes/features/workflows/execute.md +173 -0
  80. package/docs/readmes/features/workflows/learn.md +167 -0
  81. package/docs/readmes/features/workflows/plan-review.md +165 -0
  82. package/docs/readmes/features/workflows/plan.md +170 -0
  83. package/docs/readmes/features/workflows/prepare-next.md +167 -0
  84. package/docs/readmes/features/workflows/review.md +169 -0
  85. package/docs/readmes/features/workflows/run-audit.md +191 -0
  86. package/docs/readmes/features/workflows/spec-challenge.md +159 -0
  87. package/docs/readmes/features/workflows/specify.md +160 -0
  88. package/docs/readmes/features/workflows/verify.md +177 -0
  89. package/docs/readmes/packages/README.md +50 -0
  90. package/docs/readmes/packages/ajv.md +117 -0
  91. package/docs/readmes/packages/context-mode.md +118 -0
  92. package/docs/readmes/packages/gray-matter.md +116 -0
  93. package/docs/readmes/packages/node-test.md +137 -0
  94. package/docs/readmes/packages/yaml.md +112 -0
  95. package/docs/reference/configuration-reference.md +159 -0
  96. package/docs/reference/expertise-index.md +52 -0
  97. package/docs/reference/git-flow.md +43 -0
  98. package/docs/reference/hooks.md +87 -0
  99. package/docs/reference/host-exports.md +50 -0
  100. package/docs/reference/launch-checklist.md +172 -0
  101. package/docs/reference/marketplace-listings.md +76 -0
  102. package/docs/reference/release-process.md +34 -0
  103. package/docs/reference/roles-reference.md +77 -0
  104. package/docs/reference/skills.md +33 -0
  105. package/docs/reference/templates.md +29 -0
  106. package/docs/reference/tooling-cli.md +94 -0
  107. package/docs/truth-claims.yaml +222 -0
  108. package/expertise/PROGRESS.md +63 -0
  109. package/expertise/README.md +18 -0
  110. package/expertise/antipatterns/PROGRESS.md +56 -0
  111. package/expertise/antipatterns/backend/api-design-antipatterns.md +1271 -0
  112. package/expertise/antipatterns/backend/auth-antipatterns.md +1195 -0
  113. package/expertise/antipatterns/backend/caching-antipatterns.md +622 -0
  114. package/expertise/antipatterns/backend/database-antipatterns.md +1038 -0
  115. package/expertise/antipatterns/backend/index.md +24 -0
  116. package/expertise/antipatterns/backend/microservices-antipatterns.md +850 -0
  117. package/expertise/antipatterns/code/architecture-antipatterns.md +919 -0
  118. package/expertise/antipatterns/code/async-antipatterns.md +622 -0
  119. package/expertise/antipatterns/code/code-smells.md +1186 -0
  120. package/expertise/antipatterns/code/dependency-antipatterns.md +1209 -0
  121. package/expertise/antipatterns/code/error-handling-antipatterns.md +1360 -0
  122. package/expertise/antipatterns/code/index.md +27 -0
  123. package/expertise/antipatterns/code/naming-and-abstraction.md +1118 -0
  124. package/expertise/antipatterns/code/state-management-antipatterns.md +1076 -0
  125. package/expertise/antipatterns/code/testing-antipatterns.md +1053 -0
  126. package/expertise/antipatterns/design/accessibility-antipatterns.md +1136 -0
  127. package/expertise/antipatterns/design/dark-patterns.md +1121 -0
  128. package/expertise/antipatterns/design/index.md +22 -0
  129. package/expertise/antipatterns/design/ui-antipatterns.md +1202 -0
  130. package/expertise/antipatterns/design/ux-antipatterns.md +680 -0
  131. package/expertise/antipatterns/frontend/css-layout-antipatterns.md +691 -0
  132. package/expertise/antipatterns/frontend/flutter-antipatterns.md +1827 -0
  133. package/expertise/antipatterns/frontend/index.md +23 -0
  134. package/expertise/antipatterns/frontend/mobile-antipatterns.md +573 -0
  135. package/expertise/antipatterns/frontend/react-antipatterns.md +1128 -0
  136. package/expertise/antipatterns/frontend/spa-antipatterns.md +1235 -0
  137. package/expertise/antipatterns/index.md +31 -0
  138. package/expertise/antipatterns/performance/index.md +20 -0
  139. package/expertise/antipatterns/performance/performance-antipatterns.md +1013 -0
  140. package/expertise/antipatterns/performance/premature-optimization.md +623 -0
  141. package/expertise/antipatterns/performance/scaling-antipatterns.md +785 -0
  142. package/expertise/antipatterns/process/ai-coding-antipatterns.md +853 -0
  143. package/expertise/antipatterns/process/code-review-antipatterns.md +656 -0
  144. package/expertise/antipatterns/process/deployment-antipatterns.md +920 -0
  145. package/expertise/antipatterns/process/index.md +23 -0
  146. package/expertise/antipatterns/process/technical-debt-antipatterns.md +647 -0
  147. package/expertise/antipatterns/security/index.md +20 -0
  148. package/expertise/antipatterns/security/secrets-antipatterns.md +849 -0
  149. package/expertise/antipatterns/security/security-theater.md +843 -0
  150. package/expertise/antipatterns/security/vulnerability-patterns.md +801 -0
  151. package/expertise/architecture/PROGRESS.md +70 -0
  152. package/expertise/architecture/data/caching-architecture.md +671 -0
  153. package/expertise/architecture/data/data-consistency.md +574 -0
  154. package/expertise/architecture/data/data-modeling.md +536 -0
  155. package/expertise/architecture/data/event-streams-and-queues.md +634 -0
  156. package/expertise/architecture/data/index.md +25 -0
  157. package/expertise/architecture/data/search-architecture.md +663 -0
  158. package/expertise/architecture/data/sql-vs-nosql.md +708 -0
  159. package/expertise/architecture/decisions/architecture-decision-records.md +640 -0
  160. package/expertise/architecture/decisions/build-vs-buy.md +616 -0
  161. package/expertise/architecture/decisions/index.md +23 -0
  162. package/expertise/architecture/decisions/monolith-to-microservices.md +790 -0
  163. package/expertise/architecture/decisions/technology-selection.md +616 -0
  164. package/expertise/architecture/distributed/cap-theorem-and-tradeoffs.md +800 -0
  165. package/expertise/architecture/distributed/circuit-breaker-bulkhead.md +741 -0
  166. package/expertise/architecture/distributed/consensus-and-coordination.md +796 -0
  167. package/expertise/architecture/distributed/distributed-systems-fundamentals.md +564 -0
  168. package/expertise/architecture/distributed/idempotency-and-retry.md +796 -0
  169. package/expertise/architecture/distributed/index.md +25 -0
  170. package/expertise/architecture/distributed/saga-pattern.md +797 -0
  171. package/expertise/architecture/foundations/architectural-thinking.md +460 -0
  172. package/expertise/architecture/foundations/coupling-and-cohesion.md +770 -0
  173. package/expertise/architecture/foundations/design-principles-solid.md +649 -0
  174. package/expertise/architecture/foundations/domain-driven-design.md +719 -0
  175. package/expertise/architecture/foundations/index.md +25 -0
  176. package/expertise/architecture/foundations/separation-of-concerns.md +472 -0
  177. package/expertise/architecture/foundations/twelve-factor-app.md +797 -0
  178. package/expertise/architecture/index.md +34 -0
  179. package/expertise/architecture/integration/api-design-graphql.md +638 -0
  180. package/expertise/architecture/integration/api-design-grpc.md +804 -0
  181. package/expertise/architecture/integration/api-design-rest.md +892 -0
  182. package/expertise/architecture/integration/index.md +25 -0
  183. package/expertise/architecture/integration/third-party-integration.md +795 -0
  184. package/expertise/architecture/integration/webhooks-and-callbacks.md +1152 -0
  185. package/expertise/architecture/integration/websockets-realtime.md +791 -0
  186. package/expertise/architecture/mobile-architecture/index.md +22 -0
  187. package/expertise/architecture/mobile-architecture/mobile-app-architecture.md +780 -0
  188. package/expertise/architecture/mobile-architecture/mobile-backend-for-frontend.md +670 -0
  189. package/expertise/architecture/mobile-architecture/offline-first.md +719 -0
  190. package/expertise/architecture/mobile-architecture/push-and-sync.md +782 -0
  191. package/expertise/architecture/patterns/cqrs-event-sourcing.md +717 -0
  192. package/expertise/architecture/patterns/event-driven.md +797 -0
  193. package/expertise/architecture/patterns/hexagonal-clean-architecture.md +870 -0
  194. package/expertise/architecture/patterns/index.md +27 -0
  195. package/expertise/architecture/patterns/layered-architecture.md +736 -0
  196. package/expertise/architecture/patterns/microservices.md +753 -0
  197. package/expertise/architecture/patterns/modular-monolith.md +692 -0
  198. package/expertise/architecture/patterns/monolith.md +626 -0
  199. package/expertise/architecture/patterns/plugin-architecture.md +735 -0
  200. package/expertise/architecture/patterns/serverless.md +780 -0
  201. package/expertise/architecture/scaling/database-scaling.md +615 -0
  202. package/expertise/architecture/scaling/feature-flags-and-rollouts.md +757 -0
  203. package/expertise/architecture/scaling/horizontal-vs-vertical.md +606 -0
  204. package/expertise/architecture/scaling/index.md +24 -0
  205. package/expertise/architecture/scaling/multi-tenancy.md +800 -0
  206. package/expertise/architecture/scaling/stateless-design.md +787 -0
  207. package/expertise/backend/embedded-firmware.md +625 -0
  208. package/expertise/backend/go.md +853 -0
  209. package/expertise/backend/index.md +24 -0
  210. package/expertise/backend/java-spring.md +448 -0
  211. package/expertise/backend/node-typescript.md +625 -0
  212. package/expertise/backend/python-fastapi.md +724 -0
  213. package/expertise/backend/rust.md +458 -0
  214. package/expertise/backend/solidity.md +711 -0
  215. package/expertise/composition-map.yaml +443 -0
  216. package/expertise/content/foundations/content-modeling.md +395 -0
  217. package/expertise/content/foundations/editorial-standards.md +449 -0
  218. package/expertise/content/foundations/index.md +24 -0
  219. package/expertise/content/foundations/microcopy.md +455 -0
  220. package/expertise/content/foundations/terminology-governance.md +509 -0
  221. package/expertise/content/index.md +34 -0
  222. package/expertise/content/patterns/accessibility-copy.md +518 -0
  223. package/expertise/content/patterns/index.md +24 -0
  224. package/expertise/content/patterns/notification-content.md +433 -0
  225. package/expertise/content/patterns/sample-content.md +486 -0
  226. package/expertise/content/patterns/state-copy.md +439 -0
  227. package/expertise/design/PROGRESS.md +58 -0
  228. package/expertise/design/disciplines/dark-mode-theming.md +577 -0
  229. package/expertise/design/disciplines/design-systems.md +595 -0
  230. package/expertise/design/disciplines/index.md +25 -0
  231. package/expertise/design/disciplines/information-architecture.md +800 -0
  232. package/expertise/design/disciplines/interaction-design.md +788 -0
  233. package/expertise/design/disciplines/responsive-design.md +552 -0
  234. package/expertise/design/disciplines/usability-testing.md +516 -0
  235. package/expertise/design/disciplines/user-research.md +792 -0
  236. package/expertise/design/foundations/accessibility-design.md +796 -0
  237. package/expertise/design/foundations/color-theory.md +797 -0
  238. package/expertise/design/foundations/iconography.md +795 -0
  239. package/expertise/design/foundations/index.md +26 -0
  240. package/expertise/design/foundations/motion-and-animation.md +653 -0
  241. package/expertise/design/foundations/rtl-design.md +585 -0
  242. package/expertise/design/foundations/spacing-and-layout.md +607 -0
  243. package/expertise/design/foundations/typography.md +800 -0
  244. package/expertise/design/foundations/visual-hierarchy.md +761 -0
  245. package/expertise/design/index.md +32 -0
  246. package/expertise/design/patterns/authentication-flows.md +474 -0
  247. package/expertise/design/patterns/content-consumption.md +789 -0
  248. package/expertise/design/patterns/data-display.md +618 -0
  249. package/expertise/design/patterns/e-commerce.md +1494 -0
  250. package/expertise/design/patterns/feedback-and-states.md +642 -0
  251. package/expertise/design/patterns/forms-and-input.md +819 -0
  252. package/expertise/design/patterns/gamification.md +801 -0
  253. package/expertise/design/patterns/index.md +31 -0
  254. package/expertise/design/patterns/microinteractions.md +449 -0
  255. package/expertise/design/patterns/navigation.md +800 -0
  256. package/expertise/design/patterns/notifications.md +705 -0
  257. package/expertise/design/patterns/onboarding.md +700 -0
  258. package/expertise/design/patterns/search-and-filter.md +601 -0
  259. package/expertise/design/patterns/settings-and-preferences.md +768 -0
  260. package/expertise/design/patterns/social-and-community.md +748 -0
  261. package/expertise/design/platforms/desktop-native.md +612 -0
  262. package/expertise/design/platforms/index.md +25 -0
  263. package/expertise/design/platforms/mobile-android.md +825 -0
  264. package/expertise/design/platforms/mobile-cross-platform.md +983 -0
  265. package/expertise/design/platforms/mobile-ios.md +699 -0
  266. package/expertise/design/platforms/tablet.md +794 -0
  267. package/expertise/design/platforms/web-dashboard.md +790 -0
  268. package/expertise/design/platforms/web-responsive.md +550 -0
  269. package/expertise/design/psychology/behavioral-nudges.md +449 -0
  270. package/expertise/design/psychology/cognitive-load.md +1191 -0
  271. package/expertise/design/psychology/error-psychology.md +778 -0
  272. package/expertise/design/psychology/index.md +22 -0
  273. package/expertise/design/psychology/persuasive-design.md +736 -0
  274. package/expertise/design/psychology/user-mental-models.md +623 -0
  275. package/expertise/design/tooling/open-pencil.md +266 -0
  276. package/expertise/frontend/angular.md +1073 -0
  277. package/expertise/frontend/desktop-electron.md +546 -0
  278. package/expertise/frontend/flutter.md +782 -0
  279. package/expertise/frontend/index.md +27 -0
  280. package/expertise/frontend/native-android.md +409 -0
  281. package/expertise/frontend/native-ios.md +490 -0
  282. package/expertise/frontend/react-native.md +1160 -0
  283. package/expertise/frontend/react.md +808 -0
  284. package/expertise/frontend/vue.md +1089 -0
  285. package/expertise/humanize/domain-rules-code.md +79 -0
  286. package/expertise/humanize/domain-rules-content.md +67 -0
  287. package/expertise/humanize/domain-rules-technical-docs.md +56 -0
  288. package/expertise/humanize/index.md +35 -0
  289. package/expertise/humanize/self-audit-checklist.md +87 -0
  290. package/expertise/humanize/sentence-patterns.md +218 -0
  291. package/expertise/humanize/vocabulary-blacklist.md +105 -0
  292. package/expertise/i18n/PROGRESS.md +65 -0
  293. package/expertise/i18n/advanced/accessibility-and-i18n.md +28 -0
  294. package/expertise/i18n/advanced/bidirectional-text-algorithm.md +38 -0
  295. package/expertise/i18n/advanced/complex-scripts.md +30 -0
  296. package/expertise/i18n/advanced/performance-and-i18n.md +27 -0
  297. package/expertise/i18n/advanced/testing-i18n.md +28 -0
  298. package/expertise/i18n/content/content-adaptation.md +23 -0
  299. package/expertise/i18n/content/locale-specific-formatting.md +23 -0
  300. package/expertise/i18n/content/machine-translation-integration.md +28 -0
  301. package/expertise/i18n/content/translation-management.md +29 -0
  302. package/expertise/i18n/foundations/date-time-calendars.md +67 -0
  303. package/expertise/i18n/foundations/i18n-architecture.md +272 -0
  304. package/expertise/i18n/foundations/locale-and-language-tags.md +79 -0
  305. package/expertise/i18n/foundations/numbers-currency-units.md +61 -0
  306. package/expertise/i18n/foundations/pluralization-and-gender.md +109 -0
  307. package/expertise/i18n/foundations/string-externalization.md +236 -0
  308. package/expertise/i18n/foundations/text-direction-bidi.md +241 -0
  309. package/expertise/i18n/foundations/unicode-and-encoding.md +86 -0
  310. package/expertise/i18n/index.md +38 -0
  311. package/expertise/i18n/platform/backend-i18n.md +31 -0
  312. package/expertise/i18n/platform/flutter-i18n.md +148 -0
  313. package/expertise/i18n/platform/native-android-i18n.md +36 -0
  314. package/expertise/i18n/platform/native-ios-i18n.md +36 -0
  315. package/expertise/i18n/platform/react-i18n.md +103 -0
  316. package/expertise/i18n/platform/web-css-i18n.md +81 -0
  317. package/expertise/i18n/rtl/arabic-specific.md +175 -0
  318. package/expertise/i18n/rtl/hebrew-specific.md +149 -0
  319. package/expertise/i18n/rtl/rtl-animations-and-transitions.md +111 -0
  320. package/expertise/i18n/rtl/rtl-forms-and-input.md +161 -0
  321. package/expertise/i18n/rtl/rtl-fundamentals.md +211 -0
  322. package/expertise/i18n/rtl/rtl-icons-and-images.md +181 -0
  323. package/expertise/i18n/rtl/rtl-layout-mirroring.md +252 -0
  324. package/expertise/i18n/rtl/rtl-navigation-and-gestures.md +107 -0
  325. package/expertise/i18n/rtl/rtl-testing-and-qa.md +147 -0
  326. package/expertise/i18n/rtl/rtl-typography.md +160 -0
  327. package/expertise/index.md +113 -0
  328. package/expertise/index.yaml +216 -0
  329. package/expertise/infrastructure/cloud-aws.md +597 -0
  330. package/expertise/infrastructure/cloud-gcp.md +599 -0
  331. package/expertise/infrastructure/cybersecurity.md +816 -0
  332. package/expertise/infrastructure/database-mongodb.md +447 -0
  333. package/expertise/infrastructure/database-postgres.md +400 -0
  334. package/expertise/infrastructure/devops-cicd.md +787 -0
  335. package/expertise/infrastructure/index.md +27 -0
  336. package/expertise/performance/PROGRESS.md +50 -0
  337. package/expertise/performance/backend/api-latency.md +1204 -0
  338. package/expertise/performance/backend/background-jobs.md +506 -0
  339. package/expertise/performance/backend/connection-pooling.md +1209 -0
  340. package/expertise/performance/backend/database-query-optimization.md +515 -0
  341. package/expertise/performance/backend/index.md +23 -0
  342. package/expertise/performance/backend/rate-limiting-and-throttling.md +971 -0
  343. package/expertise/performance/foundations/algorithmic-complexity.md +954 -0
  344. package/expertise/performance/foundations/caching-strategies.md +489 -0
  345. package/expertise/performance/foundations/concurrency-and-parallelism.md +847 -0
  346. package/expertise/performance/foundations/index.md +24 -0
  347. package/expertise/performance/foundations/measuring-and-profiling.md +440 -0
  348. package/expertise/performance/foundations/memory-management.md +964 -0
  349. package/expertise/performance/foundations/performance-budgets.md +1314 -0
  350. package/expertise/performance/index.md +31 -0
  351. package/expertise/performance/infrastructure/auto-scaling.md +1059 -0
  352. package/expertise/performance/infrastructure/cdn-and-edge.md +1081 -0
  353. package/expertise/performance/infrastructure/index.md +22 -0
  354. package/expertise/performance/infrastructure/load-balancing.md +1081 -0
  355. package/expertise/performance/infrastructure/observability.md +1079 -0
  356. package/expertise/performance/mobile/index.md +23 -0
  357. package/expertise/performance/mobile/mobile-animations.md +544 -0
  358. package/expertise/performance/mobile/mobile-memory-battery.md +416 -0
  359. package/expertise/performance/mobile/mobile-network.md +452 -0
  360. package/expertise/performance/mobile/mobile-rendering.md +599 -0
  361. package/expertise/performance/mobile/mobile-startup-time.md +505 -0
  362. package/expertise/performance/platform-specific/flutter-performance.md +647 -0
  363. package/expertise/performance/platform-specific/index.md +22 -0
  364. package/expertise/performance/platform-specific/node-performance.md +1307 -0
  365. package/expertise/performance/platform-specific/postgres-performance.md +1366 -0
  366. package/expertise/performance/platform-specific/react-performance.md +1403 -0
  367. package/expertise/performance/web/bundle-optimization.md +1239 -0
  368. package/expertise/performance/web/image-and-media.md +636 -0
  369. package/expertise/performance/web/index.md +24 -0
  370. package/expertise/performance/web/network-optimization.md +1133 -0
  371. package/expertise/performance/web/rendering-performance.md +1098 -0
  372. package/expertise/performance/web/ssr-and-hydration.md +918 -0
  373. package/expertise/performance/web/web-vitals.md +1374 -0
  374. package/expertise/quality/accessibility.md +985 -0
  375. package/expertise/quality/evidence-based-verification.md +499 -0
  376. package/expertise/quality/index.md +24 -0
  377. package/expertise/quality/ml-model-audit.md +614 -0
  378. package/expertise/quality/performance.md +600 -0
  379. package/expertise/quality/testing-api.md +891 -0
  380. package/expertise/quality/testing-mobile.md +496 -0
  381. package/expertise/quality/testing-web.md +849 -0
  382. package/expertise/security/PROGRESS.md +54 -0
  383. package/expertise/security/agentic-identity.md +540 -0
  384. package/expertise/security/compliance-frameworks.md +601 -0
  385. package/expertise/security/data/data-encryption.md +364 -0
  386. package/expertise/security/data/data-privacy-gdpr.md +692 -0
  387. package/expertise/security/data/database-security.md +1171 -0
  388. package/expertise/security/data/index.md +22 -0
  389. package/expertise/security/data/pii-handling.md +531 -0
  390. package/expertise/security/foundations/authentication.md +1041 -0
  391. package/expertise/security/foundations/authorization.md +603 -0
  392. package/expertise/security/foundations/cryptography.md +1001 -0
  393. package/expertise/security/foundations/index.md +25 -0
  394. package/expertise/security/foundations/owasp-top-10.md +1354 -0
  395. package/expertise/security/foundations/secrets-management.md +1217 -0
  396. package/expertise/security/foundations/secure-sdlc.md +700 -0
  397. package/expertise/security/foundations/supply-chain-security.md +698 -0
  398. package/expertise/security/index.md +31 -0
  399. package/expertise/security/infrastructure/cloud-security-aws.md +1296 -0
  400. package/expertise/security/infrastructure/cloud-security-gcp.md +1376 -0
  401. package/expertise/security/infrastructure/container-security.md +721 -0
  402. package/expertise/security/infrastructure/incident-response.md +1295 -0
  403. package/expertise/security/infrastructure/index.md +24 -0
  404. package/expertise/security/infrastructure/logging-and-monitoring.md +1618 -0
  405. package/expertise/security/infrastructure/network-security.md +1337 -0
  406. package/expertise/security/mobile/index.md +23 -0
  407. package/expertise/security/mobile/mobile-android-security.md +1218 -0
  408. package/expertise/security/mobile/mobile-binary-protection.md +1229 -0
  409. package/expertise/security/mobile/mobile-data-storage.md +1265 -0
  410. package/expertise/security/mobile/mobile-ios-security.md +1401 -0
  411. package/expertise/security/mobile/mobile-network-security.md +1520 -0
  412. package/expertise/security/smart-contract-security.md +594 -0
  413. package/expertise/security/testing/index.md +22 -0
  414. package/expertise/security/testing/penetration-testing.md +1258 -0
  415. package/expertise/security/testing/security-code-review.md +1765 -0
  416. package/expertise/security/testing/threat-modeling.md +1074 -0
  417. package/expertise/security/testing/vulnerability-scanning.md +1062 -0
  418. package/expertise/security/web/api-security.md +586 -0
  419. package/expertise/security/web/cors-and-headers.md +433 -0
  420. package/expertise/security/web/csrf.md +562 -0
  421. package/expertise/security/web/file-upload.md +1477 -0
  422. package/expertise/security/web/index.md +25 -0
  423. package/expertise/security/web/injection.md +1375 -0
  424. package/expertise/security/web/session-management.md +1101 -0
  425. package/expertise/security/web/xss.md +1158 -0
  426. package/exports/README.md +17 -0
  427. package/exports/hosts/claude/.claude/agents/clarifier.md +42 -0
  428. package/exports/hosts/claude/.claude/agents/content-author.md +63 -0
  429. package/exports/hosts/claude/.claude/agents/designer.md +55 -0
  430. package/exports/hosts/claude/.claude/agents/executor.md +55 -0
  431. package/exports/hosts/claude/.claude/agents/learner.md +51 -0
  432. package/exports/hosts/claude/.claude/agents/planner.md +53 -0
  433. package/exports/hosts/claude/.claude/agents/researcher.md +43 -0
  434. package/exports/hosts/claude/.claude/agents/reviewer.md +54 -0
  435. package/exports/hosts/claude/.claude/agents/specifier.md +47 -0
  436. package/exports/hosts/claude/.claude/agents/verifier.md +71 -0
  437. package/exports/hosts/claude/.claude/commands/author.md +42 -0
  438. package/exports/hosts/claude/.claude/commands/clarify.md +38 -0
  439. package/exports/hosts/claude/.claude/commands/design-review.md +46 -0
  440. package/exports/hosts/claude/.claude/commands/design.md +44 -0
  441. package/exports/hosts/claude/.claude/commands/discover.md +37 -0
  442. package/exports/hosts/claude/.claude/commands/execute.md +48 -0
  443. package/exports/hosts/claude/.claude/commands/learn.md +38 -0
  444. package/exports/hosts/claude/.claude/commands/plan-review.md +42 -0
  445. package/exports/hosts/claude/.claude/commands/plan.md +39 -0
  446. package/exports/hosts/claude/.claude/commands/prepare-next.md +37 -0
  447. package/exports/hosts/claude/.claude/commands/review.md +40 -0
  448. package/exports/hosts/claude/.claude/commands/run-audit.md +41 -0
  449. package/exports/hosts/claude/.claude/commands/spec-challenge.md +41 -0
  450. package/exports/hosts/claude/.claude/commands/specify.md +38 -0
  451. package/exports/hosts/claude/.claude/commands/verify.md +37 -0
  452. package/exports/hosts/claude/.claude/settings.json +34 -0
  453. package/exports/hosts/claude/CLAUDE.md +19 -0
  454. package/exports/hosts/claude/export.manifest.json +38 -0
  455. package/exports/hosts/claude/host-package.json +67 -0
  456. package/exports/hosts/codex/AGENTS.md +19 -0
  457. package/exports/hosts/codex/export.manifest.json +38 -0
  458. package/exports/hosts/codex/host-package.json +41 -0
  459. package/exports/hosts/cursor/.cursor/hooks.json +16 -0
  460. package/exports/hosts/cursor/.cursor/rules/wazir-core.mdc +19 -0
  461. package/exports/hosts/cursor/export.manifest.json +38 -0
  462. package/exports/hosts/cursor/host-package.json +42 -0
  463. package/exports/hosts/gemini/GEMINI.md +19 -0
  464. package/exports/hosts/gemini/export.manifest.json +38 -0
  465. package/exports/hosts/gemini/host-package.json +41 -0
  466. package/hooks/README.md +18 -0
  467. package/hooks/definitions/loop_cap_guard.yaml +21 -0
  468. package/hooks/definitions/post_tool_capture.yaml +24 -0
  469. package/hooks/definitions/pre_compact_summary.yaml +19 -0
  470. package/hooks/definitions/pre_tool_capture_route.yaml +19 -0
  471. package/hooks/definitions/protected_path_write_guard.yaml +19 -0
  472. package/hooks/definitions/session_start.yaml +19 -0
  473. package/hooks/definitions/stop_handoff_harvest.yaml +20 -0
  474. package/hooks/loop-cap-guard +17 -0
  475. package/hooks/post-tool-lint +36 -0
  476. package/hooks/protected-path-write-guard +17 -0
  477. package/hooks/session-start +41 -0
  478. package/llms-full.txt +2355 -0
  479. package/llms.txt +43 -0
  480. package/package.json +79 -0
  481. package/roles/README.md +20 -0
  482. package/roles/clarifier.md +42 -0
  483. package/roles/content-author.md +63 -0
  484. package/roles/designer.md +55 -0
  485. package/roles/executor.md +55 -0
  486. package/roles/learner.md +51 -0
  487. package/roles/planner.md +53 -0
  488. package/roles/researcher.md +43 -0
  489. package/roles/reviewer.md +54 -0
  490. package/roles/specifier.md +47 -0
  491. package/roles/verifier.md +71 -0
  492. package/schemas/README.md +24 -0
  493. package/schemas/accepted-learning.schema.json +20 -0
  494. package/schemas/author-artifact.schema.json +156 -0
  495. package/schemas/clarification.schema.json +19 -0
  496. package/schemas/design-artifact.schema.json +80 -0
  497. package/schemas/docs-claim.schema.json +18 -0
  498. package/schemas/export-manifest.schema.json +20 -0
  499. package/schemas/hook.schema.json +67 -0
  500. package/schemas/host-export-package.schema.json +18 -0
  501. package/schemas/implementation-plan.schema.json +19 -0
  502. package/schemas/proposed-learning.schema.json +19 -0
  503. package/schemas/research.schema.json +18 -0
  504. package/schemas/review.schema.json +29 -0
  505. package/schemas/run-manifest.schema.json +18 -0
  506. package/schemas/spec-challenge.schema.json +18 -0
  507. package/schemas/spec.schema.json +20 -0
  508. package/schemas/usage.schema.json +102 -0
  509. package/schemas/verification-proof.schema.json +29 -0
  510. package/schemas/wazir-manifest.schema.json +173 -0
  511. package/skills/README.md +40 -0
  512. package/skills/brainstorming/SKILL.md +77 -0
  513. package/skills/debugging/SKILL.md +50 -0
  514. package/skills/design/SKILL.md +61 -0
  515. package/skills/dispatching-parallel-agents/SKILL.md +128 -0
  516. package/skills/executing-plans/SKILL.md +70 -0
  517. package/skills/finishing-a-development-branch/SKILL.md +169 -0
  518. package/skills/humanize/SKILL.md +123 -0
  519. package/skills/init-pipeline/SKILL.md +124 -0
  520. package/skills/prepare-next/SKILL.md +20 -0
  521. package/skills/receiving-code-review/SKILL.md +123 -0
  522. package/skills/requesting-code-review/SKILL.md +105 -0
  523. package/skills/requesting-code-review/code-reviewer.md +108 -0
  524. package/skills/run-audit/SKILL.md +197 -0
  525. package/skills/scan-project/SKILL.md +41 -0
  526. package/skills/self-audit/SKILL.md +153 -0
  527. package/skills/subagent-driven-development/SKILL.md +154 -0
  528. package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  529. package/skills/subagent-driven-development/implementer-prompt.md +102 -0
  530. package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  531. package/skills/tdd/SKILL.md +23 -0
  532. package/skills/using-git-worktrees/SKILL.md +163 -0
  533. package/skills/using-skills/SKILL.md +95 -0
  534. package/skills/verification/SKILL.md +22 -0
  535. package/skills/wazir/SKILL.md +463 -0
  536. package/skills/writing-plans/SKILL.md +30 -0
  537. package/skills/writing-skills/SKILL.md +157 -0
  538. package/skills/writing-skills/anthropic-best-practices.md +122 -0
  539. package/skills/writing-skills/persuasion-principles.md +50 -0
  540. package/templates/README.md +20 -0
  541. package/templates/artifacts/README.md +10 -0
  542. package/templates/artifacts/accepted-learning.md +19 -0
  543. package/templates/artifacts/accepted-learning.template.json +12 -0
  544. package/templates/artifacts/author.md +74 -0
  545. package/templates/artifacts/author.template.json +19 -0
  546. package/templates/artifacts/clarification.md +21 -0
  547. package/templates/artifacts/clarification.template.json +12 -0
  548. package/templates/artifacts/execute-notes.md +19 -0
  549. package/templates/artifacts/implementation-plan.md +21 -0
  550. package/templates/artifacts/implementation-plan.template.json +11 -0
  551. package/templates/artifacts/learning-proposal.md +19 -0
  552. package/templates/artifacts/next-run-handoff.md +21 -0
  553. package/templates/artifacts/plan-review.md +19 -0
  554. package/templates/artifacts/proposed-learning.template.json +12 -0
  555. package/templates/artifacts/research.md +21 -0
  556. package/templates/artifacts/research.template.json +12 -0
  557. package/templates/artifacts/review-findings.md +19 -0
  558. package/templates/artifacts/review.template.json +11 -0
  559. package/templates/artifacts/run-manifest.template.json +8 -0
  560. package/templates/artifacts/spec-challenge.md +19 -0
  561. package/templates/artifacts/spec-challenge.template.json +11 -0
  562. package/templates/artifacts/spec.md +21 -0
  563. package/templates/artifacts/spec.template.json +12 -0
  564. package/templates/artifacts/verification-proof.md +19 -0
  565. package/templates/artifacts/verification-proof.template.json +11 -0
  566. package/templates/examples/accepted-learning.example.json +14 -0
  567. package/templates/examples/author.example.json +152 -0
  568. package/templates/examples/clarification.example.json +15 -0
  569. package/templates/examples/docs-claim.example.json +8 -0
  570. package/templates/examples/export-manifest.example.json +7 -0
  571. package/templates/examples/host-export-package.example.json +11 -0
  572. package/templates/examples/implementation-plan.example.json +17 -0
  573. package/templates/examples/proposed-learning.example.json +13 -0
  574. package/templates/examples/research.example.json +15 -0
  575. package/templates/examples/research.example.md +6 -0
  576. package/templates/examples/review.example.json +17 -0
  577. package/templates/examples/run-manifest.example.json +9 -0
  578. package/templates/examples/spec-challenge.example.json +14 -0
  579. package/templates/examples/spec.example.json +21 -0
  580. package/templates/examples/verification-proof.example.json +21 -0
  581. package/templates/examples/wazir-manifest.example.yaml +65 -0
  582. package/templates/task-definition-schema.md +99 -0
  583. package/tooling/README.md +20 -0
  584. package/tooling/src/adapters/context-mode.js +50 -0
  585. package/tooling/src/capture/command.js +376 -0
  586. package/tooling/src/capture/store.js +99 -0
  587. package/tooling/src/capture/usage.js +270 -0
  588. package/tooling/src/checks/branches.js +50 -0
  589. package/tooling/src/checks/brand-truth.js +110 -0
  590. package/tooling/src/checks/changelog.js +231 -0
  591. package/tooling/src/checks/command-registry.js +36 -0
  592. package/tooling/src/checks/commits.js +102 -0
  593. package/tooling/src/checks/docs-drift.js +103 -0
  594. package/tooling/src/checks/docs-truth.js +201 -0
  595. package/tooling/src/checks/runtime-surface.js +156 -0
  596. package/tooling/src/cli.js +116 -0
  597. package/tooling/src/command-options.js +56 -0
  598. package/tooling/src/commands/validate.js +320 -0
  599. package/tooling/src/doctor/command.js +91 -0
  600. package/tooling/src/export/command.js +77 -0
  601. package/tooling/src/export/compiler.js +498 -0
  602. package/tooling/src/guards/loop-cap-guard.js +52 -0
  603. package/tooling/src/guards/protected-path-write-guard.js +67 -0
  604. package/tooling/src/index/command.js +152 -0
  605. package/tooling/src/index/storage.js +1061 -0
  606. package/tooling/src/index/summarizers.js +261 -0
  607. package/tooling/src/loaders.js +18 -0
  608. package/tooling/src/project-root.js +22 -0
  609. package/tooling/src/recall/command.js +225 -0
  610. package/tooling/src/schema-validator.js +30 -0
  611. package/tooling/src/state-root.js +40 -0
  612. package/tooling/src/status/command.js +71 -0
  613. package/wazir.manifest.yaml +135 -0
  614. package/workflows/README.md +19 -0
  615. package/workflows/author.md +42 -0
  616. package/workflows/clarify.md +38 -0
  617. package/workflows/design-review.md +46 -0
  618. package/workflows/design.md +44 -0
  619. package/workflows/discover.md +37 -0
  620. package/workflows/execute.md +48 -0
  621. package/workflows/learn.md +38 -0
  622. package/workflows/plan-review.md +42 -0
  623. package/workflows/plan.md +39 -0
  624. package/workflows/prepare-next.md +37 -0
  625. package/workflows/review.md +40 -0
  626. package/workflows/run-audit.md +41 -0
  627. package/workflows/spec-challenge.md +41 -0
  628. package/workflows/specify.md +38 -0
  629. package/workflows/verify.md +37 -0
@@ -0,0 +1,1258 @@
1
+ # Penetration Testing — Comprehensive Expertise Module
2
+
3
+ > **Purpose:** Reference for AI agents to understand penetration testing methodology, guide test
4
+ > planning and scoping, interpret pen test results, and assist with remediation prioritization.
5
+ > This module is strictly DEFENSIVE — it helps teams plan, scope, and act on pen test findings.
6
+ > **Last updated:** 2026-03-08
7
+ > **Sources:** OWASP Web Security Testing Guide (WSTG) v4.2/v5, PTES, NIST SP 800-115,
8
+ > PCI-DSS v4.0 Requirement 11.3, CVSS v3.1/v4.0, HackerOne/Bugcrowd reports 2024-2025
9
+
10
+ ---
11
+
12
+ ## 1. Threat Landscape
13
+
14
+ ### 1.1 Why Penetration Testing Matters
15
+
16
+ Penetration testing is the controlled simulation of real-world attacks against systems,
17
+ applications, and infrastructure — performed by authorized security professionals to discover
18
+ vulnerabilities before adversaries do. Unlike automated scanning, pen testing involves human
19
+ creativity, chained exploitation, and business-logic analysis that tools alone cannot replicate.
20
+
21
+ Key statistics underscoring the need:
22
+ - Critical vulnerabilities in web applications increased 150% in 2024 (BreachLock PTI Report).
23
+ - Over 1,000 high-risk vulnerabilities with CVSSv3 score of 10.0 were discovered since 2024.
24
+ - Gartner estimates that through 2025, 99% of cloud breaches result from customer
25
+ misconfigurations — exactly the class of issue pen testing identifies.
26
+ - The global penetration testing market is projected to exceed $5 billion USD annually by 2031.
27
+ - Organizations that conduct regular pen tests reduce mean time to detect (MTTD) breaches
28
+ by an average of 30-50% compared to those relying solely on automated scanning.
29
+
30
+ ### 1.2 Breaches That Pen Testing Would Have Caught
31
+
32
+ | Breach | Year | Root Cause | Pen Test Detection Method |
33
+ |--------|------|-----------|--------------------------|
34
+ | MOVEit Transfer | 2023 | SQL injection in file transfer app | Web app pen test with injection testing |
35
+ | Optus | 2022 | Unauthenticated API exposing customer data | API pen test — BOLA/missing auth checks |
36
+ | Capital One | 2019 | SSRF in WAF + overprivileged IAM role | Cloud pen test — SSRF + IAM review |
37
+ | Equifax | 2017 | Unpatched Apache Struts (CVE-2017-5638) | Infrastructure pen test — patch verification |
38
+ | Marriott/Starwood | 2018 | Lateral movement after initial compromise | Internal network pen test — segmentation testing |
39
+
40
+ ### 1.3 Regulatory Requirements for Pen Testing
41
+
42
+ | Regulation / Standard | Pen Test Requirement | Frequency |
43
+ |-----------------------|---------------------|-----------|
44
+ | PCI-DSS v4.0 (Req 11.3) | Mandatory external + internal pen test | Annual + after significant changes |
45
+ | SOC 2 | Not explicitly required, but strongly recommended for Trust Services Criteria | Annual (best practice) |
46
+ | HIPAA | Risk analysis must include technical testing | Annual (best practice) |
47
+ | FedRAMP | Required for all cloud service providers | Annual + after major changes |
48
+ | ISO 27001 (Annex A.12.6) | Technical vulnerability management including testing | Defined by risk assessment |
49
+ | NIST CSF (PR.IP-12) | Penetration testing as part of vulnerability management | Risk-based cadence |
50
+ | DORA (EU) | Threat-Led Penetration Testing (TLPT) for financial entities | Every 3 years minimum |
51
+ | NIS2 (EU) | Security testing including pen tests for essential entities | Regular, risk-based |
52
+
53
+ ### 1.4 Bug Bounty Program Evolution
54
+
55
+ Bug bounty programs complement formal pen testing with continuous, crowd-sourced security
56
+ research. Their evolution reflects the maturation of the security testing ecosystem:
57
+
58
+ **Scale and payouts (2024-2025):**
59
+ - Google's Vulnerability Reward Program paid out $12 million in 2024.
60
+ - Meta awarded over $2.3 million in 2024, bringing lifetime totals to over $20 million.
61
+ - GitLab awarded over $1 million across 275 valid reports from 457 researchers in 2024.
62
+ - Zoom's average resolution time improved by over 90% from Feb 2024 to Jan 2025.
63
+
64
+ **Trends:**
65
+ - AI systems are now in scope for many bounty programs (prompt injection, model DoS).
66
+ - Vendors increasingly pay for full exploit chains, not isolated bug reports.
67
+ - Bug bounties and formal pen tests are complementary — bounties provide continuous coverage,
68
+ while pen tests provide structured, time-boxed depth.
69
+
70
+ ---
71
+
72
+ ## 2. Core Security Principles
73
+
74
+ ### 2.1 Authorized Testing Only
75
+
76
+ **This is the non-negotiable foundation of all penetration testing.**
77
+
78
+ - NEVER test systems without explicit, written authorization from the asset owner.
79
+ - Authorization must cover specific IP ranges, domains, applications, and time windows.
80
+ - Unauthorized testing is illegal under the Computer Fraud and Abuse Act (CFAA) in the US,
81
+ the Computer Misuse Act 1990 in the UK, and equivalent laws in most jurisdictions.
82
+ - Cloud provider policies add additional constraints (see Section 7).
83
+ - "Get out of jail free" letters (authorization documents) must be carried during physical tests.
84
+
85
+ ### 2.2 Scoping and Rules of Engagement (RoE)
86
+
87
+ A well-defined scope prevents legal issues, operational disruption, and wasted effort.
88
+
89
+ **Scope definition must include:**
90
+ - In-scope systems: IP addresses, CIDR ranges, domain names, application URLs
91
+ - Out-of-scope systems: production databases with real customer data, third-party services
92
+ - Testing window: dates, times, timezone
93
+ - Allowed techniques: scanning, exploitation, social engineering, physical access
94
+ - Forbidden techniques: denial of service, data exfiltration of real data, destructive actions
95
+ - Emergency contacts: who to call if testing causes an outage
96
+ - Data handling: how test data and findings are stored, transmitted, and destroyed
97
+ - Retesting clause: included or separate engagement
98
+
99
+ ### 2.3 Testing Approaches
100
+
101
+ | Approach | Tester Knowledge | Simulates | Best For |
102
+ |----------|-----------------|-----------|----------|
103
+ | **Black Box** | No prior knowledge of systems | External attacker | Realistic external threat assessment |
104
+ | **White Box** | Full access: source code, architecture, credentials | Insider threat / thorough review | Maximum coverage, finding deep issues |
105
+ | **Gray Box** | Partial knowledge: credentials, architecture docs | Compromised user / partner | Balance of realism and coverage |
106
+
107
+ **Recommendation:** Gray box testing provides the best cost-to-coverage ratio for most
108
+ organizations. Black box testing alone misses issues that require authenticated access.
109
+ White box testing is ideal for high-assurance applications (financial, healthcare, defense).
110
+
111
+ ### 2.4 Risk-Based Testing Priority
112
+
113
+ Not all assets deserve the same testing depth. Prioritize based on:
114
+
115
+ 1. **Business criticality** — revenue-generating systems, customer-facing applications
116
+ 2. **Data sensitivity** — systems processing PCI, PHI, PII, or trade secrets
117
+ 3. **Exposure** — internet-facing vs. internal-only systems
118
+ 4. **Change velocity** — recently deployed or significantly modified systems
119
+ 5. **Compliance requirements** — systems in scope for PCI-DSS, HIPAA, SOC 2
120
+ 6. **Historical findings** — systems with prior critical or high findings
121
+
122
+ ### 2.5 Testing Cadence
123
+
124
+ | Trigger | Test Type | Rationale |
125
+ |---------|-----------|-----------|
126
+ | Annual cycle | Full-scope pen test | Baseline compliance, discover drift |
127
+ | Significant change | Targeted pen test | New features, architecture changes, migrations |
128
+ | Major release | Application pen test | Pre-release security validation |
129
+ | Post-incident | Focused pen test | Verify remediation, find related weaknesses |
130
+ | Continuous | Bug bounty / PTaaS | Ongoing coverage between formal tests |
131
+
132
+ ### 2.6 Responsible Disclosure
133
+
134
+ When pen testers (or bug bounty researchers) find vulnerabilities:
135
+ - Report immediately to the designated contact per the RoE.
136
+ - Critical findings (CVSS >= 9.0) require immediate verbal notification, not just written.
137
+ - Never publicly disclose findings without explicit permission from the asset owner.
138
+ - Coordinate disclosure timelines (typically 90 days for vendor notification before public).
139
+ - Retain evidence securely and destroy per the engagement agreement upon completion.
140
+
141
+ ---
142
+
143
+ ## 3. Implementation Patterns
144
+
145
+ ### 3.1 Pen Test Planning and Scoping
146
+
147
+ **Phase 0: Pre-Engagement (1-2 weeks before testing)**
148
+
149
+ ```
150
+ Pre-Engagement Checklist:
151
+ 1. Define objectives (compliance, risk reduction, release validation)
152
+ 2. Identify target systems and environments
153
+ 3. Document rules of engagement
154
+ 4. Obtain written authorization (signed by asset owner with legal authority)
155
+ 5. Define communication channels and escalation procedures
156
+ 6. Confirm testing window and change freeze (if applicable)
157
+ 7. Provision test accounts (for gray/white box)
158
+ 8. Set up secure reporting channel (encrypted email, secure portal)
159
+ 9. Confirm insurance coverage (tester's professional liability)
160
+ 10. Distribute emergency contact list to all stakeholders
161
+ ```
162
+
163
+ ### 3.2 OWASP Testing Guide Methodology
164
+
165
+ The OWASP Web Security Testing Guide (WSTG) defines a structured approach that is the
166
+ industry standard for web application pen testing. The methodology follows these phases:
167
+
168
+ **Phase 1: Information Gathering / Reconnaissance**
169
+ - Passive reconnaissance: OSINT, DNS enumeration, certificate transparency logs,
170
+ WHOIS, Google dorking, Shodan/Censys, social media, GitHub/GitLab leak scanning
171
+ - Active reconnaissance: port scanning, service fingerprinting, web spidering,
172
+ technology stack identification (Wappalyzer-style), WAF detection
173
+ - Goal: Build a comprehensive map of the attack surface
174
+
175
+ **Phase 2: Configuration and Deployment Management Testing**
176
+ - Test SSL/TLS configuration (cipher suites, certificate validity, HSTS)
177
+ - Review HTTP methods (OPTIONS, TRACE, PUT, DELETE)
178
+ - Test for default credentials on admin interfaces
179
+ - Review file extensions handling and backup files
180
+ - Check for information leakage in HTTP headers, error messages, stack traces
181
+ - Test platform/framework-specific configuration
182
+
183
+ **Phase 3: Identity Management and Authentication Testing**
184
+ - Test user registration, account provisioning, and account enumeration
185
+ - Test credential policies (password complexity, account lockout)
186
+ - Test authentication mechanisms (login, MFA, SSO, OAuth flows)
187
+ - Test session management (token generation, session fixation, timeout)
188
+ - Test password reset flows (token predictability, email verification)
189
+ - Test "remember me" and persistent login functionality
190
+
191
+ **Phase 4: Authorization Testing**
192
+ - Test for path traversal and privilege escalation
193
+ - Test for IDOR (Insecure Direct Object References)
194
+ - Test role-based access control bypass
195
+ - Test horizontal privilege escalation (user A accessing user B's data)
196
+ - Test vertical privilege escalation (user escalating to admin)
197
+ - Test for missing function-level access control
198
+
199
+ **Phase 5: Input Validation Testing**
200
+ - Test for reflected, stored, and DOM-based XSS
201
+ - Test for SQL injection (error-based, blind, time-based)
202
+ - Test for command injection, LDAP injection, XML injection
203
+ - Test for Server-Side Request Forgery (SSRF)
204
+ - Test for Server-Side Template Injection (SSTI)
205
+ - Test for file inclusion (LFI/RFI)
206
+ - Test HTTP parameter pollution and mass assignment
207
+
208
+ **Phase 6: Business Logic Testing**
209
+ - Test workflow bypass (skipping steps in multi-step processes)
210
+ - Test for race conditions and TOCTOU vulnerabilities
211
+ - Test transaction limits and boundary conditions
212
+ - Test for business logic abuse (coupon stacking, negative quantities)
213
+ - Test data validation on business rules
214
+
215
+ **Phase 7: Reporting** (see Section 3.6)
216
+
217
+ ### 3.3 API Testing Workflow
218
+
219
+ APIs present unique attack surfaces beyond traditional web applications:
220
+
221
+ ```
222
+ API Pen Test Flow:
223
+ 1. Obtain API documentation (OpenAPI/Swagger, GraphQL schema, Postman collections)
224
+ 2. Map all endpoints, methods, and parameters
225
+ 3. Identify authentication mechanisms (API keys, OAuth, JWT, mTLS)
226
+ 4. Test authentication bypass on every endpoint
227
+ 5. Test BOLA — modify object IDs in requests (IDOR pattern)
228
+ 6. Test BFLA — access admin/privileged endpoints with low-privilege tokens
229
+ 7. Test rate limiting and resource consumption
230
+ 8. Test input validation on all parameters (injection, type confusion)
231
+ 9. Test mass assignment — send extra fields in POST/PUT requests
232
+ 10. Test JWT weaknesses (none algorithm, weak signing, claim tampering)
233
+ 11. Test GraphQL-specific issues (introspection, nested query DoS, batching)
234
+ 12. Test for excessive data exposure in responses
235
+ 13. Test CORS configuration and credential handling
236
+ 14. Check for undocumented/shadow endpoints (wordlist fuzzing)
237
+ ```
238
+
239
+ ### 3.4 Mobile App Testing Workflow
240
+
241
+ Mobile pen testing covers the app binary, its network communications, and backend APIs:
242
+
243
+ ```
244
+ Mobile Pen Test Flow:
245
+ 1. Static analysis — decompile/disassemble the app binary
246
+ 2. Check for hardcoded secrets (API keys, credentials, certificates)
247
+ 3. Review data storage (Keychain/Keystore usage, SQLite, SharedPreferences/NSUserDefaults)
248
+ 4. Test certificate pinning implementation and bypass resistance
249
+ 5. Intercept and analyze network traffic (proxy through Burp/ZAP)
250
+ 6. Test authentication and session management via the API layer
251
+ 7. Test local authentication bypass (biometric, PIN)
252
+ 8. Review inter-process communication (deep links, intents, URL schemes)
253
+ 9. Test for binary protections (obfuscation, anti-tampering, anti-debugging)
254
+ 10. Test push notification security
255
+ 11. Test offline data exposure
256
+ 12. Verify proper use of platform security features (iOS App Transport Security, Android Network Security Config)
257
+ ```
258
+
259
+ ### 3.5 Infrastructure and Cloud Testing
260
+
261
+ **Network Infrastructure Testing:**
262
+ - External perimeter scan and vulnerability assessment
263
+ - Internal network segmentation testing
264
+ - Wireless network testing (if in scope)
265
+ - Active Directory / identity provider assessment
266
+ - Review firewall rules and ACLs
267
+ - Test VPN and remote access security
268
+ - Test for lateral movement paths
269
+
270
+ **Cloud Penetration Testing:**
271
+ - IAM policy review (overprivileged roles, unused permissions)
272
+ - Storage bucket/blob/object permissions (public access, ACL misconfig)
273
+ - Serverless function security (Lambda/Cloud Functions injection, env var leakage)
274
+ - Container and Kubernetes security (pod escape, RBAC, network policies)
275
+ - Secrets management (hardcoded credentials, insecure parameter stores)
276
+ - Network security groups and VPC configuration
277
+ - Logging and monitoring gaps
278
+
279
+ ### 3.6 Reporting Format and Severity Ratings
280
+
281
+ **Report Structure:**
282
+
283
+ ```
284
+ Pen Test Report Template:
285
+ ==========================================
286
+
287
+ 1. EXECUTIVE SUMMARY (1-2 pages)
288
+ - Engagement overview and objectives
289
+ - Scope summary
290
+ - Testing dates and methodology
291
+ - Overall risk rating (Critical/High/Medium/Low)
292
+ - Key findings summary (top 3-5 findings in plain language)
293
+ - Strategic recommendations
294
+
295
+ 2. SCOPE AND METHODOLOGY
296
+ - Systems tested (IPs, URLs, applications)
297
+ - Testing approach (black/gray/white box)
298
+ - Methodologies applied (OWASP WSTG, PTES, NIST 800-115)
299
+ - Tools used
300
+ - Limitations and constraints
301
+
302
+ 3. FINDINGS (per finding)
303
+ - Title
304
+ - Severity (Critical/High/Medium/Low/Informational)
305
+ - CVSS v3.1 score and vector string
306
+ - Affected systems/endpoints
307
+ - Description
308
+ - Evidence (screenshots, request/response pairs — redacted)
309
+ - Business impact
310
+ - Remediation recommendation
311
+ - References (CWE, OWASP, vendor advisories)
312
+
313
+ 4. REMEDIATION ROADMAP
314
+ - Prioritized remediation plan
315
+ - Quick wins vs. strategic improvements
316
+ - Estimated effort per finding
317
+ - Suggested timelines by severity
318
+
319
+ 5. APPENDICES
320
+ - Detailed scan results
321
+ - Testing logs and timeline
322
+ - Tool configuration details
323
+ - Glossary of terms
324
+ ```
325
+
326
+ **CVSS v3.1 Severity Ratings:**
327
+
328
+ | Rating | CVSS Score | Remediation Timeline | Description |
329
+ |--------|-----------|---------------------|-------------|
330
+ | Critical | 9.0 - 10.0 | 24-72 hours | Immediate risk of exploitation, data breach, or system compromise |
331
+ | High | 7.0 - 8.9 | 1-2 weeks | Significant risk requiring prompt attention |
332
+ | Medium | 4.0 - 6.9 | 1-3 months | Moderate risk, should be addressed in next maintenance cycle |
333
+ | Low | 0.1 - 3.9 | 3-6 months | Minor risk, address during planned updates |
334
+ | Informational | 0.0 | Best effort | Security observation, no direct exploitability |
335
+
336
+ ---
337
+
338
+ ## 4. Vulnerability Catalog
339
+
340
+ The following are the 20 most commonly found vulnerabilities during penetration tests,
341
+ based on industry reports from 2023-2025. No working exploit code is provided — only
342
+ descriptions, severity ratings, discovery methods, and remediation guidance.
343
+
344
+ ### 4.1 Broken Access Control / IDOR
345
+
346
+ - **Typical Severity:** High (CVSS 7.5-8.6)
347
+ - **Discovery:** Modify object IDs in API requests (e.g., `/api/users/123` to `/api/users/124`);
348
+ compare responses between two authenticated users
349
+ - **Remediation:** Implement server-side authorization checks on every object access;
350
+ use indirect references (UUIDs) instead of sequential IDs; apply row-level security
351
+
352
+ ### 4.2 SQL Injection
353
+
354
+ - **Typical Severity:** Critical (CVSS 9.0-10.0)
355
+ - **Discovery:** Input single quotes, boolean conditions, time delays into parameters;
356
+ detected by Burp Scanner, sqlmap (authorized), or manual testing
357
+ - **Remediation:** Use parameterized queries / prepared statements exclusively; apply
358
+ input validation; enforce least-privilege database accounts; deploy WAF rules
359
+
360
+ ### 4.3 Cross-Site Scripting (XSS)
361
+
362
+ - **Typical Severity:** Medium-High (CVSS 4.3-8.1 depending on context)
363
+ - **Discovery:** Inject benign script payloads into input fields, URL parameters, headers;
364
+ check if reflected in response without encoding
365
+ - **Remediation:** Context-aware output encoding; Content Security Policy (CSP);
366
+ use framework auto-escaping (React, Angular); validate and sanitize input
367
+
368
+ ### 4.4 Broken Authentication
369
+
370
+ - **Typical Severity:** High-Critical (CVSS 7.5-9.8)
371
+ - **Discovery:** Test for credential stuffing resistance, account enumeration via login/reset
372
+ response differences, weak password policies, missing MFA
373
+ - **Remediation:** Enforce MFA; implement account lockout / rate limiting; use secure
374
+ session management; normalize error messages
375
+
376
+ ### 4.5 Security Misconfiguration
377
+
378
+ - **Typical Severity:** Medium-High (CVSS 5.3-7.5)
379
+ - **Discovery:** Check default credentials, verbose error pages, directory listings,
380
+ unnecessary HTTP methods, missing security headers, debug endpoints
381
+ - **Remediation:** Harden server configurations; disable defaults; automate configuration
382
+ baselines; implement security headers (HSTS, CSP, X-Frame-Options)
383
+
384
+ ### 4.6 Sensitive Data Exposure
385
+
386
+ - **Typical Severity:** High (CVSS 7.0-8.5)
387
+ - **Discovery:** Inspect API responses for excessive data; check TLS configuration;
388
+ look for credentials in source code, comments, or JavaScript files
389
+ - **Remediation:** Minimize data in API responses; enforce TLS 1.2+; encrypt sensitive
390
+ data at rest; remove credentials from source code
391
+
392
+ ### 4.7 Server-Side Request Forgery (SSRF)
393
+
394
+ - **Typical Severity:** High-Critical (CVSS 7.5-9.8)
395
+ - **Discovery:** Submit internal URLs (169.254.169.254, localhost, internal hostnames)
396
+ in parameters that trigger server-side requests (webhooks, URL previews, file imports)
397
+ - **Remediation:** Allowlist permitted external domains; block requests to internal/metadata
398
+ IPs; validate and sanitize URLs; use network-level controls
399
+
400
+ ### 4.8 Missing or Weak TLS Configuration
401
+
402
+ - **Typical Severity:** Medium (CVSS 4.3-5.9)
403
+ - **Discovery:** SSL/TLS scanner (testssl.sh, sslyze, Nmap ssl-enum-ciphers);
404
+ check for expired certificates, weak ciphers, missing HSTS
405
+ - **Remediation:** Enforce TLS 1.2+ only; disable weak cipher suites; implement HSTS
406
+ with includeSubDomains and preload; automate certificate renewal
407
+
408
+ ### 4.9 Cross-Site Request Forgery (CSRF)
409
+
410
+ - **Typical Severity:** Medium (CVSS 4.3-6.5)
411
+ - **Discovery:** Attempt state-changing requests without CSRF tokens; test SameSite
412
+ cookie attribute enforcement; check for referer/origin validation
413
+ - **Remediation:** Anti-CSRF tokens (synchronizer token pattern); SameSite=Strict/Lax
414
+ cookies; verify Origin/Referer headers
415
+
416
+ ### 4.10 Insecure Deserialization
417
+
418
+ - **Typical Severity:** High-Critical (CVSS 7.5-9.8)
419
+ - **Discovery:** Identify serialized objects in cookies, hidden fields, API parameters;
420
+ test with modified serialized data
421
+ - **Remediation:** Avoid deserializing untrusted data; use safe serialization formats (JSON);
422
+ implement integrity checks; apply allowlisting for deserialization classes
423
+
424
+ ### 4.11 Missing Rate Limiting
425
+
426
+ - **Typical Severity:** Medium (CVSS 5.3-6.5)
427
+ - **Discovery:** Send rapid repeated requests to login, password reset, OTP verification,
428
+ and API endpoints; measure if throttling is applied
429
+ - **Remediation:** Implement rate limiting at API gateway and application level;
430
+ use CAPTCHA for sensitive operations; apply progressive delays
431
+
432
+ ### 4.12 JWT Implementation Flaws
433
+
434
+ - **Typical Severity:** High-Critical (CVSS 7.5-9.8)
435
+ - **Discovery:** Test for "none" algorithm acceptance; attempt key confusion attacks
436
+ (RS256 to HS256); check for weak signing keys; test expired token acceptance
437
+ - **Remediation:** Validate algorithm in server config (not from token); use strong signing
438
+ keys; validate all claims (exp, iss, aud); rotate keys regularly
439
+
440
+ ### 4.13 Path Traversal / Local File Inclusion
441
+
442
+ - **Typical Severity:** High (CVSS 7.5-8.6)
443
+ - **Discovery:** Insert `../` sequences in file path parameters; test URL-encoded and
444
+ double-encoded variants; look for file download/preview functionality
445
+ - **Remediation:** Canonicalize file paths before validation; use allowlists for permitted
446
+ files/directories; avoid passing user input to file system APIs
447
+
448
+ ### 4.14 Privilege Escalation
449
+
450
+ - **Typical Severity:** High-Critical (CVSS 7.5-9.8)
451
+ - **Discovery:** Access admin endpoints with regular user credentials; modify role/privilege
452
+ parameters in requests; test for horizontal and vertical escalation
453
+ - **Remediation:** Enforce role-based access control server-side; validate permissions on
454
+ every request; follow principle of least privilege
455
+
456
+ ### 4.15 Subdomain Takeover
457
+
458
+ - **Typical Severity:** High (CVSS 7.5-8.1)
459
+ - **Discovery:** Enumerate subdomains; check for dangling CNAME/DNS records pointing to
460
+ deprovisioned cloud services (S3, Heroku, Azure, GitHub Pages)
461
+ - **Remediation:** Audit DNS records regularly; remove dangling records immediately;
462
+ use CNAME verification where supported
463
+
464
+ ### 4.16 Information Disclosure via Error Messages
465
+
466
+ - **Typical Severity:** Low-Medium (CVSS 2.1-5.3)
467
+ - **Discovery:** Trigger errors with malformed input; check for stack traces, database
468
+ errors, internal IP addresses, framework versions in responses
469
+ - **Remediation:** Implement custom error pages; log detailed errors server-side only;
470
+ return generic error messages to clients
471
+
472
+ ### 4.17 Insecure Direct Object References in File Upload
473
+
474
+ - **Typical Severity:** High (CVSS 7.5-9.0)
475
+ - **Discovery:** Upload files with manipulated extensions, MIME types, or oversized content;
476
+ test for stored XSS via SVG/HTML upload; test path traversal in filename
477
+ - **Remediation:** Validate file type by content (magic bytes), not extension; store files
478
+ outside web root; randomize filenames; scan uploaded files for malware
479
+
480
+ ### 4.18 Missing Security Headers
481
+
482
+ - **Typical Severity:** Low-Medium (CVSS 2.1-4.3)
483
+ - **Discovery:** Inspect HTTP response headers; check for missing CSP, X-Frame-Options,
484
+ X-Content-Type-Options, Referrer-Policy, Permissions-Policy
485
+ - **Remediation:** Configure security headers at the web server or CDN layer; use
486
+ securityheaders.com for validation; deploy CSP in report-only mode first
487
+
488
+ ### 4.19 AWS/Cloud IAM Misconfigurations
489
+
490
+ - **Typical Severity:** High-Critical (CVSS 7.5-9.8)
491
+ - **Discovery:** Enumerate IAM policies for overprivileged roles; check for wildcard
492
+ permissions; test for unused access keys; scan for exposed credentials
493
+ - **Remediation:** Apply least-privilege IAM policies; use IAM Access Analyzer;
494
+ rotate credentials regularly; enforce MFA for privileged accounts
495
+
496
+ ### 4.20 Outdated Software with Known CVEs
497
+
498
+ - **Typical Severity:** Variable (CVSS depends on specific CVE)
499
+ - **Discovery:** Version fingerprinting via HTTP headers, error pages, JavaScript library
500
+ versions; Nmap service detection; dependency scanning
501
+ - **Remediation:** Establish patch management process; subscribe to vendor security
502
+ advisories; automate dependency updates; use virtual patching for legacy systems
503
+
504
+ ---
505
+
506
+ ## 5. Security Checklist
507
+
508
+ ### 5.1 Pre-Engagement Checklist
509
+
510
+ ```
511
+ [ ] 1. Written authorization obtained and signed by asset owner
512
+ [ ] 2. Scope defined: in-scope IPs, domains, applications documented
513
+ [ ] 3. Out-of-scope systems explicitly listed
514
+ [ ] 4. Rules of engagement agreed and signed
515
+ [ ] 5. Testing window confirmed (dates, times, timezone)
516
+ [ ] 6. Emergency contacts exchanged (tester + client)
517
+ [ ] 7. Communication channels established (encrypted email, secure portal)
518
+ [ ] 8. Test accounts provisioned (for gray/white box)
519
+ [ ] 9. VPN access or network connectivity confirmed
520
+ [ ] 10. Insurance and NDA in place
521
+ [ ] 11. Data handling and retention policy agreed
522
+ [ ] 12. Retesting terms defined
523
+ [ ] 13. Stakeholder notification plan confirmed
524
+ ```
525
+
526
+ ### 5.2 Testing Phases Checklist
527
+
528
+ ```
529
+ [ ] 14. Passive reconnaissance completed (OSINT, DNS, certificates)
530
+ [ ] 15. Active reconnaissance completed (port scan, service enumeration)
531
+ [ ] 16. Attack surface mapped (endpoints, parameters, entry points)
532
+ [ ] 17. Authentication testing completed (all auth mechanisms)
533
+ [ ] 18. Authorization testing completed (IDOR, privilege escalation)
534
+ [ ] 19. Input validation testing completed (injection, XSS, SSRF)
535
+ [ ] 20. Business logic testing completed (workflow bypass, race conditions)
536
+ [ ] 21. Session management testing completed (fixation, timeout, tokens)
537
+ [ ] 22. Cryptography review completed (TLS, key management, hashing)
538
+ [ ] 23. Error handling and logging tested (information leakage)
539
+ [ ] 24. API-specific testing completed (if APIs in scope)
540
+ [ ] 25. Cloud configuration testing completed (if cloud in scope)
541
+ [ ] 26. All findings documented with evidence
542
+ ```
543
+
544
+ ### 5.3 Reporting Checklist
545
+
546
+ ```
547
+ [ ] 27. Executive summary written in non-technical language
548
+ [ ] 28. Each finding has CVSS score and vector string
549
+ [ ] 29. Each finding has clear reproduction steps
550
+ [ ] 30. Each finding has evidence (screenshots, redacted request/response)
551
+ [ ] 31. Each finding has specific remediation guidance
552
+ [ ] 32. Findings sorted by severity (Critical > High > Medium > Low > Info)
553
+ [ ] 33. Remediation roadmap included with timelines
554
+ [ ] 34. Report delivered via secure channel (encrypted)
555
+ [ ] 35. Report walkthrough/debrief meeting scheduled
556
+ ```
557
+
558
+ ### 5.4 Remediation Verification Checklist
559
+
560
+ ```
561
+ [ ] 36. Critical and high findings remediated within agreed timelines
562
+ [ ] 37. Remediation evidence collected from development team
563
+ [ ] 38. Retest performed to verify fix effectiveness
564
+ [ ] 39. Regression testing confirms fixes did not introduce new issues
565
+ [ ] 40. Updated report issued with retest results
566
+ [ ] 41. Residual risk documented and accepted by stakeholder
567
+ [ ] 42. Lessons learned session conducted
568
+ [ ] 43. Findings fed into SDLC improvements (secure coding training, etc.)
569
+ ```
570
+
571
+ ---
572
+
573
+ ## 6. Tools and Automation
574
+
575
+ ### 6.1 Web Application Testing Tools
576
+
577
+ **Burp Suite Professional**
578
+ - Primary use: Web application proxy, scanner, and manual testing platform
579
+ - Key features: Intercept and modify HTTP/S traffic, automated scanning, Intruder for
580
+ parameter fuzzing, Repeater for manual request manipulation, Collaborator for OOB testing
581
+ - Defensive value: Identifies injection flaws, access control issues, authentication weaknesses
582
+ - License: Commercial (Community edition available with limited features)
583
+ - Integration: CI/CD via Burp Enterprise, REST API for automation
584
+
585
+ **OWASP ZAP (Zed Attack Proxy)**
586
+ - Primary use: Open-source web application security scanner and proxy
587
+ - Key features: Automated scanner, spider, fuzzer, passive scanner, API scan mode,
588
+ Automation Framework for CI/CD integration
589
+ - Defensive value: Free alternative to Burp; excellent for CI/CD pipeline integration
590
+ - License: Open source (Apache 2.0)
591
+ - Integration: Docker images, GitHub Actions, Jenkins plugin, Automation Framework YAML
592
+
593
+ **Nuclei (ProjectDiscovery)**
594
+ - Primary use: Template-based vulnerability scanner
595
+ - Key features: YAML-based templates, 4000+ community templates, fast scanning,
596
+ workflow support, CI/CD integration
597
+ - Defensive value: Rapid detection of known vulnerabilities and misconfigurations
598
+ - License: Open source (MIT)
599
+ - Integration: CLI, Docker, GitHub Actions, ProjectDiscovery Cloud
600
+
601
+ **ffuf (Fuzz Faster U Fool)**
602
+ - Primary use: Web fuzzer for directory/file discovery and parameter fuzzing
603
+ - Key features: Fast, flexible, supports multiple wordlists, filters by response code/size
604
+ - Defensive value: Discovers hidden endpoints, backup files, admin panels
605
+ - License: Open source (MIT)
606
+
607
+ ### 6.2 Network and Infrastructure Tools
608
+
609
+ **Nmap (Network Mapper)**
610
+ - Primary use: Network discovery and security auditing
611
+ - Key features: Port scanning, service detection, OS fingerprinting, NSE scripting engine,
612
+ vulnerability detection scripts
613
+ - Defensive value: Maps attack surface, identifies open ports, detects outdated services
614
+ - License: Open source (custom Nmap license)
615
+ - Note: Nmap scanning is the reconnaissance phase — always within authorized scope
616
+
617
+ **Metasploit Framework**
618
+ - Primary use: Exploitation framework for validating vulnerabilities
619
+ - Key features: Exploit modules, payload generation, post-exploitation, auxiliary scanners
620
+ - Defensive value: Validates that vulnerabilities are actually exploitable (not just theoretical);
621
+ demonstrates real business impact to stakeholders
622
+ - License: Open source (Framework), Commercial (Metasploit Pro)
623
+ - IMPORTANT: Use only in authorized engagements; never use against production systems
624
+ without explicit approval; prefer Metasploit Pro's controlled exploitation features
625
+
626
+ **sqlmap**
627
+ - Primary use: Automated SQL injection detection and exploitation
628
+ - Key features: Detection of injection points, database fingerprinting, data extraction
629
+ - Defensive value: Validates SQL injection findings, determines actual impact and exploitability
630
+ - License: Open source (GPLv2)
631
+ - IMPORTANT: Authorized use only; can be destructive; use read-only techniques when possible
632
+
633
+ ### 6.3 Mobile Application Testing Tools
634
+
635
+ **MobSF (Mobile Security Framework)**
636
+ - Primary use: Automated mobile app security assessment
637
+ - Key features: Static analysis (APK/IPA), dynamic analysis, API testing, malware analysis
638
+ - Defensive value: Rapid identification of hardcoded secrets, insecure storage, weak crypto
639
+ - License: Open source (GPLv3)
640
+
641
+ **Frida**
642
+ - Primary use: Dynamic instrumentation toolkit for mobile and desktop apps
643
+ - Key features: Runtime hooking, SSL pinning bypass (for authorized testing), method tracing
644
+ - Defensive value: Test runtime protections, validate certificate pinning implementation
645
+ - License: Open source (wxWindows Library Licence)
646
+
647
+ ### 6.4 Cloud Penetration Testing Tools
648
+
649
+ **Prowler**
650
+ - Primary use: AWS and Azure security assessment
651
+ - Key features: CIS Benchmark checks, PCI-DSS compliance, GDPR, HIPAA assessments,
652
+ multi-account support
653
+ - Defensive value: Automated discovery of cloud misconfigurations
654
+ - License: Open source (Apache 2.0)
655
+
656
+ **ScoutSuite (NCC Group)**
657
+ - Primary use: Multi-cloud security auditing (AWS, Azure, GCP, Oracle Cloud)
658
+ - Key features: Service-level findings, risk-based severity, HTML report generation
659
+ - Defensive value: Cross-cloud configuration assessment from a single tool
660
+ - License: Open source (GPLv2)
661
+
662
+ **Pacu (Rhino Security Labs)**
663
+ - Primary use: AWS exploitation framework
664
+ - Key features: IAM enumeration, privilege escalation testing, data exfiltration testing
665
+ - Defensive value: Validates IAM policies, tests for lateral movement paths in AWS
666
+ - License: Open source (BSD 3-Clause)
667
+
668
+ ### 6.5 Automated Pen Test Platforms
669
+
670
+ | Platform | Type | Best For |
671
+ |----------|------|----------|
672
+ | Pentera | Automated pen testing | Continuous internal/external testing |
673
+ | Horizon3.ai (NodeZero) | Autonomous pen testing | Validating exploitable attack paths |
674
+ | Cobalt | PTaaS (Pen Test as a Service) | On-demand pen tests with human testers |
675
+ | HackerOne | Bug bounty + PTaaS | Continuous crowd-sourced testing |
676
+ | Bugcrowd | Bug bounty + PTaaS | Managed bug bounty programs |
677
+ | Synack | Crowd-sourced pen testing | Vetted researcher community |
678
+
679
+ ---
680
+
681
+ ## 7. Platform-Specific Guidance
682
+
683
+ ### 7.1 Web Application Pen Test Focus Areas
684
+
685
+ Priority areas for web application testing:
686
+
687
+ 1. **Authentication and session management** — Login, MFA, session tokens, password reset
688
+ 2. **Authorization / access control** — IDOR, role-based access, privilege escalation
689
+ 3. **Input validation** — All user-controllable input (forms, URLs, headers, cookies, files)
690
+ 4. **Business logic** — Workflow manipulation, race conditions, abuse cases
691
+ 5. **Client-side security** — CSP, XSS, DOM manipulation, postMessage handling
692
+ 6. **Third-party integrations** — OAuth flows, SSO, payment processing, webhooks
693
+ 7. **File handling** — Upload, download, processing (ImageMagick, PDF generation)
694
+ 8. **Caching and CDN** — Cache poisoning, cache deception, CDN bypass
695
+
696
+ ### 7.2 API Pen Test Focus Areas
697
+
698
+ 1. **Authentication** — API key exposure, JWT flaws, OAuth misconfiguration
699
+ 2. **Object-level authorization** — BOLA/IDOR on all endpoints
700
+ 3. **Function-level authorization** — Admin endpoints accessible to regular users
701
+ 4. **Rate limiting** — Brute force on all resource-intensive endpoints
702
+ 5. **Input validation** — Injection via JSON/XML/GraphQL parameters
703
+ 6. **Mass assignment** — Extra properties in request bodies accepted by server
704
+ 7. **Data exposure** — API responses returning more data than needed
705
+ 8. **GraphQL specifics** — Introspection enabled, nested query depth, batching attacks
706
+ 9. **API versioning** — Old API versions still accessible with weaker security
707
+ 10. **Documentation/shadow APIs** — Undocumented endpoints discoverable via fuzzing
708
+
709
+ ### 7.3 Mobile Pen Test Focus Areas
710
+
711
+ 1. **Data storage** — Keychain/Keystore, SQLite, SharedPreferences, logs, clipboard
712
+ 2. **Network security** — Certificate pinning, TLS configuration, proxy detection
713
+ 3. **Binary protections** — Obfuscation, root/jailbreak detection, anti-tampering
714
+ 4. **Authentication** — Biometric bypass, token storage, session management
715
+ 5. **Inter-process communication** — Deep links, intents, custom URL schemes
716
+ 6. **Reverse engineering resistance** — Code obfuscation, integrity checks
717
+
718
+ ### 7.4 Cloud Pen Test Scoping — Provider Policies
719
+
720
+ **Amazon Web Services (AWS):**
721
+ - Permitted: Testing your own EC2 instances, RDS, Lambda, API Gateway, CloudFront,
722
+ Elastic Beanstalk, and other customer-owned resources
723
+ - Not permitted: Testing AWS infrastructure, DoS/DDoS simulation, DNS zone walking
724
+ against Route 53, port flooding
725
+ - Notification: No longer required for most test types (as of 2019); still required for
726
+ simulated events and some specific test types
727
+ - Reference: AWS Penetration Testing Policy page
728
+
729
+ **Google Cloud Platform (GCP):**
730
+ - Permitted: Testing your own projects and resources without prior notification
731
+ - Not permitted: Testing Google infrastructure, other customers' resources
732
+ - Must comply with Google Cloud Acceptable Use Policy
733
+ - Reference: GCP Terms of Service, Acceptable Use Policy
734
+
735
+ **Microsoft Azure:**
736
+ - Permitted: Testing your own Azure resources
737
+ - Not permitted: DoS testing, port scanning of other customers, testing shared services
738
+ - Notification: No longer required (as of 2017) for standard pen testing
739
+ - Reference: Microsoft Cloud Penetration Testing Rules of Engagement
740
+
741
+ ### 7.5 Infrastructure Pen Test Focus Areas
742
+
743
+ 1. **External perimeter** — Internet-facing services, exposed management interfaces
744
+ 2. **Internal network** — Segmentation, lateral movement, Active Directory attacks
745
+ 3. **Wireless** — Rogue access points, WPA configuration, captive portal bypass
746
+ 4. **VPN/Remote access** — Authentication, split tunneling, endpoint compliance
747
+ 5. **Patch management** — Outdated services with known CVEs
748
+ 6. **DNS** — Zone transfer, subdomain enumeration, DNS rebinding
749
+ 7. **Email** — SPF/DKIM/DMARC configuration, phishing resistance (if in scope)
750
+
751
+ ---
752
+
753
+ ## 8. Incident Patterns
754
+
755
+ ### 8.1 Pen Test Finding Triage
756
+
757
+ When a pen test report is received, triage findings systematically:
758
+
759
+ ```
760
+ Triage Workflow:
761
+ 1. Receive report via secure channel
762
+ 2. Validate findings — can internal team reproduce each finding?
763
+ 3. Classify by severity (CVSS) and business impact
764
+ 4. Assign owners for each finding (team, individual)
765
+ 5. Estimate remediation effort (hours, complexity, dependencies)
766
+ 6. Create remediation tickets in issue tracker
767
+ 7. Set deadlines per severity (see timeline table below)
768
+ 8. Schedule progress check-ins (weekly for Critical/High)
769
+ 9. Plan retest after remediation
770
+ ```
771
+
772
+ ### 8.2 Critical Finding Escalation
773
+
774
+ Critical findings (CVSS >= 9.0) require immediate escalation:
775
+
776
+ ```
777
+ Critical Finding Escalation Protocol:
778
+ 1. IMMEDIATE: Verbal notification to CISO/security lead (do not wait for written report)
779
+ 2. Within 1 hour: Assess if finding is actively exploitable
780
+ 3. Within 4 hours: Implement temporary mitigation (WAF rule, network block, feature disable)
781
+ 4. Within 24 hours: Begin permanent remediation
782
+ 5. Within 72 hours: Permanent fix deployed or risk acceptance documented by executive
783
+ 6. Within 1 week: Retest to verify remediation
784
+ 7. Post-mortem: Why did this vulnerability exist? What process failed?
785
+ ```
786
+
787
+ ### 8.3 Remediation Timelines by Severity
788
+
789
+ | Severity | Max Time to Remediate | Progress Check | Retest Window |
790
+ |----------|-----------------------|----------------|---------------|
791
+ | Critical (9.0-10.0) | 72 hours (temporary), 2 weeks (permanent) | Daily | Within 1 week of fix |
792
+ | High (7.0-8.9) | 30 days | Weekly | Within 2 weeks of fix |
793
+ | Medium (4.0-6.9) | 90 days | Bi-weekly | Next scheduled test or within 30 days |
794
+ | Low (0.1-3.9) | 180 days | Monthly | Next scheduled test |
795
+ | Informational (0.0) | Best effort / next release | Quarterly | Next scheduled test |
796
+
797
+ ### 8.4 Common Remediation Failures
798
+
799
+ Watch for these patterns that indicate remediation was insufficient:
800
+
801
+ - **Fixing the symptom, not the cause** — Blocking a specific payload instead of fixing
802
+ the underlying injection vulnerability
803
+ - **Incomplete fix** — Fixing one endpoint but leaving the same vulnerability in similar
804
+ endpoints
805
+ - **Client-side only fix** — Adding JavaScript validation without server-side checks
806
+ - **WAF-only mitigation** — Relying solely on WAF rules without fixing application code
807
+ - **Regression** — Fix is reverted by a subsequent deployment
808
+ - **Scope creep** — New features introduced during remediation create new vulnerabilities
809
+
810
+ ---
811
+
812
+ ## 9. Compliance and Standards
813
+
814
+ ### 9.1 PCI-DSS v4.0 — Requirement 11.3
815
+
816
+ PCI-DSS Requirement 11.3 mandates penetration testing for any organization that processes,
817
+ stores, or transmits cardholder data:
818
+
819
+ **Key requirements:**
820
+ - External penetration test at least annually and after significant infrastructure/application changes
821
+ - Internal penetration test at least annually and after significant changes
822
+ - Must use industry-accepted methodologies (NIST SP 800-115, OWASP, PTES)
823
+ - Must test network segmentation controls (verify cardholder data environment isolation)
824
+ - Must test from both inside and outside the network
825
+ - Must test the entire CDE (cardholder data environment) perimeter
826
+ - Application-layer testing must cover OWASP Top 10 at minimum
827
+ - Exploitable vulnerabilities must be corrected and retested
828
+ - Testing must be performed by qualified internal or external personnel
829
+
830
+ **PCI-DSS v4.0 updates (effective March 2025):**
831
+ - Requirement 11.3.1.1: Internal pen tests must also evaluate segmentation controls
832
+ - Requirement 11.3.1.2: Multi-tenant service providers must support customer pen testing
833
+ - Requirement 6.4.1: Public-facing web applications must be protected by automated
834
+ solutions that detect and prevent attacks (WAF or equivalent)
835
+
836
+ ### 9.2 SOC 2 Pen Test Requirements
837
+
838
+ SOC 2 does not explicitly mandate penetration testing, but:
839
+ - Common Criteria CC7.1 requires identification and assessment of vulnerabilities
840
+ - CC4.1 requires evaluation of internal controls
841
+ - Pen testing is the most efficient way to satisfy multiple Trust Services Criteria
842
+ - Most SOC 2 auditors expect or recommend annual pen testing
843
+ - Pen test reports serve as strong evidence for the Security Trust Services Criteria
844
+
845
+ ### 9.3 NIST SP 800-115
846
+
847
+ NIST SP 800-115 "Technical Guide to Information Security Testing and Assessment" provides:
848
+
849
+ **Four-phase methodology:**
850
+ 1. **Planning** — Define scope, objectives, approach, obtain authorization
851
+ 2. **Discovery** — Information gathering, scanning, vulnerability analysis
852
+ 3. **Attack** — Exploit identified vulnerabilities to validate impact
853
+ 4. **Reporting** — Document findings, provide remediation recommendations
854
+
855
+ **Key principles:**
856
+ - Testing must be authorized and planned
857
+ - Results must be defensible and reproducible
858
+ - Evidence handling must follow chain-of-custody practices
859
+ - Findings must be classified by risk level
860
+ - Reports must include both technical and executive summaries
861
+ - Applicable to government agencies and widely adopted by private sector
862
+
863
+ ### 9.4 OWASP Web Security Testing Guide (WSTG)
864
+
865
+ The OWASP WSTG (currently v4.2, with v5 in development) is the most comprehensive
866
+ open-source guide for web application security testing:
867
+
868
+ **Testing categories (11 categories, 90+ test cases):**
869
+
870
+ | Category | ID Prefix | Example Tests |
871
+ |----------|-----------|---------------|
872
+ | Information Gathering | WSTG-INFO | Fingerprint web server, review web content |
873
+ | Configuration Management | WSTG-CONF | Test HTTP methods, file extensions |
874
+ | Identity Management | WSTG-IDNT | Test user registration, account enumeration |
875
+ | Authentication | WSTG-ATHN | Test credentials, lockout, MFA bypass |
876
+ | Authorization | WSTG-ATHZ | Test path traversal, privilege escalation |
877
+ | Session Management | WSTG-SESS | Test cookies, session fixation, CSRF |
878
+ | Input Validation | WSTG-INPV | Test XSS, SQL injection, SSRF, SSTI |
879
+ | Error Handling | WSTG-ERRH | Test error codes, stack traces |
880
+ | Cryptography | WSTG-CRYP | Test TLS, padding oracle, weak ciphers |
881
+ | Business Logic | WSTG-BUSL | Test workflow bypass, data validation |
882
+ | Client-Side | WSTG-CLNT | Test DOM XSS, postMessage, clickjacking |
883
+
884
+ ### 9.5 PTES (Penetration Testing Execution Standard)
885
+
886
+ PTES defines seven phases for a complete penetration test:
887
+
888
+ 1. **Pre-engagement Interactions** — Scoping, RoE, authorization, questionnaires
889
+ 2. **Intelligence Gathering** — OSINT, active/passive recon, target profiling
890
+ 3. **Threat Modeling** — Identify business assets, threats, attack vectors
891
+ 4. **Vulnerability Analysis** — Automated scanning + manual testing, false positive elimination
892
+ 5. **Exploitation** — Validate vulnerabilities through controlled exploitation
893
+ 6. **Post-Exploitation** — Determine value of compromised systems, lateral movement,
894
+ data access, persistence (within RoE boundaries)
895
+ 7. **Reporting** — Executive summary, technical findings, remediation guidance
896
+
897
+ PTES is particularly valued for its emphasis on pre-engagement clarity, threat modeling
898
+ integration, and structured post-exploitation analysis — making it ideal for enterprise-scale
899
+ engagements and red team operations.
900
+
901
+ ---
902
+
903
+ ## 10. Code Examples
904
+
905
+ All examples below are for DEFENSIVE purposes — configuring security scanning tools,
906
+ automating detection, and structuring reports. No exploit code or attack payloads are included.
907
+
908
+ ### 10.1 Nuclei Template — Detect Missing Security Headers
909
+
910
+ ```yaml
911
+ # nuclei-template: missing-security-headers.yaml
912
+ # Purpose: Detect missing security headers on web applications
913
+ # Usage: nuclei -t missing-security-headers.yaml -u https://target.example.com
914
+
915
+ id: missing-security-headers
916
+
917
+ info:
918
+ name: Missing Security Headers Detection
919
+ author: security-team
920
+ severity: info
921
+ description: |
922
+ Checks for the absence of recommended security headers
923
+ that help protect against common web attacks.
924
+ tags: headers,misconfiguration,best-practice
925
+ reference:
926
+ - https://owasp.org/www-project-secure-headers/
927
+
928
+ http:
929
+ - method: GET
930
+ path:
931
+ - "{{BaseURL}}"
932
+
933
+ matchers-condition: or
934
+ matchers:
935
+ - type: word
936
+ name: missing-csp
937
+ words:
938
+ - "Content-Security-Policy"
939
+ part: header
940
+ negative: true
941
+
942
+ - type: word
943
+ name: missing-hsts
944
+ words:
945
+ - "Strict-Transport-Security"
946
+ part: header
947
+ negative: true
948
+
949
+ - type: word
950
+ name: missing-x-frame-options
951
+ words:
952
+ - "X-Frame-Options"
953
+ part: header
954
+ negative: true
955
+
956
+ - type: word
957
+ name: missing-x-content-type
958
+ words:
959
+ - "X-Content-Type-Options"
960
+ part: header
961
+ negative: true
962
+ ```
963
+
964
+ ### 10.2 Nuclei Template — Detect Exposed Git Directory
965
+
966
+ ```yaml
967
+ # nuclei-template: git-directory-exposed.yaml
968
+ # Purpose: Detect exposed .git directories that may leak source code
969
+ # Usage: nuclei -t git-directory-exposed.yaml -l targets.txt
970
+
971
+ id: git-directory-exposed
972
+
973
+ info:
974
+ name: Exposed Git Directory
975
+ author: security-team
976
+ severity: high
977
+ description: |
978
+ Detects exposed .git directories on web servers that could
979
+ allow attackers to download source code and find credentials.
980
+ tags: exposure,git,misconfiguration
981
+ reference:
982
+ - https://owasp.org/www-project-web-security-testing-guide/
983
+
984
+ http:
985
+ - method: GET
986
+ path:
987
+ - "{{BaseURL}}/.git/config"
988
+
989
+ matchers-condition: and
990
+ matchers:
991
+ - type: word
992
+ words:
993
+ - "[core]"
994
+ - "[remote"
995
+ condition: or
996
+
997
+ - type: status
998
+ status:
999
+ - 200
1000
+
1001
+ extractors:
1002
+ - type: regex
1003
+ regex:
1004
+ - 'url = (.+)'
1005
+ group: 1
1006
+ ```
1007
+
1008
+ ### 10.3 ZAP Automation Framework — CI/CD Scan Configuration
1009
+
1010
+ ```yaml
1011
+ # zap-automation.yaml
1012
+ # Purpose: OWASP ZAP Automation Framework configuration for CI/CD pipeline
1013
+ # Usage: docker run -v $(pwd):/zap/wrk/ owasp/zap2docker-stable \
1014
+ # zap.sh -cmd -autorun /zap/wrk/zap-automation.yaml
1015
+
1016
+ env:
1017
+ contexts:
1018
+ - name: "target-app"
1019
+ urls:
1020
+ - "https://staging.example.com"
1021
+ includePaths:
1022
+ - "https://staging.example.com/.*"
1023
+ excludePaths:
1024
+ - "https://staging.example.com/logout.*"
1025
+ - "https://staging.example.com/health.*"
1026
+ authentication:
1027
+ method: "json"
1028
+ parameters:
1029
+ loginPageUrl: "https://staging.example.com/api/auth/login"
1030
+ loginRequestUrl: "https://staging.example.com/api/auth/login"
1031
+ loginRequestBody: '{"username":"{%username%}","password":"{%password%}"}'
1032
+ verification:
1033
+ method: "response"
1034
+ loggedInRegex: "\\Qauthorization\\E"
1035
+ users:
1036
+ - name: "test-user"
1037
+ credentials:
1038
+ username: "${ZAP_TEST_USER}"
1039
+ password: "${ZAP_TEST_PASS}"
1040
+
1041
+ jobs:
1042
+ - type: passiveScan-config
1043
+ parameters:
1044
+ maxAlertsPerRule: 10
1045
+ scanOnlyInScope: true
1046
+
1047
+ - type: spider
1048
+ parameters:
1049
+ context: "target-app"
1050
+ user: "test-user"
1051
+ maxDuration: 5
1052
+ maxDepth: 10
1053
+
1054
+ - type: spiderAjax
1055
+ parameters:
1056
+ context: "target-app"
1057
+ user: "test-user"
1058
+ maxDuration: 5
1059
+
1060
+ - type: passiveScan-wait
1061
+ parameters:
1062
+ maxDuration: 10
1063
+
1064
+ - type: activeScan
1065
+ parameters:
1066
+ context: "target-app"
1067
+ user: "test-user"
1068
+ maxRuleDurationInMins: 5
1069
+ maxScanDurationInMins: 30
1070
+
1071
+ - type: report
1072
+ parameters:
1073
+ template: "traditional-json"
1074
+ reportDir: "/zap/wrk/reports"
1075
+ reportFile: "zap-scan-report"
1076
+ risks:
1077
+ - high
1078
+ - medium
1079
+ - low
1080
+ ```
1081
+
1082
+ ### 10.4 Pen Test Report — Finding Template (Markdown)
1083
+
1084
+ ```markdown
1085
+ ## Finding: [FINDING-ID] — [Title]
1086
+
1087
+ **Severity:** [Critical | High | Medium | Low | Informational]
1088
+ **CVSS v3.1 Score:** [X.X] ([Vector String])
1089
+ **CWE:** [CWE-XXX — Name]
1090
+ **OWASP Category:** [e.g., A01:2021 — Broken Access Control]
1091
+ **Status:** [Open | Remediated | Accepted Risk]
1092
+
1093
+ ### Affected Assets
1094
+ - [URL / IP / Application / Endpoint]
1095
+
1096
+ ### Description
1097
+ [Clear description of the vulnerability, what it is, and why it matters.
1098
+ Written for a technical audience but understandable by a security-aware PM.]
1099
+
1100
+ ### Evidence
1101
+ [Redacted screenshots, HTTP request/response pairs, or tool output
1102
+ demonstrating the vulnerability. NEVER include real credentials or PII.]
1103
+
1104
+ ### Business Impact
1105
+ [What could an attacker achieve by exploiting this? Data breach, financial
1106
+ loss, compliance violation, reputational damage, service disruption?]
1107
+
1108
+ ### Remediation
1109
+ **Recommended fix:**
1110
+ [Specific, actionable remediation steps.]
1111
+
1112
+ **References:**
1113
+ - [Link to relevant OWASP page]
1114
+ - [Link to vendor documentation]
1115
+ - [Link to CWE entry]
1116
+
1117
+ ### Retest Results
1118
+ - **Date:** [YYYY-MM-DD]
1119
+ - **Result:** [Fixed | Partially Fixed | Not Fixed]
1120
+ - **Notes:** [Details of retest]
1121
+ ```
1122
+
1123
+ ### 10.5 Remediation Tracking Template
1124
+
1125
+ ```markdown
1126
+ # Pen Test Remediation Tracker
1127
+
1128
+ **Engagement:** [Engagement Name]
1129
+ **Report Date:** [YYYY-MM-DD]
1130
+ **Retest Target Date:** [YYYY-MM-DD]
1131
+
1132
+ ## Summary
1133
+
1134
+ | Severity | Total | Remediated | In Progress | Open | Accepted Risk |
1135
+ |----------|-------|------------|-------------|------|---------------|
1136
+ | Critical | 0 | 0 | 0 | 0 | 0 |
1137
+ | High | 0 | 0 | 0 | 0 | 0 |
1138
+ | Medium | 0 | 0 | 0 | 0 | 0 |
1139
+ | Low | 0 | 0 | 0 | 0 | 0 |
1140
+ | Info | 0 | 0 | 0 | 0 | 0 |
1141
+
1142
+ ## Findings Detail
1143
+
1144
+ | ID | Title | Severity | Owner | Status | Deadline | Notes |
1145
+ |----|-------|----------|-------|--------|----------|-------|
1146
+ | F-001 | [Title] | Critical | [Team] | Open | [Date] | [Notes] |
1147
+ | F-002 | [Title] | High | [Team] | In Progress | [Date] | [Notes] |
1148
+
1149
+ ## Risk Acceptances
1150
+
1151
+ | ID | Title | Severity | Accepted By | Date | Justification | Review Date |
1152
+ |----|-------|----------|-------------|------|---------------|-------------|
1153
+ | F-XXX | [Title] | [Sev] | [Name/Role] | [Date] | [Why accepted] | [Date] |
1154
+ ```
1155
+
1156
+ ### 10.6 Nmap Defensive Scan Script
1157
+
1158
+ ```bash
1159
+ #!/usr/bin/env bash
1160
+ # nmap-defensive-scan.sh
1161
+ # Purpose: Authorized network reconnaissance for pen test scope validation
1162
+ # Usage: ./nmap-defensive-scan.sh <target-file> <output-dir>
1163
+ # IMPORTANT: Only run against authorized targets listed in the engagement scope
1164
+
1165
+ set -euo pipefail
1166
+
1167
+ TARGET_FILE="${1:?Usage: $0 <target-file> <output-dir>}"
1168
+ OUTPUT_DIR="${2:?Usage: $0 <target-file> <output-dir>}"
1169
+
1170
+ if [[ ! -f "$TARGET_FILE" ]]; then
1171
+ echo "ERROR: Target file not found: $TARGET_FILE"
1172
+ exit 1
1173
+ fi
1174
+
1175
+ mkdir -p "$OUTPUT_DIR"
1176
+ TIMESTAMP=$(date +%Y%m%d_%H%M%S)
1177
+
1178
+ echo "[*] Starting authorized scan at $(date)"
1179
+ echo "[*] Targets: $TARGET_FILE"
1180
+ echo "[*] Output: $OUTPUT_DIR"
1181
+
1182
+ # Phase 1: TCP SYN scan — top 1000 ports, service detection
1183
+ echo "[*] Phase 1: TCP service scan"
1184
+ nmap -sS -sV --top-ports 1000 \
1185
+ -oA "$OUTPUT_DIR/tcp-scan-$TIMESTAMP" \
1186
+ -iL "$TARGET_FILE" \
1187
+ --reason --open
1188
+
1189
+ # Phase 2: UDP scan — top 100 ports
1190
+ echo "[*] Phase 2: UDP service scan"
1191
+ nmap -sU --top-ports 100 \
1192
+ -oA "$OUTPUT_DIR/udp-scan-$TIMESTAMP" \
1193
+ -iL "$TARGET_FILE" \
1194
+ --reason --open
1195
+
1196
+ # Phase 3: NSE vulnerability detection scripts (safe category only)
1197
+ echo "[*] Phase 3: NSE safe vulnerability checks"
1198
+ nmap -sV --script=safe \
1199
+ -oA "$OUTPUT_DIR/nse-safe-$TIMESTAMP" \
1200
+ -iL "$TARGET_FILE" \
1201
+ --open
1202
+
1203
+ # Phase 4: SSL/TLS configuration check
1204
+ echo "[*] Phase 4: SSL/TLS configuration audit"
1205
+ nmap -p 443,8443,8080 --script ssl-enum-ciphers,ssl-cert \
1206
+ -oA "$OUTPUT_DIR/ssl-audit-$TIMESTAMP" \
1207
+ -iL "$TARGET_FILE"
1208
+
1209
+ echo "[*] Scan complete at $(date)"
1210
+ echo "[*] Results saved to $OUTPUT_DIR/"
1211
+ ```
1212
+
1213
+ ---
1214
+
1215
+ ## Quick Reference Card
1216
+
1217
+ ### Pen Test Types at a Glance
1218
+
1219
+ | Type | Target | Methodology | Typical Duration |
1220
+ |------|--------|-------------|-----------------|
1221
+ | Web App Pen Test | Web applications | OWASP WSTG | 5-15 days |
1222
+ | API Pen Test | REST/GraphQL/SOAP APIs | OWASP WSTG + API Top 10 | 3-10 days |
1223
+ | Mobile Pen Test | iOS/Android apps | OWASP MASTG | 5-10 days |
1224
+ | Network Pen Test (External) | Internet-facing infra | PTES + NIST 800-115 | 3-7 days |
1225
+ | Network Pen Test (Internal) | Internal network | PTES + NIST 800-115 | 5-10 days |
1226
+ | Cloud Pen Test | AWS/GCP/Azure configs | CIS Benchmarks + custom | 5-15 days |
1227
+ | Red Team Exercise | Full organization | PTES + MITRE ATT&CK | 2-6 weeks |
1228
+ | Physical Pen Test | Facilities, access control | PTES physical | 1-5 days |
1229
+ | Social Engineering | Employees (phishing, vishing) | PTES + custom | 1-4 weeks |
1230
+
1231
+ ### Key Standards Reference
1232
+
1233
+ | Standard | Focus | Publisher | Current Version |
1234
+ |----------|-------|-----------|-----------------|
1235
+ | OWASP WSTG | Web application testing | OWASP Foundation | v4.2 (v5 in development) |
1236
+ | PTES | Full pen test lifecycle | PTES.org | 1.0 |
1237
+ | NIST SP 800-115 | Security testing and assessment | NIST | 2008 (still current) |
1238
+ | OWASP MASTG | Mobile app testing | OWASP Foundation | v2 |
1239
+ | OWASP API Top 10 | API security risks | OWASP Foundation | 2023 |
1240
+ | CVSS | Vulnerability scoring | FIRST.org | v3.1 / v4.0 |
1241
+ | MITRE ATT&CK | Adversary tactics/techniques | MITRE Corporation | v14+ |
1242
+ | CIS Benchmarks | Configuration hardening | CIS | Updated regularly |
1243
+ | PCI-DSS | Payment card security | PCI SSC | v4.0 |
1244
+
1245
+ ---
1246
+
1247
+ ## References
1248
+
1249
+ - OWASP Web Security Testing Guide: https://owasp.org/www-project-web-security-testing-guide/
1250
+ - PTES (Penetration Testing Execution Standard): http://www.pentest-standard.org/
1251
+ - NIST SP 800-115: https://csrc.nist.gov/pubs/sp/800/115/final
1252
+ - PCI-DSS v4.0: https://www.pcisecuritystandards.org/
1253
+ - CVSS v3.1 Calculator: https://www.first.org/cvss/calculator/3.1
1254
+ - OWASP API Security Top 10: https://owasp.org/API-Security/
1255
+ - OWASP Mobile Application Security: https://mas.owasp.org/
1256
+ - Nuclei Templates: https://github.com/projectdiscovery/nuclei-templates
1257
+ - OWASP ZAP: https://www.zaproxy.org/
1258
+ - MITRE ATT&CK: https://attack.mitre.org/