diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 10c6e91..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" diff --git a/.mergify.yml b/.mergify.yml deleted file mode 100644 index 5349120..0000000 --- a/.mergify.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Adapted from https://doc.mergify.io/examples.html#running-ci-pipelines-automatically -# Validate your changes with: -# $ curl -F 'data=@.mergify.yml' https://gh.mergify.io/validate/ - -pull_request_rules: - - name: Automatic merges for Dependabot pull requests - conditions: - - author~=^dependabot(|-preview)\[bot\]$ - - check-success=build (ubuntu-latest, 3.9) - - check-success=build (ubuntu-latest, 3.10) - - check-success=build (ubuntu-latest, 3.11) - - check-success=build (ubuntu-latest, 3.12) - - check-success=build (windows-latest, 3.9) - - check-success=build (windows-latest, 3.10) - - check-success=build (windows-latest, 3.11) - - check-success=build (windows-latest, 3.12) - - check-success=build (macos-latest, 3.9) - - check-success=build (macos-latest, 3.10) - - check-success=build (macos-latest, 3.11) - - check-success=build (macos-latest, 3.12) - actions: - merge: - method: squash - - - name: Be author's friend - conditions: - - author~=^joaolfp - - check-success=build (ubuntu-latest, 3.9) - - check-success=build (ubuntu-latest, 3.10) - - check-success=build (ubuntu-latest, 3.11) - - check-success=build (ubuntu-latest, 3.12) - - check-success=build (windows-latest, 3.9) - - check-success=build (windows-latest, 3.10) - - check-success=build (windows-latest, 3.11) - - check-success=build (windows-latest, 3.12) - - check-success=build (macos-latest, 3.9) - - check-success=build (macos-latest, 3.10) - - check-success=build (macos-latest, 3.11) - - check-success=build (macos-latest, 3.12) - actions: - merge: - method: squash diff --git a/assets/dir.png b/assets/dir.png index 75d146b..4476087 100644 Binary files a/assets/dir.png and b/assets/dir.png differ diff --git a/assets/subdomain.png b/assets/subdomain.png index 79235ad..a440b9c 100644 Binary files a/assets/subdomain.png and b/assets/subdomain.png differ diff --git a/dirMagic.py b/dirMagic.py index a1b1470..df71ef8 100644 --- a/dirMagic.py +++ b/dirMagic.py @@ -4,7 +4,7 @@ from rich.console import Console def header(): - print(""" + print(r""" _______ __ .______ .___ ___. ___ _______ __ ______ | \ | | | _ \ | \/ | / \ / _____|| | / | | .--. || | | |_) | | \ / | / ^ \ | | __ | | | ,----' @@ -34,11 +34,11 @@ def find_dir(): for directory in directories: directory = directory.strip() - response = requests.get(url+directory) + response = requests.get(url + directory) if response.status_code != 404: - print("{} - {}".format(url+directory, response.status_code)) - all_results.append("{} - {}".format(url+directory, response.status_code)) + print("{} - {}".format(url + directory, response.status_code)) + all_results.append("{} - {}".format(url + directory, response.status_code)) with open("directories_found.txt", 'w') as file: for item in all_results: @@ -48,17 +48,31 @@ def find_dir(): except KeyboardInterrupt: print("\n Bye!!!") sys.exit() - except: - print("an error happened") + except Exception as e: + print(f"An error happened: {e}") sys.exit() +def test_subdomain(subdomain): + try: + resolver = dns.resolver.Resolver() + responses = resolver.resolve(subdomain, "A") + return True + except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.resolver.NoNameservers): + return False + except Exception as e: + print(f"An error happened: {e}") + return False + def find_subdomains(): try: print("\n") domain = input("Domain: ") wordlist = input("WordList: ") - print("\n -------------- search --------------") + console = Console() + console.print("\n -------------- search --------------", style="#af00ff") + + all_results = [] with open(wordlist, "r") as file: words = file.read().splitlines() @@ -66,20 +80,25 @@ def find_subdomains(): for word in words: subdomain = "{}.{}".format(word, domain) - try: - resolver = dns.resolver.Resolver() - responses = resolver.resolve(subdomain, "A") - print("{}".format(subdomain)) - except KeyboardInterrupt: - print("\n Bye!!!") - sys.exit() - except: - pass + if test_subdomain(subdomain): + try: + response = requests.get("http://" + subdomain) + if response.status_code != 404: + print("{}".format(subdomain)) + all_results.append(subdomain) + except requests.RequestException as e: + print(f"Failed to request {subdomain}: {e}") + + with open("subdomains_found.txt", 'w') as file: + for item in all_results: + file.write("{}\n".format(item)) + + console.print("Saved in the subdomains_found.txt file", style="#008000") except KeyboardInterrupt: print("\n Bye!!!") sys.exit() - except: - print("an error happened") + except Exception as e: + print(f"An error happened: {e}") sys.exit() if __name__ == "__main__": @@ -99,4 +118,4 @@ def find_subdomains(): print("This option does not exist") except KeyboardInterrupt: print("\n Bye!!!") - sys.exit() + sys.exit() \ No newline at end of file diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..096594f --- /dev/null +++ b/renovate.json @@ -0,0 +1,12 @@ +{ + "extends": [ + "config:base" + ], + "packageRules": [ + { + "packagePatterns": ["*"], + "groupName": "all dependencies", + "automerge": false + } + ] +}