Last active
June 9, 2026 16:36
-
-
Save b4ldr/2adaddebd803a3b74635ffb3ff55eb19 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| from scapy.all import IP, UDP, DNS, DNSQR, DNSRR, RandShort, send | |
| dns_resp = DNS( | |
| id=0x1234, | |
| qr=1, | |
| opcode=15, | |
| rcode=7, | |
| aa=0, | |
| rd=1, | |
| ra=1, | |
| qdcount=1, | |
| ancount=1, | |
| nscount=0, | |
| arcount=0, | |
| ) | |
| packet = IP( | |
| src="104.152.52.205", | |
| dst="199.7.83.42" | |
| ) / UDP( | |
| sport=34324, | |
| dport=53 | |
| ) / dns_resp | |
| packet.show() | |
| # wrpcap("dns_forged.pcap", packet) # Save to pcap for analysis | |
| send(packet) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment