arachni 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (348) hide show
  1. data/ACKNOWLEDGMENTS.md +1 -1
  2. data/CHANGELOG.md +146 -0
  3. data/CONTRIBUTORS.md +1 -0
  4. data/HACKING.md +3 -3
  5. data/README.md +81 -49
  6. data/Rakefile +11 -14
  7. data/bin/arachni +4 -8
  8. data/bin/arachni_rpc +17 -0
  9. data/bin/arachni_rpcd +18 -0
  10. data/bin/arachni_rpcd_monitor +18 -0
  11. data/bin/arachni_web +25 -48
  12. data/bin/arachni_web_autostart +3 -3
  13. data/conf/README.webui.yaml.txt +7 -21
  14. data/external/metasploit/plugins/arachni.rb +0 -7
  15. data/extras/modules/recon/raft_dirs.rb +108 -0
  16. data/extras/modules/recon/raft_dirs/raft-large-directories.txt +62290 -0
  17. data/extras/modules/recon/raft_files.rb +110 -0
  18. data/extras/modules/recon/raft_files/raft-large-files.txt +37037 -0
  19. data/extras/modules/recon/svn_digger_dirs.rb +108 -0
  20. data/extras/modules/recon/svn_digger_dirs/Licence.txt +674 -0
  21. data/extras/modules/recon/svn_digger_dirs/ReadMe-Arachni.txt +4 -0
  22. data/extras/modules/recon/svn_digger_dirs/ReadMe.txt +6 -0
  23. data/extras/modules/recon/svn_digger_dirs/all-dirs.txt +5960 -0
  24. data/extras/modules/recon/svn_digger_files.rb +114 -0
  25. data/extras/modules/recon/svn_digger_files/Licence.txt +674 -0
  26. data/extras/modules/recon/svn_digger_files/ReadMe-Arachni.txt +4 -0
  27. data/extras/modules/recon/svn_digger_files/ReadMe.txt +6 -0
  28. data/extras/modules/recon/svn_digger_files/all-extensionless.txt +25419 -0
  29. data/extras/modules/recon/svn_digger_files/all.txt +43135 -0
  30. data/lib/arachni.rb +2 -7
  31. data/lib/{audit_store.rb → arachni/audit_store.rb} +68 -60
  32. data/lib/{component_manager.rb → arachni/component_manager.rb} +8 -8
  33. data/lib/{component_options.rb → arachni/component_options.rb} +34 -4
  34. data/lib/{crypto → arachni/crypto}/rsa_aes_cbc.rb +1 -2
  35. data/lib/arachni/database.rb +4 -0
  36. data/lib/arachni/database/base.rb +125 -0
  37. data/lib/arachni/database/hash.rb +384 -0
  38. data/lib/arachni/database/queue.rb +93 -0
  39. data/lib/{exceptions.rb → arachni/exceptions.rb} +1 -1
  40. data/lib/arachni/framework.rb +899 -0
  41. data/lib/{http.rb → arachni/http.rb} +63 -166
  42. data/lib/{issue.rb → arachni/issue.rb} +46 -17
  43. data/lib/{mixins → arachni/mixins}/observable.rb +1 -1
  44. data/lib/arachni/mixins/progress_bar.rb +81 -0
  45. data/lib/arachni/mixins/terminal.rb +106 -0
  46. data/lib/{module.rb → arachni/module.rb} +0 -0
  47. data/lib/{module → arachni/module}/auditor.rb +250 -86
  48. data/lib/{module → arachni/module}/base.rb +8 -18
  49. data/lib/{module → arachni/module}/element_db.rb +10 -2
  50. data/lib/{module → arachni/module}/key_filler.rb +1 -1
  51. data/lib/arachni/module/manager.rb +145 -0
  52. data/lib/{module → arachni/module}/output.rb +6 -1
  53. data/lib/{module → arachni/module}/trainer.rb +48 -52
  54. data/lib/{module → arachni/module}/utilities.rb +66 -15
  55. data/lib/{nokogiri → arachni/nokogiri}/xml/node.rb +0 -0
  56. data/lib/arachni/options.rb +986 -0
  57. data/lib/{parser.rb → arachni/parser.rb} +0 -0
  58. data/lib/{parser → arachni/parser}/auditable.rb +111 -32
  59. data/lib/{parser → arachni/parser}/elements.rb +28 -20
  60. data/lib/{parser → arachni/parser}/page.rb +20 -3
  61. data/lib/{parser → arachni/parser}/parser.rb +100 -63
  62. data/lib/{plugin.rb → arachni/plugin.rb} +0 -0
  63. data/lib/{plugin → arachni/plugin}/base.rb +43 -6
  64. data/lib/{plugin → arachni/plugin}/manager.rb +40 -13
  65. data/lib/{report.rb → arachni/report.rb} +0 -0
  66. data/lib/{report → arachni/report}/base.rb +43 -2
  67. data/lib/{report → arachni/report}/manager.rb +7 -18
  68. data/lib/arachni/rpc/client/base.rb +42 -0
  69. data/lib/{rpc/xml → arachni/rpc}/client/dispatcher.rb +12 -13
  70. data/lib/arachni/rpc/client/instance.rb +62 -0
  71. data/lib/arachni/rpc/server/base.rb +51 -0
  72. data/lib/arachni/rpc/server/dispatcher.rb +438 -0
  73. data/lib/arachni/rpc/server/framework.rb +1163 -0
  74. data/lib/arachni/rpc/server/instance.rb +184 -0
  75. data/lib/{rpc/xml → arachni/rpc}/server/module/manager.rb +8 -5
  76. data/lib/arachni/rpc/server/node.rb +267 -0
  77. data/lib/{rpc/xml → arachni/rpc}/server/options.rb +6 -35
  78. data/lib/{rpc/xml → arachni/rpc}/server/output.rb +29 -3
  79. data/lib/{rpc/xml → arachni/rpc}/server/plugin/manager.rb +5 -6
  80. data/lib/{ruby.rb → arachni/ruby.rb} +1 -2
  81. data/lib/arachni/ruby/array.rb +31 -0
  82. data/lib/{ruby → arachni/ruby}/object.rb +1 -1
  83. data/lib/{ruby → arachni/ruby}/string.rb +1 -1
  84. data/lib/{spider.rb → arachni/spider.rb} +83 -110
  85. data/lib/arachni/typhoeus/hydra.rb +7 -0
  86. data/lib/{typhoeus → arachni/typhoeus}/request.rb +11 -9
  87. data/lib/{typhoeus → arachni/typhoeus}/response.rb +4 -0
  88. data/lib/{ui → arachni/ui}/cli/cli.rb +154 -84
  89. data/lib/{ui → arachni/ui}/cli/output.rb +57 -19
  90. data/lib/{ui/xmlrpc → arachni/ui/rpc}/dispatcher_monitor.rb +11 -10
  91. data/lib/{ui/xmlrpc/xmlrpc.rb → arachni/ui/rpc/rpc.rb} +102 -158
  92. data/lib/{ui → arachni/ui}/web/addon_manager.rb +23 -3
  93. data/lib/arachni/ui/web/addons/autodeploy.rb +207 -0
  94. data/lib/{ui → arachni/ui}/web/addons/autodeploy/lib/manager.rb +142 -35
  95. data/lib/arachni/ui/web/addons/autodeploy/views/index.erb +291 -0
  96. data/lib/{ui → arachni/ui}/web/addons/sample.rb +1 -1
  97. data/lib/{ui → arachni/ui}/web/addons/sample/views/index.erb +0 -0
  98. data/lib/{ui → arachni/ui}/web/addons/scheduler.rb +30 -22
  99. data/lib/{ui → arachni/ui}/web/addons/scheduler/views/index.erb +56 -22
  100. data/lib/{ui → arachni/ui}/web/addons/scheduler/views/options.erb +0 -0
  101. data/lib/arachni/ui/web/dispatcher_manager.rb +274 -0
  102. data/lib/arachni/ui/web/instance_manager.rb +69 -0
  103. data/lib/{ui → arachni/ui}/web/log.rb +1 -1
  104. data/lib/arachni/ui/web/output_stream.rb +54 -0
  105. data/lib/{ui → arachni/ui}/web/report_manager.rb +48 -54
  106. data/lib/{ui → arachni/ui}/web/scheduler.rb +42 -47
  107. data/lib/arachni/ui/web/server.rb +1197 -0
  108. data/lib/{ui → arachni/ui}/web/server/db/placeholder +0 -0
  109. data/lib/{ui → arachni/ui}/web/server/public/banner.png +0 -0
  110. data/lib/{ui → arachni/ui}/web/server/public/bodybg-small.png +0 -0
  111. data/lib/{ui → arachni/ui}/web/server/public/bodybg.png +0 -0
  112. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/pbar-ani.gif +0 -0
  113. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  114. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  115. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  116. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  117. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  118. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  119. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  120. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  121. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
  122. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  123. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
  124. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
  125. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  126. data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/jquery-ui-1.8.9.custom.css +0 -0
  127. data/lib/{ui → arachni/ui}/web/server/public/favicon.ico +0 -0
  128. data/lib/{ui → arachni/ui}/web/server/public/footer.jpg +0 -0
  129. data/lib/{ui/web/server/public/icons/error.png → arachni/ui/web/server/public/icons/bad.png} +0 -0
  130. data/lib/arachni/ui/web/server/public/icons/error.png +0 -0
  131. data/lib/{ui → arachni/ui}/web/server/public/icons/info.png +0 -0
  132. data/lib/{ui → arachni/ui}/web/server/public/icons/ok.png +0 -0
  133. data/lib/{ui → arachni/ui}/web/server/public/icons/status.png +0 -0
  134. data/lib/{ui → arachni/ui}/web/server/public/js/jquery-1.4.4.min.js +0 -0
  135. data/lib/{ui → arachni/ui}/web/server/public/js/jquery-ui-1.8.9.custom.min.js +0 -0
  136. data/lib/{ui → arachni/ui}/web/server/public/js/jquery-ui-timepicker.js +0 -0
  137. data/lib/{ui → arachni/ui}/web/server/public/logo.png +0 -0
  138. data/lib/{ui → arachni/ui}/web/server/public/nav-left.jpg +0 -0
  139. data/lib/{ui → arachni/ui}/web/server/public/nav-right.jpg +0 -0
  140. data/lib/{ui → arachni/ui}/web/server/public/nav-selected-left.jpg +0 -0
  141. data/lib/{ui → arachni/ui}/web/server/public/nav-selected-right.jpg +0 -0
  142. data/lib/{ui → arachni/ui}/web/server/public/plugins/sample/style.css +0 -0
  143. data/lib/{ui/web/server/tmp → arachni/ui/web/server/public/reports}/placeholder +0 -0
  144. data/lib/{ui → arachni/ui}/web/server/public/sidebar-bottom.jpg +0 -0
  145. data/lib/{ui → arachni/ui}/web/server/public/sidebar-h4.jpg +0 -0
  146. data/lib/{ui → arachni/ui}/web/server/public/sidebar-top.jpg +0 -0
  147. data/lib/{ui → arachni/ui}/web/server/public/spider.png +0 -0
  148. data/lib/{ui → arachni/ui}/web/server/public/style.css +3 -2
  149. data/lib/arachni/ui/web/server/tmp/placeholder +0 -0
  150. data/lib/{ui → arachni/ui}/web/server/views/addon.erb +0 -0
  151. data/lib/{ui → arachni/ui}/web/server/views/addons.erb +0 -0
  152. data/lib/{ui → arachni/ui}/web/server/views/dispatcher_error.erb +0 -0
  153. data/lib/arachni/ui/web/server/views/dispatchers.erb +175 -0
  154. data/lib/arachni/ui/web/server/views/dispatchers_edit.erb +71 -0
  155. data/lib/arachni/ui/web/server/views/error.erb +22 -0
  156. data/lib/{ui → arachni/ui}/web/server/views/flash.erb +2 -2
  157. data/lib/arachni/ui/web/server/views/home.erb +60 -0
  158. data/lib/{ui → arachni/ui}/web/server/views/instance.erb +55 -75
  159. data/lib/arachni/ui/web/server/views/js/home.erb +32 -0
  160. data/lib/{ui → arachni/ui}/web/server/views/layout.erb +2 -2
  161. data/lib/{ui → arachni/ui}/web/server/views/log.erb +0 -0
  162. data/lib/arachni/ui/web/server/views/module.erb +30 -0
  163. data/lib/{ui → arachni/ui}/web/server/views/modules.erb +2 -22
  164. data/lib/{ui → arachni/ui}/web/server/views/options.erb +0 -0
  165. data/lib/{ui → arachni/ui}/web/server/views/output_results.erb +4 -4
  166. data/lib/{ui → arachni/ui}/web/server/views/plugins.erb +23 -12
  167. data/lib/{ui → arachni/ui}/web/server/views/report_formats.erb +1 -1
  168. data/lib/{ui → arachni/ui}/web/server/views/reports.erb +1 -1
  169. data/lib/{ui → arachni/ui}/web/server/views/settings.erb +59 -16
  170. data/lib/{ui → arachni/ui}/web/server/views/welcome.erb +3 -1
  171. data/lib/{ui → arachni/ui}/web/utilities.rb +8 -3
  172. data/lib/arachni/version.rb +16 -0
  173. data/modules/audit/code_injection.rb +11 -20
  174. data/modules/audit/code_injection_timing.rb +2 -6
  175. data/modules/audit/csrf.rb +8 -16
  176. data/modules/audit/ldapi.rb +5 -11
  177. data/modules/audit/os_cmd_injection.rb +5 -9
  178. data/modules/audit/os_cmd_injection_timing.rb +4 -8
  179. data/modules/audit/path_traversal.rb +7 -13
  180. data/modules/audit/response_splitting.rb +8 -21
  181. data/modules/audit/rfi.rb +6 -46
  182. data/modules/audit/sqli.rb +5 -11
  183. data/modules/audit/sqli/regexp_ids.txt +0 -6
  184. data/modules/audit/sqli_blind_rdiff.rb +5 -10
  185. data/modules/audit/sqli_blind_timing.rb +4 -9
  186. data/modules/audit/trainer.rb +6 -12
  187. data/modules/audit/unvalidated_redirect.rb +6 -17
  188. data/modules/audit/xpath.rb +5 -12
  189. data/modules/audit/xss.rb +37 -23
  190. data/modules/audit/xss_event.rb +5 -10
  191. data/modules/audit/xss_path.rb +47 -41
  192. data/modules/audit/xss_script_tag.rb +5 -10
  193. data/modules/audit/xss_tag.rb +5 -10
  194. data/modules/audit/xss_uri.rb +17 -89
  195. data/modules/recon/allowed_methods.rb +6 -15
  196. data/modules/recon/backdoors.rb +12 -52
  197. data/modules/recon/backup_files.rb +25 -88
  198. data/modules/recon/common_directories.rb +8 -54
  199. data/modules/recon/common_files.rb +7 -58
  200. data/modules/recon/directory_listing.rb +6 -15
  201. data/modules/recon/grep/captcha.rb +1 -1
  202. data/modules/recon/grep/credit_card.rb +62 -27
  203. data/modules/recon/grep/cvs_svn_users.rb +1 -1
  204. data/modules/recon/grep/emails.rb +1 -1
  205. data/modules/recon/grep/html_objects.rb +1 -1
  206. data/modules/recon/grep/private_ip.rb +1 -1
  207. data/modules/recon/grep/ssn.rb +9 -9
  208. data/modules/recon/htaccess_limit.rb +6 -14
  209. data/modules/recon/http_put.rb +7 -15
  210. data/modules/recon/interesting_responses.rb +7 -13
  211. data/modules/recon/mixed_resource.rb +100 -0
  212. data/modules/recon/unencrypted_password_forms.rb +8 -20
  213. data/modules/recon/webdav.rb +6 -16
  214. data/modules/recon/xst.rb +7 -13
  215. data/path_extractors/anchors.rb +1 -1
  216. data/path_extractors/forms.rb +1 -1
  217. data/path_extractors/frames.rb +1 -1
  218. data/path_extractors/generic.rb +47 -3
  219. data/path_extractors/links.rb +1 -1
  220. data/path_extractors/meta_refresh.rb +1 -1
  221. data/path_extractors/scripts.rb +3 -4
  222. data/path_extractors/sitemap.rb +1 -1
  223. data/plugins/autologin.rb +9 -18
  224. data/plugins/beep_notify.rb +51 -0
  225. data/plugins/cookie_collector.rb +12 -12
  226. data/plugins/defaults/autothrottle.rb +86 -0
  227. data/plugins/{content_types.rb → defaults/content_types.rb} +25 -19
  228. data/plugins/{healthmap.rb → defaults/healthmap.rb} +30 -18
  229. data/plugins/defaults/metamodules/remedies/discovery.rb +164 -0
  230. data/plugins/defaults/metamodules/remedies/manual_verification.rb +65 -0
  231. data/{metamodules/timeout_notice.rb → plugins/defaults/metamodules/remedies/timing_attacks.rb} +26 -22
  232. data/{metamodules → plugins/defaults/metamodules}/uniformity.rb +15 -14
  233. data/plugins/{profiler.rb → defaults/profiler.rb} +19 -30
  234. data/plugins/defaults/resolver.rb +55 -0
  235. data/plugins/email_notify.rb +108 -0
  236. data/plugins/form_dicattack.rb +8 -16
  237. data/plugins/http_dicattack.rb +4 -12
  238. data/plugins/libnotify.rb +86 -0
  239. data/plugins/proxy.rb +8 -17
  240. data/plugins/proxy/server.rb +3 -3
  241. data/plugins/rescan.rb +60 -0
  242. data/plugins/waf_detector.rb +5 -16
  243. data/profiles/full.afp +3 -30
  244. data/reports/afr.rb +2 -5
  245. data/reports/ap.rb +3 -1
  246. data/reports/html.rb +210 -68
  247. data/reports/html/default.erb +72 -1014
  248. data/reports/html/default/configuration.erb +126 -0
  249. data/reports/html/default/css/jquery-ui.css +570 -0
  250. data/reports/html/default/css/jquery.jqplot.min.css +1 -0
  251. data/reports/html/default/css/main.css +391 -0
  252. data/reports/html/default/issue.erb +189 -0
  253. data/reports/html/default/issues.erb +65 -0
  254. data/reports/html/default/js/charts.js +146 -0
  255. data/reports/html/default/js/helpers.js +95 -0
  256. data/reports/html/default/js/init.js +73 -0
  257. data/reports/html/default/js/lib/jqplot.barRenderer.min.js +57 -0
  258. data/reports/html/default/js/lib/jqplot.categoryAxisRenderer.min.js +57 -0
  259. data/reports/html/default/js/lib/jqplot.cursor.min.js +57 -0
  260. data/reports/html/default/js/lib/jqplot.pieRenderer.min.js +57 -0
  261. data/reports/html/default/js/lib/jqplot.pointLabels.min.js +57 -0
  262. data/reports/html/default/js/lib/jquery-ui.min.js +404 -0
  263. data/reports/html/default/js/lib/jquery.jqplot.min.js +57 -0
  264. data/reports/html/default/js/lib/jquery.min.js +167 -0
  265. data/reports/html/default/plugins.erb +22 -0
  266. data/reports/html/default/search.erb +8 -0
  267. data/reports/html/default/sitemap.erb +15 -0
  268. data/reports/html/default/summary.erb +68 -0
  269. data/reports/html/default/summary_issue.erb +19 -0
  270. data/reports/json.rb +51 -0
  271. data/reports/marshal.rb +49 -0
  272. data/reports/metareport.rb +4 -6
  273. data/reports/metareport/arachni_metareport.rb +1 -1
  274. data/reports/plugin_formatters/html/autologin.rb +30 -41
  275. data/reports/plugin_formatters/html/content_types.rb +1 -10
  276. data/reports/plugin_formatters/html/cookie_collector.rb +36 -44
  277. data/reports/plugin_formatters/html/discovery.rb +50 -0
  278. data/reports/plugin_formatters/html/form_dicattack.rb +24 -32
  279. data/reports/plugin_formatters/html/healthmap.rb +45 -54
  280. data/reports/plugin_formatters/html/http_dicattack.rb +24 -32
  281. data/reports/plugin_formatters/html/profiler.rb +17 -48
  282. data/reports/plugin_formatters/html/profiler/template.erb +6 -99
  283. data/reports/plugin_formatters/html/resolver.rb +63 -0
  284. data/reports/plugin_formatters/html/{metaformatters/timeout_notice.rb → timing_attacks.rb} +7 -19
  285. data/reports/plugin_formatters/html/{metaformatters/uniformity.rb → uniformity.rb} +5 -17
  286. data/reports/plugin_formatters/html/waf_detector.rb +24 -32
  287. data/reports/plugin_formatters/stdout/autologin.rb +30 -35
  288. data/reports/plugin_formatters/stdout/content_types.rb +41 -46
  289. data/reports/plugin_formatters/stdout/cookie_collector.rb +33 -38
  290. data/reports/plugin_formatters/stdout/discovery.rb +47 -0
  291. data/reports/plugin_formatters/stdout/form_dicattack.rb +27 -32
  292. data/reports/plugin_formatters/stdout/healthmap.rb +47 -51
  293. data/reports/plugin_formatters/stdout/http_dicattack.rb +27 -32
  294. data/reports/plugin_formatters/stdout/metamodules.rb +48 -55
  295. data/reports/plugin_formatters/stdout/profiler.rb +60 -65
  296. data/reports/plugin_formatters/stdout/resolver.rb +45 -0
  297. data/reports/plugin_formatters/stdout/{metaformatters/timeout_notice.rb → timing_attacks.rb} +6 -14
  298. data/reports/plugin_formatters/stdout/{metaformatters/uniformity.rb → uniformity.rb} +6 -14
  299. data/reports/plugin_formatters/stdout/waf_detector.rb +23 -28
  300. data/reports/plugin_formatters/xml/autologin.rb +36 -41
  301. data/reports/plugin_formatters/xml/content_types.rb +47 -52
  302. data/reports/plugin_formatters/xml/cookie_collector.rb +39 -44
  303. data/reports/plugin_formatters/xml/discovery.rb +54 -0
  304. data/reports/plugin_formatters/xml/form_dicattack.rb +22 -27
  305. data/reports/plugin_formatters/xml/healthmap.rb +53 -58
  306. data/reports/plugin_formatters/xml/http_dicattack.rb +22 -27
  307. data/reports/plugin_formatters/xml/profiler.rb +61 -77
  308. data/reports/plugin_formatters/xml/resolver.rb +53 -0
  309. data/reports/plugin_formatters/xml/{metaformatters/timeout_notice.rb → timing_attacks.rb} +3 -15
  310. data/reports/plugin_formatters/xml/{metaformatters/uniformity.rb → uniformity.rb} +4 -14
  311. data/reports/plugin_formatters/xml/waf_detector.rb +23 -28
  312. data/reports/stdout.rb +1 -1
  313. data/reports/txt.rb +2 -5
  314. data/reports/xml.rb +2 -5
  315. data/reports/xml/buffer.rb +6 -2
  316. data/reports/yaml.rb +49 -0
  317. metadata +419 -278
  318. data/bin/arachni_xmlrpc +0 -21
  319. data/bin/arachni_xmlrpcd +0 -82
  320. data/bin/arachni_xmlrpcd_monitor +0 -74
  321. data/getoptslong.rb +0 -242
  322. data/lib/anemone.rb +0 -2
  323. data/lib/framework.rb +0 -673
  324. data/lib/module/manager.rb +0 -111
  325. data/lib/options.rb +0 -547
  326. data/lib/rpc/xml/client/base.rb +0 -76
  327. data/lib/rpc/xml/client/instance.rb +0 -88
  328. data/lib/rpc/xml/server/base.rb +0 -112
  329. data/lib/rpc/xml/server/dispatcher.rb +0 -386
  330. data/lib/rpc/xml/server/framework.rb +0 -206
  331. data/lib/rpc/xml/server/instance.rb +0 -191
  332. data/lib/ruby/xmlrpc/server.rb +0 -27
  333. data/lib/ui/web/addons/autodeploy.rb +0 -172
  334. data/lib/ui/web/addons/autodeploy/views/index.erb +0 -124
  335. data/lib/ui/web/dispatcher_manager.rb +0 -165
  336. data/lib/ui/web/instance_manager.rb +0 -87
  337. data/lib/ui/web/output_stream.rb +0 -94
  338. data/lib/ui/web/server.rb +0 -925
  339. data/lib/ui/web/server/public/reports/placeholder +0 -1
  340. data/lib/ui/web/server/views/dispatchers.erb +0 -100
  341. data/lib/ui/web/server/views/dispatchers_edit.erb +0 -42
  342. data/lib/ui/web/server/views/error.erb +0 -1
  343. data/lib/ui/web/server/views/home.erb +0 -25
  344. data/metamodules/autothrottle.rb +0 -74
  345. data/plugins/metamodules.rb +0 -118
  346. data/profiles/comprehensive.afp +0 -74
  347. data/reports/plugin_formatters/html/metamodules.rb +0 -93
  348. data/reports/plugin_formatters/xml/metamodules.rb +0 -91
@@ -1,6 +1,6 @@
1
1
  =begin
2
2
  Arachni
3
- Copyright (c) 2010-2011 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
3
+ Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
4
4
 
5
5
  This is free software; you can copy and distribute and modify
6
6
  this program under the term of the GPL v2.0 License
@@ -15,12 +15,12 @@ module Plugins
15
15
  # Passive proxy.
16
16
  #
17
17
  # Will gather data based on user actions and exchanged HTTP traffic and push that
18
- # data to the {Framework#page_queue} to be audited.
18
+ # data to the {Framework#push_to_page_queue} to be audited.
19
19
  #
20
20
  # @author: Tasos "Zapotek" Laskos
21
21
  # <tasos.laskos@gmail.com>
22
22
  # <zapotek@segfault.gr>
23
- # @version: 0.1
23
+ # @version: 0.1.2
24
24
  #
25
25
  class Proxy < Arachni::Plugin::Base
26
26
 
@@ -38,20 +38,11 @@ class Proxy < Arachni::Plugin::Base
38
38
 
39
39
  MSG_NOT_INCLUDED = 'This resource is disallowed based on an include rule.'
40
40
 
41
- #
42
- # @param [Arachni::Framework] framework
43
- # @param [Hash] options options passed to the plugin
44
- #
45
- def initialize( framework, options )
46
- @framework = framework
47
- @options = options
48
-
41
+ def prepare
49
42
  # don't let the framework run just yet
50
43
  @framework.pause!
51
44
  print_info( "System paused." )
52
- end
53
45
 
54
- def prepare
55
46
  require @framework.opts.dir['plugins'] + '/proxy/server.rb'
56
47
 
57
48
  # foo initialization, we just need it to verify URLs
@@ -74,7 +65,7 @@ class Proxy < Arachni::Plugin::Base
74
65
  )
75
66
  end
76
67
 
77
- def run( )
68
+ def run
78
69
  print_status( "Listening on: " +
79
70
  "http://#{@server[:BindAddress]}:#{@server[:Port]}" )
80
71
 
@@ -116,7 +107,7 @@ class Proxy < Arachni::Plugin::Base
116
107
  print_info " * #{page.cookies.size} cookies"
117
108
 
118
109
  update_framework_cookies( page, req )
119
- @framework.page_queue << page.dup
110
+ @framework.push_to_page_queue( page.dup )
120
111
 
121
112
  return res
122
113
  end
@@ -158,7 +149,7 @@ class Proxy < Arachni::Plugin::Base
158
149
  def update_forms( page, req )
159
150
  params = {}
160
151
 
161
- URI.decode( req.body ).split( '&' ).each {
152
+ uri_decode( req.body ).split( '&' ).each {
162
153
  |param|
163
154
  k,v = param.split( '=', 2 )
164
155
  params[k] = v
@@ -234,7 +225,7 @@ class Proxy < Arachni::Plugin::Base
234
225
  It also updates the framework cookies with the cookies of the HTTP requests and
235
226
  responses, thus it can also be used to login to a web application.},
236
227
  :author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>',
237
- :version => '0.1',
228
+ :version => '0.1.2',
238
229
  :options => [
239
230
  Arachni::OptPort.new( 'port', [ false, 'Port to bind to.', 8282 ] ),
240
231
  Arachni::OptAddress.new( 'bind_address', [ false, 'IP address to bind to.', '0.0.0.0' ] )
@@ -1,6 +1,6 @@
1
1
  =begin
2
2
  Arachni
3
- Copyright (c) 2010-2011 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
3
+ Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
4
4
 
5
5
  This is free software; you can copy and distribute and modify
6
6
  this program under the term of the GPL v2.0 License
@@ -25,7 +25,7 @@ class Proxy
25
25
  # @author: Tasos "Zapotek" Laskos
26
26
  # <tasos.laskos@gmail.com>
27
27
  # <zapotek@segfault.gr>
28
- # @version: 0.1.1
28
+ # @version: 0.1.2
29
29
  #
30
30
  class Server < WEBrick::HTTPProxyServer
31
31
 
@@ -34,7 +34,7 @@ class Proxy
34
34
  src.each{|key, value|
35
35
  key = key.downcase
36
36
  if HopByHop.member?(key) || # RFC2616: 13.5.1
37
- connections.member?(key) || # RFC2616: 14.10
37
+ connections.member?(key) #|| # RFC2616: 14.10
38
38
  # ShouldNotTransfer.member?(key) # pragmatics
39
39
  @logger.debug("choose_header: `#{key}: #{value}'")
40
40
  next
@@ -0,0 +1,60 @@
1
+ =begin
2
+ Arachni
3
+ Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
4
+
5
+ This is free software; you can copy and distribute and modify
6
+ this program under the term of the GPL v2.0 License
7
+ (See LICENSE file for details)
8
+
9
+ =end
10
+
11
+ module Arachni
12
+ module Plugins
13
+
14
+ #
15
+ # Allows users to skip the crawling phase by extracting paths discovered
16
+ # by a previous scan.
17
+ #
18
+ # It basically sets the 'restrict_paths' framework option to the sitemap of
19
+ # a previous report.
20
+ #
21
+ # @author: Tasos "Zapotek" Laskos
22
+ # <tasos.laskos@gmail.com>
23
+ # <zapotek@segfault.gr>
24
+ # @version: 0.1
25
+ #
26
+ class ReScan < Arachni::Plugin::Base
27
+
28
+ def prepare
29
+ @framework.pause!
30
+ print_status( "System paused." )
31
+ end
32
+
33
+ def run
34
+ @framework.opts.restrict_paths = Arachni::AuditStore.load( @options['afr'] ).sitemap
35
+ print_status( "Found #{@framework.opts.restrict_paths.size} paths." )
36
+ end
37
+
38
+ def clean_up
39
+ @framework.resume!
40
+ print_status( "System resumed." )
41
+ end
42
+
43
+ def self.info
44
+ {
45
+ :name => 'ReScan',
46
+ :description => %q{It uses the AFR report of a previous scan to
47
+ extract the sitemap in order to avoid a redundant crawl.
48
+ },
49
+ :author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>',
50
+ :version => '0.1',
51
+ :options => [
52
+ Arachni::OptPath.new( 'afr', [ true, 'Path to the AFR report.' ] )
53
+ ]
54
+ }
55
+ end
56
+
57
+ end
58
+
59
+ end
60
+ end
@@ -1,6 +1,6 @@
1
1
  =begin
2
2
  Arachni
3
- Copyright (c) 2010-2011 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
3
+ Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
4
4
 
5
5
  This is free software; you can copy and distribute and modify
6
6
  this program under the term of the GPL v2.0 License
@@ -26,7 +26,7 @@ module Plugins
26
26
  # @author: Tasos "Zapotek" Laskos
27
27
  # <tasos.laskos@gmail.com>
28
28
  # <zapotek@segfault.gr>
29
- # @version: 0.1
29
+ # @version: 0.1.1
30
30
  #
31
31
  class WAFDetector < Arachni::Plugin::Base
32
32
 
@@ -36,17 +36,7 @@ class WAFDetector < Arachni::Plugin::Base
36
36
 
37
37
  MSG_NOT_FOUND = %q{Could not detect any sign of filtering, a WAF doesn't seem to be present.}
38
38
 
39
- #
40
- # @param [Arachni::Framework] framework
41
- # @param [Hash] options options passed to the plugin
42
- #
43
- def initialize( framework, options )
44
- @framework = framework
45
- @options = options
46
- end
47
-
48
39
  def prepare
49
-
50
40
  @precision = @options['precision']
51
41
 
52
42
  bad = [
@@ -79,8 +69,7 @@ class WAFDetector < Arachni::Plugin::Base
79
69
 
80
70
  end
81
71
 
82
- def run( )
83
-
72
+ def run
84
73
  print_status( "Starting detection with a precision of #{@precision}." )
85
74
 
86
75
  print_status( "Stage #1: Requesting original page." )
@@ -106,7 +95,7 @@ class WAFDetector < Arachni::Plugin::Base
106
95
  inconclusive!
107
96
  end
108
97
  }
109
-
98
+ @framework.http.run
110
99
  end
111
100
 
112
101
  def found!
@@ -168,7 +157,7 @@ class WAFDetector < Arachni::Plugin::Base
168
157
 
169
158
  Steps 1 to 3 will be repeated _precision_ times (default: 5) and the responses will be averaged using rDiff analysis.},
170
159
  :author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>',
171
- :version => '0.1',
160
+ :version => '0.1.1',
172
161
  :options => [
173
162
  Arachni::OptInt.new( 'precision', [ false, 'Stage precision (how many times to perform each detection stage).', 5 ] )
174
163
  ]
@@ -1,27 +1,12 @@
1
- --- !ruby/object:Arachni::Options
1
+ --- !ruby/object:Arachni::Options
2
2
  audit_cookies: true
3
3
  audit_forms: true
4
4
  audit_headers: true
5
5
  audit_links: true
6
- authed_by:
7
- dir:
8
- exclude: []
9
-
10
- exclude_cookies: []
11
-
12
- http_req_limit: 20
13
- include: []
14
-
15
- load_profile:
16
- lsmod: []
17
-
18
- lsplug: []
19
-
20
- lsrep: []
21
-
22
- mods:
6
+ mods:
23
7
  - interesting_responses
24
8
  - common_files
9
+ - mixed_resource
25
10
  - xst
26
11
  - http_put
27
12
  - webdav
@@ -46,7 +31,6 @@ mods:
46
31
  - sqli_blind_rdiff
47
32
  - path_traversal
48
33
  - xss_event
49
- - xss_uri
50
34
  - sqli_blind_timing
51
35
  - code_injection
52
36
  - rfi
@@ -60,16 +44,5 @@ mods:
60
44
  - xpath
61
45
  - unvalidated_redirect
62
46
  - xss
63
- plugins:
64
- healthmap: {}
65
-
66
- content_types: {}
67
47
 
68
48
  redirect_limit: 20
69
- redundant: []
70
-
71
- reports:
72
- stdout: {}
73
-
74
- save_profile:
75
- user_agent: Arachni/0.2.2
@@ -1,6 +1,6 @@
1
1
  =begin
2
2
  Arachni
3
- Copyright (c) 2010-2011 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
3
+ Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
4
4
 
5
5
  This is free software; you can copy and distribute and modify
6
6
  this program under the term of the GPL v2.0 License
@@ -46,10 +46,7 @@ class AFR < Arachni::Report::Base
46
46
  :description => %q{Saves the file in the default Arachni Framework Report (.afr) format.},
47
47
  :author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>',
48
48
  :version => '0.1',
49
- :options => [
50
- Arachni::OptString.new( 'outfile', [ false, 'Where to save the report.',
51
- Time.now.to_s + '.afr' ] ),
52
- ]
49
+ :options => [ Arachni::Report::Options.outfile( '.afr' ) ]
53
50
  }
54
51
  end
55
52
 
@@ -1,6 +1,6 @@
1
1
  =begin
2
2
  Arachni
3
- Copyright (c) 2010-2011 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
3
+ Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
4
4
 
5
5
  This is free software; you can copy and distribute and modify
6
6
  this program under the term of the GPL v2.0 License
@@ -8,6 +8,8 @@
8
8
 
9
9
  =end
10
10
 
11
+ require 'ap'
12
+
11
13
  module Arachni
12
14
  module Reports
13
15
 
@@ -1,6 +1,6 @@
1
1
  =begin
2
2
  Arachni
3
- Copyright (c) 2010-2011 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
3
+ Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
4
4
 
5
5
  This is free software; you can copy and distribute and modify
6
6
  this program under the term of the GPL v2.0 License
@@ -25,44 +25,145 @@ module Reports
25
25
  # @author: Tasos "Zapotek" Laskos
26
26
  # <tasos.laskos@gmail.com>
27
27
  # <zapotek@segfault.gr>
28
- # @version: 0.2.2
28
+ # @version: 0.3
29
29
  #
30
30
  class HTML < Arachni::Report::Base
31
+ include Arachni::Module::Utilities
32
+
33
+ module Utils
34
+
35
+ def normalize( str )
36
+ return '' if !str || str.empty?
37
+ str.encode( 'UTF-8', :invalid => :replace, :undef => :replace )
38
+ end
39
+
40
+ def escapeHTML( str )
41
+ # carefully escapes HTML and converts to UTF-8
42
+ # while removing invalid character sequences
43
+ return CGI.escapeHTML( normalize( str ) )
44
+ end
45
+
46
+ def for_anomalous_metamodules( audit_store, &block )
47
+ audit_store.plugins.each_pair {
48
+ |metaname, data|
49
+ next if !data[:tags] || !data[:tags].include?( 'anomaly' )
50
+ block.call( metaname, data )
51
+ }
52
+ end
31
53
 
32
- REPORT_FP_URL = "https://arachni.segfault.gr/false_positive"
54
+ def erb( tpl, params = {} )
55
+ scope = TemplateScope.new( params )
56
+ scope.add( :audit_store, @audit_store )
33
57
 
34
- #
35
- # @param [AuditStore] audit_store
36
- # @param [Hash] options options passed to the report
37
- #
38
- def initialize( audit_store, options )
39
- @audit_store = audit_store
40
- @options = options
58
+ tpl = tpl.to_s + '.erb' if tpl.is_a?( Symbol )
59
+
60
+ @@base_path ||= @base_path
41
61
 
42
- @crypto = RSA_AES_CBC.new( Options.instance.dir['data'] + 'crypto/public.pem' )
62
+
63
+ path = File.exist?( tpl ) ? tpl : @@base_path + tpl
64
+ ERB.new( IO.read( path ) ).result( scope.get_binding )
65
+ end
66
+ end
67
+
68
+ include Utils
69
+
70
+ class TemplateScope
71
+ include Utils
72
+
73
+ REPORT_FP_URL = "https://arachni.segfault.gr/false_positive"
74
+ ISSUES_URL = 'https://github.com/Zapotek/arachni/issues'
75
+
76
+ def initialize( params )
77
+ add_hash( params )
78
+ end
79
+
80
+ def add_hash( params )
81
+ params.each_pair {
82
+ |name, value|
83
+ add( name, value )
84
+ }
85
+ self
86
+ end
87
+
88
+ def add( name, value )
89
+ self.class.send( :attr_accessor, name )
90
+ instance_variable_set( "@#{name.to_s}", value )
91
+ self
92
+ end
93
+
94
+ def format_issue( hash )
95
+ idx, issue = find_issue_by_hash( hash )
96
+ erb :issue, {
97
+ :idx => idx,
98
+ :issue => issue
99
+ }
100
+ end
101
+
102
+ def prep_description( str )
103
+ Arachni::Reports::HTML.prep_description( str )
104
+ end
105
+
106
+ def find_issue_by_hash( hash )
107
+ @audit_store.issues.each_with_index {
108
+ |issue, i|
109
+ return [i+1, issue] if issue._hash == hash
110
+ }
111
+ return nil
112
+ end
113
+
114
+ def get_meta_info( name )
115
+ @audit_store.plugins['metamodules'][:results][name]
116
+ end
117
+
118
+ def get_plugin_info( name )
119
+ @audit_store.plugins[name]
120
+ end
121
+
122
+ def js_multiline( str )
123
+ "\"" + normalize( str ).gsub( "\n", '\n' ) + "\"";
124
+ end
125
+
126
+ def get_binding
127
+ binding
128
+ end
129
+ end
130
+
131
+ def prepare
132
+ # @crypto = RSA_AES_CBC.new( Options.instance.dir['data'] + 'crypto/public.pem' )
43
133
  end
44
134
 
45
135
  #
46
136
  # Runs the HTML report.
47
137
  #
48
- def run( )
49
-
50
- print_line( )
138
+ def run
139
+ print_line
51
140
  print_status( 'Creating HTML report...' )
52
141
 
53
- report = ERB.new( IO.read( @options['tpl'] ) )
54
-
55
- __prepare_data
56
-
57
- @plugins = format_plugin_results( @audit_store.plugins )
142
+ plugins = format_plugin_results( @audit_store.plugins )
143
+ @base_path = File.dirname( @options['tpl'] ) + '/' +
144
+ File.basename( @options['tpl'], '.erb' ) + '/'
58
145
 
59
146
  conf = {}
60
- conf['options'] = @audit_store.options
61
- conf['version'] = @audit_store.version
62
- conf['revision'] = @audit_store.revision
63
- conf = @crypto.encrypt( conf.to_yaml )
64
-
65
- __save( @options['outfile'], report.result( binding ) )
147
+ # conf['options'] = @audit_store.options
148
+ # conf['version'] = @audit_store.version
149
+ # conf['revision'] = @audit_store.revision
150
+ # conf = @crypto.encrypt( conf.to_yaml )
151
+
152
+ title_url = @audit_store.options['url']
153
+ begin
154
+ title_url = uri_parse( @audit_store.options['url'] ).host
155
+ rescue
156
+ end
157
+
158
+ params = __prepare_data.merge(
159
+ :title_url => escapeHTML( title_url ),
160
+ :conf => conf,
161
+ :audit_store => @audit_store,
162
+ :plugins => plugins,
163
+ :base_path => @base_path
164
+ )
165
+
166
+ __save( @options['outfile'], erb( @options['tpl'], params ) )
66
167
 
67
168
  print_status( 'Saved in \'' + @options['outfile'] + '\'.' )
68
169
  end
@@ -76,29 +177,13 @@ class HTML < Arachni::Report::Base
76
177
  :options => [
77
178
  Arachni::OptPath.new( 'tpl', [ false, 'Template to use.',
78
179
  File.dirname( __FILE__ ) + '/html/default.erb' ] ),
79
- Arachni::OptString.new( 'outfile', [ false, 'Where to save the report.',
80
- Time.now.to_s + '.html' ] ),
180
+ Arachni::Report::Options.outfile( '.html' )
81
181
  ]
82
182
  }
83
183
  end
84
184
 
85
185
  private
86
186
 
87
- def js_multiline( str )
88
- "\"" + str.gsub( "\n", '\n' ) + "\"";
89
- end
90
-
91
- def normalize( str )
92
- ic = ::Iconv.new( 'UTF-8//IGNORE', 'UTF-8' )
93
- ic.iconv( str + ' ' )[0..-2]
94
- end
95
-
96
- def escapeHTML( str )
97
- # carefully escapes HTML and converts to UTF-8
98
- # while removing invalid character sequences
99
- return CGI.escapeHTML( normalize( str ) )
100
- end
101
-
102
187
  def self.prep_description( str )
103
188
  placeholder = '--' + rand( 1000 ).to_s + '--'
104
189
  cstr = str.gsub( /^\s*$/xm, placeholder )
@@ -116,7 +201,7 @@ class HTML < Arachni::Report::Base
116
201
 
117
202
  def __prepare_data( )
118
203
 
119
- @graph_data = {
204
+ graph_data = {
120
205
  :severities => {
121
206
  Issue::Severity::HIGH => 0,
122
207
  Issue::Severity::MEDIUM => 0,
@@ -124,6 +209,8 @@ class HTML < Arachni::Report::Base
124
209
  Issue::Severity::INFORMATIONAL => 0,
125
210
  },
126
211
  :issues => {},
212
+ :trusted_issues => {},
213
+ :untrusted_issues => {},
127
214
  :elements => {
128
215
  Issue::Element::FORM => 0,
129
216
  Issue::Element::LINK => 0,
@@ -136,34 +223,49 @@ class HTML < Arachni::Report::Base
136
223
  :verification => {
137
224
  'Yes' => 0,
138
225
  'No' => 0
226
+ },
227
+ :trust => {
228
+ 'Trusted' => 0,
229
+ 'Untrusted' => 0
139
230
  }
140
231
  }
141
232
 
142
- @total_severities = 0
143
- @total_elements = 0
144
- @total_verifications = 0
233
+ total_severities = 0
234
+ total_elements = 0
235
+ total_verifications = 0
236
+
237
+ crypto_issues = []
238
+
239
+ filtered_hashes = []
240
+ anomalous_hashes = []
241
+
242
+ anomalous_meta_results = {}
243
+ for_anomalous_metamodules( @audit_store ) {
244
+ |metaname, data|
245
+ anomalous_meta_results[metaname] = data
246
+ }
145
247
 
146
- @crypto_issues = []
147
248
  @audit_store.issues.each_with_index {
148
249
  |issue, i|
149
250
 
150
- @crypto_issues << @crypto.encrypt( issue.to_yaml )
251
+ # begin
252
+ # crypto_issues << @crypto.encrypt( YAML::dump( issue ) )
253
+ # rescue
254
+ # end
255
+
256
+ graph_data[:severities][issue.severity] += 1
257
+ total_severities += 1
151
258
 
152
- @graph_data[:severities][issue.severity] ||= 0
153
- @graph_data[:severities][issue.severity] += 1
154
- @total_severities += 1
259
+ graph_data[:issues][issue.name] ||= 0
260
+ graph_data[:issues][issue.name] += 1
155
261
 
156
- @graph_data[:issues][issue.name] ||= 0
157
- @graph_data[:issues][issue.name] += 1
158
262
 
159
- @graph_data[:elements][issue.elem] ||= 0
160
- @graph_data[:elements][issue.elem] += 1
161
- @total_elements += 1
263
+ graph_data[:elements][issue.elem] += 1
264
+ total_elements += 1
162
265
 
163
266
  verification = issue.verification ? 'Yes' : 'No'
164
- @graph_data[:verification][verification] ||= 0
165
- @graph_data[:verification][verification] += 1
166
- @total_verifications += 1
267
+ graph_data[:verification][verification] += 1
268
+ total_verifications += 1
167
269
 
168
270
  issue.variations.each_with_index {
169
271
  |variation, j|
@@ -189,35 +291,75 @@ class HTML < Arachni::Report::Base
189
291
 
190
292
  }
191
293
 
294
+ if !anomalous?( anomalous_meta_results, issue )
295
+ filtered_hashes << issue._hash
296
+ graph_data[:trust]['Trusted'] += 1
297
+ graph_data[:trusted_issues][issue.name] ||= 0
298
+ graph_data[:trusted_issues][issue.name] += 1
299
+
300
+ graph_data[:untrusted_issues][issue.name] ||= 0
301
+ else
302
+ anomalous_hashes << issue._hash
303
+ graph_data[:trust]['Untrusted'] += 1
304
+ graph_data[:untrusted_issues][issue.name] ||= 0
305
+ graph_data[:untrusted_issues][issue.name] += 1
306
+ graph_data[:trusted_issues][issue.name] ||= 0
307
+ end
308
+
192
309
  }
193
310
 
194
- @graph_data[:severities].each {
311
+ graph_data[:severities].each {
195
312
  |severity, cnt|
313
+ graph_data[:severities][severity] ||= 0
196
314
  begin
197
- @graph_data[:severities][severity] = ((cnt/Float(@total_severities)) * 100).to_i
315
+ graph_data[:severities][severity] = ((cnt/Float(total_severities)) * 100).to_i
198
316
  rescue
199
- @graph_data[:severities][severity] = 0
200
317
  end
201
318
  }
202
319
 
203
- @graph_data[:elements].each {
320
+ graph_data[:elements].each {
204
321
  |elem, cnt|
322
+ graph_data[:elements][elem] ||= 0
323
+
205
324
  begin
206
- @graph_data[:elements][elem] = ((cnt/Float(@total_elements)) * 100).to_i
325
+ graph_data[:elements][elem] = ((cnt/Float(total_elements)) * 100).to_i
207
326
  rescue
208
- @graph_data[:elements][elem] = 0
209
327
  end
210
328
  }
211
329
 
212
- @graph_data[:verification].each {
330
+ graph_data[:verification].each {
213
331
  |verification, cnt|
332
+ graph_data[:verification][verification] ||= 0
333
+
214
334
  begin
215
- @graph_data[:verification][verification] = ((cnt/Float(@total_verifications)) * 100).to_i
335
+ graph_data[:verification][verification] = ((cnt/Float(total_verifications)) * 100).to_i
216
336
  rescue
217
- @graph_data[:verification][verification] = 0
218
337
  end
219
338
  }
220
339
 
340
+ {
341
+ :graph_data => graph_data,
342
+ :total_severities => total_severities,
343
+ :total_elements => total_elements,
344
+ :total_verifications => total_verifications,
345
+ :crypto_issues => crypto_issues,
346
+ :filtered_hashes => filtered_hashes,
347
+ :anomalous_hashes => anomalous_hashes,
348
+ :anomalous_meta_results => anomalous_meta_results
349
+ }
350
+
351
+ end
352
+
353
+ def anomalous?( anomalous_meta_results, issue )
354
+ anomalous_meta_results.each_pair {
355
+ |metaname, data|
356
+ data[:results].each {
357
+ |m_issue|
358
+ return true if m_issue['hash'] == issue._hash
359
+ }
360
+ }
361
+
362
+ return false
221
363
  end
222
364
 
223
365
  end