miesc 4.3.2__tar.gz

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 (293) hide show
  1. miesc-4.3.2/.dockerignore +51 -0
  2. miesc-4.3.2/.env.example +108 -0
  3. miesc-4.3.2/.gitattributes +51 -0
  4. miesc-4.3.2/.nojekyll +0 -0
  5. miesc-4.3.2/.pre-commit-config.yaml +140 -0
  6. miesc-4.3.2/.pre-commit-hooks.yaml +56 -0
  7. miesc-4.3.2/.secrets.baseline +1 -0
  8. miesc-4.3.2/CHANGELOG.md +226 -0
  9. miesc-4.3.2/CITATION.cff +102 -0
  10. miesc-4.3.2/CODEOWNERS +154 -0
  11. miesc-4.3.2/CODE_OF_CONDUCT.md +134 -0
  12. miesc-4.3.2/CONTRIBUTING.md +449 -0
  13. miesc-4.3.2/CONTRIBUTORS.md +110 -0
  14. miesc-4.3.2/DPG-COMPLIANCE.md +398 -0
  15. miesc-4.3.2/Dockerfile +154 -0
  16. miesc-4.3.2/Dockerfile.x86 +139 -0
  17. miesc-4.3.2/GOVERNANCE.md +255 -0
  18. miesc-4.3.2/INSTALL.md +171 -0
  19. miesc-4.3.2/LICENSE +674 -0
  20. miesc-4.3.2/MANIFEST.in +56 -0
  21. miesc-4.3.2/Makefile +419 -0
  22. miesc-4.3.2/PKG-INFO +244 -0
  23. miesc-4.3.2/PRIVACY.md +234 -0
  24. miesc-4.3.2/QUICKSTART.md +183 -0
  25. miesc-4.3.2/README.md +166 -0
  26. miesc-4.3.2/README_ES.md +795 -0
  27. miesc-4.3.2/SECURITY.md +260 -0
  28. miesc-4.3.2/config/miesc.yaml +540 -0
  29. miesc-4.3.2/config/profiles.yaml +219 -0
  30. miesc-4.3.2/contracts/Vault.sol +268 -0
  31. miesc-4.3.2/contracts/audit/AccessControlFlawed.sol +121 -0
  32. miesc-4.3.2/contracts/audit/FlashLoanVault.sol +252 -0
  33. miesc-4.3.2/contracts/audit/NFTMarketplace.sol +263 -0
  34. miesc-4.3.2/contracts/audit/UnsafeToken.sol +142 -0
  35. miesc-4.3.2/contracts/audit/VulnerableBank.sol +99 -0
  36. miesc-4.3.2/contracts/audit/certora/VulnerableBank.conf +11 -0
  37. miesc-4.3.2/contracts/audit/certora/VulnerableBank.sol +99 -0
  38. miesc-4.3.2/contracts/audit/certora/VulnerableBank.spec +131 -0
  39. miesc-4.3.2/data/fine_tuning/dataset_stats.json +16 -0
  40. miesc-4.3.2/data/fine_tuning/solidity_security_alpaca.json +202 -0
  41. miesc-4.3.2/data/fine_tuning/solidity_security_chatml.jsonl +40 -0
  42. miesc-4.3.2/data/fine_tuning/solidity_security_sharegpt.json +482 -0
  43. miesc-4.3.2/data/licenses.db +0 -0
  44. miesc-4.3.2/demo/README.md +157 -0
  45. miesc-4.3.2/demo/create_youtube_video.sh +255 -0
  46. miesc-4.3.2/demo/demo_defensa_grabacion.py +1070 -0
  47. miesc-4.3.2/demo/demo_miesc_v4_complete.py +475 -0
  48. miesc-4.3.2/demo/demo_thesis_defense.py +1453 -0
  49. miesc-4.3.2/demo/miesc_video_demo.py +852 -0
  50. miesc-4.3.2/demo/quick_demo.sh +31 -0
  51. miesc-4.3.2/demo/record_video.sh +120 -0
  52. miesc-4.3.2/demo/run_demo.sh +284 -0
  53. miesc-4.3.2/demo/run_full_demo.sh +609 -0
  54. miesc-4.3.2/demo/subtitles.srt +139 -0
  55. miesc-4.3.2/demo/subtitles_50s.srt +31 -0
  56. miesc-4.3.2/demo/subtitles_50s_es.srt +31 -0
  57. miesc-4.3.2/demo/subtitles_50s_pt.srt +31 -0
  58. miesc-4.3.2/demo/video_recording_guide.md +80 -0
  59. miesc-4.3.2/deploy/.env.example +32 -0
  60. miesc-4.3.2/deploy/Dockerfile.prod +67 -0
  61. miesc-4.3.2/deploy/docker-compose.prod.yml +94 -0
  62. miesc-4.3.2/deploy/ecs-task-definition.json +132 -0
  63. miesc-4.3.2/deprecated/GPTLens_tool.py +134 -0
  64. miesc-4.3.2/deprecated/Llama2_tool.py +51 -0
  65. miesc-4.3.2/deprecated/README.md +24 -0
  66. miesc-4.3.2/deprecated/audit_generator.py +83 -0
  67. miesc-4.3.2/deprecated/manticore_tool.py +309 -0
  68. miesc-4.3.2/deprecated/miesc_ai_layer.py +524 -0
  69. miesc-4.3.2/deprecated/miesc_cli.py +430 -0
  70. miesc-4.3.2/deprecated/miesc_core.py +499 -0
  71. miesc-4.3.2/deprecated/miesc_mcp_adapter.py +533 -0
  72. miesc-4.3.2/deprecated/miesc_mcp_rest.py +1191 -0
  73. miesc-4.3.2/deprecated/miesc_ml_cli.py +310 -0
  74. miesc-4.3.2/deprecated/miesc_policy_agent.py +827 -0
  75. miesc-4.3.2/deprecated/miesc_policy_mapper.py +534 -0
  76. miesc-4.3.2/deprecated/miesc_risk_engine.py +531 -0
  77. miesc-4.3.2/deprecated/miesc_security_checks.py +108 -0
  78. miesc-4.3.2/deprecated/miesc_websocket_api.py +377 -0
  79. miesc-4.3.2/deprecated/mythril_tool.py +59 -0
  80. miesc-4.3.2/deprecated/orchestrator.py +440 -0
  81. miesc-4.3.2/deprecated/project_analyzer.py +523 -0
  82. miesc-4.3.2/deprecated/rawchatGPT_tool.py +29 -0
  83. miesc-4.3.2/deprecated/slither_tool.py +89 -0
  84. miesc-4.3.2/deprecated/surya_tool.py +318 -0
  85. miesc-4.3.2/deprecated/symbolic_agent 2.py +584 -0
  86. miesc-4.3.2/docker-compose.yml +191 -0
  87. miesc-4.3.2/examples/cyberpunk_demo.py +671 -0
  88. miesc-4.3.2/examples/demo_v3.5.py +309 -0
  89. miesc-4.3.2/examples/miesc_full_demo_2025.py +726 -0
  90. miesc-4.3.2/examples/miesc_interactive_demo.py +412 -0
  91. miesc-4.3.2/examples/run_demo.sh +14 -0
  92. miesc-4.3.2/examples/simple_demo.py +172 -0
  93. miesc-4.3.2/foundry.toml +49 -0
  94. miesc-4.3.2/install.sh +122 -0
  95. miesc-4.3.2/miesc/__init__.py +72 -0
  96. miesc-4.3.2/miesc/__main__.py +18 -0
  97. miesc-4.3.2/miesc/adapters/__init__.py +21 -0
  98. miesc-4.3.2/miesc/agents/__init__.py +35 -0
  99. miesc-4.3.2/miesc/api/__init__.py +62 -0
  100. miesc-4.3.2/miesc/api/rest.py +1136 -0
  101. miesc-4.3.2/miesc/cli/__init__.py +9 -0
  102. miesc-4.3.2/miesc/cli/main.py +2330 -0
  103. miesc-4.3.2/miesc/core/__init__.py +23 -0
  104. miesc-4.3.2/miesc/core/orchestrator.py +259 -0
  105. miesc-4.3.2/miesc/core/quick_scanner.py +250 -0
  106. miesc-4.3.2/miesc/llm/__init__.py +61 -0
  107. miesc-4.3.2/miesc/mcp/__init__.py +20 -0
  108. miesc-4.3.2/miesc/ml/__init__.py +30 -0
  109. miesc-4.3.2/miesc/security/__init__.py +26 -0
  110. miesc-4.3.2/miesc.egg-info/SOURCES.txt +290 -0
  111. miesc-4.3.2/mkdocs.yml +227 -0
  112. miesc-4.3.2/pyproject.toml +358 -0
  113. miesc-4.3.2/reports/REPORT.md +75 -0
  114. miesc-4.3.2/reports/demo_audit.html +467 -0
  115. miesc-4.3.2/reports/demo_audit.json +50 -0
  116. miesc-4.3.2/reports/demo_audit_report.html +683 -0
  117. miesc-4.3.2/reports/demo_audit_report.json +115 -0
  118. miesc-4.3.2/reports/report.json +78 -0
  119. miesc-4.3.2/reports/sample_audit.html +640 -0
  120. miesc-4.3.2/reports/sample_audit.json +101 -0
  121. miesc-4.3.2/run_complete_multilayer_audit.py +1058 -0
  122. miesc-4.3.2/scripts/capture_evidence.py +751 -0
  123. miesc-4.3.2/scripts/generate_academic_report.py +1868 -0
  124. miesc-4.3.2/scripts/generate_bilingual_report.py +1063 -0
  125. miesc-4.3.2/scripts/generate_separate_reports.py +1494 -0
  126. miesc-4.3.2/scripts/generate_slides.py +456 -0
  127. miesc-4.3.2/scripts/generate_thesis_pptx.py +819 -0
  128. miesc-4.3.2/scripts/install_tools.py +620 -0
  129. miesc-4.3.2/scripts/miesc-quick +950 -0
  130. miesc-4.3.2/scripts/publish.sh +120 -0
  131. miesc-4.3.2/scripts/run_full_audit.py +265 -0
  132. miesc-4.3.2/scripts/validate_installation.sh +267 -0
  133. miesc-4.3.2/scripts/verify_installation.py +326 -0
  134. miesc-4.3.2/setup.cfg +4 -0
  135. miesc-4.3.2/src/__init__.py +0 -0
  136. miesc-4.3.2/src/adapters/__init__.py +294 -0
  137. miesc-4.3.2/src/adapters/aderyn_adapter.py +497 -0
  138. miesc-4.3.2/src/adapters/advanced_detector_adapter.py +270 -0
  139. miesc-4.3.2/src/adapters/certora_adapter.py +393 -0
  140. miesc-4.3.2/src/adapters/contract_clone_detector_adapter.py +456 -0
  141. miesc-4.3.2/src/adapters/crosschain_adapter.py +745 -0
  142. miesc-4.3.2/src/adapters/dagnn_adapter.py +698 -0
  143. miesc-4.3.2/src/adapters/defi_adapter.py +291 -0
  144. miesc-4.3.2/src/adapters/dogefuzz_adapter.py +722 -0
  145. miesc-4.3.2/src/adapters/echidna_adapter.py +386 -0
  146. miesc-4.3.2/src/adapters/foundry_adapter.py +544 -0
  147. miesc-4.3.2/src/adapters/gas_analyzer_adapter.py +263 -0
  148. miesc-4.3.2/src/adapters/gptscan_adapter.py +399 -0
  149. miesc-4.3.2/src/adapters/halmos_adapter.py +391 -0
  150. miesc-4.3.2/src/adapters/invariant_synthesizer.py +932 -0
  151. miesc-4.3.2/src/adapters/llmbugscanner_adapter.py +648 -0
  152. miesc-4.3.2/src/adapters/llmsmartaudit_adapter.py +442 -0
  153. miesc-4.3.2/src/adapters/manticore_adapter.py +351 -0
  154. miesc-4.3.2/src/adapters/medusa_adapter.py +465 -0
  155. miesc-4.3.2/src/adapters/mev_detector_adapter.py +366 -0
  156. miesc-4.3.2/src/adapters/mythril_adapter.py +425 -0
  157. miesc-4.3.2/src/adapters/propertygpt_adapter.py +577 -0
  158. miesc-4.3.2/src/adapters/slither_adapter.py +514 -0
  159. miesc-4.3.2/src/adapters/smartbugs_detector_adapter.py +278 -0
  160. miesc-4.3.2/src/adapters/smartbugs_ml_adapter.py +446 -0
  161. miesc-4.3.2/src/adapters/smartguard_adapter.py +668 -0
  162. miesc-4.3.2/src/adapters/smartllm_adapter.py +1133 -0
  163. miesc-4.3.2/src/adapters/smartllm_rag_knowledge.py +1875 -0
  164. miesc-4.3.2/src/adapters/smtchecker_adapter.py +387 -0
  165. miesc-4.3.2/src/adapters/solhint_adapter.py +476 -0
  166. miesc-4.3.2/src/adapters/threat_model_adapter.py +376 -0
  167. miesc-4.3.2/src/adapters/vertigo_adapter.py +364 -0
  168. miesc-4.3.2/src/adapters/wake_adapter.py +359 -0
  169. miesc-4.3.2/src/adapters/zk_circuit_adapter.py +627 -0
  170. miesc-4.3.2/src/agents/__init__.py +36 -0
  171. miesc-4.3.2/src/agents/aderyn_agent.py +280 -0
  172. miesc-4.3.2/src/agents/ai_agent.py +447 -0
  173. miesc-4.3.2/src/agents/audit_readiness/__init__.py +24 -0
  174. miesc-4.3.2/src/agents/audit_readiness/documentation_analyzer.py +757 -0
  175. miesc-4.3.2/src/agents/audit_readiness/maturity_analyzer.py +325 -0
  176. miesc-4.3.2/src/agents/audit_readiness/security_practices_analyzer.py +430 -0
  177. miesc-4.3.2/src/agents/audit_readiness/testing_analyzer.py +307 -0
  178. miesc-4.3.2/src/agents/base_agent.py +219 -0
  179. miesc-4.3.2/src/agents/coordinator_agent.py +740 -0
  180. miesc-4.3.2/src/agents/crewai_coordinator.py +474 -0
  181. miesc-4.3.2/src/agents/dynamic_agent.py +384 -0
  182. miesc-4.3.2/src/agents/formal_agent.py +267 -0
  183. miesc-4.3.2/src/agents/gptscan_agent.py +429 -0
  184. miesc-4.3.2/src/agents/halmos_agent.py +300 -0
  185. miesc-4.3.2/src/agents/interpretation_agent.py +545 -0
  186. miesc-4.3.2/src/agents/llm_smartaudit_agent.py +466 -0
  187. miesc-4.3.2/src/agents/medusa_agent.py +296 -0
  188. miesc-4.3.2/src/agents/ollama_agent.py +521 -0
  189. miesc-4.3.2/src/agents/policy_agent.py +1877 -0
  190. miesc-4.3.2/src/agents/recommendation_agent.py +689 -0
  191. miesc-4.3.2/src/agents/slither_protocol_agent.py +244 -0
  192. miesc-4.3.2/src/agents/smartllm_agent.py +469 -0
  193. miesc-4.3.2/src/agents/smtchecker_agent.py +311 -0
  194. miesc-4.3.2/src/agents/static_agent.py +562 -0
  195. miesc-4.3.2/src/agents/symbolic_agent.py +623 -0
  196. miesc-4.3.2/src/agents/wake_agent.py +359 -0
  197. miesc-4.3.2/src/core/__init__.py +134 -0
  198. miesc-4.3.2/src/core/agent_protocol.py +371 -0
  199. miesc-4.3.2/src/core/agent_registry.py +347 -0
  200. miesc-4.3.2/src/core/config_loader.py +234 -0
  201. miesc-4.3.2/src/core/correlation_api.py +600 -0
  202. miesc-4.3.2/src/core/exceptions.py +530 -0
  203. miesc-4.3.2/src/core/exporters.py +557 -0
  204. miesc-4.3.2/src/core/framework_detector.py +551 -0
  205. miesc-4.3.2/src/core/health_checker.py +329 -0
  206. miesc-4.3.2/src/core/llm_config.py +223 -0
  207. miesc-4.3.2/src/core/logging_config.py +490 -0
  208. miesc-4.3.2/src/core/metrics.py +439 -0
  209. miesc-4.3.2/src/core/ml_orchestrator.py +538 -0
  210. miesc-4.3.2/src/core/optimized_orchestrator.py +500 -0
  211. miesc-4.3.2/src/core/persistence.py +738 -0
  212. miesc-4.3.2/src/core/result_aggregator.py +400 -0
  213. miesc-4.3.2/src/core/rich_cli.py +575 -0
  214. miesc-4.3.2/src/core/tool_discovery.py +296 -0
  215. miesc-4.3.2/src/core/tool_protocol.py +340 -0
  216. miesc-4.3.2/src/core/websocket_api.py +550 -0
  217. miesc-4.3.2/src/dashboard/__init__.py +7 -0
  218. miesc-4.3.2/src/dashboard/real_time_dashboard.html +505 -0
  219. miesc-4.3.2/src/detectors/__init__.py +48 -0
  220. miesc-4.3.2/src/detectors/advanced_detectors.py +683 -0
  221. miesc-4.3.2/src/detectors/defi_detectors.py +577 -0
  222. miesc-4.3.2/src/detectors/dependency_analyzer.py +403 -0
  223. miesc-4.3.2/src/detectors/detector_api.py +536 -0
  224. miesc-4.3.2/src/detectors/example_detectors.py +272 -0
  225. miesc-4.3.2/src/detectors/smartbugs_detectors.py +1082 -0
  226. miesc-4.3.2/src/integration/__init__.py +26 -0
  227. miesc-4.3.2/src/integration/adapter_integration.py +402 -0
  228. miesc-4.3.2/src/knowledge_base/__init__.py +38 -0
  229. miesc-4.3.2/src/knowledge_base/vulnerabilities.json +76 -0
  230. miesc-4.3.2/src/licensing/__init__.py +22 -0
  231. miesc-4.3.2/src/licensing/admin_api.py +431 -0
  232. miesc-4.3.2/src/licensing/cli.py +268 -0
  233. miesc-4.3.2/src/licensing/key_generator.py +89 -0
  234. miesc-4.3.2/src/licensing/license_manager.py +378 -0
  235. miesc-4.3.2/src/licensing/models.py +167 -0
  236. miesc-4.3.2/src/licensing/plans.py +119 -0
  237. miesc-4.3.2/src/licensing/quota_checker.py +285 -0
  238. miesc-4.3.2/src/llm/__init__.py +52 -0
  239. miesc-4.3.2/src/llm/llm_orchestrator.py +545 -0
  240. miesc-4.3.2/src/llm/openllama_helper.py +429 -0
  241. miesc-4.3.2/src/mcp/__init__.py +38 -0
  242. miesc-4.3.2/src/mcp/context_bus.py +240 -0
  243. miesc-4.3.2/src/mcp/tool_registry.py +688 -0
  244. miesc-4.3.2/src/mcp/websocket_server.py +524 -0
  245. miesc-4.3.2/src/miesc_core.py +61 -0
  246. miesc-4.3.2/src/miesc_policy_mapper.py +38 -0
  247. miesc-4.3.2/src/miesc_risk_engine.py +74 -0
  248. miesc-4.3.2/src/miesc_tests/__init__.py +18 -0
  249. miesc-4.3.2/src/miesc_tests/test_policy_agent.py +421 -0
  250. miesc-4.3.2/src/ml/__init__.py +230 -0
  251. miesc-4.3.2/src/ml/code_embeddings.py +500 -0
  252. miesc-4.3.2/src/ml/correlation_engine.py +1395 -0
  253. miesc-4.3.2/src/ml/false_positive_filter.py +693 -0
  254. miesc-4.3.2/src/ml/feedback_loop.py +589 -0
  255. miesc-4.3.2/src/ml/fine_tuning/README.md +363 -0
  256. miesc-4.3.2/src/ml/fine_tuning/__init__.py +16 -0
  257. miesc-4.3.2/src/ml/fine_tuning/dataset_generator.py +647 -0
  258. miesc-4.3.2/src/ml/fine_tuning/fine_tuning_trainer.py +497 -0
  259. miesc-4.3.2/src/ml/severity_predictor.py +322 -0
  260. miesc-4.3.2/src/ml/vulnerability_clusterer.py +371 -0
  261. miesc-4.3.2/src/reports/__init__.py +8 -0
  262. miesc-4.3.2/src/reports/audit_report.py +926 -0
  263. miesc-4.3.2/src/security/README.md +279 -0
  264. miesc-4.3.2/src/security/README_ES.md +279 -0
  265. miesc-4.3.2/src/security/__init__.py +71 -0
  266. miesc-4.3.2/src/security/api_limiter.py +397 -0
  267. miesc-4.3.2/src/security/compliance_mapper.py +602 -0
  268. miesc-4.3.2/src/security/input_validator.py +317 -0
  269. miesc-4.3.2/src/security/remediation_engine.py +604 -0
  270. miesc-4.3.2/src/security/remediations.py +700 -0
  271. miesc-4.3.2/src/security/secure_logging.py +273 -0
  272. miesc-4.3.2/src/tests/ERC4626Test.t.sol +168 -0
  273. miesc-4.3.2/src/tests/OracleTest.t.sol +269 -0
  274. miesc-4.3.2/src/tests/ProxyTest.t.sol +125 -0
  275. miesc-4.3.2/src/tests/ReentrancyTest.t.sol +92 -0
  276. miesc-4.3.2/src/tests/__init__.py +5 -0
  277. miesc-4.3.2/src/utils/__init__.py +7 -0
  278. miesc-4.3.2/src/utils/ai_assistant.py +237 -0
  279. miesc-4.3.2/src/utils/enhanced_reporter.py +688 -0
  280. miesc-4.3.2/src/utils/metrics_dashboard.py +361 -0
  281. miesc-4.3.2/src/utils/web_dashboard.py +997 -0
  282. miesc-4.3.2/vscode-extension/.eslintrc.json +34 -0
  283. miesc-4.3.2/vscode-extension/.vscodeignore +11 -0
  284. miesc-4.3.2/vscode-extension/README.md +206 -0
  285. miesc-4.3.2/vscode-extension/media/shield.svg +5 -0
  286. miesc-4.3.2/vscode-extension/package.json +253 -0
  287. miesc-4.3.2/vscode-extension/src/extension.ts +684 -0
  288. miesc-4.3.2/vscode-extension/src/services/miescClient.ts +214 -0
  289. miesc-4.3.2/vscode-extension/src/views/findingsTreeView.ts +220 -0
  290. miesc-4.3.2/vscode-extension/src/views/layersTreeView.ts +211 -0
  291. miesc-4.3.2/vscode-extension/tsconfig.json +22 -0
  292. miesc-4.3.2/webapp/app.py +964 -0
  293. miesc-4.3.2/webapp/dashboard_enhanced.py +974 -0
@@ -0,0 +1,51 @@
1
+ # Recordings and large media files
2
+ demo/recordings/
3
+ *.mp4
4
+ *.gif
5
+ *.wav
6
+ *.aiff
7
+ *.cast
8
+
9
+ # Development files
10
+ .git
11
+ .github
12
+ .vscode
13
+ .idea
14
+ *.egg-info
15
+ __pycache__
16
+ *.pyc
17
+ *.pyo
18
+ .pytest_cache
19
+ .coverage
20
+ htmlcov
21
+ .tox
22
+ .nox
23
+ dist
24
+ build
25
+ *.egg
26
+
27
+ # Virtual environments
28
+ venv/
29
+ venv314/
30
+ .venv/
31
+
32
+ # Thesis and documentation builds
33
+ thesis_generator/
34
+ docs/
35
+ *.docx
36
+ *.pdf
37
+
38
+ # Test artifacts
39
+ .benchmarks/
40
+ benchmarks/datasets/
41
+
42
+ # IDE and OS files
43
+ .DS_Store
44
+ *.swp
45
+ *.swo
46
+ Thumbs.db
47
+
48
+ # Misc
49
+ *.log
50
+ *.tmp
51
+ node_modules/
@@ -0,0 +1,108 @@
1
+ # ============================================================================
2
+ # MIESC Environment Configuration (v3.3.0)
3
+ # ============================================================================
4
+ # Copy this file to .env and fill in your actual values:
5
+ # cp .env.example .env
6
+ #
7
+ # IMPORTANT: Never commit .env to version control!
8
+ # ============================================================================
9
+
10
+ # ============================================================================
11
+ # AI/LLM Configuration
12
+ # ============================================================================
13
+
14
+ # OpenAI API (Required for AI correlation with GPT-4o)
15
+ # Get your key at: https://platform.openai.com/api-keys
16
+ OPENAI_API_KEY=your_openai_api_key_here
17
+
18
+ # OpenAI Model Selection
19
+ # OPENAI_MODEL=gpt-4o
20
+ # OPENAI_TEMPERATURE=0.2
21
+ # OPENAI_MAX_TOKENS=2000
22
+
23
+ # Anthropic Claude API (Optional, for Claude-based correlation)
24
+ # Get your key at: https://console.anthropic.com/
25
+ # ANTHROPIC_API_KEY=sk-ant-your-anthropic-key-here
26
+ # ANTHROPIC_MODEL=claude-3-5-sonnet-20241022
27
+
28
+ # Local LLM Configuration (Optional, for self-hosted models)
29
+ # LOCAL_LLM_ENABLED=false
30
+ # LOCAL_LLM_ENDPOINT=http://localhost:11434/api/generate
31
+ # LOCAL_LLM_MODEL=llama3.1:70b
32
+
33
+ # HuggingFace API Key (Optional for SmartLLM)
34
+ # HUGGINGFACE_API_KEY=your_huggingface_api_key_here
35
+
36
+ # ============================================================================
37
+ # Tool Configuration
38
+ # ============================================================================
39
+
40
+ # Slither Configuration
41
+ # SLITHER_TIMEOUT=60
42
+ # SLITHER_DETECTORS=all
43
+
44
+ # Mythril Configuration
45
+ # MYTHRIL_TIMEOUT=120
46
+ # MYTHRIL_MAX_DEPTH=22
47
+
48
+ # ============================================================================
49
+ # MCP REST API Configuration
50
+ # ============================================================================
51
+
52
+ # MCP Server Settings
53
+ # MCP_HOST=0.0.0.0
54
+ # MCP_PORT=5001
55
+ # MCP_DEBUG=false
56
+ # MCP_LOG_LEVEL=INFO
57
+ # MCP_MESSAGE_HISTORY_LIMIT=1000
58
+
59
+ # API Authentication (Optional, for production)
60
+ # MCP_API_KEY=your-secret-api-key-here
61
+ # MCP_ENABLE_AUTH=false
62
+
63
+ # ============================================================================
64
+ # Output & Reporting
65
+ # ============================================================================
66
+
67
+ # Report Output Directory
68
+ # REPORT_OUTPUT_DIR=analysis/reports
69
+ # REPORT_FORMATS=json,markdown
70
+
71
+ # ============================================================================
72
+ # Logging Configuration
73
+ # ============================================================================
74
+
75
+ # Log Level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
76
+ # LOG_LEVEL=INFO
77
+ # LOG_FILE=logs/miesc.log
78
+
79
+ # ============================================================================
80
+ # Development & Testing
81
+ # ============================================================================
82
+
83
+ # Development Mode
84
+ # DEV_MODE=false
85
+ # ENABLE_PROFILING=false
86
+
87
+ # ============================================================================
88
+ # External Services (Optional)
89
+ # ============================================================================
90
+
91
+ # Etherscan API (for fetching verified contracts)
92
+ # ETHERSCAN_API_KEY=your-etherscan-key-here
93
+
94
+ # Slack Notifications (Optional)
95
+ # SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
96
+ # SLACK_ENABLED=false
97
+
98
+ # ============================================================================
99
+ # Notes
100
+ # ============================================================================
101
+ #
102
+ # 1. Copy this file: cp .env.example .env
103
+ # 2. Fill in your API keys and credentials
104
+ # 3. Never commit .env to Git (it's in .gitignore)
105
+ # 4. Load variables: export $(cat .env | xargs)
106
+ # 5. Verify: python scripts/check_env.py
107
+ #
108
+ # ============================================================================
@@ -0,0 +1,51 @@
1
+ # GitHub Linguist Configuration
2
+ # This file tells GitHub how to detect languages in the repository
3
+
4
+ # Mark documentation directories - exclude from language stats
5
+ docs/** linguist-documentation
6
+ thesis/** linguist-documentation
7
+ *.md linguist-documentation
8
+
9
+ # Mark vendored/generated code - exclude from language stats
10
+ venv/** linguist-vendored
11
+ node_modules/** linguist-vendored
12
+ *.min.js linguist-vendored
13
+ *.min.css linguist-vendored
14
+
15
+ # Website assets - mark as documentation (GitHub Pages site)
16
+ css/** linguist-documentation=false
17
+ js/** linguist-documentation=false
18
+ pages/** linguist-documentation=false
19
+ index.html linguist-documentation=false
20
+
21
+ # Explicitly mark smart contract languages
22
+ *.sol linguist-language=Solidity
23
+ *.vy linguist-language=Vyper
24
+ *.rs linguist-language=Rust
25
+ *.cairo linguist-language=Cairo
26
+ *.move linguist-language=Move
27
+
28
+ # Mark Python as primary language
29
+ *.py linguist-language=Python
30
+
31
+ # Mark shell scripts
32
+ *.sh linguist-language=Shell
33
+
34
+ # Mark configuration files appropriately
35
+ *.toml linguist-language=TOML
36
+ *.yml linguist-language=YAML
37
+ *.yaml linguist-language=YAML
38
+ *.json linguist-language=JSON
39
+
40
+ # Exclude analysis outputs and data files from stats
41
+ output/** linguist-generated
42
+ outputs/** linguist-generated
43
+ analysis/** linguist-generated
44
+ data/** linguist-generated
45
+
46
+ # Exclude test contracts that are intentionally vulnerable
47
+ vulnerable_contracts/** linguist-documentation
48
+ examples/** linguist-documentation=false
49
+
50
+ # Video assets - exclude from stats
51
+ video_assets/** linguist-documentation
miesc-4.3.2/.nojekyll ADDED
File without changes
@@ -0,0 +1,140 @@
1
+ # Pre-commit hooks configuration for MIESC
2
+ # Implements Shift-Left Security by running checks before commits
3
+ #
4
+ # Installation:
5
+ # pip install pre-commit
6
+ # pre-commit install
7
+ #
8
+ # Usage:
9
+ # pre-commit run --all-files # Run all hooks manually
10
+ # git commit -m "message" # Hooks run automatically
11
+
12
+ repos:
13
+ # Code Formatting
14
+ - repo: https://github.com/psf/black
15
+ rev: 24.1.1
16
+ hooks:
17
+ - id: black
18
+ name: Black Code Formatter
19
+ language_version: python3.9
20
+ args: ['--line-length=100']
21
+
22
+ # Fast Linting (Ruff)
23
+ - repo: https://github.com/astral-sh/ruff-pre-commit
24
+ rev: v0.1.14
25
+ hooks:
26
+ - id: ruff
27
+ name: Ruff Linter
28
+ args: ['--fix', '--exit-non-zero-on-fix']
29
+
30
+ # Traditional Linting (Flake8)
31
+ - repo: https://github.com/PyCQA/flake8
32
+ rev: 7.0.0
33
+ hooks:
34
+ - id: flake8
35
+ name: Flake8 Style Checker
36
+ args: ['--max-line-length=100', '--ignore=E203,W503']
37
+
38
+ # Security Scanning (Bandit)
39
+ - repo: https://github.com/PyCQA/bandit
40
+ rev: 1.7.6
41
+ hooks:
42
+ - id: bandit
43
+ name: Bandit Security Scanner
44
+ args: ['-r', 'src/', '-ll'] # Low-level severity
45
+ exclude: ^tests/
46
+
47
+ # Secret Scanning
48
+ - repo: https://github.com/Yelp/detect-secrets
49
+ rev: v1.4.0
50
+ hooks:
51
+ - id: detect-secrets
52
+ name: Detect Hardcoded Secrets
53
+ args: ['--baseline', '.secrets.baseline']
54
+ exclude: tests/
55
+
56
+ # YAML Validation
57
+ - repo: https://github.com/pre-commit/pre-commit-hooks
58
+ rev: v4.5.0
59
+ hooks:
60
+ - id: check-yaml
61
+ name: Check YAML Syntax
62
+ - id: check-json
63
+ name: Check JSON Syntax
64
+ - id: check-toml
65
+ name: Check TOML Syntax
66
+ - id: end-of-file-fixer
67
+ name: Fix End of Files
68
+ - id: trailing-whitespace
69
+ name: Trim Trailing Whitespace
70
+ - id: check-added-large-files
71
+ name: Check for Large Files
72
+ args: ['--maxkb=1000']
73
+ - id: check-merge-conflict
74
+ name: Check for Merge Conflicts
75
+ - id: check-case-conflict
76
+ name: Check for Case Conflicts
77
+
78
+ # Python-specific checks
79
+ - repo: https://github.com/pre-commit/pre-commit-hooks
80
+ rev: v4.5.0
81
+ hooks:
82
+ - id: check-ast
83
+ name: Check Python AST
84
+ - id: check-docstring-first
85
+ name: Check Docstring First
86
+ - id: debug-statements
87
+ name: Check for Debug Statements
88
+ - id: name-tests-test
89
+ name: Check Test Naming
90
+ args: ['--pytest-test-first']
91
+
92
+ # Type Checking (MyPy)
93
+ - repo: https://github.com/pre-commit/mirrors-mypy
94
+ rev: v1.8.0
95
+ hooks:
96
+ - id: mypy
97
+ name: MyPy Type Checker
98
+ args: ['--ignore-missing-imports', '--show-error-codes']
99
+ additional_dependencies:
100
+ - 'types-requests'
101
+ - 'types-PyYAML'
102
+ - 'types-click'
103
+ exclude: ^tests/
104
+
105
+ # Markdown Linting
106
+ - repo: https://github.com/igorshubovych/markdownlint-cli
107
+ rev: v0.38.0
108
+ hooks:
109
+ - id: markdownlint
110
+ name: Markdown Linter
111
+ args: ['--fix']
112
+
113
+ # Commit Message Validation
114
+ - repo: https://github.com/commitizen-tools/commitizen
115
+ rev: v3.13.0
116
+ hooks:
117
+ - id: commitizen
118
+ name: Check Commit Message Format
119
+ stages: [commit-msg]
120
+
121
+ # Configuration
122
+ default_language_version:
123
+ python: python3.9
124
+
125
+ fail_fast: false # Run all hooks even if one fails
126
+ minimum_pre_commit_version: '3.0.0'
127
+
128
+ # Exclude patterns
129
+ exclude: |
130
+ (?x)^(
131
+ venv/|
132
+ .venv/|
133
+ __pycache__/|
134
+ \.git/|
135
+ \.pytest_cache/|
136
+ \.mypy_cache/|
137
+ build/|
138
+ dist/|
139
+ \.egg-info/
140
+ )
@@ -0,0 +1,56 @@
1
+ # MIESC Pre-commit Hooks
2
+ # These hooks allow users to integrate MIESC security scanning into their projects
3
+ #
4
+ # Usage in your project's .pre-commit-config.yaml:
5
+ #
6
+ # repos:
7
+ # - repo: https://github.com/fboiero/MIESC
8
+ # rev: v4.2.2
9
+ # hooks:
10
+ # - id: miesc-quick
11
+ # args: ['--fail-on', 'high,critical']
12
+ #
13
+ # For more information: https://github.com/fboiero/MIESC
14
+
15
+ - id: miesc-quick
16
+ name: MIESC Quick Security Scan
17
+ description: Run quick security scan on Solidity contracts (4 tools, ~30s)
18
+ entry: python -m miesc audit quick
19
+ language: python
20
+ files: \.sol$
21
+ types: [file]
22
+ pass_filenames: true
23
+ require_serial: false
24
+ additional_dependencies: ['miesc>=4.2.2']
25
+
26
+ - id: miesc-full
27
+ name: MIESC Full Security Audit
28
+ description: Run comprehensive 9-layer security audit (all tools)
29
+ entry: python -m miesc audit full
30
+ language: python
31
+ files: \.sol$
32
+ types: [file]
33
+ pass_filenames: true
34
+ require_serial: true
35
+ stages: [manual]
36
+ additional_dependencies: ['miesc>=4.2.2']
37
+
38
+ - id: miesc-layer
39
+ name: MIESC Single Layer Scan
40
+ description: Run specific layer analysis
41
+ entry: python -m miesc audit layer 1
42
+ language: python
43
+ files: \.sol$
44
+ types: [file]
45
+ pass_filenames: true
46
+ additional_dependencies: ['miesc>=4.2.2']
47
+
48
+ - id: miesc-ci
49
+ name: MIESC CI Mode
50
+ description: Security scan with CI-friendly output (exit code on issues)
51
+ entry: python -m miesc audit quick --ci
52
+ language: python
53
+ files: \.sol$
54
+ types: [file]
55
+ pass_filenames: true
56
+ additional_dependencies: ['miesc>=4.2.2']
@@ -0,0 +1 @@
1
+ {"version": "1.4.0", "plugins_used": [], "results": {}}
@@ -0,0 +1,226 @@
1
+ # Changelog
2
+
3
+ All notable changes to MIESC will be documented in this file.
4
+
5
+ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
+ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [4.2.1] - 2024-12-23
9
+
10
+ ### Added
11
+
12
+ #### Scientific Benchmark Validation (SmartBugs Curated)
13
+ - **Comprehensive multi-tool benchmark** against SmartBugs Curated dataset (143 contracts)
14
+ - Benchmark runner script (`benchmarks/run_benchmark.py`) for reproducible validation
15
+ - Detailed results in `benchmarks/results/` JSON format
16
+
17
+ #### Benchmark Results Summary
18
+ | Tool | Layer | Recall | F1-Score | Notes |
19
+ |------|-------|--------|----------|-------|
20
+ | Slither | 1 | 84.3% | 80.0% | +27.3% vs SmartBugs 2020 paper |
21
+ | SmartBugsDetector | 2 | 100% | - | Pattern-based, no compilation |
22
+ | Mythril | 3 | - | - | 6 findings with SWC codes |
23
+
24
+ #### Per-Category Detection Rates (Slither)
25
+ - Unchecked low-level calls: 100%
26
+ - Front running: 100%
27
+ - Arithmetic overflow: 93.3%
28
+ - Bad randomness: 87.5%
29
+ - Access control: 86.7%
30
+ - Reentrancy: 73.3%
31
+ - Time manipulation: 60.0%
32
+ - Denial of service: 50.0%
33
+
34
+ #### New Adapters
35
+ - **SmartGuard Adapter** - ML-based vulnerability prediction
36
+ - **LLMBugScanner Adapter** - GPT-4o powered vulnerability detection
37
+ - **ZK Circuit Adapter** - Zero-knowledge proof circuit validation
38
+ - **CrossChain Adapter** - Bridge and cross-chain security analysis
39
+
40
+ #### Slither Adapter Improvements
41
+ - Legacy Solidity support (0.4.x - 0.5.x) with `--compile-force-framework solc`
42
+ - Automatic solc-select integration for version management
43
+ - Improved IR generation handling for complex legacy patterns
44
+
45
+ ### Changed
46
+ - Updated version to 4.2.1
47
+ - Enhanced adapter error handling for legacy contracts
48
+ - Improved benchmark reproducibility with JSON result export
49
+
50
+ ### Documentation
51
+ - Added benchmark methodology documentation
52
+ - Scientific comparison with literature (SmartBugs 2020, Empirical Review 2020)
53
+ - Multi-tool strategy recommendations
54
+
55
+ ---
56
+
57
+ ## [4.1.0] - 2024-12-09
58
+
59
+ ### Added
60
+
61
+ #### New Security Layers (post-thesis extension)
62
+ - **Layer 8: DeFi Security Analysis** - First open-source DeFi vulnerability detectors
63
+ - Flash loan attack detection (callback validation, repayment verification)
64
+ - Oracle manipulation detection (spot price vs TWAP)
65
+ - Sandwich attack detection (zero slippage, missing deadlines)
66
+ - MEV exposure analysis (liquidation front-running)
67
+ - Price manipulation detection (reserve ratio vulnerabilities)
68
+
69
+ - **Layer 9: Dependency Security Analysis** - Supply chain security
70
+ - OpenZeppelin CVE database integration (CVE-2022-35961, etc.)
71
+ - Vulnerable version detection with semantic versioning
72
+ - Dangerous pattern detection (tx.origin, selfdestruct, delegatecall, ecrecover)
73
+ - Third-party library vulnerability scanning (Uniswap, Compound)
74
+
75
+ #### API Enhancements
76
+ - SSE (Server-Sent Events) streaming endpoint `/mcp/stream/audit`
77
+ - DeFi-specific analysis endpoint `/mcp/defi/analyze`
78
+ - Real-time layer-by-layer progress updates
79
+
80
+ #### Scientific Validation
81
+ - **SmartBugs benchmark integration** (143 contracts, 207 vulnerabilities)
82
+ - 50.22% recall (outperforms individual tools)
83
+ - 87.5% recall on reentrancy vulnerabilities
84
+ - 89.3% recall on unchecked low-level calls
85
+ - Automated evaluation script with metrics calculation
86
+ - Scientific report generation for thesis
87
+
88
+ #### Performance Benchmarks
89
+ - Scalability benchmarks demonstrating 346 contracts/minute
90
+ - 3.53x parallel speedup with 4 workers
91
+ - Memory-efficient analysis (< 5 MB per contract)
92
+
93
+ ### Changed
94
+ - Updated MCP REST API to version 4.1.0
95
+ - Improved Solidity version auto-detection for legacy contracts (0.4.x - 0.8.x)
96
+ - Enhanced error handling in tool adapters
97
+ - Architecture extended from 7 to 9 layers (Layers 8-9 are post-thesis work)
98
+
99
+ ### Fixed
100
+ - Foundry.toml interference with Slither analysis on SmartBugs dataset
101
+ - Solc version selection for legacy contracts
102
+
103
+ ---
104
+
105
+ ## [Unreleased]
106
+
107
+ ### Added
108
+ - **DPGA Application Submitted** (December 5, 2025)
109
+ - Application ID: GID0092948
110
+ - Status: Under Review
111
+ - Contact: Bolaji Ayodeji (DPG Evangelist)
112
+ - Expected review period: 4-8 weeks
113
+ - Complete DPG compliance documentation package
114
+ - DPGA Application Responses CSV for reference
115
+
116
+ ## [4.0.0] - 2025-01-14
117
+
118
+ ### Added
119
+ - **PropertyGPT** (Layer 4 - Formal Verification): Automated CVL property generation
120
+ - 80% recall on ground-truth Certora properties
121
+ - Increases formal verification adoption from 5% to 40% (+700%)
122
+ - Based on NDSS 2025 paper (arXiv:2405.02580)
123
+ - **DA-GNN** (Layer 6 - ML Detection): Graph Neural Network-based vulnerability detection
124
+ - 95.7% accuracy with 4.3% false positive rate
125
+ - Control-flow + data-flow graph representation
126
+ - Based on Computer Networks (ScienceDirect, Feb 2024)
127
+ - **SmartLLM RAG + Verificator** (Layer 5 - AI Analysis): Enhanced AI-powered analysis
128
+ - Retrieval-Augmented Generation with ERC-20/721/1155 knowledge base
129
+ - Multi-stage pipeline: Generator → Verificator → Consensus
130
+ - Precision improved from 75% to 88% (+17%), FP rate reduced by 52%
131
+ - Based on arXiv:2502.13167 (Feb 2025)
132
+ - **DogeFuzz** (Layer 2 - Dynamic Testing): Coverage-guided fuzzer with hybrid execution
133
+ - AFL-style power scheduling algorithm
134
+ - 85% code coverage, 3x faster than Echidna
135
+ - Parallel execution with 4 workers
136
+ - Based on arXiv:2409.01788 (Sep 2024)
137
+ - Certora adapter (formal verification integration)
138
+ - Halmos adapter (symbolic testing for Foundry)
139
+ - DAG-NN adapter (graph neural network detection)
140
+
141
+ ### Changed
142
+ - Increased tool count from 22 to 25 adapters (+13.6%)
143
+ - Precision: 89.47% → 94.5% (+5.03pp)
144
+ - Recall: 86.2% → 92.8% (+6.6pp)
145
+ - False Positive Rate: 10.53% → 5.5% (-48%)
146
+ - Detection Coverage: 85% → 96% (+11pp)
147
+ - Restructured repository to UNIX/OSS conventions
148
+ - Updated README with comprehensive "What's New in v4.0" section
149
+ - Improved scientific rigor in documentation
150
+
151
+ ### Research Papers Integrated
152
+ - NDSS Symposium 2025: PropertyGPT for automated property generation
153
+ - Computer Networks 2024: DA-GNN for graph-based vulnerability detection
154
+ - arXiv 2025: SmartLLM with RAG and Verificator enhancements
155
+ - arXiv 2024: DogeFuzz coverage-guided fuzzing
156
+
157
+ ## [3.5.0] - 2025-01-13
158
+
159
+ ### Added
160
+ - OpenLLaMA local LLM integration for AI-assisted analysis
161
+ - Aderyn adapter (Rust-based static analyzer)
162
+ - Medusa adapter (coverage-guided fuzzer)
163
+ - AI enhancement for Layers 3-4 (symbolic execution, formal verification)
164
+ - SmartLLM, GPTScan, LLM-SmartAudit adapters
165
+ - SMTChecker adapter (built-in Solidity verification)
166
+ - Wake adapter (Python development framework)
167
+ - 117 unit and integration tests
168
+ - CI/CD workflow with automated tool installation
169
+ - Complete adapter documentation
170
+
171
+ ### Changed
172
+ - Increased tool count from 15 to 17
173
+ - Improved test coverage to 87.5%
174
+ - Enhanced DPGA compliance (100% maintained)
175
+
176
+ ## [3.4.0] - 2025-11-08
177
+
178
+ ### Added
179
+ - Aderyn and Medusa adapters
180
+ - 17 security tool integrations
181
+
182
+ ### Changed
183
+ - Test suite expanded to 117 tests
184
+
185
+ ## [2.2.0] - 2024-10-XX
186
+
187
+ ### Added
188
+ - 15 security tool integrations
189
+ - AI-assisted triage (GPT-4, Llama)
190
+ - PolicyAgent v2.2 (12 compliance standards)
191
+ - Model Context Protocol (MCP) architecture
192
+ - 30 regression tests
193
+ - Comprehensive documentation
194
+
195
+ ## [2.1.0] - 2024-09-XX
196
+
197
+ ### Added
198
+ - Multi-agent architecture
199
+ - Initial MCP integration
200
+ - Compliance mapping framework
201
+
202
+ ## [2.0.0] - 2024-08-XX
203
+
204
+ ### Added
205
+ - Complete framework rewrite
206
+ - 7-layer defense architecture
207
+ - Initial tool adapters (10)
208
+
209
+ ## [1.0.0] - 2024-06-XX
210
+
211
+ ### Added
212
+ - Initial proof-of-concept
213
+ - Basic Slither and Mythril integration
214
+
215
+ ---
216
+
217
+ [Unreleased]: https://github.com/fboiero/MIESC/compare/v4.2.1...HEAD
218
+ [4.2.1]: https://github.com/fboiero/MIESC/compare/v4.1.0...v4.2.1
219
+ [4.1.0]: https://github.com/fboiero/MIESC/compare/v4.0.0...v4.1.0
220
+ [4.0.0]: https://github.com/fboiero/MIESC/compare/v3.5.0...v4.0.0
221
+ [3.5.0]: https://github.com/fboiero/MIESC/compare/v3.4.0...v3.5.0
222
+ [3.4.0]: https://github.com/fboiero/MIESC/compare/v2.2.0...v3.4.0
223
+ [2.2.0]: https://github.com/fboiero/MIESC/compare/v2.1.0...v2.2.0
224
+ [2.1.0]: https://github.com/fboiero/MIESC/compare/v2.0.0...v2.1.0
225
+ [2.0.0]: https://github.com/fboiero/MIESC/compare/v1.0.0...v2.0.0
226
+ [1.0.0]: https://github.com/fboiero/MIESC/releases/tag/v1.0.0