moriarty-project 0.1.6__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.
Files changed (416) hide show
  1. moriarty/__init__.py +5 -0
  2. moriarty/adapters/__init__.py +0 -0
  3. moriarty/agent/__init__.py +0 -0
  4. moriarty/assets/modules/.gitkeep +0 -0
  5. moriarty/assets/modules/asia/douban.yaml +19 -0
  6. moriarty/assets/modules/asia/kakao.yaml +19 -0
  7. moriarty/assets/modules/asia/line.yaml +19 -0
  8. moriarty/assets/modules/asia/mixi.yaml +19 -0
  9. moriarty/assets/modules/asia/naver.yaml +19 -0
  10. moriarty/assets/modules/asia/qq.yaml +19 -0
  11. moriarty/assets/modules/asia/vk.yaml +19 -0
  12. moriarty/assets/modules/asia/wechat.yaml +19 -0
  13. moriarty/assets/modules/asia/weibo.yaml +19 -0
  14. moriarty/assets/modules/asia/xiaohongshu.yaml +19 -0
  15. moriarty/assets/modules/behance.yaml +47 -0
  16. moriarty/assets/modules/business/crunchbase.yaml +27 -0
  17. moriarty/assets/modules/business/fiverr.yaml +32 -0
  18. moriarty/assets/modules/business/freelancer.yaml +27 -0
  19. moriarty/assets/modules/business/glassdoor.yaml +27 -0
  20. moriarty/assets/modules/business/guru.yaml +26 -0
  21. moriarty/assets/modules/business/indeed.yaml +25 -0
  22. moriarty/assets/modules/business/monster.yaml +25 -0
  23. moriarty/assets/modules/business/peopleperhour.yaml +26 -0
  24. moriarty/assets/modules/business/toptal.yaml +28 -0
  25. moriarty/assets/modules/business/upwork.yaml +27 -0
  26. moriarty/assets/modules/business/ziprecruiter.yaml +25 -0
  27. moriarty/assets/modules/content/buymeacoffee.yaml +27 -0
  28. moriarty/assets/modules/content/gumroad.yaml +27 -0
  29. moriarty/assets/modules/content/ko-fi.yaml +32 -0
  30. moriarty/assets/modules/content/onlyfans.yaml +27 -0
  31. moriarty/assets/modules/content/patreon.yaml +33 -0
  32. moriarty/assets/modules/content/substack.yaml +32 -0
  33. moriarty/assets/modules/creative/500px.yaml +31 -0
  34. moriarty/assets/modules/creative/artstation.yaml +33 -0
  35. moriarty/assets/modules/creative/deviantart.yaml +32 -0
  36. moriarty/assets/modules/creative/flickr.yaml +31 -0
  37. moriarty/assets/modules/creative/pexels.yaml +26 -0
  38. moriarty/assets/modules/creative/unsplash.yaml +26 -0
  39. moriarty/assets/modules/creative/vimeo.yaml +31 -0
  40. moriarty/assets/modules/crypto/binance.yaml +27 -0
  41. moriarty/assets/modules/crypto/bitcointalk.yaml +33 -0
  42. moriarty/assets/modules/crypto/coinbase.yaml +26 -0
  43. moriarty/assets/modules/crypto/etherscan.yaml +32 -0
  44. moriarty/assets/modules/crypto/foundation.yaml +28 -0
  45. moriarty/assets/modules/crypto/kraken.yaml +27 -0
  46. moriarty/assets/modules/crypto/mirror.yaml +27 -0
  47. moriarty/assets/modules/crypto/niftygateway.yaml +26 -0
  48. moriarty/assets/modules/crypto/opensea.yaml +32 -0
  49. moriarty/assets/modules/crypto/rarible.yaml +27 -0
  50. moriarty/assets/modules/crypto/superrare.yaml +29 -0
  51. moriarty/assets/modules/dating/bumble.yaml +25 -0
  52. moriarty/assets/modules/dating/grindr.yaml +27 -0
  53. moriarty/assets/modules/dating/happn.yaml +25 -0
  54. moriarty/assets/modules/dating/her.yaml +27 -0
  55. moriarty/assets/modules/dating/hinge.yaml +25 -0
  56. moriarty/assets/modules/dating/match.yaml +25 -0
  57. moriarty/assets/modules/dating/meetme.yaml +27 -0
  58. moriarty/assets/modules/dating/okcupid.yaml +25 -0
  59. moriarty/assets/modules/dating/pof.yaml +25 -0
  60. moriarty/assets/modules/dating/tinder.yaml +25 -0
  61. moriarty/assets/modules/dating-nsfw/adultfriendfinder.yaml +28 -0
  62. moriarty/assets/modules/dating-nsfw/ashley-madison.yaml +26 -0
  63. moriarty/assets/modules/design/adobe-portfolio.yaml +27 -0
  64. moriarty/assets/modules/design/carbonmade.yaml +27 -0
  65. moriarty/assets/modules/design/cgsociety.yaml +27 -0
  66. moriarty/assets/modules/design/coroflot.yaml +27 -0
  67. moriarty/assets/modules/design/figma.yaml +27 -0
  68. moriarty/assets/modules/design/sketch.yaml +26 -0
  69. moriarty/assets/modules/dev/bitbucket.yaml +35 -0
  70. moriarty/assets/modules/dev/codeforces.yaml +32 -0
  71. moriarty/assets/modules/dev/codepen.yaml +34 -0
  72. moriarty/assets/modules/dev/hackerone.yaml +32 -0
  73. moriarty/assets/modules/dev/hackthebox.yaml +27 -0
  74. moriarty/assets/modules/dev/huggingface.yaml +27 -0
  75. moriarty/assets/modules/dev/kaggle.yaml +32 -0
  76. moriarty/assets/modules/dev/leetcode.yaml +32 -0
  77. moriarty/assets/modules/dev/replit.yaml +31 -0
  78. moriarty/assets/modules/dribbble.yaml +53 -0
  79. moriarty/assets/modules/ecommerce/etsy.yaml +32 -0
  80. moriarty/assets/modules/education/duolingo.yaml +32 -0
  81. moriarty/assets/modules/education/edx.yaml +26 -0
  82. moriarty/assets/modules/education/khanacademy.yaml +26 -0
  83. moriarty/assets/modules/education/lynda.yaml +27 -0
  84. moriarty/assets/modules/education/memrise.yaml +27 -0
  85. moriarty/assets/modules/education/pluralsight.yaml +27 -0
  86. moriarty/assets/modules/education/skillshare.yaml +27 -0
  87. moriarty/assets/modules/education/udacity.yaml +27 -0
  88. moriarty/assets/modules/email/github_email.yaml +40 -0
  89. moriarty/assets/modules/email/gravatar.yaml +23 -0
  90. moriarty/assets/modules/europe/badoo.yaml +19 -0
  91. moriarty/assets/modules/europe/lovoo.yaml +19 -0
  92. moriarty/assets/modules/europe/myspace.yaml +19 -0
  93. moriarty/assets/modules/europe/netlog.yaml +19 -0
  94. moriarty/assets/modules/europe/ok.yaml +19 -0
  95. moriarty/assets/modules/europe/skyrock.yaml +19 -0
  96. moriarty/assets/modules/europe/studivz.yaml +19 -0
  97. moriarty/assets/modules/europe/tuenti.yaml +19 -0
  98. moriarty/assets/modules/europe/viadeo.yaml +19 -0
  99. moriarty/assets/modules/europe/xing.yaml +19 -0
  100. moriarty/assets/modules/fitness/fitbit.yaml +27 -0
  101. moriarty/assets/modules/fitness/garmin.yaml +27 -0
  102. moriarty/assets/modules/fitness/myfitnesspal.yaml +27 -0
  103. moriarty/assets/modules/fitness/strava.yaml +33 -0
  104. moriarty/assets/modules/fitness/zwift.yaml +28 -0
  105. moriarty/assets/modules/food/allrecipes.yaml +27 -0
  106. moriarty/assets/modules/food/tasty.yaml +27 -0
  107. moriarty/assets/modules/food/yelp.yaml +32 -0
  108. moriarty/assets/modules/food/zomato.yaml +28 -0
  109. moriarty/assets/modules/forums/4chan.yaml +26 -0
  110. moriarty/assets/modules/forums/8kun.yaml +26 -0
  111. moriarty/assets/modules/forums/9gag.yaml +26 -0
  112. moriarty/assets/modules/forums/discourse.yaml +26 -0
  113. moriarty/assets/modules/forums/disqus.yaml +31 -0
  114. moriarty/assets/modules/forums/hackernews.yaml +32 -0
  115. moriarty/assets/modules/forums/launchpad.yaml +27 -0
  116. moriarty/assets/modules/forums/phpbb.yaml +25 -0
  117. moriarty/assets/modules/forums/quora.yaml +32 -0
  118. moriarty/assets/modules/forums/serverfault.yaml +27 -0
  119. moriarty/assets/modules/forums/slashdot.yaml +28 -0
  120. moriarty/assets/modules/forums/stackexchange.yaml +32 -0
  121. moriarty/assets/modules/forums/superuser.yaml +27 -0
  122. moriarty/assets/modules/forums/vbulletin.yaml +25 -0
  123. moriarty/assets/modules/forums/xenforo.yaml +25 -0
  124. moriarty/assets/modules/forums-nsfw/kiwifarms.yaml +25 -0
  125. moriarty/assets/modules/forums-nsfw/lolcow.yaml +26 -0
  126. moriarty/assets/modules/gaming/apextracker.yaml +27 -0
  127. moriarty/assets/modules/gaming/battlenet.yaml +26 -0
  128. moriarty/assets/modules/gaming/chess.yaml +30 -0
  129. moriarty/assets/modules/gaming/discord-public.yaml +27 -0
  130. moriarty/assets/modules/gaming/dotabuff.yaml +32 -0
  131. moriarty/assets/modules/gaming/epicgames.yaml +25 -0
  132. moriarty/assets/modules/gaming/faceit.yaml +33 -0
  133. moriarty/assets/modules/gaming/fortnitetracker.yaml +32 -0
  134. moriarty/assets/modules/gaming/gog.yaml +26 -0
  135. moriarty/assets/modules/gaming/itch.yaml +32 -0
  136. moriarty/assets/modules/gaming/kongregate.yaml +25 -0
  137. moriarty/assets/modules/gaming/minecraft.yaml +31 -0
  138. moriarty/assets/modules/gaming/opgg.yaml +32 -0
  139. moriarty/assets/modules/gaming/origin.yaml +26 -0
  140. moriarty/assets/modules/gaming/playstation.yaml +30 -0
  141. moriarty/assets/modules/gaming/roblox.yaml +31 -0
  142. moriarty/assets/modules/gaming/xbox.yaml +25 -0
  143. moriarty/assets/modules/github.yaml +68 -0
  144. moriarty/assets/modules/gitlab.yaml +60 -0
  145. moriarty/assets/modules/instagram.yaml +48 -0
  146. moriarty/assets/modules/latam/fotolog.yaml +27 -0
  147. moriarty/assets/modules/latam/orkut.yaml +26 -0
  148. moriarty/assets/modules/latam/taringa.yaml +27 -0
  149. moriarty/assets/modules/learning/coursera.yaml +26 -0
  150. moriarty/assets/modules/learning/udemy.yaml +26 -0
  151. moriarty/assets/modules/linkedin.yaml +40 -0
  152. moriarty/assets/modules/marketplaces/depop.yaml +28 -0
  153. moriarty/assets/modules/marketplaces/ebay.yaml +32 -0
  154. moriarty/assets/modules/marketplaces/grailed.yaml +27 -0
  155. moriarty/assets/modules/marketplaces/mercari.yaml +26 -0
  156. moriarty/assets/modules/marketplaces/poshmark.yaml +27 -0
  157. moriarty/assets/modules/marketplaces/reverb.yaml +27 -0
  158. moriarty/assets/modules/marketplaces/vinted.yaml +28 -0
  159. moriarty/assets/modules/medium.yaml +44 -0
  160. moriarty/assets/modules/music/audiomack.yaml +26 -0
  161. moriarty/assets/modules/music/bandcamp.yaml +30 -0
  162. moriarty/assets/modules/music/beatport.yaml +28 -0
  163. moriarty/assets/modules/music/deezer.yaml +26 -0
  164. moriarty/assets/modules/music/discogs.yaml +32 -0
  165. moriarty/assets/modules/music/genius.yaml +26 -0
  166. moriarty/assets/modules/music/lastfm.yaml +30 -0
  167. moriarty/assets/modules/music/mixcloud.yaml +26 -0
  168. moriarty/assets/modules/music/reverbnation.yaml +31 -0
  169. moriarty/assets/modules/music/soundcloud.yaml +31 -0
  170. moriarty/assets/modules/music/spotify.yaml +26 -0
  171. moriarty/assets/modules/music/tidal.yaml +26 -0
  172. moriarty/assets/modules/nsfw/adultwork.yaml +27 -0
  173. moriarty/assets/modules/nsfw/bongacams.yaml +28 -0
  174. moriarty/assets/modules/nsfw/cam4.yaml +28 -0
  175. moriarty/assets/modules/nsfw/chaturbate.yaml +28 -0
  176. moriarty/assets/modules/nsfw/clips4sale.yaml +27 -0
  177. moriarty/assets/modules/nsfw/extralunchmoney.yaml +27 -0
  178. moriarty/assets/modules/nsfw/fansly.yaml +28 -0
  179. moriarty/assets/modules/nsfw/fetlife.yaml +28 -0
  180. moriarty/assets/modules/nsfw/iwantclips.yaml +27 -0
  181. moriarty/assets/modules/nsfw/justforfans.yaml +28 -0
  182. moriarty/assets/modules/nsfw/loyalfans.yaml +28 -0
  183. moriarty/assets/modules/nsfw/manyvids.yaml +27 -0
  184. moriarty/assets/modules/nsfw/myfreecams.yaml +28 -0
  185. moriarty/assets/modules/nsfw/niteflirt.yaml +26 -0
  186. moriarty/assets/modules/nsfw/pornhub.yaml +32 -0
  187. moriarty/assets/modules/nsfw/redtube.yaml +27 -0
  188. moriarty/assets/modules/nsfw/stripchat.yaml +28 -0
  189. moriarty/assets/modules/nsfw/xhamster.yaml +27 -0
  190. moriarty/assets/modules/nsfw/xvideos.yaml +27 -0
  191. moriarty/assets/modules/nsfw/youporn.yaml +27 -0
  192. moriarty/assets/modules/photography/eyeem.yaml +25 -0
  193. moriarty/assets/modules/photography/fotki.yaml +25 -0
  194. moriarty/assets/modules/photography/photobucket.yaml +26 -0
  195. moriarty/assets/modules/photography/smugmug.yaml +25 -0
  196. moriarty/assets/modules/photography/vsco.yaml +27 -0
  197. moriarty/assets/modules/pinterest.yaml +40 -0
  198. moriarty/assets/modules/podcasts/anchor.yaml +26 -0
  199. moriarty/assets/modules/podcasts/castbox.yaml +26 -0
  200. moriarty/assets/modules/podcasts/podbean.yaml +26 -0
  201. moriarty/assets/modules/professional/about.yaml +31 -0
  202. moriarty/assets/modules/professional/academia.yaml +27 -0
  203. moriarty/assets/modules/professional/angellist.yaml +27 -0
  204. moriarty/assets/modules/professional/calendly.yaml +26 -0
  205. moriarty/assets/modules/professional/issuu.yaml +27 -0
  206. moriarty/assets/modules/professional/mendeley.yaml +27 -0
  207. moriarty/assets/modules/professional/notion.yaml +27 -0
  208. moriarty/assets/modules/professional/orcid.yaml +27 -0
  209. moriarty/assets/modules/professional/producthunt.yaml +31 -0
  210. moriarty/assets/modules/professional/researchgate.yaml +32 -0
  211. moriarty/assets/modules/professional/scribd.yaml +27 -0
  212. moriarty/assets/modules/professional/slideshare.yaml +31 -0
  213. moriarty/assets/modules/professional/trello.yaml +26 -0
  214. moriarty/assets/modules/professional/typeform.yaml +27 -0
  215. moriarty/assets/modules/reddit.yaml +46 -0
  216. moriarty/assets/modules/regional/amino.yaml +27 -0
  217. moriarty/assets/modules/regional/ask-fm.yaml +32 -0
  218. moriarty/assets/modules/regional/babycenter.yaml +26 -0
  219. moriarty/assets/modules/regional/cafemom.yaml +27 -0
  220. moriarty/assets/modules/regional/care2.yaml +27 -0
  221. moriarty/assets/modules/regional/diaspora.yaml +26 -0
  222. moriarty/assets/modules/regional/ello.yaml +27 -0
  223. moriarty/assets/modules/regional/gaia.yaml +27 -0
  224. moriarty/assets/modules/regional/habbo.yaml +27 -0
  225. moriarty/assets/modules/regional/imvu.yaml +27 -0
  226. moriarty/assets/modules/regional/lemmy.yaml +27 -0
  227. moriarty/assets/modules/regional/peertube.yaml +26 -0
  228. moriarty/assets/modules/regional/pixelfed.yaml +27 -0
  229. moriarty/assets/modules/regional/plurk.yaml +26 -0
  230. moriarty/assets/modules/regional/recroom.yaml +27 -0
  231. moriarty/assets/modules/regional/secondlife.yaml +26 -0
  232. moriarty/assets/modules/regional/vine-archive.yaml +27 -0
  233. moriarty/assets/modules/regional/vrchat.yaml +27 -0
  234. moriarty/assets/modules/regional/weheartit.yaml +27 -0
  235. moriarty/assets/modules/social/anilist.yaml +27 -0
  236. moriarty/assets/modules/social/beacons.yaml +26 -0
  237. moriarty/assets/modules/social/blogger.yaml +27 -0
  238. moriarty/assets/modules/social/crunchyroll.yaml +27 -0
  239. moriarty/assets/modules/social/discord.yaml +27 -0
  240. moriarty/assets/modules/social/dreamwidth.yaml +26 -0
  241. moriarty/assets/modules/social/facebook.yaml +34 -0
  242. moriarty/assets/modules/social/goodreads.yaml +32 -0
  243. moriarty/assets/modules/social/imdb.yaml +27 -0
  244. moriarty/assets/modules/social/kitsu.yaml +27 -0
  245. moriarty/assets/modules/social/letterboxd.yaml +32 -0
  246. moriarty/assets/modules/social/linktree.yaml +26 -0
  247. moriarty/assets/modules/social/livejournal.yaml +27 -0
  248. moriarty/assets/modules/social/mastodon.yaml +30 -0
  249. moriarty/assets/modules/social/minds.yaml +25 -0
  250. moriarty/assets/modules/social/myanimelist.yaml +32 -0
  251. moriarty/assets/modules/social/ravelry.yaml +27 -0
  252. moriarty/assets/modules/social/snapchat.yaml +25 -0
  253. moriarty/assets/modules/social/telegram.yaml +35 -0
  254. moriarty/assets/modules/social/tiktok.yaml +35 -0
  255. moriarty/assets/modules/social/trakt.yaml +28 -0
  256. moriarty/assets/modules/social/wattpad.yaml +32 -0
  257. moriarty/assets/modules/social/wordpress-com.yaml +26 -0
  258. moriarty/assets/modules/sports/espn.yaml +26 -0
  259. moriarty/assets/modules/sports/untappd.yaml +32 -0
  260. moriarty/assets/modules/stackoverflow.yaml +47 -0
  261. moriarty/assets/modules/steam.yaml +47 -0
  262. moriarty/assets/modules/streaming/caffeine.yaml +25 -0
  263. moriarty/assets/modules/streaming/dlive.yaml +27 -0
  264. moriarty/assets/modules/streaming/trovo.yaml +25 -0
  265. moriarty/assets/modules/travel/airbnb.yaml +26 -0
  266. moriarty/assets/modules/travel/booking.yaml +26 -0
  267. moriarty/assets/modules/travel/couchsurfing.yaml +27 -0
  268. moriarty/assets/modules/travel/tripadvisor.yaml +32 -0
  269. moriarty/assets/modules/tumblr.yaml +40 -0
  270. moriarty/assets/modules/twitch.yaml +48 -0
  271. moriarty/assets/modules/twitter.yaml +39 -0
  272. moriarty/assets/modules/youtube.yaml +42 -0
  273. moriarty/assets/templates/cves/CVE-2017-5638.yaml +27 -0
  274. moriarty/assets/templates/cves/CVE-2018-7600.yaml +30 -0
  275. moriarty/assets/templates/cves/CVE-2019-11510.yaml +27 -0
  276. moriarty/assets/templates/cves/CVE-2019-19781.yaml +28 -0
  277. moriarty/assets/templates/cves/CVE-2020-14882.yaml +28 -0
  278. moriarty/assets/templates/cves/CVE-2020-14883.yaml +29 -0
  279. moriarty/assets/templates/cves/CVE-2020-3452.yaml +28 -0
  280. moriarty/assets/templates/cves/CVE-2020-5902.yaml +28 -0
  281. moriarty/assets/templates/cves/CVE-2021-21972.yaml +31 -0
  282. moriarty/assets/templates/cves/CVE-2021-21985.yaml +28 -0
  283. moriarty/assets/templates/cves/CVE-2021-26084.yaml +30 -0
  284. moriarty/assets/templates/cves/CVE-2021-41773.yaml +25 -0
  285. moriarty/assets/templates/cves/CVE-2021-42013.yaml +28 -0
  286. moriarty/assets/templates/cves/CVE-2021-44228.yaml +27 -0
  287. moriarty/assets/templates/cves/CVE-2022-0185.yaml +21 -0
  288. moriarty/assets/templates/cves/CVE-2022-1388.yaml +36 -0
  289. moriarty/assets/templates/cves/CVE-2022-22954.yaml +28 -0
  290. moriarty/assets/templates/cves/CVE-2022-22965.yaml +31 -0
  291. moriarty/assets/templates/cves/CVE-2022-26134.yaml +27 -0
  292. moriarty/assets/templates/cves/CVE-2023-22515.yaml +27 -0
  293. moriarty/assets/templates/cves/CVE-2023-22527.yaml +29 -0
  294. moriarty/assets/templates/cves/CVE-2023-23752.yaml +33 -0
  295. moriarty/assets/templates/cves/CVE-2023-27350.yaml +27 -0
  296. moriarty/assets/templates/cves/CVE-2023-2868.yaml +27 -0
  297. moriarty/assets/templates/cves/CVE-2023-34362.yaml +27 -0
  298. moriarty/assets/templates/cves/CVE-2023-3519.yaml +28 -0
  299. moriarty/assets/templates/cves/CVE-2023-4966.yaml +27 -0
  300. moriarty/assets/templates/default-logins/admin-weak.yaml +40 -0
  301. moriarty/assets/templates/default-logins/wordpress-default.yaml +38 -0
  302. moriarty/assets/templates/exposures/aws-credentials.yaml +35 -0
  303. moriarty/assets/templates/exposures/backup-files.yaml +36 -0
  304. moriarty/assets/templates/exposures/database-files.yaml +34 -0
  305. moriarty/assets/templates/exposures/docker-exposed.yaml +31 -0
  306. moriarty/assets/templates/exposures/env-exposed.yaml +41 -0
  307. moriarty/assets/templates/exposures/git-exposed.yaml +41 -0
  308. moriarty/assets/templates/exposures/phpinfo.yaml +36 -0
  309. moriarty/assets/templates/exposures/svn-exposed.yaml +28 -0
  310. moriarty/assets/templates/fuzzing/api-endpoints.yaml +39 -0
  311. moriarty/assets/templates/fuzzing/common-files.yaml +37 -0
  312. moriarty/assets/templates/fuzzing/open-redirect-fuzz.yaml +35 -0
  313. moriarty/assets/templates/fuzzing/xss-search-fuzz.yaml +29 -0
  314. moriarty/assets/templates/git-config.yaml +18 -0
  315. moriarty/assets/templates/misconfigurations/cors-misconfiguration.yaml +30 -0
  316. moriarty/assets/templates/misconfigurations/debug-enabled.yaml +29 -0
  317. moriarty/assets/templates/misconfigurations/directory-listing.yaml +33 -0
  318. moriarty/assets/templates/misconfigurations/jwt-none-algo.yaml +30 -0
  319. moriarty/assets/templates/misconfigurations/ssl-tls-weak.yaml +23 -0
  320. moriarty/assets/templates/vulnerabilities/lfi-basic.yaml +31 -0
  321. moriarty/assets/templates/vulnerabilities/open-redirect.yaml +31 -0
  322. moriarty/assets/templates/vulnerabilities/rce-basic.yaml +34 -0
  323. moriarty/assets/templates/vulnerabilities/sqli-error.yaml +39 -0
  324. moriarty/assets/templates/vulnerabilities/ssrf-basic.yaml +31 -0
  325. moriarty/assets/templates/vulnerabilities/xss-reflected.yaml +38 -0
  326. moriarty/assets/templates/vulnerabilities/xxe-basic.yaml +30 -0
  327. moriarty/assets/wordlists/subdomains-1000.txt +1063 -0
  328. moriarty/cli/__init__.py +3 -0
  329. moriarty/cli/app.py +120 -0
  330. moriarty/cli/async_utils.py +19 -0
  331. moriarty/cli/dns.py +83 -0
  332. moriarty/cli/domain_cmd.py +572 -0
  333. moriarty/cli/email.py +383 -0
  334. moriarty/cli/email_investigate.py +224 -0
  335. moriarty/cli/intelligence.py +329 -0
  336. moriarty/cli/output.py +62 -0
  337. moriarty/cli/rdap.py +94 -0
  338. moriarty/cli/state.py +38 -0
  339. moriarty/cli/tls.py +91 -0
  340. moriarty/cli/user.py +227 -0
  341. moriarty/core/cache_backend.py +223 -0
  342. moriarty/core/config_manager.py +303 -0
  343. moriarty/correlator/__init__.py +0 -0
  344. moriarty/data/__init__.py +81 -0
  345. moriarty/data/ioc/__init__.py +142 -0
  346. moriarty/data/ioc/matcher.py +254 -0
  347. moriarty/data/ioc/types.py +267 -0
  348. moriarty/data/local_intelligence.py +507 -0
  349. moriarty/data/signature_loaders/__init__.py +103 -0
  350. moriarty/data/signature_loaders/base.py +54 -0
  351. moriarty/data/signature_loaders/ioc_feed.py +356 -0
  352. moriarty/data/signature_loaders/wappalyzer.py +112 -0
  353. moriarty/dsl/__init__.py +0 -0
  354. moriarty/dsl/loader.py +99 -0
  355. moriarty/dsl/schema.py +47 -0
  356. moriarty/export/__init__.py +0 -0
  357. moriarty/intelligence/__init__.py +27 -0
  358. moriarty/intelligence/__main__.py +150 -0
  359. moriarty/intelligence/config.py +395 -0
  360. moriarty/intelligence/ioc.py +267 -0
  361. moriarty/intelligence/signatures.py +550 -0
  362. moriarty/intelligence/storage.py +501 -0
  363. moriarty/interop/__init__.py +0 -0
  364. moriarty/logging/__init__.py +0 -0
  365. moriarty/logging/config.py +47 -0
  366. moriarty/models/__init__.py +16 -0
  367. moriarty/models/assertion.py +24 -0
  368. moriarty/models/entity.py +22 -0
  369. moriarty/models/evidence.py +37 -0
  370. moriarty/models/relation.py +24 -0
  371. moriarty/models/types.py +28 -0
  372. moriarty/modules/__init__.py +0 -0
  373. moriarty/modules/avatar_hash.py +184 -0
  374. moriarty/modules/directory_fuzzer.py +322 -0
  375. moriarty/modules/dns_scan.py +40 -0
  376. moriarty/modules/domain_scanner.py +620 -0
  377. moriarty/modules/email_check.py +98 -0
  378. moriarty/modules/email_investigate.py +267 -0
  379. moriarty/modules/email_security.py +274 -0
  380. moriarty/modules/googlemaps_lookup.py +106 -0
  381. moriarty/modules/headless_executor.py +201 -0
  382. moriarty/modules/orchestrator.py +60 -0
  383. moriarty/modules/passive_recon.py +444 -0
  384. moriarty/modules/phone_extractor.py +151 -0
  385. moriarty/modules/pipeline_orchestrator.py +726 -0
  386. moriarty/modules/port_scanner.py +129 -0
  387. moriarty/modules/rdap.py +61 -0
  388. moriarty/modules/rdap_extended.py +188 -0
  389. moriarty/modules/stealth_mode.py +610 -0
  390. moriarty/modules/subdomain_discovery.py +595 -0
  391. moriarty/modules/technology_profiler.py +361 -0
  392. moriarty/modules/template_executor.py +239 -0
  393. moriarty/modules/template_scanner.py +1048 -0
  394. moriarty/modules/tls_scan.py +46 -0
  395. moriarty/modules/tls_validator.py +188 -0
  396. moriarty/modules/vuln_scanner.py +483 -0
  397. moriarty/modules/waf_detector.py +585 -0
  398. moriarty/modules/wayback_discovery.py +234 -0
  399. moriarty/modules/web_crawler.py +163 -0
  400. moriarty/net/__init__.py +0 -0
  401. moriarty/net/dns_cache.py +175 -0
  402. moriarty/net/dns_client.py +188 -0
  403. moriarty/net/rdap_client.py +52 -0
  404. moriarty/net/smtp_client.py +114 -0
  405. moriarty/net/tls_client.py +111 -0
  406. moriarty/parsers/__init__.py +0 -0
  407. moriarty/parsers/html_parser.py +136 -0
  408. moriarty/tests/__init__.py +0 -0
  409. moriarty/tests/test_email_service.py +17 -0
  410. moriarty/tests/test_models.py +46 -0
  411. moriarty/tests/test_orchestrator.py +30 -0
  412. moriarty/tests/test_tls_client.py +18 -0
  413. moriarty_project-0.1.6.dist-info/METADATA +388 -0
  414. moriarty_project-0.1.6.dist-info/RECORD +418 -0
  415. moriarty_project-0.1.6.dist-info/WHEEL +4 -0
  416. moriarty_project-0.1.6.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,610 @@
1
+ """Stealth Mode - Sistema completo de evasão para scanning."""
2
+ import asyncio
3
+ import random
4
+ import ssl
5
+ import time
6
+ from dataclasses import dataclass
7
+ from datetime import datetime, timedelta
8
+ from typing import Dict, List, Optional
9
+
10
+ import httpx
11
+ import structlog
12
+ from urllib.parse import urlparse
13
+ from rich.console import Console
14
+ from rich.table import Table
15
+
16
+ logger = structlog.get_logger(__name__)
17
+ console = Console()
18
+
19
+
20
+ @dataclass
21
+ class StealthConfig:
22
+ """Configuração do Stealth Mode."""
23
+ level: int
24
+ user_agent_rotation: bool
25
+ header_randomization: bool
26
+ timing_randomization: bool
27
+ proxy_rotation: bool
28
+ packet_fragmentation: bool
29
+ decoy_traffic: bool
30
+ encoding_layers: int
31
+ session_management: bool
32
+ anti_forensics: bool
33
+ tls_fingerprint_randomization: bool
34
+ tcp_stack_spoofing: bool
35
+ tor_support: bool
36
+ i2p_support: bool
37
+
38
+
39
+ @dataclass
40
+ class ProxyState:
41
+ """Estado de saúde de um proxy."""
42
+
43
+ url: str
44
+ healthy: bool = True
45
+ last_checked: float = 0.0
46
+ latency: float = 0.0
47
+ failures: int = 0
48
+
49
+
50
+ class StealthMode:
51
+ """
52
+ Sistema de Stealth Mode com 5 níveis de evasão.
53
+
54
+ Níveis:
55
+ 0 - Disabled: Sem stealth
56
+ 1 - Low: Randomização básica
57
+ 2 - Medium: Proxies + timing
58
+ 3 - High: Fragmentação + adaptativo
59
+ 4 - Paranoid: Todas técnicas + decoys
60
+ """
61
+
62
+ # 50+ User Agents
63
+ USER_AGENTS = [
64
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
65
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
66
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
67
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0",
68
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15",
69
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Edge/120.0.0.0",
70
+ "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0",
71
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1",
72
+ "Mozilla/5.0 (iPad; CPU OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1",
73
+ "Mozilla/5.0 (Android 14; Mobile; rv:121.0) Gecko/121.0 Firefox/121.0",
74
+ ]
75
+
76
+ # Headers dinâmicos
77
+ DYNAMIC_HEADERS = {
78
+ "Accept": [
79
+ "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
80
+ "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
81
+ "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
82
+ ],
83
+ "Accept-Language": [
84
+ "en-US,en;q=0.9",
85
+ "en-GB,en;q=0.9",
86
+ "pt-BR,pt;q=0.9,en;q=0.8",
87
+ ],
88
+ "Accept-Encoding": [
89
+ "gzip, deflate, br",
90
+ "gzip, deflate",
91
+ ],
92
+ "DNT": ["1", "0"],
93
+ "Connection": ["keep-alive", "close"],
94
+ "Upgrade-Insecure-Requests": ["1"],
95
+ }
96
+
97
+ def __init__(self, level: int = 2, healthcheck_url: str = "https://example.com"):
98
+ self.level = level
99
+ self.config = self._build_config()
100
+ self.proxies: List[str] = []
101
+ self._current_proxy_index = 0
102
+ self.proxy_states: Dict[str, ProxyState] = {}
103
+ self.healthcheck_url = healthcheck_url
104
+ self.proxy_health_interval = 300 # seconds
105
+ self.max_proxy_failures = 3
106
+ self._last_health_sweep: float = 0.0
107
+
108
+ try:
109
+ from moriarty.core.config_manager import config_manager
110
+
111
+ self.config_manager = config_manager
112
+ except Exception:
113
+ self.config_manager = None
114
+
115
+ self._load_configured_proxies()
116
+
117
+ def _build_config(self) -> StealthConfig:
118
+ """Constrói configuração baseada no nível."""
119
+ return StealthConfig(
120
+ level=self.level,
121
+ user_agent_rotation=self.level >= 1,
122
+ header_randomization=self.level >= 1,
123
+ timing_randomization=self.level >= 2,
124
+ proxy_rotation=self.level >= 2,
125
+ packet_fragmentation=self.level >= 3,
126
+ decoy_traffic=self.level >= 4,
127
+ encoding_layers=min(self.level, 3),
128
+ session_management=self.level >= 3,
129
+ anti_forensics=self.level >= 4,
130
+ tls_fingerprint_randomization=self.level >= 3,
131
+ tcp_stack_spoofing=self.level >= 3,
132
+ tor_support=self.level >= 2,
133
+ i2p_support=self.level >= 4,
134
+ )
135
+
136
+ def _load_configured_proxies(self):
137
+ """Carrega proxies configurados via config manager ou arquivo padrão."""
138
+ if not self.config_manager:
139
+ return
140
+
141
+ proxy_config = getattr(self.config_manager, "proxies", None)
142
+ if not proxy_config:
143
+ return
144
+
145
+ for proxy in proxy_config.http_proxies or []:
146
+ self._register_proxy(proxy)
147
+
148
+ for proxy in proxy_config.socks_proxies or []:
149
+ self._register_proxy(proxy)
150
+
151
+ if (proxy_config.tor_enabled or self.config.tor_support) and proxy_config.tor_port:
152
+ tor_proxy = f"socks5://127.0.0.1:{proxy_config.tor_port}"
153
+ self._register_proxy(tor_proxy)
154
+
155
+ if (proxy_config.i2p_enabled or self.config.i2p_support) and proxy_config.i2p_port:
156
+ i2p_proxy = f"http://127.0.0.1:{proxy_config.i2p_port}"
157
+ self._register_proxy(i2p_proxy)
158
+
159
+ if self.proxies:
160
+ logger.info("stealth.proxies.loaded", count=len(self.proxies))
161
+
162
+ def _register_proxy(self, proxy: str):
163
+ """Registra proxy na rotação com estado inicial saudável."""
164
+ if not proxy:
165
+ return
166
+
167
+ if proxy not in self.proxies:
168
+ self.proxies.append(proxy)
169
+ self.proxy_states.setdefault(proxy, ProxyState(url=proxy))
170
+
171
+ def get_random_headers(self) -> dict:
172
+ """Retorna headers randomizados."""
173
+ headers = {}
174
+
175
+ if self.config.user_agent_rotation:
176
+ headers["User-Agent"] = random.choice(self.USER_AGENTS)
177
+
178
+ if self.config.header_randomization:
179
+ for key, values in self.DYNAMIC_HEADERS.items():
180
+ headers[key] = random.choice(values)
181
+
182
+ if self.config.tls_fingerprint_randomization:
183
+ sec_ch_templates = [
184
+ '"Chromium";v="123", "Not=A?Brand";v="8", "Google Chrome";v="123"',
185
+ '"Chromium";v="120", "Not)A(Brand";v="24", "Microsoft Edge";v="120"',
186
+ '"Google Chrome";v="122", "Chromium";v="122", ";Not A Brand";v="99"',
187
+ ]
188
+ headers["Sec-CH-UA"] = random.choice(sec_ch_templates)
189
+ headers["Sec-CH-UA-Mobile"] = random.choice(["?0", "?1"])
190
+ headers["Sec-CH-UA-Platform"] = random.choice(['"Windows"', '"macOS"', '"Linux"'])
191
+ headers.setdefault("Sec-Fetch-Site", random.choice(["none", "same-origin", "cross-site"]))
192
+ headers.setdefault("Sec-Fetch-Mode", random.choice(["navigate", "cors", "no-cors"]))
193
+ headers.setdefault("Sec-Fetch-Dest", random.choice(["document", "empty", "iframe"]))
194
+
195
+ if random.random() < 0.4:
196
+ headers["X-Forwarded-For"] = ".".join(str(random.randint(1, 254)) for _ in range(4))
197
+ if random.random() < 0.2:
198
+ headers["X-Requested-With"] = random.choice(["XMLHttpRequest", "Fetch"])
199
+
200
+ return headers
201
+
202
+ def get_random_delay(self) -> float:
203
+ """Retorna delay randomizado (distribuição gaussiana)."""
204
+ if not self.config.timing_randomization:
205
+ return 0.0
206
+
207
+ # Delay base aumenta com o nível
208
+ base_delay = self.level * 0.5
209
+
210
+ # Adiciona variação gaussiana
211
+ delay = max(0.1, random.gauss(base_delay, base_delay * 0.3))
212
+
213
+ return delay
214
+
215
+ async def _ensure_proxy_health(self):
216
+ """Executa health check periódico nos proxies."""
217
+ if not self.config.proxy_rotation or not self.proxies:
218
+ return
219
+
220
+ now = time.time()
221
+ if now - self._last_health_sweep < self.proxy_health_interval:
222
+ return
223
+
224
+ for proxy, state in self.proxy_states.items():
225
+ if now - state.last_checked >= self.proxy_health_interval:
226
+ await self._check_proxy_health(proxy)
227
+
228
+ self._last_health_sweep = time.time()
229
+
230
+ async def _check_proxy_health(self, proxy: str) -> None:
231
+ """Verifica saúde de um proxy específico."""
232
+ state = self.proxy_states.setdefault(proxy, ProxyState(url=proxy))
233
+ start = time.time()
234
+
235
+ try:
236
+ async with httpx.AsyncClient(timeout=5.0) as client:
237
+ await client.get(
238
+ self.healthcheck_url,
239
+ proxies=self._build_proxy_mapping(proxy),
240
+ headers={"User-Agent": random.choice(self.USER_AGENTS)},
241
+ )
242
+ latency = time.time() - start
243
+ state.healthy = True
244
+ state.latency = latency
245
+ state.failures = 0
246
+ state.last_checked = time.time()
247
+ logger.debug(
248
+ "stealth.proxy.health_ok",
249
+ proxy=proxy,
250
+ latency=f"{latency:.2f}s",
251
+ )
252
+ except Exception as exc: # pragma: no cover - protegido para ambientes sem rede
253
+ state.failures += 1
254
+ state.last_checked = time.time()
255
+ if state.failures >= self.max_proxy_failures:
256
+ state.healthy = False
257
+ logger.debug(
258
+ "stealth.proxy.health_fail",
259
+ proxy=proxy,
260
+ error=str(exc),
261
+ failures=state.failures,
262
+ )
263
+
264
+ def get_next_proxy(self) -> Optional[str]:
265
+ """Retorna próximo proxy saudável sem await (retrocompatibilidade)."""
266
+ if not self.config.proxy_rotation or not self.proxies:
267
+ return None
268
+
269
+ healthy = [p for p in self.proxies if self.proxy_states.get(p, ProxyState(p)).healthy]
270
+ if not healthy:
271
+ return None
272
+
273
+ proxy = healthy[self._current_proxy_index % len(healthy)]
274
+ self._current_proxy_index = (self._current_proxy_index + 1) % len(healthy)
275
+ return proxy
276
+
277
+ async def _select_proxy(self) -> Optional[str]:
278
+ """Seleciona proxy saudável, disparando health checks se necessário."""
279
+ if not self.config.proxy_rotation or not self.proxies:
280
+ return None
281
+
282
+ await self._ensure_proxy_health()
283
+
284
+ healthy = [p for p in self.proxies if self.proxy_states.get(p, ProxyState(p)).healthy]
285
+ if not healthy:
286
+ # todos degradados -> reativar temporariamente para tentativa
287
+ logger.warning("stealth.proxy.all_unhealthy")
288
+ for state in self.proxy_states.values():
289
+ state.healthy = True
290
+ healthy = self.proxies[:]
291
+
292
+ proxy = healthy[self._current_proxy_index % len(healthy)]
293
+ self._current_proxy_index = (self._current_proxy_index + 1) % max(len(healthy), 1)
294
+ return proxy
295
+
296
+ def _build_proxy_mapping(self, proxy: str) -> Dict[str, str]:
297
+ return {
298
+ "http://": proxy,
299
+ "https://": proxy,
300
+ }
301
+
302
+ def _extract_proxy_url(self, proxies: Optional[Dict[str, str]]) -> Optional[str]:
303
+ if not proxies:
304
+ return None
305
+ return proxies.get("https://") or proxies.get("http://")
306
+
307
+ def _mark_proxy_success(self, proxy: Optional[str], latency: float) -> None:
308
+ if not proxy:
309
+ return
310
+ state = self.proxy_states.setdefault(proxy, ProxyState(url=proxy))
311
+ state.healthy = True
312
+ state.latency = latency
313
+ state.failures = 0
314
+ state.last_checked = time.time()
315
+
316
+ def _mark_proxy_failure(self, proxy: Optional[str]) -> None:
317
+ if not proxy:
318
+ return
319
+ state = self.proxy_states.setdefault(proxy, ProxyState(url=proxy))
320
+ state.failures += 1
321
+ state.last_checked = time.time()
322
+ if state.failures >= self.max_proxy_failures:
323
+ state.healthy = False
324
+ logger.warning("stealth.proxy.mark_unhealthy", proxy=proxy)
325
+
326
+ def _get_tls_context(self) -> Optional[ssl.SSLContext]:
327
+ """Gera contexto TLS com fingerprint randomizado."""
328
+ if not self.config.tls_fingerprint_randomization:
329
+ return None
330
+
331
+ try:
332
+ context = ssl.create_default_context()
333
+ except ssl.SSLError:
334
+ return None
335
+
336
+ min_version = random.choice([
337
+ ssl.TLSVersion.TLSv1_2,
338
+ ssl.TLSVersion.TLSv1_3,
339
+ ])
340
+ context.minimum_version = min_version
341
+ context.maximum_version = ssl.TLSVersion.TLSv1_3
342
+
343
+ cipher_sets = [
344
+ "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256",
345
+ "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305",
346
+ "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:TLS_AES_128_GCM_SHA256",
347
+ ]
348
+
349
+ try:
350
+ context.set_ciphers(random.choice(cipher_sets))
351
+ except ssl.SSLError:
352
+ pass
353
+
354
+ if random.random() < 0.5:
355
+ context.check_hostname = False
356
+ context.verify_mode = ssl.CERT_NONE
357
+
358
+ return context
359
+
360
+ async def _spoof_tcp_stack(self, url: str, proxy: Optional[str]) -> None:
361
+ """Envia pacotes forjados para confundir fingerprint TCP/IP."""
362
+ if not self.config.tcp_stack_spoofing:
363
+ return
364
+
365
+ try:
366
+ from scapy.all import IP, TCP, RandShort, send # type: ignore
367
+ except Exception:
368
+ logger.debug("stealth.tcp.spoof_unavailable")
369
+ return
370
+
371
+ parsed = urlparse(url)
372
+ dst = parsed.hostname
373
+ if not dst:
374
+ return
375
+
376
+ dport = parsed.port or (443 if parsed.scheme == "https" else 80)
377
+ ttl = random.randint(40, 255)
378
+ window = random.randint(1024, 65535)
379
+
380
+ packet = IP(dst=dst, ttl=ttl) / TCP(dport=dport, sport=RandShort(), window=window, flags="S")
381
+
382
+ try:
383
+ send(packet, verbose=False)
384
+ except Exception as exc: # pragma: no cover - pode exigir privilégios
385
+ logger.debug("stealth.tcp.spoof_error", error=str(exc))
386
+
387
+ async def make_request(
388
+ self,
389
+ client: httpx.AsyncClient,
390
+ url: str,
391
+ method: str = "GET",
392
+ **kwargs
393
+ ) -> Optional[httpx.Response]:
394
+ """Faz request com stealth aplicado."""
395
+ base_kwargs = dict(kwargs)
396
+ provided_headers = base_kwargs.pop("headers", {})
397
+ provided_proxies = base_kwargs.pop("proxies", None)
398
+
399
+ attempts = 0
400
+ max_attempts = max(1, len(self.proxies)) if self.config.proxy_rotation and not provided_proxies else 1
401
+
402
+ while attempts < max_attempts:
403
+ headers = self.get_random_headers()
404
+ if isinstance(provided_headers, dict):
405
+ headers.update(provided_headers)
406
+
407
+ proxies = provided_proxies
408
+ proxy_url = self._extract_proxy_url(proxies) if isinstance(provided_proxies, dict) else provided_proxies
409
+
410
+ if proxies is None and self.config.proxy_rotation:
411
+ proxy_url = await self._select_proxy()
412
+ if proxy_url:
413
+ proxies = self._build_proxy_mapping(proxy_url)
414
+
415
+ if self.config.timing_randomization:
416
+ await asyncio.sleep(self.get_random_delay())
417
+
418
+ if self.config.decoy_traffic:
419
+ await self._send_decoy_traffic(client)
420
+
421
+ await self._spoof_tcp_stack(url, proxy_url)
422
+
423
+ tls_context = self._get_tls_context()
424
+ request_kwargs = dict(base_kwargs)
425
+ request_kwargs["headers"] = headers
426
+ if proxies:
427
+ request_kwargs["proxies"] = proxies
428
+ if tls_context:
429
+ request_kwargs["verify"] = tls_context
430
+ if self.config.tls_fingerprint_randomization and "http2" not in request_kwargs:
431
+ request_kwargs["http2"] = random.random() < 0.6
432
+
433
+ start_time = time.time()
434
+
435
+ try:
436
+ response = await client.request(
437
+ method,
438
+ url,
439
+ **request_kwargs,
440
+ )
441
+
442
+ self._mark_proxy_success(proxy_url, time.time() - start_time)
443
+
444
+ if self.config.anti_forensics:
445
+ self._sanitize_response(response)
446
+
447
+ return response
448
+
449
+ except httpx.RequestError as exc:
450
+ self._mark_proxy_failure(proxy_url)
451
+ logger.warning(
452
+ "stealth.request.network_error",
453
+ url=url,
454
+ proxy=proxy_url,
455
+ error=str(exc),
456
+ )
457
+
458
+ attempts += 1
459
+ if provided_proxies is not None:
460
+ break
461
+ continue
462
+
463
+ except Exception as exc: # pragma: no cover - captura erros inespecíficos
464
+ logger.warning("stealth.request.error", url=url, error=str(exc))
465
+ break
466
+
467
+ return None
468
+
469
+ async def _send_decoy_traffic(self, client: httpx.AsyncClient):
470
+ """Envia tráfego decoy para confundir IDS/IPS."""
471
+ decoy_targets = [
472
+ "https://www.google.com",
473
+ "https://www.bing.com",
474
+ "https://www.yahoo.com",
475
+ ]
476
+
477
+ target = random.choice(decoy_targets)
478
+ try:
479
+ await client.get(target, timeout=2.0)
480
+ except:
481
+ pass
482
+
483
+ def _sanitize_response(self, response: httpx.Response):
484
+ """Remove informações sensíveis da response."""
485
+ # Remove headers que podem identificar
486
+ sensitive_headers = ["X-Request-ID", "X-Trace-ID", "X-Correlation-ID"]
487
+ for header in sensitive_headers:
488
+ response.headers.pop(header, None)
489
+
490
+ def show_config(self):
491
+ """Mostra configuração atual."""
492
+ table = Table(title=f"🥷 Stealth Mode - Level {self.level}")
493
+
494
+ table.add_column("Feature", style="cyan")
495
+ table.add_column("Status", style="green")
496
+
497
+ table.add_row("User-Agent Rotation", "✅" if self.config.user_agent_rotation else "❌")
498
+ table.add_row("Header Randomization", "✅" if self.config.header_randomization else "❌")
499
+ table.add_row("Timing Randomization", "✅" if self.config.timing_randomization else "❌")
500
+ table.add_row("Proxy Rotation", "✅" if self.config.proxy_rotation else "❌")
501
+ table.add_row("Packet Fragmentation", "✅" if self.config.packet_fragmentation else "❌")
502
+ table.add_row("Decoy Traffic", "✅" if self.config.decoy_traffic else "❌")
503
+ table.add_row("Encoding Layers", str(self.config.encoding_layers))
504
+ table.add_row("Session Management", "✅" if self.config.session_management else "❌")
505
+ table.add_row("Anti-Forensics", "✅" if self.config.anti_forensics else "❌")
506
+ table.add_row("TLS Fingerprint", "✅" if self.config.tls_fingerprint_randomization else "❌")
507
+ table.add_row("TCP Spoofing", "✅" if self.config.tcp_stack_spoofing else "❌")
508
+ table.add_row("Tor Support", "✅" if self.config.tor_support else "❌")
509
+ table.add_row("I2P Support", "✅" if self.config.i2p_support else "❌")
510
+
511
+ console.print(table)
512
+
513
+ if self.proxies:
514
+ rows = []
515
+ for proxy in self.proxies:
516
+ state = self.proxy_states.get(proxy, ProxyState(url=proxy))
517
+ health_icon = "✅" if state.healthy else "❌"
518
+ latency = f"{state.latency*1000:.0f}ms" if state.latency else "--"
519
+ rows.append(f"{health_icon} {proxy} (latência: {latency}, falhas: {state.failures})")
520
+
521
+ console.print("\n[cyan]Proxies carregados:[/cyan]")
522
+ for line in rows:
523
+ console.print(f" • {line}")
524
+
525
+ async def scan(self, target: str):
526
+ """Executa scan com stealth mode."""
527
+ console.print(f"[bold cyan]🥷 Stealth Scan iniciado[/bold cyan] (Level {self.level})")
528
+ console.print(f"[dim]Target: {target}[/dim]\n")
529
+
530
+ async with httpx.AsyncClient(timeout=10.0) as client:
531
+ # Exemplo de scan
532
+ response = await self.make_request(client, f"https://{target}")
533
+
534
+ if response:
535
+ console.print(f"[green]✅ Response: {response.status_code}[/green]")
536
+ else:
537
+ console.print("[red]❌ Request failed[/red]")
538
+
539
+ def manage_proxies(self):
540
+ """Gerencia lista de proxies."""
541
+ console.print("[bold cyan]🔧 Proxy Management[/bold cyan]\n")
542
+
543
+ if not self.proxies:
544
+ console.print("[yellow]⚠️ Nenhum proxy configurado[/yellow]")
545
+ console.print("\nAdicione proxies ao arquivo: ~/.moriarty/proxies.txt")
546
+ else:
547
+ for i, proxy in enumerate(self.proxies, 1):
548
+ state = self.proxy_states.get(proxy, ProxyState(url=proxy))
549
+ status = "healthy" if state.healthy else "unhealthy"
550
+ latency = f"{state.latency*1000:.0f}ms" if state.latency else "--"
551
+ console.print(f"{i}. {proxy} [{status}] (latência {latency}, falhas {state.failures})")
552
+
553
+ async def refresh_proxy_health(self):
554
+ """Força health check imediato em todos os proxies."""
555
+ await asyncio.gather(*(self._check_proxy_health(proxy) for proxy in self.proxies))
556
+
557
+ async def test_capabilities(self, target: str):
558
+ """Testa capacidades de stealth."""
559
+ console.print(f"[bold cyan]🧪 Testando Stealth Capabilities[/bold cyan]\n")
560
+ console.print(f"Target: {target}\n")
561
+
562
+ async with httpx.AsyncClient(timeout=10.0) as client:
563
+ # Test 1: User-Agent rotation
564
+ console.print("[cyan]1. User-Agent Rotation...[/cyan]")
565
+ ua1 = self.get_random_headers()["User-Agent"]
566
+ ua2 = self.get_random_headers()["User-Agent"]
567
+ console.print(f" UA1: {ua1[:50]}...")
568
+ console.print(f" UA2: {ua2[:50]}...")
569
+ console.print(f" [green]✅ Different: {ua1 != ua2}[/green]\n")
570
+
571
+ # Test 2: Timing
572
+ console.print("[cyan]2. Timing Randomization...[/cyan]")
573
+ delays = [self.get_random_delay() for _ in range(5)]
574
+ console.print(f" Delays: {[f'{d:.2f}s' for d in delays]}")
575
+ console.print(f" [green]✅ Variação: {max(delays) - min(delays):.2f}s[/green]\n")
576
+
577
+ # Test 3: TLS fingerprint preview
578
+ console.print("[cyan]3. TLS Fingerprint Randomization...[/cyan]")
579
+ tls_context = self._get_tls_context()
580
+ if tls_context:
581
+ console.print(
582
+ " [green]✅ TLS context criado com ciphers customizados[/green]"
583
+ )
584
+ else:
585
+ console.print(" [yellow]⚠️ TLS randomization desabilitada[/yellow]")
586
+
587
+ # Test 4: Proxy health
588
+ if self.proxies:
589
+ console.print("[cyan]4. Proxy Health Check...[/cyan]")
590
+ await self.refresh_proxy_health()
591
+ healthy = sum(1 for p in self.proxies if self.proxy_states.get(p, ProxyState(p)).healthy)
592
+ console.print(f" [green]✅ {healthy}/{len(self.proxies)} proxies saudáveis[/green]\n")
593
+ else:
594
+ console.print("[cyan]4. Proxy Health Check...[/cyan]")
595
+ console.print(" [yellow]⚠️ Nenhum proxy configurado[/yellow]\n")
596
+
597
+ # Test 5: Request with stealth completo
598
+ console.print("[cyan]5. Stealth Request...[/cyan]")
599
+ start = time.time()
600
+ response = await self.make_request(client, f"https://{target}")
601
+ elapsed = time.time() - start
602
+
603
+ if response:
604
+ console.print(f" [green]✅ Status: {response.status_code}[/green]")
605
+ console.print(f" [dim]Time: {elapsed:.2f}s[/dim]")
606
+ else:
607
+ console.print(" [red]❌ Failed[/red]")
608
+
609
+
610
+ __all__ = ["StealthMode", "StealthConfig"]