arachni 1.2.1 → 1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (373) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +66 -0
  3. data/Gemfile +1 -1
  4. data/README.md +16 -5
  5. data/components/checks/active/ldap_injection/errors.txt +1 -0
  6. data/components/checks/active/source_code_disclosure.rb +1 -1
  7. data/components/checks/active/unvalidated_redirect.rb +6 -6
  8. data/components/checks/active/unvalidated_redirect_dom.rb +10 -7
  9. data/components/checks/passive/grep/captcha.rb +14 -5
  10. data/components/checks/passive/grep/form_upload.rb +7 -3
  11. data/components/checks/passive/grep/hsts.rb +3 -3
  12. data/components/checks/passive/grep/html_objects.rb +2 -3
  13. data/components/checks/passive/grep/http_only_cookies.rb +2 -3
  14. data/components/checks/passive/grep/insecure_cookies.rb +1 -1
  15. data/components/checks/passive/grep/password_autocomplete.rb +2 -2
  16. data/components/checks/passive/grep/unencrypted_password_forms.rb +7 -7
  17. data/components/checks/passive/grep/x_frame_options.rb +2 -2
  18. data/components/checks/passive/http_put.rb +2 -3
  19. data/components/path_extractors/comments.rb +3 -3
  20. data/components/path_extractors/scripts.rb +10 -1
  21. data/components/plugins/defaults/autothrottle.rb +27 -18
  22. data/components/plugins/defaults/meta/remedies/discovery.rb +30 -33
  23. data/components/plugins/defaults/meta/remedies/timing_attacks.rb +7 -11
  24. data/components/plugins/login_script.rb +9 -3
  25. data/components/plugins/proxy.rb +4 -3
  26. data/components/reporters/html.rb +11 -14
  27. data/components/reporters/html/default/issue.erb +13 -38
  28. data/components/reporters/html/default/issue/info.erb +1 -1
  29. data/components/reporters/html/default/summary/issues/by_name.erb +3 -3
  30. data/components/reporters/stdout.rb +62 -71
  31. data/components/reporters/xml.rb +26 -40
  32. data/components/reporters/xml/schema.xsd +43 -89
  33. data/lib/arachni/browser.rb +52 -3
  34. data/lib/arachni/browser/javascript.rb +3 -3
  35. data/lib/arachni/browser/javascript/scripts/taint_tracer.js +46 -25
  36. data/lib/arachni/browser_cluster.rb +61 -0
  37. data/lib/arachni/browser_cluster/job.rb +21 -1
  38. data/lib/arachni/browser_cluster/jobs/browser_provider.rb +3 -1
  39. data/lib/arachni/browser_cluster/jobs/resource_exploration.rb +2 -1
  40. data/lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb +2 -1
  41. data/lib/arachni/browser_cluster/jobs/taint_trace.rb +3 -2
  42. data/lib/arachni/browser_cluster/jobs/taint_trace/event_trigger.rb +1 -1
  43. data/lib/arachni/browser_cluster/worker.rb +5 -0
  44. data/lib/arachni/check/auditor.rb +22 -12
  45. data/lib/arachni/data/framework.rb +13 -1
  46. data/lib/arachni/data/issues.rb +9 -25
  47. data/lib/arachni/element/base.rb +9 -3
  48. data/lib/arachni/element/capabilities/analyzable.rb +2 -6
  49. data/lib/arachni/element/capabilities/analyzable/differential.rb +24 -7
  50. data/lib/arachni/element/capabilities/analyzable/{taint.rb → signature.rb} +23 -23
  51. data/lib/arachni/element/capabilities/auditable.rb +0 -6
  52. data/lib/arachni/element/capabilities/dom_only.rb +61 -0
  53. data/lib/arachni/element/capabilities/with_dom.rb +3 -1
  54. data/lib/arachni/element/cookie.rb +35 -5
  55. data/lib/arachni/element/cookie/dom.rb +13 -4
  56. data/lib/arachni/element/{capabilities/auditable/dom.rb → dom.rb} +20 -68
  57. data/lib/arachni/element/dom/capabilities/auditable.rb +29 -0
  58. data/lib/arachni/element/dom/capabilities/inputtable.rb +27 -0
  59. data/lib/arachni/element/dom/capabilities/mutable.rb +21 -0
  60. data/lib/arachni/element/dom/capabilities/submittable.rb +52 -0
  61. data/lib/arachni/element/form.rb +12 -1
  62. data/lib/arachni/element/form/capabilities/mutable.rb +2 -1
  63. data/lib/arachni/element/form/capabilities/with_dom.rb +0 -1
  64. data/lib/arachni/element/form/dom.rb +9 -3
  65. data/lib/arachni/element/header.rb +14 -33
  66. data/lib/arachni/element/header/capabilities/inputtable.rb +29 -0
  67. data/lib/arachni/element/header/capabilities/mutable.rb +51 -0
  68. data/lib/arachni/element/input/dom.rb +71 -0
  69. data/lib/arachni/element/json.rb +2 -0
  70. data/lib/arachni/element/link.rb +3 -0
  71. data/lib/arachni/element/link/capabilities/with_dom.rb +0 -1
  72. data/lib/arachni/element/link/dom.rb +16 -3
  73. data/lib/arachni/element/link/dom/capabilities/submittable.rb +29 -0
  74. data/lib/arachni/element/link_template.rb +3 -5
  75. data/lib/arachni/element/link_template/capabilities/inputtable.rb +5 -0
  76. data/lib/arachni/element/link_template/capabilities/with_dom.rb +0 -1
  77. data/lib/arachni/element/link_template/dom.rb +16 -3
  78. data/lib/arachni/element/link_template/dom/capabilities/submittable.rb +29 -0
  79. data/lib/arachni/element/server.rb +3 -5
  80. data/lib/arachni/element/ui_form.rb +106 -0
  81. data/lib/arachni/element/ui_form/dom.rb +107 -0
  82. data/lib/arachni/element/ui_input.rb +62 -0
  83. data/lib/arachni/element/xml.rb +2 -1
  84. data/lib/arachni/framework.rb +7 -5
  85. data/lib/arachni/framework/parts/audit.rb +0 -1
  86. data/lib/arachni/framework/parts/check.rb +1 -0
  87. data/lib/arachni/framework/parts/data.rb +4 -0
  88. data/lib/arachni/framework/parts/state.rb +0 -2
  89. data/lib/arachni/http/client.rb +17 -6
  90. data/lib/arachni/http/proxy_server.rb +52 -5
  91. data/lib/arachni/http/request.rb +1 -1
  92. data/lib/arachni/issue.rb +34 -179
  93. data/lib/arachni/issue/severity.rb +2 -0
  94. data/lib/arachni/option_groups/audit.rb +22 -2
  95. data/lib/arachni/option_groups/browser_cluster.rb +15 -0
  96. data/lib/arachni/page.rb +3 -2
  97. data/lib/arachni/parser.rb +24 -5
  98. data/lib/arachni/platform/manager.rb +1 -2
  99. data/lib/arachni/rpc/server/framework.rb +3 -4
  100. data/lib/arachni/rpc/server/framework/multi_instance.rb +2 -1
  101. data/lib/arachni/session.rb +1 -1
  102. data/lib/arachni/trainer.rb +4 -7
  103. data/lib/arachni/watir/element.rb +12 -1
  104. data/lib/version +1 -1
  105. data/spec/arachni/browser/element_locator_spec.rb +43 -43
  106. data/spec/arachni/browser/javascript/dom_monitor_spec.rb +44 -44
  107. data/spec/arachni/browser/javascript/proxy/stub_spec.rb +17 -14
  108. data/spec/arachni/browser/javascript/proxy_spec.rb +24 -24
  109. data/spec/arachni/browser/javascript/taint_tracer/frame/called_function_spec.rb +11 -11
  110. data/spec/arachni/browser/javascript/taint_tracer/frame_spec.rb +7 -7
  111. data/spec/arachni/browser/javascript/taint_tracer/sink/data_flow_spec.rb +13 -13
  112. data/spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb +7 -7
  113. data/spec/arachni/browser/javascript/taint_tracer_spec.rb +568 -558
  114. data/spec/arachni/browser/javascript_spec.rb +73 -63
  115. data/spec/arachni/browser_cluster/job/result_spec.rb +3 -3
  116. data/spec/arachni/browser_cluster/job_spec.rb +68 -48
  117. data/spec/arachni/browser_cluster/jobs/resource_exploration/event_trigger/result_spec.rb +2 -2
  118. data/spec/arachni/browser_cluster/jobs/resource_exploration/event_trigger_spec.rb +5 -4
  119. data/spec/arachni/browser_cluster/jobs/resource_exploration/result_spec.rb +2 -2
  120. data/spec/arachni/browser_cluster/jobs/resource_exploration_spec.rb +5 -5
  121. data/spec/arachni/browser_cluster/worker_spec.rb +87 -70
  122. data/spec/arachni/browser_cluster_spec.rb +64 -39
  123. data/spec/arachni/browser_spec.rb +692 -527
  124. data/spec/arachni/check/auditor_spec.rb +177 -147
  125. data/spec/arachni/check/base_spec.rb +33 -33
  126. data/spec/arachni/check/manager_spec.rb +15 -15
  127. data/spec/arachni/component/base_spec.rb +8 -8
  128. data/spec/arachni/component/manager_spec.rb +100 -99
  129. data/spec/arachni/component/options/address_spec.rb +3 -3
  130. data/spec/arachni/component/options/base_spec.rb +7 -7
  131. data/spec/arachni/component/options/bool_spec.rb +9 -9
  132. data/spec/arachni/component/options/float_spec.rb +6 -6
  133. data/spec/arachni/component/options/int_spec.rb +5 -5
  134. data/spec/arachni/component/options/multiple_choice_spec.rb +12 -12
  135. data/spec/arachni/component/options/object_spec.rb +2 -2
  136. data/spec/arachni/component/options/path_spec.rb +3 -3
  137. data/spec/arachni/component/options/port_spec.rb +5 -5
  138. data/spec/arachni/component/options/string_spec.rb +3 -3
  139. data/spec/arachni/component/options/url_spec.rb +4 -4
  140. data/spec/arachni/component/utilities_spec.rb +2 -2
  141. data/spec/arachni/data/framework/rpc_spec.rb +10 -9
  142. data/spec/arachni/data/framework_spec.rb +65 -46
  143. data/spec/arachni/data/issues_spec.rb +39 -77
  144. data/spec/arachni/data/plugins_spec.rb +11 -11
  145. data/spec/arachni/data/session_spec.rb +6 -6
  146. data/spec/arachni/data_spec.rb +8 -8
  147. data/spec/arachni/element/body_spec.rb +10 -10
  148. data/spec/arachni/element/capabilities/analyzable/differential_spec.rb +39 -21
  149. data/spec/arachni/element/capabilities/analyzable/{taint_spec.rb → signature_spec.rb} +63 -63
  150. data/spec/arachni/element/capabilities/analyzable/timeout_spec.rb +51 -51
  151. data/spec/arachni/element/capabilities/with_scope/scope_spec.rb +5 -5
  152. data/spec/arachni/element/cookie/dom_spec.rb +37 -18
  153. data/spec/arachni/element/cookie_spec.rb +206 -139
  154. data/spec/arachni/element/form/dom_spec.rb +36 -19
  155. data/spec/arachni/element/form_spec.rb +210 -187
  156. data/spec/arachni/element/generic_dom_spec.rb +14 -14
  157. data/spec/arachni/element/header_spec.rb +35 -17
  158. data/spec/arachni/element/json_spec.rb +53 -31
  159. data/spec/arachni/element/link/dom_spec.rb +46 -28
  160. data/spec/arachni/element/link_spec.rb +58 -40
  161. data/spec/arachni/element/link_template/dom_spec.rb +47 -29
  162. data/spec/arachni/element/link_template_spec.rb +79 -61
  163. data/spec/arachni/element/path_spec.rb +1 -1
  164. data/spec/arachni/element/server_spec.rb +33 -32
  165. data/spec/arachni/element/ui_form/ui_form_dom_spec.rb +164 -0
  166. data/spec/arachni/element/ui_form_spec.rb +242 -0
  167. data/spec/arachni/element/ui_input/dom_spec.rb +157 -0
  168. data/spec/arachni/element/ui_input_spec.rb +136 -0
  169. data/spec/arachni/element/xml_spec.rb +42 -24
  170. data/spec/arachni/element_filter_spec.rb +49 -48
  171. data/spec/arachni/error_spec.rb +3 -3
  172. data/spec/arachni/framework/parts/audit_spec.rb +64 -63
  173. data/spec/arachni/framework/parts/browser_spec.rb +16 -16
  174. data/spec/arachni/framework/parts/check_spec.rb +3 -3
  175. data/spec/arachni/framework/parts/data_spec.rb +48 -48
  176. data/spec/arachni/framework/parts/platform_spec.rb +3 -3
  177. data/spec/arachni/framework/parts/plugin_spec.rb +7 -6
  178. data/spec/arachni/framework/parts/report_spec.rb +7 -7
  179. data/spec/arachni/framework/parts/scope_spec.rb +16 -16
  180. data/spec/arachni/framework/parts/state_spec.rb +68 -69
  181. data/spec/arachni/framework_spec.rb +39 -31
  182. data/spec/arachni/http/client/dynamic_404_handlers_spec.rb +32 -32
  183. data/spec/arachni/http/client_spec.rb +219 -208
  184. data/spec/arachni/http/cookie_jar_spec.rb +72 -72
  185. data/spec/arachni/http/headers_spec.rb +14 -14
  186. data/spec/arachni/http/proxy_server_spec.rb +43 -42
  187. data/spec/arachni/http/request_spec.rb +105 -103
  188. data/spec/arachni/http/response/scope_spec.rb +24 -24
  189. data/spec/arachni/http/response_spec.rb +50 -49
  190. data/spec/arachni/issue/severity_spec.rb +10 -9
  191. data/spec/arachni/issue_spec.rb +71 -369
  192. data/spec/arachni/option_groups/audit_spec.rb +114 -114
  193. data/spec/arachni/option_groups/browser_cluster_spec.rb +20 -3
  194. data/spec/arachni/option_groups/datastore_spec.rb +6 -6
  195. data/spec/arachni/option_groups/dispatcher_spec.rb +19 -19
  196. data/spec/arachni/option_groups/http_spec.rb +11 -11
  197. data/spec/arachni/option_groups/input_spec.rb +31 -27
  198. data/spec/arachni/option_groups/output_spec.rb +2 -2
  199. data/spec/arachni/option_groups/paths_spec.rb +17 -17
  200. data/spec/arachni/option_groups/rpc_spec.rb +2 -2
  201. data/spec/arachni/option_groups/scope_spec.rb +40 -40
  202. data/spec/arachni/option_groups/session_spec.rb +6 -5
  203. data/spec/arachni/option_groups/snapshot_spec.rb +4 -4
  204. data/spec/arachni/options_spec.rb +46 -45
  205. data/spec/arachni/page/dom/transition_spec.rb +74 -72
  206. data/spec/arachni/page/dom_spec.rb +35 -35
  207. data/spec/arachni/page/scope_spec.rb +15 -15
  208. data/spec/arachni/page_spec.rb +217 -217
  209. data/spec/arachni/parser_spec.rb +106 -104
  210. data/spec/arachni/platform/fingerprinter_spec.rb +17 -14
  211. data/spec/arachni/platform/list_spec.rb +33 -33
  212. data/spec/arachni/platform/manager_spec.rb +67 -64
  213. data/spec/arachni/plugin/base_spec.rb +10 -10
  214. data/spec/arachni/plugin/manager_spec.rb +38 -37
  215. data/spec/arachni/report_spec.rb +43 -40
  216. data/spec/arachni/reporter/base_spec.rb +15 -15
  217. data/spec/arachni/reporter/manager_spec.rb +4 -4
  218. data/spec/arachni/reporter/options_spec.rb +6 -6
  219. data/spec/arachni/rpc/client/base_spec.rb +6 -6
  220. data/spec/arachni/rpc/client/dispatcher_spec.rb +2 -2
  221. data/spec/arachni/rpc/client/instance_spec.rb +6 -6
  222. data/spec/arachni/rpc/server/active_options_spec.rb +11 -8
  223. data/spec/arachni/rpc/server/base_spec.rb +5 -5
  224. data/spec/arachni/rpc/server/checks/manager_spec.rb +8 -8
  225. data/spec/arachni/rpc/server/dispatcher/node_spec.rb +37 -37
  226. data/spec/arachni/rpc/server/dispatcher/service_spec.rb +15 -14
  227. data/spec/arachni/rpc/server/dispatcher_spec.rb +36 -35
  228. data/spec/arachni/rpc/server/framework/distributor_spec.rb +36 -36
  229. data/spec/arachni/rpc/server/framework_multi_spec.rb +340 -336
  230. data/spec/arachni/rpc/server/framework_spec.rb +90 -85
  231. data/spec/arachni/rpc/server/instance_spec.rb +126 -107
  232. data/spec/arachni/rpc/server/output_spec.rb +1 -1
  233. data/spec/arachni/rpc/server/plugin/manager_spec.rb +6 -6
  234. data/spec/arachni/ruby/array_spec.rb +42 -42
  235. data/spec/arachni/ruby/hash_spec.rb +20 -18
  236. data/spec/arachni/ruby/io_spec.rb +2 -2
  237. data/spec/arachni/ruby/object_spec.rb +1 -1
  238. data/spec/arachni/ruby/set_spec.rb +3 -3
  239. data/spec/arachni/ruby/string_spec.rb +30 -30
  240. data/spec/arachni/ruby/webrick_spec.rb +2 -2
  241. data/spec/arachni/scope_spec.rb +1 -1
  242. data/spec/arachni/session_spec.rb +67 -64
  243. data/spec/arachni/snapshot_spec.rb +15 -15
  244. data/spec/arachni/state/audit_spec.rb +11 -11
  245. data/spec/arachni/state/element_filter_spec.rb +6 -6
  246. data/spec/arachni/state/framework/rpc_spec.rb +12 -12
  247. data/spec/arachni/state/framework_spec.rb +125 -121
  248. data/spec/arachni/state/http_spec.rb +7 -7
  249. data/spec/arachni/state/options_spec.rb +7 -7
  250. data/spec/arachni/state/plugins_spec.rb +8 -8
  251. data/spec/arachni/state_spec.rb +10 -10
  252. data/spec/arachni/support/buffer/autoflush_spec.rb +16 -16
  253. data/spec/arachni/support/buffer/base_spec.rb +39 -39
  254. data/spec/arachni/support/cache/least_cost_replacement_spec.rb +18 -18
  255. data/spec/arachni/support/cache/least_recently_pushed_spec.rb +24 -24
  256. data/spec/arachni/support/cache/least_recently_used_spec.rb +20 -20
  257. data/spec/arachni/support/cache/preference_spec.rb +4 -4
  258. data/spec/arachni/support/cache/random_replacement_spec.rb +8 -8
  259. data/spec/arachni/support/crypto/rsa_aes_cbc_spec.rb +1 -1
  260. data/spec/arachni/support/database/hash_spec.rb +44 -43
  261. data/spec/arachni/support/database/queue_spec.rb +27 -27
  262. data/spec/arachni/support/lookup/hash_set_spec.rb +8 -8
  263. data/spec/arachni/support/lookup/moolb_spec.rb +3 -3
  264. data/spec/arachni/support/mixins/observable_spec.rb +6 -6
  265. data/spec/arachni/support/signature_spec.rb +19 -19
  266. data/spec/arachni/trainer_spec.rb +39 -39
  267. data/spec/arachni/typhoeus/hydra_spec.rb +2 -2
  268. data/spec/arachni/uri/scope_spec.rb +66 -66
  269. data/spec/arachni/uri_spec.rb +107 -105
  270. data/spec/arachni/utilities_spec.rb +40 -40
  271. data/spec/components/checks/active/csrf_spec.rb +8 -8
  272. data/spec/components/checks/active/no_sql_injection_spec.rb +1 -1
  273. data/spec/components/checks/active/sql_injection_spec.rb +16 -16
  274. data/spec/components/checks/active/trainer_spec.rb +4 -4
  275. data/spec/components/checks/active/unvalidated_redirect_dom_spec.rb +4 -2
  276. data/spec/components/checks/active/xpath_injection_spec.rb +1 -1
  277. data/spec/components/checks/active/xss_dom_script_context_spec.rb +51 -21
  278. data/spec/components/checks/active/xss_dom_spec.rb +46 -24
  279. data/spec/components/checks/passive/allowed_methods_spec.rb +1 -1
  280. data/spec/components/checks/passive/grep/cookie_set_for_parent_domain_spec.rb +1 -1
  281. data/spec/components/checks/passive/grep/hsts_spec.rb +2 -2
  282. data/spec/components/checks/passive/grep/http_only_cookies_spec.rb +1 -1
  283. data/spec/components/checks/passive/grep/insecure_cookies_spec.rb +1 -1
  284. data/spec/components/checks/passive/grep/insecure_cors_policy_spec.rb +2 -2
  285. data/spec/components/checks/passive/grep/password_autocomplete_spec.rb +1 -1
  286. data/spec/components/checks/passive/grep/private_ip_spec.rb +3 -3
  287. data/spec/components/checks/passive/grep/unencrypted_password_forms_spec.rb +1 -1
  288. data/spec/components/checks/passive/grep/x_frame_options_spec.rb +2 -2
  289. data/spec/components/checks/passive/interesting_responses_spec.rb +2 -2
  290. data/spec/components/checks/passive/webdav_spec.rb +1 -1
  291. data/spec/components/checks/passive/xst_spec.rb +1 -1
  292. data/spec/components/fingerprinters/servers/apache_spec.rb +2 -2
  293. data/spec/components/path_extractors/comments_spec.rb +5 -1
  294. data/spec/components/path_extractors/scripts_spec.rb +5 -2
  295. data/spec/components/plugins/autologin_spec.rb +22 -22
  296. data/spec/components/plugins/autothrottle_spec.rb +6 -5
  297. data/spec/components/plugins/content_types_spec.rb +4 -4
  298. data/spec/components/plugins/cookie_collector_spec.rb +5 -5
  299. data/spec/components/plugins/exec_spec.rb +12 -12
  300. data/spec/components/plugins/form_dicattack_spec.rb +3 -3
  301. data/spec/components/plugins/headers_collector_spec.rb +8 -8
  302. data/spec/components/plugins/healthmap_spec.rb +3 -3
  303. data/spec/components/plugins/http_dicattack_spec.rb +3 -3
  304. data/spec/components/plugins/login_script_spec.rb +79 -22
  305. data/spec/components/plugins/meta/remedies/discovery_spec.rb +3 -2
  306. data/spec/components/plugins/meta/remedies/timing_attacks_spec.rb +3 -3
  307. data/spec/components/plugins/meta/uniformity_spec.rb +2 -2
  308. data/spec/components/plugins/restrict_to_dom_state_spec.rb +1 -1
  309. data/spec/components/plugins/script_spec.rb +1 -1
  310. data/spec/components/plugins/uncommon_headers_spec.rb +2 -2
  311. data/spec/components/plugins/vector_collector_spec.rb +2 -2
  312. data/spec/components/plugins/vector_feed_spec.rb +40 -40
  313. data/spec/components/plugins/waf_detector_spec.rb +6 -6
  314. data/spec/components/reporters/json_spec.rb +4 -4
  315. data/spec/components/reporters/marshal_spec.rb +2 -2
  316. data/spec/components/reporters/yaml_spec.rb +3 -2
  317. data/spec/external/wavsep/active/sqli_spec.rb +1 -3
  318. data/spec/spec_helper.rb +4 -0
  319. data/spec/support/factories/element/ui_form.rb +14 -0
  320. data/spec/support/factories/element/ui_input.rb +13 -0
  321. data/spec/support/factories/issue.rb +0 -13
  322. data/spec/support/fixtures/report.afr +0 -0
  323. data/spec/support/fixtures/{taint_check/taint.rb → signature_check/signature.rb} +2 -2
  324. data/spec/support/helpers/browser_cluster/jobs/taint_tracer.rb +11 -11
  325. data/spec/support/helpers/framework.rb +1 -1
  326. data/spec/support/helpers/pages.rb +2 -2
  327. data/spec/support/servers/arachni/browser.rb +139 -0
  328. data/spec/support/servers/arachni/browser/javascript/taint_tracer.rb +40 -0
  329. data/spec/support/servers/arachni/element/capabilities/analyzable/{taint.rb → signature.rb} +0 -0
  330. data/spec/support/servers/arachni/element/input/input_dom.rb +102 -0
  331. data/spec/support/servers/arachni/element/ui_form/ui_form_dom.rb +238 -0
  332. data/spec/support/servers/checks/active/trainer_check.rb +7 -7
  333. data/spec/support/servers/checks/active/unvalidated_redirect_dom.rb +22 -6
  334. data/spec/support/servers/checks/active/xss_dom.rb +50 -0
  335. data/spec/support/servers/checks/active/xss_dom_script_context.rb +53 -0
  336. data/spec/support/shared/browser/javascript/taint_tracer/sink/base.rb +6 -6
  337. data/spec/support/shared/check.rb +10 -12
  338. data/spec/support/shared/component/options/base.rb +24 -24
  339. data/spec/support/shared/element/base.rb +25 -25
  340. data/spec/support/shared/element/capabilities/auditable.rb +116 -140
  341. data/spec/support/shared/element/capabilities/dom_only.rb +65 -0
  342. data/spec/support/shared/element/capabilities/inputtable.rb +71 -86
  343. data/spec/support/shared/element/capabilities/mutable.rb +122 -111
  344. data/spec/support/shared/element/capabilities/refreshable.rb +10 -10
  345. data/spec/support/shared/element/capabilities/{submitable.rb → submittable.rb} +26 -26
  346. data/spec/support/shared/element/capabilities/with_auditor.rb +10 -10
  347. data/spec/support/shared/element/capabilities/with_dom.rb +8 -8
  348. data/spec/support/shared/element/capabilities/with_node.rb +4 -6
  349. data/spec/support/shared/element/capabilities/with_scope.rb +2 -2
  350. data/spec/support/shared/element/capabilities/with_source.rb +6 -8
  351. data/spec/support/shared/element/dom.rb +144 -0
  352. data/spec/support/shared/element/dom/auditable.rb +42 -0
  353. data/spec/support/shared/element/dom/inputtable.rb +5 -0
  354. data/spec/support/shared/element/dom/mutable.rb +3 -0
  355. data/spec/support/shared/element/dom/submittable.rb +119 -0
  356. data/spec/support/shared/external/wavsep.rb +3 -3
  357. data/spec/support/shared/fingerprinter.rb +2 -2
  358. data/spec/support/shared/framework.rb +1 -1
  359. data/spec/support/shared/http/message.rb +9 -9
  360. data/spec/support/shared/option_group.rb +17 -17
  361. data/spec/support/shared/path_extractor.rb +1 -1
  362. data/spec/support/shared/plugin.rb +2 -2
  363. data/spec/support/shared/support/cache.rb +57 -57
  364. data/spec/support/shared/support/lookup.rb +25 -25
  365. data/ui/cli/framework.rb +22 -11
  366. data/ui/cli/framework/option_parser.rb +15 -0
  367. data/ui/cli/option_parser.rb +8 -1
  368. data/ui/cli/output.rb +2 -1
  369. metadata +54 -20
  370. data/components/checks/active/xss_dom_inputs.rb +0 -236
  371. data/spec/components/checks/active/xss_dom_inputs_spec.rb +0 -30
  372. data/spec/support/servers/checks/active/xss_dom_inputs.rb +0 -59
  373. data/spec/support/shared/element/capabilities/auditable/dom.rb +0 -322
@@ -20,7 +20,7 @@ describe 'Arachni::RPC::Server::Framework' do
20
20
  it 'returns all logged errors' do
21
21
  test = 'Test'
22
22
  @instance.framework.error_test test
23
- @instance.framework.errors.last.should end_with test
23
+ expect(@instance.framework.errors.last).to end_with test
24
24
  end
25
25
  end
26
26
  context 'when a start line-range has been provided' do
@@ -28,7 +28,7 @@ describe 'Arachni::RPC::Server::Framework' do
28
28
  initial_errors = @instance.framework.errors
29
29
  errors = @instance.framework.errors( 10 )
30
30
 
31
- initial_errors[10..-1].should == errors
31
+ expect(initial_errors[10..-1]).to eq(errors)
32
32
  end
33
33
  end
34
34
  end
@@ -36,77 +36,77 @@ describe 'Arachni::RPC::Server::Framework' do
36
36
  describe '#busy?' do
37
37
  context 'when the scan is not running' do
38
38
  it 'returns false' do
39
- @framework_clean.busy?.should be_false
39
+ expect(@framework_clean.busy?).to be_falsey
40
40
  end
41
41
  end
42
42
  context 'when the scan is running' do
43
43
  it 'returns true' do
44
44
  @instance.options.url = web_server_url_for( :auditor ) + '/sleep'
45
45
  @checks.load( 'test' )
46
- @framework.run.should be_true
47
- @framework.busy?.should be_true
46
+ expect(@framework.run).to be_truthy
47
+ expect(@framework.busy?).to be_truthy
48
48
  end
49
49
  end
50
50
  end
51
51
  describe '#version' do
52
52
  it 'returns the system version' do
53
- @framework_clean.version.should == Arachni::VERSION
53
+ expect(@framework_clean.version).to eq(Arachni::VERSION)
54
54
  end
55
55
  end
56
56
  describe '#master?' do
57
57
  it 'returns false' do
58
- @framework_clean.master?.should be_false
58
+ expect(@framework_clean.master?).to be_falsey
59
59
  end
60
60
  end
61
61
  describe '#slave?' do
62
62
  it 'returns false' do
63
- @framework_clean.slave?.should be_false
63
+ expect(@framework_clean.slave?).to be_falsey
64
64
  end
65
65
  end
66
66
  describe '#solo?' do
67
67
  it 'returns true' do
68
- @framework_clean.solo?.should be_true
68
+ expect(@framework_clean.solo?).to be_truthy
69
69
  end
70
70
  end
71
71
  describe '#list_plugins' do
72
72
  it 'lists all available plugins' do
73
73
  plugins = @framework_clean.list_plugins
74
- plugins.size.should == 7
74
+ expect(plugins.size).to eq(7)
75
75
  plugin = plugins.select { |i| i[:name] =~ /default/i }.first
76
- plugin[:name].should == 'Default'
77
- plugin[:description].should == 'Some description'
78
- plugin[:author].size.should == 1
79
- plugin[:author].first.should == 'Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>'
80
- plugin[:version].should == '0.1'
81
- plugin[:shortname].should == 'default'
82
- plugin[:options].size.should== 1
76
+ expect(plugin[:name]).to eq('Default')
77
+ expect(plugin[:description]).to eq('Some description')
78
+ expect(plugin[:author].size).to eq(1)
79
+ expect(plugin[:author].first).to eq('Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>')
80
+ expect(plugin[:version]).to eq('0.1')
81
+ expect(plugin[:shortname]).to eq('default')
82
+ expect(plugin[:options].size).to eq(1)
83
83
 
84
84
  opt = plugin[:options].first
85
- opt[:name].should == :int_opt
86
- opt[:required].should == false
87
- opt[:description].should == 'An integer.'
88
- opt[:default].should == 4
89
- opt[:type].should == :integer
85
+ expect(opt[:name]).to eq(:int_opt)
86
+ expect(opt[:required]).to eq(false)
87
+ expect(opt[:description]).to eq('An integer.')
88
+ expect(opt[:default]).to eq(4)
89
+ expect(opt[:type]).to eq(:integer)
90
90
  end
91
91
  end
92
92
  describe '#list_reporters' do
93
93
  it 'lists all available reporters' do
94
94
  reporters = @framework_clean.list_reporters
95
- reporters.should be_any
95
+ expect(reporters).to be_any
96
96
  report_with_opts = reporters.select{ |r| r[:options].any? }.first
97
- report_with_opts[:options].first.should be_kind_of( Hash )
97
+ expect(report_with_opts[:options].first).to be_kind_of( Hash )
98
98
  end
99
99
  end
100
100
 
101
101
  describe '#list_checks' do
102
102
  it 'lists all available checks' do
103
- @framework_clean.list_checks.should be_any
103
+ expect(@framework_clean.list_checks).to be_any
104
104
  end
105
105
  end
106
106
 
107
107
  describe '#list_platforms' do
108
108
  it 'lists all available platforms' do
109
- @framework_clean.list_platforms.should == Arachni::Framework.new.list_platforms
109
+ expect(@framework_clean.list_platforms).to eq(Arachni::Framework.new.list_platforms)
110
110
  end
111
111
  end
112
112
 
@@ -117,38 +117,38 @@ describe 'Arachni::RPC::Server::Framework' do
117
117
  instance.checks.load( 'test' )
118
118
  instance.framework.run
119
119
  sleep( 1 ) while instance.framework.busy?
120
- instance.framework.issues.should be_any
120
+ expect(instance.framework.issues).to be_any
121
121
  end
122
122
 
123
123
  it 'handles pages with JavaScript code' do
124
- @opts.paths.checks = fixtures_path + '/taint_check/'
124
+ @opts.paths.checks = fixtures_path + '/signature_check/'
125
125
 
126
126
  instance = instance_spawn
127
127
  instance.options.url = web_server_url_for( :auditor ) + '/with_javascript'
128
128
  instance.options.set audit: { elements: [:links, :forms, :cookies] }
129
- instance.checks.load :taint
129
+ instance.checks.load :signature
130
130
 
131
131
  instance.framework.run
132
132
  sleep 0.1 while instance.framework.busy?
133
133
 
134
- instance.framework.issues.
135
- map { |i| i.vector.affected_input_name }.uniq.should be
134
+ expect(instance.framework.issues.
135
+ map { |i| i.vector.affected_input_name }.uniq).to be
136
136
  %w(link_input form_input cookie_input).sort
137
137
  end
138
138
 
139
139
  it 'handles AJAX' do
140
- @opts.paths.checks = fixtures_path + '/taint_check/'
140
+ @opts.paths.checks = fixtures_path + '/signature_check/'
141
141
 
142
142
  instance = instance_spawn
143
143
  instance.options.url = web_server_url_for( :auditor ) + '/with_ajax'
144
144
  instance.options.set audit: { elements: [:links, :forms, :cookies] }
145
- instance.checks.load :taint
145
+ instance.checks.load :signature
146
146
 
147
147
  instance.framework.run
148
148
  sleep 0.1 while instance.framework.busy?
149
149
 
150
- instance.framework.issues.
151
- map { |i| i.vector.affected_input_name }.uniq.should be
150
+ expect(instance.framework.issues.
151
+ map { |i| i.vector.affected_input_name }.uniq).to be
152
152
  %w(link_input form_input cookie_taint).sort
153
153
  end
154
154
 
@@ -156,8 +156,8 @@ describe 'Arachni::RPC::Server::Framework' do
156
156
  describe '#report' do
157
157
  it 'returns an report object' do
158
158
  report = @instance_clean.framework.report
159
- report.is_a?( Arachni::Report ).should be_true
160
- report.issues.should be_any
159
+ expect(report.is_a?( Arachni::Report )).to be_truthy
160
+ expect(report.issues).to be_any
161
161
  end
162
162
  end
163
163
  describe '#statistics' do
@@ -165,9 +165,9 @@ describe 'Arachni::RPC::Server::Framework' do
165
165
  instance = @instance_clean
166
166
  instance.options.url = web_server_url_for( :framework )
167
167
  instance.checks.load( 'test' )
168
- instance.framework.run.should be_true
168
+ expect(instance.framework.run).to be_truthy
169
169
 
170
- instance.framework.statistics.should be_kind_of Hash
170
+ expect(instance.framework.statistics).to be_kind_of Hash
171
171
  end
172
172
  end
173
173
  describe '#status' do
@@ -178,14 +178,14 @@ describe 'Arachni::RPC::Server::Framework' do
178
178
  end
179
179
  context 'after initialization' do
180
180
  it 'returns :ready' do
181
- @instance.framework.status.should == :ready
181
+ expect(@instance.framework.status).to eq(:ready)
182
182
  end
183
183
  end
184
184
  context 'after #run has been called' do
185
185
  it 'returns :scanning' do
186
- @instance.framework.run.should be_true
186
+ expect(@instance.framework.run).to be_truthy
187
187
  sleep 2
188
- @instance.framework.status.should == :scanning
188
+ expect(@instance.framework.status).to eq(:scanning)
189
189
  end
190
190
  end
191
191
  context 'once the scan had completed' do
@@ -195,7 +195,7 @@ describe 'Arachni::RPC::Server::Framework' do
195
195
  instance.checks.load( 'test' )
196
196
  instance.framework.run
197
197
  sleep 1 while instance.framework.busy?
198
- instance.framework.status.should == :done
198
+ expect(instance.framework.status).to eq(:done)
199
199
  end
200
200
  end
201
201
  end
@@ -205,32 +205,33 @@ describe 'Arachni::RPC::Server::Framework' do
205
205
  instance.options.url = web_server_url_for( :framework_multi )
206
206
  instance.checks.load( 'test' )
207
207
  instance.plugins.load( { 'wait' => {} } )
208
- instance.framework.run.should be_true
209
- instance.framework.busy?.should be_true
210
- instance.framework.report.plugins.should be_empty
211
- instance.framework.clean_up.should be_true
208
+ expect(instance.framework.run).to be_truthy
209
+ expect(instance.framework.busy?).to be_truthy
210
+ expect(instance.framework.report.plugins).to be_empty
211
+ expect(instance.framework.clean_up).to be_truthy
212
212
  results = instance.framework.report.plugins
213
- results.should be_any
214
- results[:wait].should be_any
215
- results[:wait][:results].should == { 'stuff' => true }
213
+ expect(results).to be_any
214
+ expect(results[:wait]).to be_any
215
+ expect(results[:wait][:results]).to eq({ 'stuff' => true })
216
216
  end
217
217
  end
218
218
  describe '#progress' do
219
- before { @progress_keys = %W(statistics status busy messages issues).sort.map(&:to_sym) }
219
+ before { @progress_keys = %W(seed statistics status busy messages issues).sort.map(&:to_sym) }
220
220
 
221
221
  context 'when called without options' do
222
222
  it 'returns all progress data' do
223
223
  instance = @instance_clean
224
224
 
225
225
  data = instance.framework.progress
226
- data.keys.sort.should == @progress_keys
227
-
228
- data[:statistics].keys.should == instance.framework.statistics.keys
229
- data[:messages].should be_empty
230
- data[:status].should be_true
231
- data[:busy].nil?.should be_false
232
- data[:issues].should be_any
233
- data.should_not include :errors
226
+ expect(data.keys.sort).to eq(@progress_keys)
227
+
228
+ expect(data[:statistics].keys).to eq(instance.framework.statistics.keys)
229
+ expect(data[:messages]).to be_empty
230
+ expect(data[:status]).to be_truthy
231
+ expect(data[:busy].nil?).to be_falsey
232
+ expect(data[:issues]).to be_any
233
+ expect(data[:seed]).not_to be_empty
234
+ expect(data).not_to include :errors
234
235
  end
235
236
  end
236
237
 
@@ -238,15 +239,15 @@ describe 'Arachni::RPC::Server::Framework' do
238
239
  describe :errors do
239
240
  context 'when set to true' do
240
241
  it 'includes all error messages' do
241
- @instance_clean.framework.
242
- progress( errors: true )[:errors].should be_empty
242
+ expect(@instance_clean.framework.
243
+ progress( errors: true )[:errors]).to be_empty
243
244
 
244
245
  test = 'Test'
245
246
  @instance_clean.framework.error_test test
246
247
 
247
- @instance_clean.framework.
248
- progress( errors: true )[:errors].last.
249
- should end_with test
248
+ expect(@instance_clean.framework.
249
+ progress( errors: true )[:errors].last).
250
+ to end_with test
250
251
  end
251
252
  end
252
253
  context 'when set to an Integer' do
@@ -259,7 +260,7 @@ describe 'Arachni::RPC::Server::Framework' do
259
260
  errors = @instance_clean.framework.
260
261
  progress( errors: 10 )[:errors]
261
262
 
262
- errors.should == initial_errors[10..-1]
263
+ expect(errors).to eq(initial_errors[10..-1])
263
264
  end
264
265
  end
265
266
  end
@@ -267,9 +268,10 @@ describe 'Arachni::RPC::Server::Framework' do
267
268
  describe :sitemap do
268
269
  context 'when set to true' do
269
270
  it 'returns entire sitemap' do
270
- @instance_clean.framework.
271
- progress( sitemap: true )[:sitemap].should ==
271
+ expect(@instance_clean.framework.
272
+ progress( sitemap: true )[:sitemap]).to eq(
272
273
  @instance_clean.framework.sitemap
274
+ )
273
275
  end
274
276
  end
275
277
 
@@ -285,8 +287,9 @@ describe 'Arachni::RPC::Server::Framework' do
285
287
  instance.framework.run
286
288
  sleep 0.1 while instance.framework.busy?
287
289
 
288
- instance.framework.progress( sitemap: 10 )[:sitemap].should ==
290
+ expect(instance.framework.progress( sitemap: 10 )[:sitemap]).to eq(
289
291
  instance.framework.sitemap_entries( 10 )
292
+ )
290
293
  end
291
294
  end
292
295
  end
@@ -294,18 +297,18 @@ describe 'Arachni::RPC::Server::Framework' do
294
297
  describe :issue do
295
298
  context 'when set to false' do
296
299
  it 'excludes issues' do
297
- @instance_clean.framework.progress(
300
+ expect(@instance_clean.framework.progress(
298
301
  issues: false
299
- ).should_not include :issues
302
+ )).not_to include :issues
300
303
  end
301
304
  end
302
305
  end
303
306
  describe :as_hash do
304
307
  context 'when set to true' do
305
308
  it 'includes issues as a hash' do
306
- @instance_clean.framework.progress(
309
+ expect(@instance_clean.framework.progress(
307
310
  as_hash: true
308
- )[:issues].first.is_a?( Hash ).should be_true
311
+ )[:issues].first.is_a?( Hash )).to be_truthy
309
312
  end
310
313
  end
311
314
  end
@@ -315,8 +318,9 @@ describe 'Arachni::RPC::Server::Framework' do
315
318
  describe '#sitemap_entries' do
316
319
  context 'when no argument has been provided' do
317
320
  it 'returns entire sitemap' do
318
- @instance_clean.framework.sitemap_entries.should ==
321
+ expect(@instance_clean.framework.sitemap_entries).to eq(
319
322
  @instance_clean.framework.sitemap
323
+ )
320
324
  end
321
325
  end
322
326
 
@@ -333,21 +337,22 @@ describe 'Arachni::RPC::Server::Framework' do
333
337
  sleep 0.1 while instance.framework.busy?
334
338
 
335
339
  sitemap = instance.framework.sitemap
336
- instance.framework.sitemap_entries( 10 ).should ==
340
+ expect(instance.framework.sitemap_entries( 10 )).to eq(
337
341
  Hash[sitemap.to_a[10..-1]]
342
+ )
338
343
  end
339
344
  end
340
345
  end
341
346
 
342
347
  describe '#self_url' do
343
348
  it 'returns the RPC URL' do
344
- @instance_clean.framework.self_url.should == @instance_clean.url
349
+ expect(@instance_clean.framework.self_url).to eq(@instance_clean.url)
345
350
  end
346
351
  end
347
352
 
348
353
  describe '#token' do
349
354
  it 'returns the RPC token' do
350
- @instance_clean.framework.token.should == instance_token_for( @instance_clean )
355
+ expect(@instance_clean.framework.token).to eq(instance_token_for( @instance_clean ))
351
356
  end
352
357
  end
353
358
 
@@ -355,8 +360,9 @@ describe 'Arachni::RPC::Server::Framework' do
355
360
  context 'when passed a valid reporter name' do
356
361
  it 'returns the report as a string' do
357
362
  json = @instance_clean.framework.report_as( :json )
358
- JSON.load( json )['issues'].size.should ==
363
+ expect(JSON.load( json )['issues'].size).to eq(
359
364
  @instance_clean.framework.report.issues.size
365
+ )
360
366
  end
361
367
 
362
368
  context 'which does not support the \'outfile\' option' do
@@ -374,23 +380,22 @@ describe 'Arachni::RPC::Server::Framework' do
374
380
  end
375
381
 
376
382
  describe '#issues' do
377
- it 'returns an array of issues without variations' do
383
+ it 'returns an array of issues' do
378
384
  issues = @instance_clean.framework.issues
379
- issues.should be_any
385
+ expect(issues).to be_any
380
386
 
381
387
  issue = issues.first
382
- issue.is_a?( Arachni::Issue ).should be_true
383
- issue.variations.should be_empty
388
+ expect(issue.is_a?( Arachni::Issue )).to be_truthy
384
389
  end
385
390
  end
391
+
386
392
  describe '#issues_as_hash' do
387
- it 'returns an array of issues (as hash) without variations' do
393
+ it 'returns an array of issues as hash' do
388
394
  issues = @instance_clean.framework.issues_as_hash
389
- issues.should be_any
395
+ expect(issues).to be_any
390
396
 
391
397
  issue = issues.first
392
- issue.is_a?( Hash ).should be_true
393
- issue['variations'].should be_empty
398
+ expect(issue.is_a?( Hash )).to be_truthy
394
399
  end
395
400
  end
396
401
  end
@@ -25,14 +25,14 @@ describe 'Arachni::RPC::Server::Instance' do
25
25
  it 'supports UNIX sockets', if: Arachni::Reactor.supports_unix_sockets? do
26
26
  socket = "#{Dir.tmpdir}/arachni-instance-#{@utils.generate_token}"
27
27
  @instance = instance_spawn( socket: socket )
28
- @instance.framework.multi_self_url.should == socket
29
- @instance.service.alive?.should be_true
28
+ expect(@instance.framework.multi_self_url).to eq(socket)
29
+ expect(@instance.service.alive?).to be_truthy
30
30
  end
31
31
 
32
32
  describe '#snapshot_path' do
33
33
  context 'when the scan has not been suspended' do
34
34
  it 'returns nil' do
35
- @shared_instance.service.snapshot_path.should be_nil
35
+ expect(@shared_instance.service.snapshot_path).to be_nil
36
36
  end
37
37
  end
38
38
 
@@ -56,7 +56,7 @@ describe 'Arachni::RPC::Server::Instance' do
56
56
  sleep 1 while @instance.service.status != :suspended
57
57
  end
58
58
 
59
- File.exists?( @instance.service.snapshot_path ).should be_true
59
+ expect(File.exists?( @instance.service.snapshot_path )).to be_truthy
60
60
  end
61
61
  end
62
62
  end
@@ -81,7 +81,7 @@ describe 'Arachni::RPC::Server::Instance' do
81
81
  sleep 1 while @instance.service.status != :suspended
82
82
  end
83
83
 
84
- File.exists?( @instance.service.snapshot_path ).should be_true
84
+ expect(File.exists?( @instance.service.snapshot_path )).to be_truthy
85
85
  end
86
86
 
87
87
  context 'when performing a multi-Instance scan' do
@@ -107,7 +107,7 @@ describe 'Arachni::RPC::Server::Instance' do
107
107
  describe '#suspended?' do
108
108
  context 'when the scan has not been suspended' do
109
109
  it 'returns false' do
110
- @shared_instance.service.should_not be_suspended
110
+ expect(@shared_instance.service).not_to be_suspended
111
111
  end
112
112
  end
113
113
 
@@ -131,7 +131,7 @@ describe 'Arachni::RPC::Server::Instance' do
131
131
  sleep 1 while @instance.service.status != :suspended
132
132
  end
133
133
 
134
- @instance.service.should be_suspended
134
+ expect(@instance.service).to be_suspended
135
135
  end
136
136
  end
137
137
  end
@@ -168,7 +168,7 @@ describe 'Arachni::RPC::Server::Instance' do
168
168
 
169
169
  sleep 1 while @instance.service.busy?
170
170
 
171
- @instance.service.report[:options].should == options
171
+ expect(@instance.service.report[:options]).to eq(options)
172
172
  end
173
173
  end
174
174
 
@@ -178,7 +178,7 @@ describe 'Arachni::RPC::Server::Instance' do
178
178
  it 'returns all logged errors' do
179
179
  test = 'Test'
180
180
  @shared_instance.service.error_test test
181
- @shared_instance.service.errors.last.should end_with test
181
+ expect(@shared_instance.service.errors.last).to end_with test
182
182
  end
183
183
  end
184
184
  context 'when a start line-range has been provided' do
@@ -186,7 +186,7 @@ describe 'Arachni::RPC::Server::Instance' do
186
186
  initial_errors = @shared_instance.service.errors
187
187
  errors = @shared_instance.service.errors( 10 )
188
188
 
189
- initial_errors[10..-1].should == errors
189
+ expect(initial_errors[10..-1]).to eq(errors)
190
190
  end
191
191
  end
192
192
  end
@@ -194,19 +194,19 @@ describe 'Arachni::RPC::Server::Instance' do
194
194
  describe '#error_logfile' do
195
195
  it 'returns the path to the error logfile' do
196
196
  errors = IO.read( @shared_instance.service.error_logfile ).split( "\n" )
197
- errors.should == @shared_instance.service.errors
197
+ expect(errors).to eq(@shared_instance.service.errors)
198
198
  end
199
199
  end
200
200
  describe '#alive?' do
201
201
  it 'returns true' do
202
- @shared_instance.service.alive?.should == true
202
+ expect(@shared_instance.service.alive?).to eq(true)
203
203
  end
204
204
  end
205
205
  describe '#paused?' do
206
206
  context 'when not paused' do
207
207
  it 'returns false' do
208
208
  @instance = instance_spawn
209
- @instance.service.paused?.should be_false
209
+ expect(@instance.service.paused?).to be_falsey
210
210
  end
211
211
  end
212
212
  context 'when paused' do
@@ -218,13 +218,13 @@ describe 'Arachni::RPC::Server::Instance' do
218
218
  )
219
219
 
220
220
  instance.service.pause
221
- instance.service.status.should == :pausing
221
+ expect(instance.service.status).to eq(:pausing)
222
222
 
223
223
  Timeout.timeout 20 do
224
224
  sleep 1 while !instance.service.paused?
225
225
  end
226
226
 
227
- instance.service.paused?.should be_true
227
+ expect(instance.service.paused?).to be_truthy
228
228
  end
229
229
  end
230
230
  end
@@ -237,27 +237,27 @@ describe 'Arachni::RPC::Server::Instance' do
237
237
  )
238
238
 
239
239
  instance.service.pause
240
- instance.service.status.should == :pausing
240
+ expect(instance.service.status).to eq(:pausing)
241
241
 
242
242
  Timeout.timeout 20 do
243
243
  sleep 1 while !instance.service.paused?
244
244
  end
245
245
 
246
- instance.service.paused?.should be_true
247
- instance.service.resume.should be_true
246
+ expect(instance.service.paused?).to be_truthy
247
+ expect(instance.service.resume).to be_truthy
248
248
 
249
249
  Timeout.timeout 20 do
250
250
  sleep 1 while instance.service.paused?
251
251
  end
252
252
 
253
- instance.service.paused?.should be_false
253
+ expect(instance.service.paused?).to be_falsey
254
254
  end
255
255
  end
256
256
 
257
257
  [:list_platforms, :list_checks, :list_plugins, :list_reporters, :busy?].each do |m|
258
258
  describe "##{m}" do
259
259
  it "delegates to Framework##{m}" do
260
- @shared_instance.service.send(m).should == @shared_instance.framework.send(m)
260
+ expect(@shared_instance.service.send(m)).to eq(@shared_instance.framework.send(m))
261
261
  end
262
262
  end
263
263
  end
@@ -274,41 +274,43 @@ describe 'Arachni::RPC::Server::Instance' do
274
274
  framework_report.delete k
275
275
  end
276
276
 
277
- instance_report.should == framework_report
277
+ expect(instance_report).to eq(framework_report)
278
278
  end
279
279
  end
280
280
 
281
281
  describe '#abort_and_report' do
282
282
  it 'cleans-up and returns the report as a Hash' do
283
- @shared_instance.service.abort_and_report.should ==
283
+ expect(@shared_instance.service.abort_and_report).to eq(
284
284
  Arachni::RPC::Serializer.load(
285
285
  Arachni::RPC::Serializer.dump( @shared_instance.framework.report.to_h )
286
286
  )
287
+ )
287
288
  end
288
289
  end
289
290
 
290
291
  describe '#native_abort_and_report' do
291
292
  it "cleans-up and returns the report as #{Arachni::Report}" do
292
- @shared_instance.service.native_abort_and_report.should ==
293
+ expect(@shared_instance.service.native_abort_and_report).to eq(
293
294
  @shared_instance.framework.report
295
+ )
294
296
  end
295
297
  end
296
298
 
297
299
  describe '#abort_and_report_as' do
298
300
  it 'cleans-up and delegate to #report_as' do
299
- JSON.load( @shared_instance.service.abort_and_report_as( :json ) ).should include 'issues'
301
+ expect(JSON.load( @shared_instance.service.abort_and_report_as( :json ) )).to include 'issues'
300
302
  end
301
303
  end
302
304
 
303
305
  describe '#report_as' do
304
306
  it 'delegates to Framework#report_as' do
305
- JSON.load( @shared_instance.service.report_as( :json ) ).should include 'issues'
307
+ expect(JSON.load( @shared_instance.service.report_as( :json ) )).to include 'issues'
306
308
  end
307
309
  end
308
310
 
309
311
  describe '#status' do
310
312
  it 'delegate to Framework#status' do
311
- @shared_instance.service.status.should == @shared_instance.framework.status
313
+ expect(@shared_instance.service.status).to eq(@shared_instance.framework.status)
312
314
  end
313
315
  end
314
316
 
@@ -318,8 +320,8 @@ describe 'Arachni::RPC::Server::Instance' do
318
320
 
319
321
  slave = instance_spawn
320
322
 
321
- instance.service.busy?.should == instance.framework.busy?
322
- instance.service.status.should == instance.framework.status
323
+ expect(instance.service.busy?).to eq(instance.framework.busy?)
324
+ expect(instance.service.status).to eq(instance.framework.status)
323
325
 
324
326
  instance.service.scan(
325
327
  url: web_server_url_for( :framework ),
@@ -332,15 +334,15 @@ describe 'Arachni::RPC::Server::Instance' do
332
334
  )
333
335
 
334
336
  # if a scan in already running it should just bail out early
335
- instance.service.scan.should be_false
337
+ expect(instance.service.scan).to be_falsey
336
338
 
337
339
  sleep 1 while instance.service.busy?
338
340
 
339
- instance.framework.progress[:instances].size.should == 2
341
+ expect(instance.framework.progress[:instances].size).to eq(2)
340
342
 
341
- instance.service.busy?.should == instance.framework.busy?
342
- instance.service.status.should == instance.framework.status
343
- instance.service.report['issues'].should be_any
343
+ expect(instance.service.busy?).to eq(instance.framework.busy?)
344
+ expect(instance.service.status).to eq(instance.framework.status)
345
+ expect(instance.service.report['issues']).to be_any
344
346
  end
345
347
 
346
348
  context 'with invalid :platforms' do
@@ -372,16 +374,16 @@ describe 'Arachni::RPC::Server::Instance' do
372
374
  )
373
375
 
374
376
  # if a scan in already running it should just bail out early
375
- instance.service.scan.should be_false
377
+ expect(instance.service.scan).to be_falsey
376
378
 
377
379
  sleep 1 while instance.service.busy?
378
380
 
379
381
  # Since we've only got 3 Dispatchers in the Grid.
380
- instance.framework.progress[:instances].size.should == 3
382
+ expect(instance.framework.progress[:instances].size).to eq(3)
381
383
 
382
- instance.service.busy?.should == instance.framework.busy?
383
- instance.service.status.should == instance.framework.status
384
- instance.service.report['issues'].should be_any
384
+ expect(instance.service.busy?).to eq(instance.framework.busy?)
385
+ expect(instance.service.status).to eq(instance.framework.status)
386
+ expect(instance.service.report['issues']).to be_any
385
387
  end
386
388
  end
387
389
  context :balance do
@@ -397,17 +399,17 @@ describe 'Arachni::RPC::Server::Instance' do
397
399
  )
398
400
 
399
401
  # if a scan in already running it should just bail out early
400
- instance.service.scan.should be_false
402
+ expect(instance.service.scan).to be_falsey
401
403
 
402
404
  sleep 1 while instance.service.busy?
403
405
 
404
406
  # No matter how many grid members with unique Pipe-IDs there are
405
407
  # since we're in balance mode.
406
- instance.framework.progress[:instances].size.should == 5
408
+ expect(instance.framework.progress[:instances].size).to eq(5)
407
409
 
408
- instance.service.busy?.should == instance.framework.busy?
409
- instance.service.status.should == instance.framework.status
410
- instance.service.report['issues'].should be_any
410
+ expect(instance.service.busy?).to eq(instance.framework.busy?)
411
+ expect(instance.service.status).to eq(instance.framework.status)
412
+ expect(instance.service.report['issues']).to be_any
411
413
  end
412
414
  end
413
415
 
@@ -442,17 +444,17 @@ describe 'Arachni::RPC::Server::Instance' do
442
444
  )
443
445
 
444
446
  # if a scan in already running it should just bail out early
445
- instance.service.scan.should be_false
447
+ expect(instance.service.scan).to be_falsey
446
448
 
447
449
  sleep 1 while instance.service.busy?
448
450
 
449
451
  # No matter how many grid members with unique Pipe-IDs there are
450
452
  # since we're in balance mode.
451
- instance.framework.progress[:instances].size.should == 5
453
+ expect(instance.framework.progress[:instances].size).to eq(5)
452
454
 
453
- instance.service.busy?.should == instance.framework.busy?
454
- instance.service.status.should == instance.framework.status
455
- instance.service.report['issues'].should be_any
455
+ expect(instance.service.busy?).to eq(instance.framework.busy?)
456
+ expect(instance.service.status).to eq(instance.framework.status)
457
+ expect(instance.service.report['issues']).to be_any
456
458
  end
457
459
  end
458
460
  end
@@ -471,7 +473,7 @@ describe 'Arachni::RPC::Server::Instance' do
471
473
  raised = e.rpc_exception?
472
474
  end
473
475
 
474
- raised.should be_true
476
+ expect(raised).to be_truthy
475
477
  end
476
478
  end
477
479
 
@@ -492,7 +494,7 @@ describe 'Arachni::RPC::Server::Instance' do
492
494
  raised = e.rpc_exception?
493
495
  end
494
496
 
495
- raised.should be_true
497
+ expect(raised).to be_truthy
496
498
  end
497
499
  end
498
500
 
@@ -512,11 +514,11 @@ describe 'Arachni::RPC::Server::Instance' do
512
514
 
513
515
  sleep 1 while instance.service.busy?
514
516
 
515
- instance.framework.progress[:instances].size.should == 5
517
+ expect(instance.framework.progress[:instances].size).to eq(5)
516
518
 
517
- instance.service.busy?.should == instance.framework.busy?
518
- instance.service.status.should == instance.framework.status
519
- instance.service.report['issues'].should be_any
519
+ expect(instance.service.busy?).to eq(instance.framework.busy?)
520
+ expect(instance.service.status).to eq(instance.framework.status)
521
+ expect(instance.service.report['issues']).to be_any
520
522
  end
521
523
  end
522
524
  end
@@ -545,20 +547,21 @@ describe 'Arachni::RPC::Server::Instance' do
545
547
  instance = @progress_instance
546
548
 
547
549
  p = instance.service.progress
548
- p[:busy].should == instance.framework.busy?
549
- p[:status].should == instance.framework.status
550
- p[:statistics].should be_any
550
+ expect(p[:busy]).to eq(instance.framework.busy?)
551
+ expect(p[:status]).to eq(instance.framework.status)
552
+ expect(p[:statistics]).to be_any
551
553
 
552
- p[:instances].should be_nil
553
- p[:issues].should be_nil
554
+ expect(p[:instances]).to be_nil
555
+ expect(p[:issues]).to be_nil
556
+ expect(p[:seed]).not_to be_empty
554
557
  end
555
558
 
556
559
  describe :without do
557
560
  describe :statistics do
558
561
  it 'includes statistics' do
559
- @progress_instance.service.progress(
562
+ expect(@progress_instance.service.progress(
560
563
  without: :statistics
561
- ).should_not include :statistics
564
+ )).not_to include :statistics
562
565
  end
563
566
  end
564
567
  describe :issues do
@@ -572,7 +575,7 @@ describe 'Arachni::RPC::Server::Instance' do
572
575
  without: { issues: [digest] }
573
576
  )
574
577
 
575
- p[:issues].include?( issue ).should be_false
578
+ expect(p[:issues].include?( issue )).to be_falsey
576
579
  end
577
580
  end
578
581
  context 'with an array of things to be excluded' do
@@ -587,8 +590,8 @@ describe 'Arachni::RPC::Server::Instance' do
587
590
  with: [ :issues, :instances ],
588
591
  without: [ :statistics, issues: [digest] ]
589
592
  )
590
- p.should_not include :statistics
591
- p[:issues].include?( issue ).should be_false
593
+ expect(p).not_to include :statistics
594
+ expect(p[:issues].include?( issue )).to be_falsey
592
595
  end
593
596
  end
594
597
  end
@@ -599,9 +602,9 @@ describe 'Arachni::RPC::Server::Instance' do
599
602
  instance = @progress_instance
600
603
 
601
604
  issues = instance.service.progress( with: :issues )[:issues]
602
- issues.should be_any
603
- issues.first.class.should == Hash
604
- issues.should == instance.framework.progress( as_hash: true )[:issues]
605
+ expect(issues).to be_any
606
+ expect(issues.first.class).to eq(Hash)
607
+ expect(issues).to eq(instance.framework.progress( as_hash: true )[:issues])
605
608
  end
606
609
  end
607
610
 
@@ -612,11 +615,18 @@ describe 'Arachni::RPC::Server::Instance' do
612
615
  stats1 = instance.service.progress( with: :instances )[:instances]
613
616
  stats2 = instance.framework.progress[:instances]
614
617
 
615
- stats1.each { |h| h[:statistics].delete :runtime }
616
- stats2.each { |h| h[:statistics].delete :runtime }
618
+ stats1.each do |h|
619
+ h[:statistics][:http].delete :burst_responses_per_second
620
+ h[:statistics].delete :runtime
621
+ end
622
+
623
+ stats2.each do |h|
624
+ h[:statistics][:http].delete :burst_responses_per_second
625
+ h[:statistics].delete :runtime
626
+ end
617
627
 
618
- stats1.size.should == 2
619
- stats1.should == stats2
628
+ expect(stats1.size).to eq(2)
629
+ expect(stats1).to eq(stats2)
620
630
  end
621
631
  end
622
632
 
@@ -625,9 +635,10 @@ describe 'Arachni::RPC::Server::Instance' do
625
635
  it 'returns entire sitemap' do
626
636
  instance = @progress_instance
627
637
 
628
- instance.service.
629
- progress( with: { sitemap: true } )[:sitemap].should ==
638
+ expect(instance.service.
639
+ progress( with: { sitemap: true } )[:sitemap]).to eq(
630
640
  instance.service.sitemap
641
+ )
631
642
  end
632
643
  end
633
644
 
@@ -635,9 +646,10 @@ describe 'Arachni::RPC::Server::Instance' do
635
646
  it 'returns all entries after that line' do
636
647
  instance = @progress_instance
637
648
 
638
- instance.service.
639
- progress( with: { sitemap: 10 } )[:sitemap].should ==
649
+ expect(instance.service.
650
+ progress( with: { sitemap: 10 } )[:sitemap]).to eq(
640
651
  instance.service.sitemap( 10 )
652
+ )
641
653
  end
642
654
  end
643
655
  end
@@ -650,12 +662,12 @@ describe 'Arachni::RPC::Server::Instance' do
650
662
  with: [ :issues, :instances ],
651
663
  without: :statistics
652
664
  )
653
- p[:busy].should == instance.framework.busy?
654
- p[:status].should == instance.framework.status
655
- p[:statistics].should be_nil
665
+ expect(p[:busy]).to eq(instance.framework.busy?)
666
+ expect(p[:status]).to eq(instance.framework.status)
667
+ expect(p[:statistics]).to be_nil
656
668
 
657
- p[:instances].size.should == 2
658
- p[:issues].should be_any
669
+ expect(p[:instances].size).to eq(2)
670
+ expect(p[:issues]).to be_any
659
671
  end
660
672
  end
661
673
  end
@@ -680,20 +692,20 @@ describe 'Arachni::RPC::Server::Instance' do
680
692
  instance = @progress_instance
681
693
 
682
694
  p = instance.service.native_progress
683
- p[:busy].should == instance.framework.busy?
684
- p[:status].should == instance.framework.status
685
- p[:statistics].should be_any
695
+ expect(p[:busy]).to eq(instance.framework.busy?)
696
+ expect(p[:status]).to eq(instance.framework.status)
697
+ expect(p[:statistics]).to be_any
686
698
 
687
- p[:instances].should be_nil
688
- p[:issues].should be_nil
699
+ expect(p[:instances]).to be_nil
700
+ expect(p[:issues]).to be_nil
689
701
  end
690
702
 
691
703
  describe :without do
692
704
  describe :statistics do
693
705
  it 'includes statistics' do
694
- @progress_instance.service.native_progress(
706
+ expect(@progress_instance.service.native_progress(
695
707
  without: :statistics
696
- ).should_not include :statistics
708
+ )).not_to include :statistics
697
709
  end
698
710
  end
699
711
  describe :issues do
@@ -707,7 +719,7 @@ describe 'Arachni::RPC::Server::Instance' do
707
719
  without: { issues: [digest] }
708
720
  )
709
721
 
710
- p[:issues].include?( issue ).should be_false
722
+ expect(p[:issues].include?( issue )).to be_falsey
711
723
  end
712
724
  end
713
725
  context 'with an array of things to be excluded' do
@@ -722,8 +734,8 @@ describe 'Arachni::RPC::Server::Instance' do
722
734
  with: [ :issues, :instances ],
723
735
  without: [ :statistics, issues: [digest] ]
724
736
  )
725
- p.should_not include :statistics
726
- p[:issues].include?( issue ).should be_false
737
+ expect(p).not_to include :statistics
738
+ expect(p[:issues].include?( issue )).to be_falsey
727
739
  end
728
740
  end
729
741
  end
@@ -734,8 +746,8 @@ describe 'Arachni::RPC::Server::Instance' do
734
746
  instance = @progress_instance
735
747
 
736
748
  issues = instance.service.native_progress( with: :issues )[:issues]
737
- issues.should be_any
738
- issues.first.class.should == Arachni::Issue
749
+ expect(issues).to be_any
750
+ expect(issues.first.class).to eq(Arachni::Issue)
739
751
  end
740
752
  end
741
753
 
@@ -746,11 +758,18 @@ describe 'Arachni::RPC::Server::Instance' do
746
758
  stats1 = instance.service.native_progress( with: :instances )[:instances]
747
759
  stats2 = instance.framework.progress[:instances]
748
760
 
749
- stats1.each { |h| h[:statistics].delete :runtime }
750
- stats2.each { |h| h[:statistics].delete :runtime }
761
+ stats1.each do |h|
762
+ h[:statistics][:http].delete :burst_responses_per_second
763
+ h[:statistics].delete :runtime
764
+ end
765
+
766
+ stats2.each do |h|
767
+ h[:statistics][:http].delete :burst_responses_per_second
768
+ h[:statistics].delete :runtime
769
+ end
751
770
 
752
- stats1.size.should == 2
753
- stats1.should == stats2
771
+ expect(stats1.size).to eq(2)
772
+ expect(stats1).to eq(stats2)
754
773
  end
755
774
  end
756
775
 
@@ -762,12 +781,12 @@ describe 'Arachni::RPC::Server::Instance' do
762
781
  with: [ :issues, :instances ],
763
782
  without: :statistics
764
783
  )
765
- p[:busy].should == instance.framework.busy?
766
- p[:status].should == instance.framework.status
767
- p[:statistics].should be_nil
784
+ expect(p[:busy]).to eq(instance.framework.busy?)
785
+ expect(p[:status]).to eq(instance.framework.status)
786
+ expect(p[:statistics]).to be_nil
768
787
 
769
- p[:instances].size.should == 2
770
- p[:issues].should be_any
788
+ expect(p[:instances].size).to eq(2)
789
+ expect(p[:issues]).to be_any
771
790
  end
772
791
  end
773
792
  end
@@ -776,7 +795,7 @@ describe 'Arachni::RPC::Server::Instance' do
776
795
  describe '#shutdown' do
777
796
  it 'shuts-down the instance' do
778
797
  instance = instance_spawn
779
- instance.service.shutdown.should be_true
798
+ expect(instance.service.shutdown).to be_truthy
780
799
  sleep 4
781
800
 
782
801
  expect { instance.service.alive? }.to raise_error
@@ -786,7 +805,7 @@ describe 'Arachni::RPC::Server::Instance' do
786
805
 
787
806
  describe '#framework' do
788
807
  it 'provides access to the Framework' do
789
- @shared_instance.framework.busy?.should be_false
808
+ expect(@shared_instance.framework.busy?).to be_falsey
790
809
  end
791
810
  end
792
811
 
@@ -794,20 +813,20 @@ describe 'Arachni::RPC::Server::Instance' do
794
813
  it 'provides access to the Options' do
795
814
  url = 'http://blah.com'
796
815
  @shared_instance.options.url = url
797
- @shared_instance.options.url.to_s.should == @utils.normalize_url( url )
816
+ expect(@shared_instance.options.url.to_s).to eq(@utils.normalize_url( url ))
798
817
  end
799
818
  end
800
819
 
801
820
  describe '#checks' do
802
821
  it 'provides access to the checks manager' do
803
- @shared_instance.checks.available.sort.should == %w(test test2 test3).sort
822
+ expect(@shared_instance.checks.available.sort).to eq(%w(test test2 test3).sort)
804
823
  end
805
824
  end
806
825
 
807
826
  describe '#plugins' do
808
827
  it 'provides access to the plugin manager' do
809
- @shared_instance.plugins.available.sort.should == %w(wait bad distributable
810
- loop default with_options suspendable).sort
828
+ expect(@shared_instance.plugins.available.sort).to eq(%w(wait bad distributable
829
+ loop default with_options suspendable).sort)
811
830
  end
812
831
  end
813
832
  end