This script creates and sends spoofed DNS queries to DNS servers, aiming to amplify requests to a target IP address. It is intended for educational purposes and network diagnostics.
- Constructs a DNS query for a given domain.
- Sends the DNS query to a specified DNS server.
- Spoofs the source IP to amplify the DNS response to a target IP address.
- Validates IP addresses.
- Handles socket timeouts and errors.
- Logs activities and errors to a log file.
- Python 3.x
-
Clone the repository or download the script:
git clone https://github.com/thekogami/gilgamesh.git cd gilgamesh
-
Ensure you have Python 3.x installed on your machine.
-
Modify the variables in the script as needed:
target_ip
: The target IP address.dns_server
: The DNS server address.domain
: The domain to query.
-
Run the script with the following command:
sudo python main.py
This function constructs a DNS query for a given domain.
Parameters:
domain
(str): The domain name to query.
Returns:
bytes
: The constructed DNS query.
This function checks if a given IP address is valid.
Parameters:
ip
(str): The IP address to validate.
Returns:
bool
:True
if the IP address is valid,False
otherwise.
This function sends a DNS query to a DNS server and spoofs the response to a target IP.
Parameters:
target_ip
(str): The IP address of the target.dns_server
(str): The IP address of the DNS server.domain
(str): The domain name to query.
Exceptions:
- Handles socket timeouts, general socket errors, and other exceptions.
if __name__ == "__main__":
import logging
logging.basicConfig(
level=logging.INFO,
filename='dns.log',
filemode='a',
format='%(asctime)s - %(levelname)s - %(message)s'
)
target_ip = "192.0.2.1" # IP address of the target
dns_server = "8.8.8.8" # Public DNS server (Google DNS)
domain = "example.com" # Domain to query
send_amplified_request(target_ip, dns_server, domain)
- Ethical Use: Ensure the code is used for legitimate purposes, such as network diagnostics or educational purposes.
- Security Concerns: Be aware that misuse of this script can lead to DNS amplification attacks, which are illegal and unethical.
This project is licensed under the MIT License. See the LICENSE
file for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
For any questions or concerns, please open an issue in the repository.
This script is intended for educational purposes only. The author is not responsible for any misuse of this script.