Last active
February 14, 2020 10:32
-
-
Save zPrototype/a4f2d326c2c2963d407f74953a3b3586 to your computer and use it in GitHub Desktop.
Fun with scapy
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
from scapy.all import * | |
def emptyLine(): | |
print("****************************************") | |
Url = input("Enter domain name: ") | |
emptyLine() | |
dnsResponse = sr1(IP(dst="8.8.8.8") / UDP(dport=53) / DNS(rd=1, qd=DNSQR(qname=Url))) | |
emptyLine() | |
print(dnsResponse.summary()) | |
emptyLine() | |
print("Name:", dnsResponse[DNS].name) | |
emptyLine() | |
print(repr(dnsResponse[DNS])) | |
emptyLine() | |
print("Layers:", dnsResponse[DNS].ancount) | |
emptyLine() | |
for i in range(dnsResponse[DNS].ancount): | |
print(dnsResponse[DNSRR][i].rdata) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment