bbot 2.0.1.4720rc0__py3-none-any.whl → 2.3.0.5397rc0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of bbot might be problematic. Click here for more details.

Files changed (267) hide show
  1. bbot/__init__.py +1 -1
  2. bbot/cli.py +3 -7
  3. bbot/core/config/files.py +0 -1
  4. bbot/core/config/logger.py +34 -4
  5. bbot/core/core.py +21 -4
  6. bbot/core/engine.py +9 -8
  7. bbot/core/event/base.py +131 -52
  8. bbot/core/helpers/bloom.py +10 -3
  9. bbot/core/helpers/command.py +8 -7
  10. bbot/core/helpers/depsinstaller/installer.py +31 -13
  11. bbot/core/helpers/diff.py +10 -10
  12. bbot/core/helpers/dns/brute.py +7 -4
  13. bbot/core/helpers/dns/dns.py +1 -2
  14. bbot/core/helpers/dns/engine.py +4 -6
  15. bbot/core/helpers/dns/helpers.py +2 -2
  16. bbot/core/helpers/dns/mock.py +0 -1
  17. bbot/core/helpers/files.py +1 -1
  18. bbot/core/helpers/helper.py +7 -4
  19. bbot/core/helpers/interactsh.py +3 -3
  20. bbot/core/helpers/libmagic.py +65 -0
  21. bbot/core/helpers/misc.py +65 -22
  22. bbot/core/helpers/names_generator.py +17 -3
  23. bbot/core/helpers/process.py +0 -20
  24. bbot/core/helpers/regex.py +1 -1
  25. bbot/core/helpers/regexes.py +12 -6
  26. bbot/core/helpers/validators.py +1 -2
  27. bbot/core/helpers/web/client.py +1 -1
  28. bbot/core/helpers/web/engine.py +1 -2
  29. bbot/core/helpers/web/web.py +4 -114
  30. bbot/core/helpers/wordcloud.py +5 -5
  31. bbot/core/modules.py +36 -27
  32. bbot/core/multiprocess.py +58 -0
  33. bbot/core/shared_deps.py +46 -3
  34. bbot/db/sql/models.py +147 -0
  35. bbot/defaults.yml +11 -9
  36. bbot/modules/anubisdb.py +2 -2
  37. bbot/modules/apkpure.py +63 -0
  38. bbot/modules/azure_tenant.py +2 -2
  39. bbot/modules/baddns.py +35 -19
  40. bbot/modules/baddns_direct.py +92 -0
  41. bbot/modules/baddns_zone.py +3 -8
  42. bbot/modules/badsecrets.py +4 -3
  43. bbot/modules/base.py +195 -51
  44. bbot/modules/bevigil.py +7 -7
  45. bbot/modules/binaryedge.py +7 -4
  46. bbot/modules/bufferoverrun.py +47 -0
  47. bbot/modules/builtwith.py +6 -10
  48. bbot/modules/bypass403.py +5 -5
  49. bbot/modules/c99.py +10 -7
  50. bbot/modules/censys.py +9 -13
  51. bbot/modules/certspotter.py +5 -3
  52. bbot/modules/chaos.py +9 -7
  53. bbot/modules/code_repository.py +1 -0
  54. bbot/modules/columbus.py +3 -3
  55. bbot/modules/crt.py +5 -3
  56. bbot/modules/deadly/dastardly.py +1 -1
  57. bbot/modules/deadly/ffuf.py +9 -9
  58. bbot/modules/deadly/nuclei.py +3 -3
  59. bbot/modules/deadly/vhost.py +4 -3
  60. bbot/modules/dehashed.py +1 -1
  61. bbot/modules/digitorus.py +1 -1
  62. bbot/modules/dnsbimi.py +145 -0
  63. bbot/modules/dnscaa.py +3 -3
  64. bbot/modules/dnsdumpster.py +4 -4
  65. bbot/modules/dnstlsrpt.py +144 -0
  66. bbot/modules/docker_pull.py +7 -5
  67. bbot/modules/dockerhub.py +2 -2
  68. bbot/modules/dotnetnuke.py +18 -19
  69. bbot/modules/emailformat.py +1 -1
  70. bbot/modules/extractous.py +122 -0
  71. bbot/modules/filedownload.py +9 -7
  72. bbot/modules/fullhunt.py +7 -4
  73. bbot/modules/generic_ssrf.py +5 -5
  74. bbot/modules/github_codesearch.py +3 -2
  75. bbot/modules/github_org.py +4 -4
  76. bbot/modules/github_workflows.py +4 -4
  77. bbot/modules/gitlab.py +2 -5
  78. bbot/modules/google_playstore.py +93 -0
  79. bbot/modules/gowitness.py +48 -50
  80. bbot/modules/hackertarget.py +5 -3
  81. bbot/modules/host_header.py +5 -5
  82. bbot/modules/httpx.py +1 -4
  83. bbot/modules/hunterio.py +3 -9
  84. bbot/modules/iis_shortnames.py +19 -30
  85. bbot/modules/internal/cloudcheck.py +27 -12
  86. bbot/modules/internal/dnsresolve.py +22 -20
  87. bbot/modules/internal/excavate.py +85 -48
  88. bbot/modules/internal/speculate.py +41 -32
  89. bbot/modules/internetdb.py +4 -2
  90. bbot/modules/ip2location.py +3 -5
  91. bbot/modules/ipneighbor.py +1 -1
  92. bbot/modules/ipstack.py +3 -8
  93. bbot/modules/jadx.py +87 -0
  94. bbot/modules/leakix.py +11 -10
  95. bbot/modules/myssl.py +2 -2
  96. bbot/modules/newsletters.py +2 -2
  97. bbot/modules/otx.py +5 -3
  98. bbot/modules/output/asset_inventory.py +7 -7
  99. bbot/modules/output/base.py +1 -1
  100. bbot/modules/output/csv.py +1 -1
  101. bbot/modules/output/http.py +20 -14
  102. bbot/modules/output/mysql.py +51 -0
  103. bbot/modules/output/neo4j.py +7 -2
  104. bbot/modules/output/postgres.py +49 -0
  105. bbot/modules/output/slack.py +0 -1
  106. bbot/modules/output/sqlite.py +29 -0
  107. bbot/modules/output/stdout.py +2 -2
  108. bbot/modules/output/teams.py +107 -6
  109. bbot/modules/paramminer_headers.py +5 -8
  110. bbot/modules/passivetotal.py +13 -13
  111. bbot/modules/portscan.py +32 -6
  112. bbot/modules/postman.py +50 -126
  113. bbot/modules/postman_download.py +220 -0
  114. bbot/modules/rapiddns.py +3 -8
  115. bbot/modules/report/asn.py +11 -11
  116. bbot/modules/robots.py +3 -3
  117. bbot/modules/securitytrails.py +7 -10
  118. bbot/modules/securitytxt.py +1 -1
  119. bbot/modules/shodan_dns.py +7 -9
  120. bbot/modules/sitedossier.py +1 -1
  121. bbot/modules/skymem.py +2 -2
  122. bbot/modules/social.py +2 -1
  123. bbot/modules/subdomaincenter.py +1 -1
  124. bbot/modules/subdomainradar.py +160 -0
  125. bbot/modules/telerik.py +8 -8
  126. bbot/modules/templates/bucket.py +1 -1
  127. bbot/modules/templates/github.py +22 -14
  128. bbot/modules/templates/postman.py +21 -0
  129. bbot/modules/templates/shodan.py +14 -13
  130. bbot/modules/templates/sql.py +95 -0
  131. bbot/modules/templates/subdomain_enum.py +51 -16
  132. bbot/modules/templates/webhook.py +2 -4
  133. bbot/modules/trickest.py +8 -37
  134. bbot/modules/trufflehog.py +10 -12
  135. bbot/modules/url_manipulation.py +3 -3
  136. bbot/modules/urlscan.py +1 -1
  137. bbot/modules/viewdns.py +1 -1
  138. bbot/modules/virustotal.py +8 -30
  139. bbot/modules/wafw00f.py +1 -1
  140. bbot/modules/wayback.py +1 -1
  141. bbot/modules/wpscan.py +17 -11
  142. bbot/modules/zoomeye.py +11 -6
  143. bbot/presets/baddns-thorough.yml +12 -0
  144. bbot/presets/fast.yml +16 -0
  145. bbot/presets/kitchen-sink.yml +1 -0
  146. bbot/presets/spider.yml +4 -0
  147. bbot/presets/subdomain-enum.yml +7 -7
  148. bbot/scanner/manager.py +5 -16
  149. bbot/scanner/preset/args.py +44 -26
  150. bbot/scanner/preset/environ.py +7 -2
  151. bbot/scanner/preset/path.py +7 -4
  152. bbot/scanner/preset/preset.py +36 -23
  153. bbot/scanner/scanner.py +172 -62
  154. bbot/scanner/target.py +236 -434
  155. bbot/scripts/docs.py +1 -1
  156. bbot/test/bbot_fixtures.py +13 -3
  157. bbot/test/conftest.py +132 -100
  158. bbot/test/fastapi_test.py +17 -0
  159. bbot/test/owasp_mastg.apk +0 -0
  160. bbot/test/run_tests.sh +4 -4
  161. bbot/test/test.conf +2 -0
  162. bbot/test/test_step_1/test_bbot_fastapi.py +82 -0
  163. bbot/test/test_step_1/test_bloom_filter.py +2 -0
  164. bbot/test/test_step_1/test_cli.py +138 -64
  165. bbot/test/test_step_1/test_dns.py +62 -25
  166. bbot/test/test_step_1/test_engine.py +17 -17
  167. bbot/test/test_step_1/test_events.py +183 -28
  168. bbot/test/test_step_1/test_helpers.py +64 -28
  169. bbot/test/test_step_1/test_manager_deduplication.py +1 -1
  170. bbot/test/test_step_1/test_manager_scope_accuracy.py +333 -330
  171. bbot/test/test_step_1/test_modules_basic.py +68 -70
  172. bbot/test/test_step_1/test_presets.py +184 -96
  173. bbot/test/test_step_1/test_python_api.py +7 -2
  174. bbot/test/test_step_1/test_regexes.py +35 -5
  175. bbot/test/test_step_1/test_scan.py +39 -5
  176. bbot/test/test_step_1/test_scope.py +4 -3
  177. bbot/test/test_step_1/test_target.py +243 -145
  178. bbot/test/test_step_1/test_web.py +14 -8
  179. bbot/test/test_step_2/module_tests/base.py +15 -7
  180. bbot/test/test_step_2/module_tests/test_module_anubisdb.py +1 -1
  181. bbot/test/test_step_2/module_tests/test_module_apkpure.py +71 -0
  182. bbot/test/test_step_2/module_tests/test_module_asset_inventory.py +0 -1
  183. bbot/test/test_step_2/module_tests/test_module_azure_realm.py +1 -1
  184. bbot/test/test_step_2/module_tests/test_module_baddns.py +6 -6
  185. bbot/test/test_step_2/module_tests/test_module_baddns_direct.py +62 -0
  186. bbot/test/test_step_2/module_tests/test_module_bevigil.py +29 -2
  187. bbot/test/test_step_2/module_tests/test_module_binaryedge.py +4 -2
  188. bbot/test/test_step_2/module_tests/test_module_bucket_amazon.py +2 -2
  189. bbot/test/test_step_2/module_tests/test_module_bucket_azure.py +1 -1
  190. bbot/test/test_step_2/module_tests/test_module_bufferoverrun.py +35 -0
  191. bbot/test/test_step_2/module_tests/test_module_builtwith.py +2 -2
  192. bbot/test/test_step_2/module_tests/test_module_bypass403.py +1 -1
  193. bbot/test/test_step_2/module_tests/test_module_c99.py +126 -0
  194. bbot/test/test_step_2/module_tests/test_module_censys.py +4 -1
  195. bbot/test/test_step_2/module_tests/test_module_cloudcheck.py +4 -0
  196. bbot/test/test_step_2/module_tests/test_module_code_repository.py +11 -1
  197. bbot/test/test_step_2/module_tests/test_module_columbus.py +1 -1
  198. bbot/test/test_step_2/module_tests/test_module_credshed.py +3 -3
  199. bbot/test/test_step_2/module_tests/test_module_dastardly.py +2 -1
  200. bbot/test/test_step_2/module_tests/test_module_dehashed.py +2 -2
  201. bbot/test/test_step_2/module_tests/test_module_digitorus.py +1 -1
  202. bbot/test/test_step_2/module_tests/test_module_discord.py +1 -1
  203. bbot/test/test_step_2/module_tests/test_module_dnsbimi.py +103 -0
  204. bbot/test/test_step_2/module_tests/test_module_dnsbrute.py +9 -10
  205. bbot/test/test_step_2/module_tests/test_module_dnsbrute_mutations.py +1 -2
  206. bbot/test/test_step_2/module_tests/test_module_dnscommonsrv.py +1 -2
  207. bbot/test/test_step_2/module_tests/test_module_dnsdumpster.py +4 -4
  208. bbot/test/test_step_2/module_tests/test_module_dnstlsrpt.py +64 -0
  209. bbot/test/test_step_2/module_tests/test_module_dotnetnuke.py +0 -8
  210. bbot/test/test_step_2/module_tests/test_module_excavate.py +17 -37
  211. bbot/test/test_step_2/module_tests/test_module_extractous.py +54 -0
  212. bbot/test/test_step_2/module_tests/test_module_ffuf_shortnames.py +1 -1
  213. bbot/test/test_step_2/module_tests/test_module_filedownload.py +14 -14
  214. bbot/test/test_step_2/module_tests/test_module_git_clone.py +2 -2
  215. bbot/test/test_step_2/module_tests/test_module_github_org.py +19 -8
  216. bbot/test/test_step_2/module_tests/test_module_github_workflows.py +1 -1
  217. bbot/test/test_step_2/module_tests/test_module_gitlab.py +9 -4
  218. bbot/test/test_step_2/module_tests/test_module_google_playstore.py +83 -0
  219. bbot/test/test_step_2/module_tests/test_module_gowitness.py +4 -4
  220. bbot/test/test_step_2/module_tests/test_module_host_header.py +1 -1
  221. bbot/test/test_step_2/module_tests/test_module_http.py +4 -4
  222. bbot/test/test_step_2/module_tests/test_module_httpx.py +10 -8
  223. bbot/test/test_step_2/module_tests/test_module_hunterio.py +68 -4
  224. bbot/test/test_step_2/module_tests/test_module_jadx.py +55 -0
  225. bbot/test/test_step_2/module_tests/test_module_json.py +22 -9
  226. bbot/test/test_step_2/module_tests/test_module_leakix.py +7 -3
  227. bbot/test/test_step_2/module_tests/test_module_mysql.py +76 -0
  228. bbot/test/test_step_2/module_tests/test_module_myssl.py +1 -1
  229. bbot/test/test_step_2/module_tests/test_module_neo4j.py +1 -1
  230. bbot/test/test_step_2/module_tests/test_module_newsletters.py +6 -6
  231. bbot/test/test_step_2/module_tests/test_module_ntlm.py +7 -7
  232. bbot/test/test_step_2/module_tests/test_module_oauth.py +1 -1
  233. bbot/test/test_step_2/module_tests/test_module_otx.py +1 -1
  234. bbot/test/test_step_2/module_tests/test_module_paramminer_cookies.py +1 -2
  235. bbot/test/test_step_2/module_tests/test_module_paramminer_getparams.py +0 -6
  236. bbot/test/test_step_2/module_tests/test_module_paramminer_headers.py +2 -9
  237. bbot/test/test_step_2/module_tests/test_module_passivetotal.py +3 -1
  238. bbot/test/test_step_2/module_tests/test_module_portscan.py +9 -8
  239. bbot/test/test_step_2/module_tests/test_module_postgres.py +74 -0
  240. bbot/test/test_step_2/module_tests/test_module_postman.py +84 -253
  241. bbot/test/test_step_2/module_tests/test_module_postman_download.py +439 -0
  242. bbot/test/test_step_2/module_tests/test_module_rapiddns.py +93 -1
  243. bbot/test/test_step_2/module_tests/test_module_shodan_dns.py +20 -1
  244. bbot/test/test_step_2/module_tests/test_module_sitedossier.py +2 -2
  245. bbot/test/test_step_2/module_tests/test_module_smuggler.py +1 -1
  246. bbot/test/test_step_2/module_tests/test_module_social.py +11 -1
  247. bbot/test/test_step_2/module_tests/test_module_speculate.py +2 -6
  248. bbot/test/test_step_2/module_tests/test_module_splunk.py +4 -4
  249. bbot/test/test_step_2/module_tests/test_module_sqlite.py +18 -0
  250. bbot/test/test_step_2/module_tests/test_module_sslcert.py +1 -1
  251. bbot/test/test_step_2/module_tests/test_module_stdout.py +5 -3
  252. bbot/test/test_step_2/module_tests/test_module_subdomaincenter.py +1 -1
  253. bbot/test/test_step_2/module_tests/test_module_subdomainradar.py +208 -0
  254. bbot/test/test_step_2/module_tests/test_module_subdomains.py +1 -1
  255. bbot/test/test_step_2/module_tests/test_module_teams.py +8 -6
  256. bbot/test/test_step_2/module_tests/test_module_telerik.py +1 -1
  257. bbot/test/test_step_2/module_tests/test_module_trufflehog.py +317 -14
  258. bbot/test/test_step_2/module_tests/test_module_wayback.py +1 -1
  259. bbot/test/test_step_2/template_tests/test_template_subdomain_enum.py +2 -2
  260. {bbot-2.0.1.4720rc0.dist-info → bbot-2.3.0.5397rc0.dist-info}/METADATA +48 -18
  261. bbot-2.3.0.5397rc0.dist-info/RECORD +421 -0
  262. {bbot-2.0.1.4720rc0.dist-info → bbot-2.3.0.5397rc0.dist-info}/WHEEL +1 -1
  263. bbot/modules/unstructured.py +0 -163
  264. bbot/test/test_step_2/module_tests/test_module_unstructured.py +0 -102
  265. bbot-2.0.1.4720rc0.dist-info/RECORD +0 -387
  266. {bbot-2.0.1.4720rc0.dist-info → bbot-2.3.0.5397rc0.dist-info}/LICENSE +0 -0
  267. {bbot-2.0.1.4720rc0.dist-info → bbot-2.3.0.5397rc0.dist-info}/entry_points.txt +0 -0
@@ -49,6 +49,8 @@ async def test_helpers_misc(helpers, scan, bbot_scanner, bbot_httpserver):
49
49
  assert helpers.url_depth("http://evilcorp.com/") == 0
50
50
  assert helpers.url_depth("http://evilcorp.com") == 0
51
51
 
52
+ assert helpers.parent_url("http://evilcorp.com/subdir1/subdir2?foo=bar") == "http://evilcorp.com/subdir1"
53
+
52
54
  ### MISC ###
53
55
  assert helpers.is_domain("evilcorp.co.uk")
54
56
  assert not helpers.is_domain("www.evilcorp.co.uk")
@@ -62,8 +64,8 @@ async def test_helpers_misc(helpers, scan, bbot_scanner, bbot_httpserver):
62
64
  assert not helpers.is_subdomain("notreal")
63
65
  assert helpers.is_url("http://evilcorp.co.uk/asdf?a=b&c=d#asdf")
64
66
  assert helpers.is_url("https://evilcorp.co.uk/asdf?a=b&c=d#asdf")
65
- assert helpers.is_uri("ftp://evilcorp.co.uk") == True
66
- assert helpers.is_uri("http://evilcorp.co.uk") == True
67
+ assert helpers.is_uri("ftp://evilcorp.co.uk") is True
68
+ assert helpers.is_uri("http://evilcorp.co.uk") is True
67
69
  assert helpers.is_uri("evilcorp.co.uk", return_scheme=True) == ""
68
70
  assert helpers.is_uri("ftp://evilcorp.co.uk", return_scheme=True) == "ftp"
69
71
  assert helpers.is_uri("FTP://evilcorp.co.uk", return_scheme=True) == "ftp"
@@ -91,8 +93,34 @@ async def test_helpers_misc(helpers, scan, bbot_scanner, bbot_httpserver):
91
93
  ipaddress.ip_network("0.0.0.0/0"),
92
94
  ]
93
95
  assert helpers.is_ip("127.0.0.1")
96
+ assert helpers.is_ip("127.0.0.1", include_network=True)
97
+ assert helpers.is_ip("127.0.0.1", version=4)
98
+ assert not helpers.is_ip("127.0.0.1", version=6)
94
99
  assert not helpers.is_ip("127.0.0.0.1")
100
+
101
+ assert helpers.is_ip("dead::beef")
102
+ assert helpers.is_ip("dead::beef", include_network=True)
103
+ assert not helpers.is_ip("dead::beef", version=4)
104
+ assert helpers.is_ip("dead::beef", version=6)
105
+ assert not helpers.is_ip("dead:::beef")
106
+
107
+ assert not helpers.is_ip("1.2.3.4/24")
108
+ assert helpers.is_ip("1.2.3.4/24", include_network=True)
109
+ assert not helpers.is_ip("1.2.3.4/24", version=4)
110
+ assert helpers.is_ip("1.2.3.4/24", include_network=True, version=4)
111
+ assert not helpers.is_ip("1.2.3.4/24", include_network=True, version=6)
112
+
113
+ assert not helpers.is_ip_type("127.0.0.1")
114
+ assert helpers.is_ip_type(ipaddress.ip_address("127.0.0.1"))
115
+ assert not helpers.is_ip_type(ipaddress.ip_address("127.0.0.1"), network=True)
116
+ assert helpers.is_ip_type(ipaddress.ip_address("127.0.0.1"), network=False)
117
+ assert helpers.is_ip_type(ipaddress.ip_network("127.0.0.0/8"))
118
+ assert helpers.is_ip_type(ipaddress.ip_network("127.0.0.0/8"), network=True)
119
+ assert not helpers.is_ip_type(ipaddress.ip_network("127.0.0.0/8"), network=False)
120
+
95
121
  assert helpers.is_dns_name("evilcorp.com")
122
+ assert not helpers.is_dns_name("evilcorp.com:80")
123
+ assert not helpers.is_dns_name("http://evilcorp.com:80")
96
124
  assert helpers.is_dns_name("evilcorp")
97
125
  assert not helpers.is_dns_name("evilcorp", include_local=False)
98
126
  assert helpers.is_dns_name("ドメイン.テスト")
@@ -210,8 +238,12 @@ async def test_helpers_misc(helpers, scan, bbot_scanner, bbot_httpserver):
210
238
 
211
239
  ipv4_netloc = helpers.make_netloc("192.168.1.1", 80)
212
240
  assert ipv4_netloc == "192.168.1.1:80"
213
- ipv6_netloc = helpers.make_netloc("dead::beef", "443")
214
- assert ipv6_netloc == "[dead::beef]:443"
241
+ assert helpers.make_netloc("192.168.1.1") == "192.168.1.1"
242
+ assert helpers.make_netloc(ipaddress.ip_address("192.168.1.1"), None) == "192.168.1.1"
243
+ assert helpers.make_netloc("dead::beef", "443") == "[dead::beef]:443"
244
+ assert helpers.make_netloc(ipaddress.ip_address("dead::beef"), 443) == "[dead::beef]:443"
245
+ assert helpers.make_netloc("dead::beef", None) == "[dead::beef]"
246
+ assert helpers.make_netloc(ipaddress.ip_address("dead::beef"), None) == "[dead::beef]"
215
247
 
216
248
  assert helpers.get_file_extension("https://evilcorp.com/evilcorp.com/test/asdf.TXT") == "txt"
217
249
  assert helpers.get_file_extension("/etc/conf/test.tar.gz") == "gz"
@@ -251,7 +283,7 @@ async def test_helpers_misc(helpers, scan, bbot_scanner, bbot_httpserver):
251
283
  replaced = helpers.search_format_dict(
252
284
  {"asdf": [{"wat": {"here": "#{replaceme}!"}}, {500: True}]}, replaceme="asdf"
253
285
  )
254
- assert replaced["asdf"][1][500] == True
286
+ assert replaced["asdf"][1][500] is True
255
287
  assert replaced["asdf"][0]["wat"]["here"] == "asdf!"
256
288
 
257
289
  filtered_dict = helpers.filter_dict(
@@ -283,7 +315,7 @@ async def test_helpers_misc(helpers, scan, bbot_scanner, bbot_httpserver):
283
315
  fuzzy=True,
284
316
  exclude_keys="modules",
285
317
  )
286
- assert not "secrets_db" in filtered_dict4["modules"]
318
+ assert "secrets_db" not in filtered_dict4["modules"]
287
319
  assert "ipneighbor" in filtered_dict4["modules"]
288
320
  assert "secret" in filtered_dict4["modules"]["ipneighbor"]
289
321
  assert "asdf" not in filtered_dict4["modules"]["ipneighbor"]
@@ -376,15 +408,15 @@ async def test_helpers_misc(helpers, scan, bbot_scanner, bbot_httpserver):
376
408
  assert helpers.validators.validate_host("LOCALHOST ") == "localhost"
377
409
  assert helpers.validators.validate_host(" 192.168.1.1") == "192.168.1.1"
378
410
  assert helpers.validators.validate_host(" Dead::c0dE ") == "dead::c0de"
379
- assert helpers.validators.soft_validate(" evilCorp.COM", "host") == True
380
- assert helpers.validators.soft_validate("!@#$", "host") == False
411
+ assert helpers.validators.soft_validate(" evilCorp.COM", "host") is True
412
+ assert helpers.validators.soft_validate("!@#$", "host") is False
381
413
  with pytest.raises(ValueError):
382
414
  assert helpers.validators.validate_host("!@#$")
383
415
  # ports
384
416
  assert helpers.validators.validate_port(666) == 666
385
417
  assert helpers.validators.validate_port(666666) == 65535
386
- assert helpers.validators.soft_validate(666, "port") == True
387
- assert helpers.validators.soft_validate("!@#$", "port") == False
418
+ assert helpers.validators.soft_validate(666, "port") is True
419
+ assert helpers.validators.soft_validate("!@#$", "port") is False
388
420
  with pytest.raises(ValueError):
389
421
  helpers.validators.validate_port("asdf")
390
422
  # top tcp ports
@@ -396,7 +428,7 @@ async def test_helpers_misc(helpers, scan, bbot_scanner, bbot_httpserver):
396
428
  assert top_tcp_ports[-10:] == [65526, 65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534, 65535]
397
429
  assert len(top_tcp_ports) == 65535
398
430
  assert len(set(top_tcp_ports)) == 65535
399
- assert all([isinstance(i, int) for i in top_tcp_ports])
431
+ assert all(isinstance(i, int) for i in top_tcp_ports)
400
432
  top_tcp_ports = helpers.top_tcp_ports(10, as_string=True)
401
433
  assert top_tcp_ports == "80,23,443,21,22,25,3389,110,445,139"
402
434
  # urls
@@ -405,25 +437,29 @@ async def test_helpers_misc(helpers, scan, bbot_scanner, bbot_httpserver):
405
437
  helpers.validators.validate_url_parsed(" httP://evilcorP.com/asdf?a=b&c=d#e").geturl()
406
438
  == "http://evilcorp.com/asdf"
407
439
  )
408
- assert helpers.validators.soft_validate(" httP://evilcorP.com/asdf?a=b&c=d#e", "url") == True
409
- assert helpers.validators.soft_validate("!@#$", "url") == False
440
+ assert helpers.validators.soft_validate(" httP://evilcorP.com/asdf?a=b&c=d#e", "url") is True
441
+ assert helpers.validators.soft_validate("!@#$", "url") is False
410
442
  with pytest.raises(ValueError):
411
443
  helpers.validators.validate_url("!@#$")
412
444
  # severities
413
445
  assert helpers.validators.validate_severity(" iNfo") == "INFO"
414
- assert helpers.validators.soft_validate(" iNfo", "severity") == True
415
- assert helpers.validators.soft_validate("NOPE", "severity") == False
446
+ assert helpers.validators.soft_validate(" iNfo", "severity") is True
447
+ assert helpers.validators.soft_validate("NOPE", "severity") is False
416
448
  with pytest.raises(ValueError):
417
449
  helpers.validators.validate_severity("NOPE")
418
450
  # emails
419
451
  assert helpers.validators.validate_email(" bOb@eViLcorp.COM") == "bob@evilcorp.com"
420
- assert helpers.validators.soft_validate(" bOb@eViLcorp.COM", "email") == True
421
- assert helpers.validators.soft_validate("!@#$", "email") == False
452
+ assert helpers.validators.soft_validate(" bOb@eViLcorp.COM", "email") is True
453
+ assert helpers.validators.soft_validate("!@#$", "email") is False
422
454
  with pytest.raises(ValueError):
423
455
  helpers.validators.validate_email("!@#$")
424
456
 
425
457
  assert type(helpers.make_date()) == str
426
458
 
459
+ # string formatter
460
+ s = "asdf {unused} {used}"
461
+ assert helpers.safe_format(s, used="fdsa") == "asdf {unused} fdsa"
462
+
427
463
  # punycode
428
464
  assert helpers.smart_encode_punycode("ドメイン.テスト") == "xn--eckwd4c7c.xn--zckzah"
429
465
  assert helpers.smart_decode_punycode("xn--eckwd4c7c.xn--zckzah") == "ドメイン.テスト"
@@ -497,9 +533,9 @@ async def test_helpers_misc(helpers, scan, bbot_scanner, bbot_httpserver):
497
533
  truncated_filename.unlink()
498
534
 
499
535
  # misc DNS helpers
500
- assert helpers.is_ptr("wsc-11-22-33-44-wat.evilcorp.com") == True
501
- assert helpers.is_ptr("wsc-11-22-33-wat.evilcorp.com") == False
502
- assert helpers.is_ptr("11wat.evilcorp.com") == False
536
+ assert helpers.is_ptr("wsc-11-22-33-44-wat.evilcorp.com") is True
537
+ assert helpers.is_ptr("wsc-11-22-33-wat.evilcorp.com") is False
538
+ assert helpers.is_ptr("11wat.evilcorp.com") is False
503
539
 
504
540
  ## NTLM
505
541
  testheader = "TlRMTVNTUAACAAAAHgAeADgAAAAVgorilwL+bvnVipUAAAAAAAAAAJgAmABWAAAACgBjRQAAAA9XAEkATgAtAFMANAAyAE4ATwBCAEQAVgBUAEsAOAACAB4AVwBJAE4ALQBTADQAMgBOAE8AQgBEAFYAVABLADgAAQAeAFcASQBOAC0AUwA0ADIATgBPAEIARABWAFQASwA4AAQAHgBXAEkATgAtAFMANAAyAE4ATwBCAEQAVgBUAEsAOAADAB4AVwBJAE4ALQBTADQAMgBOAE8AQgBEAFYAVABLADgABwAIAHUwOZlfoNgBAAAAAA=="
@@ -577,8 +613,8 @@ async def test_helpers_misc(helpers, scan, bbot_scanner, bbot_httpserver):
577
613
  assert len(helpers.get_exception_chain(e)) == 2
578
614
  assert len([_ for _ in helpers.get_exception_chain(e) if isinstance(_, KeyboardInterrupt)]) == 1
579
615
  assert len([_ for _ in helpers.get_exception_chain(e) if isinstance(_, ValueError)]) == 1
580
- assert helpers.in_exception_chain(e, (KeyboardInterrupt, asyncio.CancelledError)) == True
581
- assert helpers.in_exception_chain(e, (TypeError, OSError)) == False
616
+ assert helpers.in_exception_chain(e, (KeyboardInterrupt, asyncio.CancelledError)) is True
617
+ assert helpers.in_exception_chain(e, (TypeError, OSError)) is False
582
618
  test_ran = True
583
619
  assert test_ran
584
620
  test_ran = False
@@ -591,9 +627,9 @@ async def test_helpers_misc(helpers, scan, bbot_scanner, bbot_httpserver):
591
627
  assert len(helpers.get_exception_chain(e)) == 2
592
628
  assert len([_ for _ in helpers.get_exception_chain(e) if isinstance(_, AttributeError)]) == 1
593
629
  assert len([_ for _ in helpers.get_exception_chain(e) if isinstance(_, ValueError)]) == 1
594
- assert helpers.in_exception_chain(e, (KeyboardInterrupt, asyncio.CancelledError)) == False
595
- assert helpers.in_exception_chain(e, (KeyboardInterrupt, AttributeError)) == True
596
- assert helpers.in_exception_chain(e, (AttributeError,)) == True
630
+ assert helpers.in_exception_chain(e, (KeyboardInterrupt, asyncio.CancelledError)) is False
631
+ assert helpers.in_exception_chain(e, (KeyboardInterrupt, AttributeError)) is True
632
+ assert helpers.in_exception_chain(e, (AttributeError,)) is True
597
633
  test_ran = True
598
634
  assert test_ran
599
635
 
@@ -850,7 +886,7 @@ async def test_parameter_validation(helpers):
850
886
  if helpers.validate_parameter(p, "getparam"):
851
887
  assert p in getparam_valid_params and p not in getparam_invalid_params
852
888
  else:
853
- assert p in getparam_invalid_params and not p in getparam_valid_params
889
+ assert p in getparam_invalid_params and p not in getparam_valid_params
854
890
 
855
891
  header_valid_params = {
856
892
  "name",
@@ -881,7 +917,7 @@ async def test_parameter_validation(helpers):
881
917
  if helpers.validate_parameter(p, "header"):
882
918
  assert p in header_valid_params and p not in header_invalid_params
883
919
  else:
884
- assert p in header_invalid_params and not p in header_valid_params
920
+ assert p in header_invalid_params and p not in header_valid_params
885
921
 
886
922
  cookie_valid_params = {
887
923
  "name",
@@ -911,4 +947,4 @@ async def test_parameter_validation(helpers):
911
947
  if helpers.validate_parameter(p, "cookie"):
912
948
  assert p in cookie_valid_params and p not in cookie_invalid_params
913
949
  else:
914
- assert p in cookie_invalid_params and not p in cookie_valid_params
950
+ assert p in cookie_invalid_params and p not in cookie_valid_params
@@ -91,7 +91,7 @@ async def test_manager_deduplication(bbot_scanner):
91
91
  _dns_mock=dns_mock_chain,
92
92
  )
93
93
 
94
- assert len(events) == 21
94
+ assert len(events) == 22
95
95
  assert 1 == len([e for e in events if e.type == "DNS_NAME" and e.data == "accept_dupes.test.notreal" and str(e.module) == "accept_dupes"])
96
96
  assert 1 == len([e for e in events if e.type == "DNS_NAME" and e.data == "default_module.test.notreal" and str(e.module) == "default_module"])
97
97
  assert 1 == len([e for e in events if e.type == "DNS_NAME" and e.data == "no_suppress_dupes.test.notreal" and str(e.module) == "no_suppress_dupes" and e.parent.data == "accept_dupes.test.notreal"])