├── .gitignore ├── LICENSE ├── README.md ├── Subdomain.txt └── script.py /.gitignore: -------------------------------------------------------------------------------- 1 | ### AL ### 2 | #Template for AL projects for Dynamics 365 Business Central 3 | #launch.json folder 4 | .vscode/ 5 | #Cache folder 6 | .alcache/ 7 | #Symbols folder 8 | .alpackages/ 9 | #Snapshots folder 10 | .snapshots/ 11 | #Testing Output folder 12 | .output/ 13 | #Extension App-file 14 | *.app 15 | #Rapid Application Development File 16 | rad.json 17 | #Translation Base-file 18 | *.g.xlf 19 | #License-file 20 | *.flf 21 | #Test results file 22 | TestResults.xml -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Trojan hax 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DNS brute force 2 | 3 | The DNS Lookup Tool is a Python script that performs DNS lookups for a list of IP addresses and appends a domain name to each IP address. This tool can be helpful for discovering domain names associated with specific IP addresses. 4 | 5 | ## Features 6 | 7 | - Resolve IP addresses to domain names using the `host` command. 8 | - Input a list of IP addresses from a file. 9 | - Customize the domain name to append to each IP address. 10 | - Save the results to an output file. 11 | 12 | ## Usage 13 | 14 | 1. Clone the repository or download the script to your local machine. 15 | 16 | 2. Ensure you have Python 3.x installed. 17 | 18 | 3. Open a terminal or command prompt and navigate to the directory where the script is located. 19 | 20 | 4. Run the script with the following command: 21 | 22 | ```bash 23 | python script.py -f -d -o 24 | ``` 25 | Replace , , and with your desired values: 26 | 27 | - : Path to the file containing the list of IP addresses. 28 | - : The domain name you want to append to each IP address. 29 | - : Path to the file where you want to save the results. 30 | 31 | For example: 32 | 33 | ```bash 34 | python script.py -f Subdomain.txt -d example.com -o results.txt 35 | ``` 36 | 1. The script will read the list of IP addresses from the input file, perform DNS lookups, and save the results to the output file. 37 | # Donate Me 38 | Buy Me A Coffee 39 | 40 | # License 41 | This project is licensed under the MIT License - see the LICENSE file for details. 42 | -------------------------------------------------------------------------------- /script.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import argparse 3 | 4 | def host_lookup(ip, domain): 5 | """Performs a DNS lookup for the given IP address and domain.""" 6 | result = subprocess.run(["host", f"{ip}.{domain}"], capture_output=True, text=True) 7 | return result.stdout 8 | 9 | def main(): 10 | parser = argparse.ArgumentParser(description='Resolve IP addresses to domain names using the host command.') 11 | parser.add_argument('-f', '--file', required=True, help='Path to the file containing IP addresses') 12 | parser.add_argument('-d', '--domain', required=True, help='Domain name to append to each IP address') 13 | parser.add_argument('-o', '--output', required=True, help='Path to the output file for saving the results') 14 | 15 | args = parser.parse_args() 16 | 17 | # Read the IP addresses from the file 18 | ips = [] 19 | with open(args.file, 'r') as f: 20 | for line in f: 21 | ips.append(line.strip()) 22 | 23 | # Perform DNS lookups for all IP addresses 24 | results = [] 25 | for ip in ips: 26 | result = host_lookup(ip, args.domain) 27 | results.append(result) 28 | 29 | # Save the results to the output file 30 | with open(args.output, 'w') as output_file: 31 | for result in results: 32 | output_file.write(result) 33 | 34 | if __name__ == '__main__': 35 | main() 36 | --------------------------------------------------------------------------------