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.
- moriarty/__init__.py +5 -0
- moriarty/adapters/__init__.py +0 -0
- moriarty/agent/__init__.py +0 -0
- moriarty/assets/modules/.gitkeep +0 -0
- moriarty/assets/modules/asia/douban.yaml +19 -0
- moriarty/assets/modules/asia/kakao.yaml +19 -0
- moriarty/assets/modules/asia/line.yaml +19 -0
- moriarty/assets/modules/asia/mixi.yaml +19 -0
- moriarty/assets/modules/asia/naver.yaml +19 -0
- moriarty/assets/modules/asia/qq.yaml +19 -0
- moriarty/assets/modules/asia/vk.yaml +19 -0
- moriarty/assets/modules/asia/wechat.yaml +19 -0
- moriarty/assets/modules/asia/weibo.yaml +19 -0
- moriarty/assets/modules/asia/xiaohongshu.yaml +19 -0
- moriarty/assets/modules/behance.yaml +47 -0
- moriarty/assets/modules/business/crunchbase.yaml +27 -0
- moriarty/assets/modules/business/fiverr.yaml +32 -0
- moriarty/assets/modules/business/freelancer.yaml +27 -0
- moriarty/assets/modules/business/glassdoor.yaml +27 -0
- moriarty/assets/modules/business/guru.yaml +26 -0
- moriarty/assets/modules/business/indeed.yaml +25 -0
- moriarty/assets/modules/business/monster.yaml +25 -0
- moriarty/assets/modules/business/peopleperhour.yaml +26 -0
- moriarty/assets/modules/business/toptal.yaml +28 -0
- moriarty/assets/modules/business/upwork.yaml +27 -0
- moriarty/assets/modules/business/ziprecruiter.yaml +25 -0
- moriarty/assets/modules/content/buymeacoffee.yaml +27 -0
- moriarty/assets/modules/content/gumroad.yaml +27 -0
- moriarty/assets/modules/content/ko-fi.yaml +32 -0
- moriarty/assets/modules/content/onlyfans.yaml +27 -0
- moriarty/assets/modules/content/patreon.yaml +33 -0
- moriarty/assets/modules/content/substack.yaml +32 -0
- moriarty/assets/modules/creative/500px.yaml +31 -0
- moriarty/assets/modules/creative/artstation.yaml +33 -0
- moriarty/assets/modules/creative/deviantart.yaml +32 -0
- moriarty/assets/modules/creative/flickr.yaml +31 -0
- moriarty/assets/modules/creative/pexels.yaml +26 -0
- moriarty/assets/modules/creative/unsplash.yaml +26 -0
- moriarty/assets/modules/creative/vimeo.yaml +31 -0
- moriarty/assets/modules/crypto/binance.yaml +27 -0
- moriarty/assets/modules/crypto/bitcointalk.yaml +33 -0
- moriarty/assets/modules/crypto/coinbase.yaml +26 -0
- moriarty/assets/modules/crypto/etherscan.yaml +32 -0
- moriarty/assets/modules/crypto/foundation.yaml +28 -0
- moriarty/assets/modules/crypto/kraken.yaml +27 -0
- moriarty/assets/modules/crypto/mirror.yaml +27 -0
- moriarty/assets/modules/crypto/niftygateway.yaml +26 -0
- moriarty/assets/modules/crypto/opensea.yaml +32 -0
- moriarty/assets/modules/crypto/rarible.yaml +27 -0
- moriarty/assets/modules/crypto/superrare.yaml +29 -0
- moriarty/assets/modules/dating/bumble.yaml +25 -0
- moriarty/assets/modules/dating/grindr.yaml +27 -0
- moriarty/assets/modules/dating/happn.yaml +25 -0
- moriarty/assets/modules/dating/her.yaml +27 -0
- moriarty/assets/modules/dating/hinge.yaml +25 -0
- moriarty/assets/modules/dating/match.yaml +25 -0
- moriarty/assets/modules/dating/meetme.yaml +27 -0
- moriarty/assets/modules/dating/okcupid.yaml +25 -0
- moriarty/assets/modules/dating/pof.yaml +25 -0
- moriarty/assets/modules/dating/tinder.yaml +25 -0
- moriarty/assets/modules/dating-nsfw/adultfriendfinder.yaml +28 -0
- moriarty/assets/modules/dating-nsfw/ashley-madison.yaml +26 -0
- moriarty/assets/modules/design/adobe-portfolio.yaml +27 -0
- moriarty/assets/modules/design/carbonmade.yaml +27 -0
- moriarty/assets/modules/design/cgsociety.yaml +27 -0
- moriarty/assets/modules/design/coroflot.yaml +27 -0
- moriarty/assets/modules/design/figma.yaml +27 -0
- moriarty/assets/modules/design/sketch.yaml +26 -0
- moriarty/assets/modules/dev/bitbucket.yaml +35 -0
- moriarty/assets/modules/dev/codeforces.yaml +32 -0
- moriarty/assets/modules/dev/codepen.yaml +34 -0
- moriarty/assets/modules/dev/hackerone.yaml +32 -0
- moriarty/assets/modules/dev/hackthebox.yaml +27 -0
- moriarty/assets/modules/dev/huggingface.yaml +27 -0
- moriarty/assets/modules/dev/kaggle.yaml +32 -0
- moriarty/assets/modules/dev/leetcode.yaml +32 -0
- moriarty/assets/modules/dev/replit.yaml +31 -0
- moriarty/assets/modules/dribbble.yaml +53 -0
- moriarty/assets/modules/ecommerce/etsy.yaml +32 -0
- moriarty/assets/modules/education/duolingo.yaml +32 -0
- moriarty/assets/modules/education/edx.yaml +26 -0
- moriarty/assets/modules/education/khanacademy.yaml +26 -0
- moriarty/assets/modules/education/lynda.yaml +27 -0
- moriarty/assets/modules/education/memrise.yaml +27 -0
- moriarty/assets/modules/education/pluralsight.yaml +27 -0
- moriarty/assets/modules/education/skillshare.yaml +27 -0
- moriarty/assets/modules/education/udacity.yaml +27 -0
- moriarty/assets/modules/email/github_email.yaml +40 -0
- moriarty/assets/modules/email/gravatar.yaml +23 -0
- moriarty/assets/modules/europe/badoo.yaml +19 -0
- moriarty/assets/modules/europe/lovoo.yaml +19 -0
- moriarty/assets/modules/europe/myspace.yaml +19 -0
- moriarty/assets/modules/europe/netlog.yaml +19 -0
- moriarty/assets/modules/europe/ok.yaml +19 -0
- moriarty/assets/modules/europe/skyrock.yaml +19 -0
- moriarty/assets/modules/europe/studivz.yaml +19 -0
- moriarty/assets/modules/europe/tuenti.yaml +19 -0
- moriarty/assets/modules/europe/viadeo.yaml +19 -0
- moriarty/assets/modules/europe/xing.yaml +19 -0
- moriarty/assets/modules/fitness/fitbit.yaml +27 -0
- moriarty/assets/modules/fitness/garmin.yaml +27 -0
- moriarty/assets/modules/fitness/myfitnesspal.yaml +27 -0
- moriarty/assets/modules/fitness/strava.yaml +33 -0
- moriarty/assets/modules/fitness/zwift.yaml +28 -0
- moriarty/assets/modules/food/allrecipes.yaml +27 -0
- moriarty/assets/modules/food/tasty.yaml +27 -0
- moriarty/assets/modules/food/yelp.yaml +32 -0
- moriarty/assets/modules/food/zomato.yaml +28 -0
- moriarty/assets/modules/forums/4chan.yaml +26 -0
- moriarty/assets/modules/forums/8kun.yaml +26 -0
- moriarty/assets/modules/forums/9gag.yaml +26 -0
- moriarty/assets/modules/forums/discourse.yaml +26 -0
- moriarty/assets/modules/forums/disqus.yaml +31 -0
- moriarty/assets/modules/forums/hackernews.yaml +32 -0
- moriarty/assets/modules/forums/launchpad.yaml +27 -0
- moriarty/assets/modules/forums/phpbb.yaml +25 -0
- moriarty/assets/modules/forums/quora.yaml +32 -0
- moriarty/assets/modules/forums/serverfault.yaml +27 -0
- moriarty/assets/modules/forums/slashdot.yaml +28 -0
- moriarty/assets/modules/forums/stackexchange.yaml +32 -0
- moriarty/assets/modules/forums/superuser.yaml +27 -0
- moriarty/assets/modules/forums/vbulletin.yaml +25 -0
- moriarty/assets/modules/forums/xenforo.yaml +25 -0
- moriarty/assets/modules/forums-nsfw/kiwifarms.yaml +25 -0
- moriarty/assets/modules/forums-nsfw/lolcow.yaml +26 -0
- moriarty/assets/modules/gaming/apextracker.yaml +27 -0
- moriarty/assets/modules/gaming/battlenet.yaml +26 -0
- moriarty/assets/modules/gaming/chess.yaml +30 -0
- moriarty/assets/modules/gaming/discord-public.yaml +27 -0
- moriarty/assets/modules/gaming/dotabuff.yaml +32 -0
- moriarty/assets/modules/gaming/epicgames.yaml +25 -0
- moriarty/assets/modules/gaming/faceit.yaml +33 -0
- moriarty/assets/modules/gaming/fortnitetracker.yaml +32 -0
- moriarty/assets/modules/gaming/gog.yaml +26 -0
- moriarty/assets/modules/gaming/itch.yaml +32 -0
- moriarty/assets/modules/gaming/kongregate.yaml +25 -0
- moriarty/assets/modules/gaming/minecraft.yaml +31 -0
- moriarty/assets/modules/gaming/opgg.yaml +32 -0
- moriarty/assets/modules/gaming/origin.yaml +26 -0
- moriarty/assets/modules/gaming/playstation.yaml +30 -0
- moriarty/assets/modules/gaming/roblox.yaml +31 -0
- moriarty/assets/modules/gaming/xbox.yaml +25 -0
- moriarty/assets/modules/github.yaml +68 -0
- moriarty/assets/modules/gitlab.yaml +60 -0
- moriarty/assets/modules/instagram.yaml +48 -0
- moriarty/assets/modules/latam/fotolog.yaml +27 -0
- moriarty/assets/modules/latam/orkut.yaml +26 -0
- moriarty/assets/modules/latam/taringa.yaml +27 -0
- moriarty/assets/modules/learning/coursera.yaml +26 -0
- moriarty/assets/modules/learning/udemy.yaml +26 -0
- moriarty/assets/modules/linkedin.yaml +40 -0
- moriarty/assets/modules/marketplaces/depop.yaml +28 -0
- moriarty/assets/modules/marketplaces/ebay.yaml +32 -0
- moriarty/assets/modules/marketplaces/grailed.yaml +27 -0
- moriarty/assets/modules/marketplaces/mercari.yaml +26 -0
- moriarty/assets/modules/marketplaces/poshmark.yaml +27 -0
- moriarty/assets/modules/marketplaces/reverb.yaml +27 -0
- moriarty/assets/modules/marketplaces/vinted.yaml +28 -0
- moriarty/assets/modules/medium.yaml +44 -0
- moriarty/assets/modules/music/audiomack.yaml +26 -0
- moriarty/assets/modules/music/bandcamp.yaml +30 -0
- moriarty/assets/modules/music/beatport.yaml +28 -0
- moriarty/assets/modules/music/deezer.yaml +26 -0
- moriarty/assets/modules/music/discogs.yaml +32 -0
- moriarty/assets/modules/music/genius.yaml +26 -0
- moriarty/assets/modules/music/lastfm.yaml +30 -0
- moriarty/assets/modules/music/mixcloud.yaml +26 -0
- moriarty/assets/modules/music/reverbnation.yaml +31 -0
- moriarty/assets/modules/music/soundcloud.yaml +31 -0
- moriarty/assets/modules/music/spotify.yaml +26 -0
- moriarty/assets/modules/music/tidal.yaml +26 -0
- moriarty/assets/modules/nsfw/adultwork.yaml +27 -0
- moriarty/assets/modules/nsfw/bongacams.yaml +28 -0
- moriarty/assets/modules/nsfw/cam4.yaml +28 -0
- moriarty/assets/modules/nsfw/chaturbate.yaml +28 -0
- moriarty/assets/modules/nsfw/clips4sale.yaml +27 -0
- moriarty/assets/modules/nsfw/extralunchmoney.yaml +27 -0
- moriarty/assets/modules/nsfw/fansly.yaml +28 -0
- moriarty/assets/modules/nsfw/fetlife.yaml +28 -0
- moriarty/assets/modules/nsfw/iwantclips.yaml +27 -0
- moriarty/assets/modules/nsfw/justforfans.yaml +28 -0
- moriarty/assets/modules/nsfw/loyalfans.yaml +28 -0
- moriarty/assets/modules/nsfw/manyvids.yaml +27 -0
- moriarty/assets/modules/nsfw/myfreecams.yaml +28 -0
- moriarty/assets/modules/nsfw/niteflirt.yaml +26 -0
- moriarty/assets/modules/nsfw/pornhub.yaml +32 -0
- moriarty/assets/modules/nsfw/redtube.yaml +27 -0
- moriarty/assets/modules/nsfw/stripchat.yaml +28 -0
- moriarty/assets/modules/nsfw/xhamster.yaml +27 -0
- moriarty/assets/modules/nsfw/xvideos.yaml +27 -0
- moriarty/assets/modules/nsfw/youporn.yaml +27 -0
- moriarty/assets/modules/photography/eyeem.yaml +25 -0
- moriarty/assets/modules/photography/fotki.yaml +25 -0
- moriarty/assets/modules/photography/photobucket.yaml +26 -0
- moriarty/assets/modules/photography/smugmug.yaml +25 -0
- moriarty/assets/modules/photography/vsco.yaml +27 -0
- moriarty/assets/modules/pinterest.yaml +40 -0
- moriarty/assets/modules/podcasts/anchor.yaml +26 -0
- moriarty/assets/modules/podcasts/castbox.yaml +26 -0
- moriarty/assets/modules/podcasts/podbean.yaml +26 -0
- moriarty/assets/modules/professional/about.yaml +31 -0
- moriarty/assets/modules/professional/academia.yaml +27 -0
- moriarty/assets/modules/professional/angellist.yaml +27 -0
- moriarty/assets/modules/professional/calendly.yaml +26 -0
- moriarty/assets/modules/professional/issuu.yaml +27 -0
- moriarty/assets/modules/professional/mendeley.yaml +27 -0
- moriarty/assets/modules/professional/notion.yaml +27 -0
- moriarty/assets/modules/professional/orcid.yaml +27 -0
- moriarty/assets/modules/professional/producthunt.yaml +31 -0
- moriarty/assets/modules/professional/researchgate.yaml +32 -0
- moriarty/assets/modules/professional/scribd.yaml +27 -0
- moriarty/assets/modules/professional/slideshare.yaml +31 -0
- moriarty/assets/modules/professional/trello.yaml +26 -0
- moriarty/assets/modules/professional/typeform.yaml +27 -0
- moriarty/assets/modules/reddit.yaml +46 -0
- moriarty/assets/modules/regional/amino.yaml +27 -0
- moriarty/assets/modules/regional/ask-fm.yaml +32 -0
- moriarty/assets/modules/regional/babycenter.yaml +26 -0
- moriarty/assets/modules/regional/cafemom.yaml +27 -0
- moriarty/assets/modules/regional/care2.yaml +27 -0
- moriarty/assets/modules/regional/diaspora.yaml +26 -0
- moriarty/assets/modules/regional/ello.yaml +27 -0
- moriarty/assets/modules/regional/gaia.yaml +27 -0
- moriarty/assets/modules/regional/habbo.yaml +27 -0
- moriarty/assets/modules/regional/imvu.yaml +27 -0
- moriarty/assets/modules/regional/lemmy.yaml +27 -0
- moriarty/assets/modules/regional/peertube.yaml +26 -0
- moriarty/assets/modules/regional/pixelfed.yaml +27 -0
- moriarty/assets/modules/regional/plurk.yaml +26 -0
- moriarty/assets/modules/regional/recroom.yaml +27 -0
- moriarty/assets/modules/regional/secondlife.yaml +26 -0
- moriarty/assets/modules/regional/vine-archive.yaml +27 -0
- moriarty/assets/modules/regional/vrchat.yaml +27 -0
- moriarty/assets/modules/regional/weheartit.yaml +27 -0
- moriarty/assets/modules/social/anilist.yaml +27 -0
- moriarty/assets/modules/social/beacons.yaml +26 -0
- moriarty/assets/modules/social/blogger.yaml +27 -0
- moriarty/assets/modules/social/crunchyroll.yaml +27 -0
- moriarty/assets/modules/social/discord.yaml +27 -0
- moriarty/assets/modules/social/dreamwidth.yaml +26 -0
- moriarty/assets/modules/social/facebook.yaml +34 -0
- moriarty/assets/modules/social/goodreads.yaml +32 -0
- moriarty/assets/modules/social/imdb.yaml +27 -0
- moriarty/assets/modules/social/kitsu.yaml +27 -0
- moriarty/assets/modules/social/letterboxd.yaml +32 -0
- moriarty/assets/modules/social/linktree.yaml +26 -0
- moriarty/assets/modules/social/livejournal.yaml +27 -0
- moriarty/assets/modules/social/mastodon.yaml +30 -0
- moriarty/assets/modules/social/minds.yaml +25 -0
- moriarty/assets/modules/social/myanimelist.yaml +32 -0
- moriarty/assets/modules/social/ravelry.yaml +27 -0
- moriarty/assets/modules/social/snapchat.yaml +25 -0
- moriarty/assets/modules/social/telegram.yaml +35 -0
- moriarty/assets/modules/social/tiktok.yaml +35 -0
- moriarty/assets/modules/social/trakt.yaml +28 -0
- moriarty/assets/modules/social/wattpad.yaml +32 -0
- moriarty/assets/modules/social/wordpress-com.yaml +26 -0
- moriarty/assets/modules/sports/espn.yaml +26 -0
- moriarty/assets/modules/sports/untappd.yaml +32 -0
- moriarty/assets/modules/stackoverflow.yaml +47 -0
- moriarty/assets/modules/steam.yaml +47 -0
- moriarty/assets/modules/streaming/caffeine.yaml +25 -0
- moriarty/assets/modules/streaming/dlive.yaml +27 -0
- moriarty/assets/modules/streaming/trovo.yaml +25 -0
- moriarty/assets/modules/travel/airbnb.yaml +26 -0
- moriarty/assets/modules/travel/booking.yaml +26 -0
- moriarty/assets/modules/travel/couchsurfing.yaml +27 -0
- moriarty/assets/modules/travel/tripadvisor.yaml +32 -0
- moriarty/assets/modules/tumblr.yaml +40 -0
- moriarty/assets/modules/twitch.yaml +48 -0
- moriarty/assets/modules/twitter.yaml +39 -0
- moriarty/assets/modules/youtube.yaml +42 -0
- moriarty/assets/templates/cves/CVE-2017-5638.yaml +27 -0
- moriarty/assets/templates/cves/CVE-2018-7600.yaml +30 -0
- moriarty/assets/templates/cves/CVE-2019-11510.yaml +27 -0
- moriarty/assets/templates/cves/CVE-2019-19781.yaml +28 -0
- moriarty/assets/templates/cves/CVE-2020-14882.yaml +28 -0
- moriarty/assets/templates/cves/CVE-2020-14883.yaml +29 -0
- moriarty/assets/templates/cves/CVE-2020-3452.yaml +28 -0
- moriarty/assets/templates/cves/CVE-2020-5902.yaml +28 -0
- moriarty/assets/templates/cves/CVE-2021-21972.yaml +31 -0
- moriarty/assets/templates/cves/CVE-2021-21985.yaml +28 -0
- moriarty/assets/templates/cves/CVE-2021-26084.yaml +30 -0
- moriarty/assets/templates/cves/CVE-2021-41773.yaml +25 -0
- moriarty/assets/templates/cves/CVE-2021-42013.yaml +28 -0
- moriarty/assets/templates/cves/CVE-2021-44228.yaml +27 -0
- moriarty/assets/templates/cves/CVE-2022-0185.yaml +21 -0
- moriarty/assets/templates/cves/CVE-2022-1388.yaml +36 -0
- moriarty/assets/templates/cves/CVE-2022-22954.yaml +28 -0
- moriarty/assets/templates/cves/CVE-2022-22965.yaml +31 -0
- moriarty/assets/templates/cves/CVE-2022-26134.yaml +27 -0
- moriarty/assets/templates/cves/CVE-2023-22515.yaml +27 -0
- moriarty/assets/templates/cves/CVE-2023-22527.yaml +29 -0
- moriarty/assets/templates/cves/CVE-2023-23752.yaml +33 -0
- moriarty/assets/templates/cves/CVE-2023-27350.yaml +27 -0
- moriarty/assets/templates/cves/CVE-2023-2868.yaml +27 -0
- moriarty/assets/templates/cves/CVE-2023-34362.yaml +27 -0
- moriarty/assets/templates/cves/CVE-2023-3519.yaml +28 -0
- moriarty/assets/templates/cves/CVE-2023-4966.yaml +27 -0
- moriarty/assets/templates/default-logins/admin-weak.yaml +40 -0
- moriarty/assets/templates/default-logins/wordpress-default.yaml +38 -0
- moriarty/assets/templates/exposures/aws-credentials.yaml +35 -0
- moriarty/assets/templates/exposures/backup-files.yaml +36 -0
- moriarty/assets/templates/exposures/database-files.yaml +34 -0
- moriarty/assets/templates/exposures/docker-exposed.yaml +31 -0
- moriarty/assets/templates/exposures/env-exposed.yaml +41 -0
- moriarty/assets/templates/exposures/git-exposed.yaml +41 -0
- moriarty/assets/templates/exposures/phpinfo.yaml +36 -0
- moriarty/assets/templates/exposures/svn-exposed.yaml +28 -0
- moriarty/assets/templates/fuzzing/api-endpoints.yaml +39 -0
- moriarty/assets/templates/fuzzing/common-files.yaml +37 -0
- moriarty/assets/templates/fuzzing/open-redirect-fuzz.yaml +35 -0
- moriarty/assets/templates/fuzzing/xss-search-fuzz.yaml +29 -0
- moriarty/assets/templates/git-config.yaml +18 -0
- moriarty/assets/templates/misconfigurations/cors-misconfiguration.yaml +30 -0
- moriarty/assets/templates/misconfigurations/debug-enabled.yaml +29 -0
- moriarty/assets/templates/misconfigurations/directory-listing.yaml +33 -0
- moriarty/assets/templates/misconfigurations/jwt-none-algo.yaml +30 -0
- moriarty/assets/templates/misconfigurations/ssl-tls-weak.yaml +23 -0
- moriarty/assets/templates/vulnerabilities/lfi-basic.yaml +31 -0
- moriarty/assets/templates/vulnerabilities/open-redirect.yaml +31 -0
- moriarty/assets/templates/vulnerabilities/rce-basic.yaml +34 -0
- moriarty/assets/templates/vulnerabilities/sqli-error.yaml +39 -0
- moriarty/assets/templates/vulnerabilities/ssrf-basic.yaml +31 -0
- moriarty/assets/templates/vulnerabilities/xss-reflected.yaml +38 -0
- moriarty/assets/templates/vulnerabilities/xxe-basic.yaml +30 -0
- moriarty/assets/wordlists/subdomains-1000.txt +1063 -0
- moriarty/cli/__init__.py +3 -0
- moriarty/cli/app.py +120 -0
- moriarty/cli/async_utils.py +19 -0
- moriarty/cli/dns.py +83 -0
- moriarty/cli/domain_cmd.py +572 -0
- moriarty/cli/email.py +383 -0
- moriarty/cli/email_investigate.py +224 -0
- moriarty/cli/intelligence.py +329 -0
- moriarty/cli/output.py +62 -0
- moriarty/cli/rdap.py +94 -0
- moriarty/cli/state.py +38 -0
- moriarty/cli/tls.py +91 -0
- moriarty/cli/user.py +227 -0
- moriarty/core/cache_backend.py +223 -0
- moriarty/core/config_manager.py +303 -0
- moriarty/correlator/__init__.py +0 -0
- moriarty/data/__init__.py +81 -0
- moriarty/data/ioc/__init__.py +142 -0
- moriarty/data/ioc/matcher.py +254 -0
- moriarty/data/ioc/types.py +267 -0
- moriarty/data/local_intelligence.py +507 -0
- moriarty/data/signature_loaders/__init__.py +103 -0
- moriarty/data/signature_loaders/base.py +54 -0
- moriarty/data/signature_loaders/ioc_feed.py +356 -0
- moriarty/data/signature_loaders/wappalyzer.py +112 -0
- moriarty/dsl/__init__.py +0 -0
- moriarty/dsl/loader.py +99 -0
- moriarty/dsl/schema.py +47 -0
- moriarty/export/__init__.py +0 -0
- moriarty/intelligence/__init__.py +27 -0
- moriarty/intelligence/__main__.py +150 -0
- moriarty/intelligence/config.py +395 -0
- moriarty/intelligence/ioc.py +267 -0
- moriarty/intelligence/signatures.py +550 -0
- moriarty/intelligence/storage.py +501 -0
- moriarty/interop/__init__.py +0 -0
- moriarty/logging/__init__.py +0 -0
- moriarty/logging/config.py +47 -0
- moriarty/models/__init__.py +16 -0
- moriarty/models/assertion.py +24 -0
- moriarty/models/entity.py +22 -0
- moriarty/models/evidence.py +37 -0
- moriarty/models/relation.py +24 -0
- moriarty/models/types.py +28 -0
- moriarty/modules/__init__.py +0 -0
- moriarty/modules/avatar_hash.py +184 -0
- moriarty/modules/directory_fuzzer.py +322 -0
- moriarty/modules/dns_scan.py +40 -0
- moriarty/modules/domain_scanner.py +620 -0
- moriarty/modules/email_check.py +98 -0
- moriarty/modules/email_investigate.py +267 -0
- moriarty/modules/email_security.py +274 -0
- moriarty/modules/googlemaps_lookup.py +106 -0
- moriarty/modules/headless_executor.py +201 -0
- moriarty/modules/orchestrator.py +60 -0
- moriarty/modules/passive_recon.py +444 -0
- moriarty/modules/phone_extractor.py +151 -0
- moriarty/modules/pipeline_orchestrator.py +726 -0
- moriarty/modules/port_scanner.py +129 -0
- moriarty/modules/rdap.py +61 -0
- moriarty/modules/rdap_extended.py +188 -0
- moriarty/modules/stealth_mode.py +610 -0
- moriarty/modules/subdomain_discovery.py +595 -0
- moriarty/modules/technology_profiler.py +361 -0
- moriarty/modules/template_executor.py +239 -0
- moriarty/modules/template_scanner.py +1048 -0
- moriarty/modules/tls_scan.py +46 -0
- moriarty/modules/tls_validator.py +188 -0
- moriarty/modules/vuln_scanner.py +483 -0
- moriarty/modules/waf_detector.py +585 -0
- moriarty/modules/wayback_discovery.py +234 -0
- moriarty/modules/web_crawler.py +163 -0
- moriarty/net/__init__.py +0 -0
- moriarty/net/dns_cache.py +175 -0
- moriarty/net/dns_client.py +188 -0
- moriarty/net/rdap_client.py +52 -0
- moriarty/net/smtp_client.py +114 -0
- moriarty/net/tls_client.py +111 -0
- moriarty/parsers/__init__.py +0 -0
- moriarty/parsers/html_parser.py +136 -0
- moriarty/tests/__init__.py +0 -0
- moriarty/tests/test_email_service.py +17 -0
- moriarty/tests/test_models.py +46 -0
- moriarty/tests/test_orchestrator.py +30 -0
- moriarty/tests/test_tls_client.py +18 -0
- moriarty_project-0.1.6.dist-info/METADATA +388 -0
- moriarty_project-0.1.6.dist-info/RECORD +418 -0
- moriarty_project-0.1.6.dist-info/WHEEL +4 -0
- moriarty_project-0.1.6.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,585 @@
|
|
1
|
+
"""Detector de WAF/IPS com bypass automático."""
|
2
|
+
import asyncio
|
3
|
+
import itertools
|
4
|
+
import json
|
5
|
+
import random
|
6
|
+
import re
|
7
|
+
import time
|
8
|
+
from dataclasses import dataclass
|
9
|
+
from typing import Dict, List, Optional
|
10
|
+
from urllib.parse import quote
|
11
|
+
|
12
|
+
import httpx
|
13
|
+
import structlog
|
14
|
+
|
15
|
+
logger = structlog.get_logger(__name__)
|
16
|
+
|
17
|
+
|
18
|
+
@dataclass
|
19
|
+
class WAFInfo:
|
20
|
+
"""Informações sobre WAF detectado."""
|
21
|
+
name: str
|
22
|
+
confidence: int # 0-100
|
23
|
+
indicators: List[str]
|
24
|
+
headers: Dict[str, str]
|
25
|
+
|
26
|
+
|
27
|
+
@dataclass
|
28
|
+
class BypassMethod:
|
29
|
+
"""Método de bypass testado."""
|
30
|
+
technique: str
|
31
|
+
success: bool
|
32
|
+
payload: str
|
33
|
+
response_code: int
|
34
|
+
|
35
|
+
|
36
|
+
@dataclass
|
37
|
+
class CaptchaBypassResult:
|
38
|
+
"""Resultado de tentativa de bypass de CAPTCHA."""
|
39
|
+
|
40
|
+
provider: Optional[str]
|
41
|
+
success: bool
|
42
|
+
token: Optional[str] = None
|
43
|
+
detail: Optional[str] = None
|
44
|
+
|
45
|
+
|
46
|
+
class WAFDetector:
|
47
|
+
"""
|
48
|
+
Detecta WAF/IPS e tenta bypass automático.
|
49
|
+
|
50
|
+
WAFs Suportados:
|
51
|
+
- Cloudflare
|
52
|
+
- AWS WAF
|
53
|
+
- Akamai
|
54
|
+
- Imperva (Incapsula)
|
55
|
+
- F5 BIG-IP
|
56
|
+
- ModSecurity
|
57
|
+
- Sucuri
|
58
|
+
- Barracuda
|
59
|
+
- Fortinet FortiWeb
|
60
|
+
- Citrix NetScaler
|
61
|
+
"""
|
62
|
+
|
63
|
+
# Assinaturas de WAFs
|
64
|
+
WAF_SIGNATURES = {
|
65
|
+
"Cloudflare": {
|
66
|
+
"headers": ["cf-ray", "cf-cache-status", "__cfduid"],
|
67
|
+
"content": ["Attention Required", "cloudflare"],
|
68
|
+
"status_codes": [403, 503],
|
69
|
+
},
|
70
|
+
"AWS WAF": {
|
71
|
+
"headers": ["x-amzn-requestid", "x-amzn-errortype"],
|
72
|
+
"content": ["AWS WAF", "RequestId"],
|
73
|
+
},
|
74
|
+
"Akamai": {
|
75
|
+
"headers": ["akamai-x-cache", "akamai-grn"],
|
76
|
+
"content": ["Reference #", "akamai"],
|
77
|
+
},
|
78
|
+
"Imperva": {
|
79
|
+
"headers": ["x-cdn", "x-iinfo"],
|
80
|
+
"content": ["Incapsula", "_Incapsula_Resource"],
|
81
|
+
},
|
82
|
+
"F5 BIG-IP": {
|
83
|
+
"headers": ["x-cnection", "x-wa-info"],
|
84
|
+
"content": ["BigIP", "F5"],
|
85
|
+
},
|
86
|
+
"ModSecurity": {
|
87
|
+
"headers": ["mod_security"],
|
88
|
+
"content": ["ModSecurity", "mod_security"],
|
89
|
+
},
|
90
|
+
"Sucuri": {
|
91
|
+
"headers": ["x-sucuri-id", "x-sucuri-cache"],
|
92
|
+
"content": ["Sucuri Website Firewall"],
|
93
|
+
},
|
94
|
+
"Barracuda": {
|
95
|
+
"headers": ["barra_counter_session"],
|
96
|
+
"content": ["Barracuda Web Application Firewall"],
|
97
|
+
},
|
98
|
+
"Fortinet": {
|
99
|
+
"headers": ["fortigate"],
|
100
|
+
"content": ["FortiWeb"],
|
101
|
+
},
|
102
|
+
"Citrix NetScaler": {
|
103
|
+
"headers": ["ns_af", "citrix_ns_id"],
|
104
|
+
"content": ["NetScaler"],
|
105
|
+
},
|
106
|
+
}
|
107
|
+
|
108
|
+
# Payloads de teste para bypass
|
109
|
+
BYPASS_PAYLOADS = {
|
110
|
+
"case_variation": [
|
111
|
+
"SeLeCt", "uNiOn", "aNd", "Or",
|
112
|
+
],
|
113
|
+
"comment_injection": [
|
114
|
+
"SELECT/**/", "UNION/**/ALL/**/SELECT",
|
115
|
+
"1'/**/and/**/1=1--",
|
116
|
+
],
|
117
|
+
"encoding": [
|
118
|
+
"%53%45%4c%45%43%54", # SELECT URL encoded
|
119
|
+
"%2527%2520union", # ' union double encoded
|
120
|
+
],
|
121
|
+
"whitespace": [
|
122
|
+
"SELECT\t", "UNION\n", "1'\rand\r1=1",
|
123
|
+
],
|
124
|
+
"null_byte": [
|
125
|
+
"SELECT%00", "1'%00and%001=1",
|
126
|
+
],
|
127
|
+
"unicode": [
|
128
|
+
"\u0053\u0045\u004c\u0045\u0043\u0054", # SELECT
|
129
|
+
],
|
130
|
+
"http_parameter_pollution": [
|
131
|
+
"id=1&id=2'union select",
|
132
|
+
],
|
133
|
+
"double_url_encoding": [
|
134
|
+
quote(quote("' OR '1'='1")),
|
135
|
+
quote(quote("../../etc/passwd")),
|
136
|
+
],
|
137
|
+
"path_obfuscation": [
|
138
|
+
"..;/..;/admin",
|
139
|
+
"..%2f..%2fadmin",
|
140
|
+
],
|
141
|
+
"method_override": [
|
142
|
+
"X-HTTP-Method-Override: PUT",
|
143
|
+
"X-HTTP-Method: DELETE",
|
144
|
+
],
|
145
|
+
"header_noise": [
|
146
|
+
"X-Originating-IP: 127.0.0.1",
|
147
|
+
"X-Forwarded-Proto: https",
|
148
|
+
],
|
149
|
+
}
|
150
|
+
|
151
|
+
RATE_LIMIT_HEADERS = ["retry-after", "x-ratelimit-remaining", "x-ratelimit-reset"]
|
152
|
+
RATE_LIMIT_STATUS = {429, 503}
|
153
|
+
|
154
|
+
CAPTCHA_PATTERNS = [
|
155
|
+
"captcha", "g-recaptcha", "hcaptcha", "__cf_chl_captcha_tk__",
|
156
|
+
"Please verify you are a human", "cloudflare-challenge",
|
157
|
+
]
|
158
|
+
|
159
|
+
def __init__(self, target: str, timeout: float = 10.0):
|
160
|
+
self.target = target
|
161
|
+
self.timeout = timeout
|
162
|
+
|
163
|
+
# Normaliza URL
|
164
|
+
if not self.target.startswith("http"):
|
165
|
+
self.target = f"https://{self.target}"
|
166
|
+
|
167
|
+
try:
|
168
|
+
from moriarty.core.config_manager import config_manager
|
169
|
+
|
170
|
+
self.config_manager = config_manager
|
171
|
+
except Exception:
|
172
|
+
self.config_manager = None
|
173
|
+
|
174
|
+
self.captcha_solver_key = self._get_api_key("captcha_solver")
|
175
|
+
self.captcha_solver_url = self._get_api_key("captcha_solver_url")
|
176
|
+
self.rate_limit_detected: Optional[Dict[str, str]] = None
|
177
|
+
self.captcha_attempt: Optional[CaptchaBypassResult] = None
|
178
|
+
|
179
|
+
async def detect(self) -> Optional[WAFInfo]:
|
180
|
+
"""Detecta presença de WAF."""
|
181
|
+
logger.info("waf.detect.start", target=self.target)
|
182
|
+
|
183
|
+
try:
|
184
|
+
async with httpx.AsyncClient(timeout=self.timeout, follow_redirects=True) as client:
|
185
|
+
# Request normal
|
186
|
+
response = await client.get(self.target)
|
187
|
+
|
188
|
+
# Request com payload malicioso
|
189
|
+
malicious_url = f"{self.target}?id=1' OR '1'='1"
|
190
|
+
malicious_response = await client.get(malicious_url)
|
191
|
+
|
192
|
+
self._detect_rate_limiting(response, malicious_response)
|
193
|
+
await self._detect_captcha(malicious_response)
|
194
|
+
|
195
|
+
# Analisa respostas
|
196
|
+
waf_info = self._analyze_responses(response, malicious_response)
|
197
|
+
|
198
|
+
if waf_info:
|
199
|
+
logger.info(
|
200
|
+
"waf.detect.found",
|
201
|
+
waf=waf_info.name,
|
202
|
+
confidence=waf_info.confidence,
|
203
|
+
)
|
204
|
+
else:
|
205
|
+
logger.info("waf.detect.none")
|
206
|
+
|
207
|
+
return waf_info
|
208
|
+
|
209
|
+
except Exception as e:
|
210
|
+
logger.error("waf.detect.error", error=str(e))
|
211
|
+
return None
|
212
|
+
|
213
|
+
def _get_api_key(self, service: str) -> Optional[str]:
|
214
|
+
if not self.config_manager:
|
215
|
+
return None
|
216
|
+
try:
|
217
|
+
return self.config_manager.get_api_key(service)
|
218
|
+
except Exception:
|
219
|
+
return None
|
220
|
+
|
221
|
+
def _analyze_responses(
|
222
|
+
self,
|
223
|
+
normal: httpx.Response,
|
224
|
+
malicious: httpx.Response,
|
225
|
+
) -> Optional[WAFInfo]:
|
226
|
+
"""Analisa respostas para detectar WAF."""
|
227
|
+
|
228
|
+
for waf_name, signatures in self.WAF_SIGNATURES.items():
|
229
|
+
confidence = 0
|
230
|
+
indicators = []
|
231
|
+
detected_headers = {}
|
232
|
+
|
233
|
+
# Verifica headers
|
234
|
+
for header in signatures.get("headers", []):
|
235
|
+
if header.lower() in [h.lower() for h in malicious.headers.keys()]:
|
236
|
+
confidence += 30
|
237
|
+
indicators.append(f"Header: {header}")
|
238
|
+
detected_headers[header] = malicious.headers.get(header, "")
|
239
|
+
|
240
|
+
# Verifica conteúdo
|
241
|
+
for content_sig in signatures.get("content", []):
|
242
|
+
if content_sig.lower() in malicious.text.lower():
|
243
|
+
confidence += 25
|
244
|
+
indicators.append(f"Content: {content_sig}")
|
245
|
+
|
246
|
+
# Verifica status codes
|
247
|
+
if "status_codes" in signatures:
|
248
|
+
if malicious.status_code in signatures["status_codes"]:
|
249
|
+
confidence += 20
|
250
|
+
indicators.append(f"Status: {malicious.status_code}")
|
251
|
+
|
252
|
+
# Verifica se houve bloqueio
|
253
|
+
if normal.status_code == 200 and malicious.status_code >= 400:
|
254
|
+
confidence += 25
|
255
|
+
indicators.append("Request malicioso bloqueado")
|
256
|
+
|
257
|
+
# Se confiança >= 50%, considera detectado
|
258
|
+
if confidence >= 50:
|
259
|
+
return WAFInfo(
|
260
|
+
name=waf_name,
|
261
|
+
confidence=min(confidence, 100),
|
262
|
+
indicators=indicators,
|
263
|
+
headers=detected_headers,
|
264
|
+
)
|
265
|
+
|
266
|
+
return None
|
267
|
+
|
268
|
+
def _detect_rate_limiting(self, normal: httpx.Response, malicious: httpx.Response) -> None:
|
269
|
+
"""Identifica indícios de rate limiting."""
|
270
|
+
indicators: Dict[str, str] = {}
|
271
|
+
|
272
|
+
if malicious.status_code in self.RATE_LIMIT_STATUS and normal.status_code not in self.RATE_LIMIT_STATUS:
|
273
|
+
indicators["status"] = str(malicious.status_code)
|
274
|
+
|
275
|
+
for header in self.RATE_LIMIT_HEADERS:
|
276
|
+
value = malicious.headers.get(header)
|
277
|
+
if value:
|
278
|
+
indicators[header] = value
|
279
|
+
|
280
|
+
if "too many requests" in malicious.text.lower():
|
281
|
+
indicators["body"] = "too many requests"
|
282
|
+
|
283
|
+
if indicators:
|
284
|
+
self.rate_limit_detected = indicators
|
285
|
+
logger.info("waf.detect.rate_limit", indicators=indicators)
|
286
|
+
|
287
|
+
async def _detect_captcha(self, response: httpx.Response) -> None:
|
288
|
+
"""Detecta e tenta contornar desafios CAPTCHA."""
|
289
|
+
content_lower = response.text.lower()
|
290
|
+
if not any(pattern in content_lower for pattern in self.CAPTCHA_PATTERNS):
|
291
|
+
return
|
292
|
+
|
293
|
+
logger.info("waf.captcha.detected")
|
294
|
+
|
295
|
+
if not self.captcha_solver_key or not self.captcha_solver_url:
|
296
|
+
self.captcha_attempt = CaptchaBypassResult(
|
297
|
+
provider=None,
|
298
|
+
success=False,
|
299
|
+
detail="captcha solver not configured",
|
300
|
+
)
|
301
|
+
return
|
302
|
+
|
303
|
+
attempt = await self._attempt_captcha_bypass(response)
|
304
|
+
self.captcha_attempt = attempt
|
305
|
+
if attempt.success:
|
306
|
+
logger.info("waf.captcha.bypass", provider=attempt.provider)
|
307
|
+
else:
|
308
|
+
logger.warning("waf.captcha.bypass_failed", detail=attempt.detail)
|
309
|
+
|
310
|
+
async def _attempt_captcha_bypass(self, response: httpx.Response) -> CaptchaBypassResult:
|
311
|
+
"""Tenta resolver CAPTCHA via serviço configurado."""
|
312
|
+
sitekey = self._extract_captcha_sitekey(response.text)
|
313
|
+
if not sitekey:
|
314
|
+
return CaptchaBypassResult(
|
315
|
+
provider=self.captcha_solver_url,
|
316
|
+
success=False,
|
317
|
+
detail="sitekey not found",
|
318
|
+
)
|
319
|
+
|
320
|
+
payload = {
|
321
|
+
"key": self.captcha_solver_key,
|
322
|
+
"sitekey": sitekey,
|
323
|
+
"url": self.target,
|
324
|
+
}
|
325
|
+
|
326
|
+
try:
|
327
|
+
async with httpx.AsyncClient(timeout=30.0) as client:
|
328
|
+
solver_response = await client.post(self.captcha_solver_url, json=payload)
|
329
|
+
|
330
|
+
if solver_response.status_code >= 400:
|
331
|
+
return CaptchaBypassResult(
|
332
|
+
provider=self.captcha_solver_url,
|
333
|
+
success=False,
|
334
|
+
detail=f"solver http {solver_response.status_code}",
|
335
|
+
)
|
336
|
+
|
337
|
+
data = solver_response.json()
|
338
|
+
token = data.get("token") or data.get("solution") or data.get("answer")
|
339
|
+
success = bool(token)
|
340
|
+
detail = data.get("status") or data.get("message")
|
341
|
+
|
342
|
+
return CaptchaBypassResult(
|
343
|
+
provider=self.captcha_solver_url,
|
344
|
+
success=success,
|
345
|
+
token=token,
|
346
|
+
detail=detail,
|
347
|
+
)
|
348
|
+
|
349
|
+
except Exception as exc: # pragma: no cover - depende de serviço externo
|
350
|
+
return CaptchaBypassResult(
|
351
|
+
provider=self.captcha_solver_url,
|
352
|
+
success=False,
|
353
|
+
detail=str(exc),
|
354
|
+
)
|
355
|
+
|
356
|
+
def _extract_captcha_sitekey(self, content: str) -> Optional[str]:
|
357
|
+
match = re.search(r"data-sitekey=\"([^\"]+)\"", content)
|
358
|
+
if match:
|
359
|
+
return match.group(1)
|
360
|
+
match = re.search(r"['\"]sitekey['\"].*?:.*?['\"]([^'\"]+)['\"]", content)
|
361
|
+
if match:
|
362
|
+
return match.group(1)
|
363
|
+
return None
|
364
|
+
|
365
|
+
def _build_ids_evasion_headers(self) -> Dict[str, str]:
|
366
|
+
"""Constrói headers para evasão de IDS/IPS."""
|
367
|
+
random_ip = ".".join(str(random.randint(1, 254)) for _ in range(4))
|
368
|
+
return {
|
369
|
+
"X-Forwarded-For": random_ip,
|
370
|
+
"X-Originating-IP": random_ip,
|
371
|
+
"X-Forwarded-Host": "localhost",
|
372
|
+
"Forwarded": f"for={random_ip}; proto=https",
|
373
|
+
"X-Requested-With": random.choice(["XMLHttpRequest", "Fetch"]),
|
374
|
+
}
|
375
|
+
|
376
|
+
async def _execute_bypass(
|
377
|
+
self,
|
378
|
+
client: httpx.AsyncClient,
|
379
|
+
technique: str,
|
380
|
+
payload: str,
|
381
|
+
) -> Optional[BypassMethod]:
|
382
|
+
try:
|
383
|
+
headers = self._build_ids_evasion_headers()
|
384
|
+
response: Optional[httpx.Response] = None
|
385
|
+
|
386
|
+
if technique == "http_parameter_pollution":
|
387
|
+
test_url = f"{self.target}?{payload}"
|
388
|
+
response = await client.get(test_url, headers=headers)
|
389
|
+
elif technique == "path_obfuscation":
|
390
|
+
test_url = f"{self.target.rstrip('/')}/{payload.lstrip('/')}"
|
391
|
+
response = await client.get(test_url, headers=headers)
|
392
|
+
elif technique == "method_override":
|
393
|
+
header_name, header_value = payload.split(":", 1)
|
394
|
+
headers[header_name.strip()] = header_value.strip()
|
395
|
+
response = await client.post(self.target, headers=headers, data="id=1")
|
396
|
+
elif technique == "header_noise":
|
397
|
+
name, value = payload.split(":", 1)
|
398
|
+
headers[name.strip()] = value.strip()
|
399
|
+
response = await client.get(self.target, headers=headers)
|
400
|
+
else:
|
401
|
+
parameter = "test"
|
402
|
+
encoded_payload = payload
|
403
|
+
if technique == "double_url_encoding":
|
404
|
+
encoded_payload = payload
|
405
|
+
elif technique == "encoding":
|
406
|
+
encoded_payload = payload
|
407
|
+
elif technique == "unicode":
|
408
|
+
encoded_payload = payload
|
409
|
+
test_url = f"{self.target}?{parameter}={encoded_payload}"
|
410
|
+
response = await client.get(test_url, headers=headers)
|
411
|
+
|
412
|
+
if response is None:
|
413
|
+
return None
|
414
|
+
|
415
|
+
success = response.status_code not in {403, 406, 503}
|
416
|
+
result = BypassMethod(
|
417
|
+
technique=technique,
|
418
|
+
success=success,
|
419
|
+
payload=payload,
|
420
|
+
response_code=response.status_code,
|
421
|
+
)
|
422
|
+
|
423
|
+
if success:
|
424
|
+
logger.info(
|
425
|
+
"waf.bypass.success",
|
426
|
+
technique=technique,
|
427
|
+
payload=payload[:60],
|
428
|
+
status=response.status_code,
|
429
|
+
)
|
430
|
+
else:
|
431
|
+
logger.debug(
|
432
|
+
"waf.bypass.blocked",
|
433
|
+
technique=technique,
|
434
|
+
status=response.status_code,
|
435
|
+
)
|
436
|
+
|
437
|
+
return result
|
438
|
+
|
439
|
+
except Exception as exc:
|
440
|
+
logger.debug("waf.bypass.error", technique=technique, error=str(exc))
|
441
|
+
return None
|
442
|
+
|
443
|
+
async def _run_advanced_bypass(self, client: httpx.AsyncClient) -> List[BypassMethod]:
|
444
|
+
"""Executa técnicas de bypass avançadas (chunked, padding etc.)."""
|
445
|
+
results: List[BypassMethod] = []
|
446
|
+
|
447
|
+
# Chunked encoding
|
448
|
+
async def chunked_body():
|
449
|
+
for chunk in [b"id=1", b"&value=payload"]:
|
450
|
+
yield chunk
|
451
|
+
|
452
|
+
try:
|
453
|
+
response = await client.post(
|
454
|
+
self.target,
|
455
|
+
headers={
|
456
|
+
"Transfer-Encoding": "chunked",
|
457
|
+
**self._build_ids_evasion_headers(),
|
458
|
+
},
|
459
|
+
content=chunked_body(),
|
460
|
+
)
|
461
|
+
success = response.status_code not in {403, 406, 503}
|
462
|
+
results.append(
|
463
|
+
BypassMethod(
|
464
|
+
technique="chunked_encoding",
|
465
|
+
success=success,
|
466
|
+
payload="chunked",
|
467
|
+
response_code=response.status_code,
|
468
|
+
)
|
469
|
+
)
|
470
|
+
except Exception as exc: # pragma: no cover - depende do backend aceitar chunked
|
471
|
+
logger.debug("waf.bypass.chunked_error", error=str(exc))
|
472
|
+
|
473
|
+
# Method tunneling using X-Original-Method
|
474
|
+
try:
|
475
|
+
headers = self._build_ids_evasion_headers()
|
476
|
+
headers.update({
|
477
|
+
"X-Original-Method": "DELETE",
|
478
|
+
"X-HTTP-Method-Override": "PUT",
|
479
|
+
})
|
480
|
+
response = await client.post(self.target, headers=headers, data="id=1")
|
481
|
+
success = response.status_code not in {403, 406, 503}
|
482
|
+
results.append(
|
483
|
+
BypassMethod(
|
484
|
+
technique="method_tunneling",
|
485
|
+
success=success,
|
486
|
+
payload="X-Original-Method",
|
487
|
+
response_code=response.status_code,
|
488
|
+
)
|
489
|
+
)
|
490
|
+
except Exception as exc:
|
491
|
+
logger.debug("waf.bypass.method_tunnel_error", error=str(exc))
|
492
|
+
|
493
|
+
# Padding large headers
|
494
|
+
try:
|
495
|
+
padding = "A" * 2048
|
496
|
+
headers = self._build_ids_evasion_headers()
|
497
|
+
headers["X-Padding"] = padding
|
498
|
+
response = await client.get(self.target, headers=headers)
|
499
|
+
success = response.status_code not in {403, 406, 503}
|
500
|
+
results.append(
|
501
|
+
BypassMethod(
|
502
|
+
technique="header_padding",
|
503
|
+
success=success,
|
504
|
+
payload="2048-bytes",
|
505
|
+
response_code=response.status_code,
|
506
|
+
)
|
507
|
+
)
|
508
|
+
except Exception as exc:
|
509
|
+
logger.debug("waf.bypass.padding_error", error=str(exc))
|
510
|
+
|
511
|
+
return results
|
512
|
+
|
513
|
+
async def _run_bypass_chains(self, client: httpx.AsyncClient) -> List[BypassMethod]:
|
514
|
+
"""Executa cadeias de técnicas combinadas."""
|
515
|
+
chain_candidates = [
|
516
|
+
("encoding", "comment_injection"),
|
517
|
+
("case_variation", "unicode"),
|
518
|
+
("encoding", "null_byte"),
|
519
|
+
]
|
520
|
+
|
521
|
+
results: List[BypassMethod] = []
|
522
|
+
base_payload = "SELECT 1 FROM users WHERE '1'='1'"
|
523
|
+
|
524
|
+
for chain in chain_candidates:
|
525
|
+
payload = base_payload
|
526
|
+
for technique in chain:
|
527
|
+
payload = self._apply_transform(technique, payload)
|
528
|
+
|
529
|
+
test_url = f"{self.target}?chain={quote(payload)}"
|
530
|
+
try:
|
531
|
+
response = await client.get(test_url, headers=self._build_ids_evasion_headers())
|
532
|
+
success = response.status_code not in {403, 406, 503}
|
533
|
+
results.append(
|
534
|
+
BypassMethod(
|
535
|
+
technique="+".join(chain),
|
536
|
+
success=success,
|
537
|
+
payload=payload[:80],
|
538
|
+
response_code=response.status_code,
|
539
|
+
)
|
540
|
+
)
|
541
|
+
except Exception as exc:
|
542
|
+
logger.debug("waf.bypass.chain_error", chain="+".join(chain), error=str(exc))
|
543
|
+
|
544
|
+
return results
|
545
|
+
|
546
|
+
def _apply_transform(self, technique: str, payload: str) -> str:
|
547
|
+
"""Aplica transformação ao payload base."""
|
548
|
+
if technique == "encoding":
|
549
|
+
return quote(payload, safe="")
|
550
|
+
if technique == "comment_injection":
|
551
|
+
return payload.replace(" ", "/**/")
|
552
|
+
if technique == "case_variation":
|
553
|
+
return "".join(
|
554
|
+
c.upper() if random.random() > 0.5 else c.lower() for c in payload
|
555
|
+
)
|
556
|
+
if technique == "unicode":
|
557
|
+
return "".join(f"\\u{ord(c):04x}" for c in payload)
|
558
|
+
if technique == "null_byte":
|
559
|
+
return payload + "%00"
|
560
|
+
return payload
|
561
|
+
async def attempt_bypass(self) -> List[BypassMethod]:
|
562
|
+
"""Tenta bypass automático do WAF."""
|
563
|
+
logger.info("waf.bypass.start", target=self.target)
|
564
|
+
|
565
|
+
results = []
|
566
|
+
|
567
|
+
async with httpx.AsyncClient(timeout=self.timeout, follow_redirects=True) as client:
|
568
|
+
# Testa cada técnica de bypass
|
569
|
+
for technique, payloads in self.BYPASS_PAYLOADS.items():
|
570
|
+
for payload in payloads:
|
571
|
+
result = await self._execute_bypass(client, technique, payload)
|
572
|
+
if result:
|
573
|
+
results.append(result)
|
574
|
+
await asyncio.sleep(0.2)
|
575
|
+
|
576
|
+
results.extend(await self._run_advanced_bypass(client))
|
577
|
+
results.extend(await self._run_bypass_chains(client))
|
578
|
+
|
579
|
+
successful = [r for r in results if r.success]
|
580
|
+
logger.info("waf.bypass.complete", total=len(results), successful=len(successful))
|
581
|
+
|
582
|
+
return results
|
583
|
+
|
584
|
+
|
585
|
+
__all__ = ["WAFDetector", "WAFInfo", "BypassMethod", "CaptchaBypassResult"]
|