I'm trying to make a code that will send an HTTP get request to a site and will save the content in an HTML file using scapy.
So if that my code:
r = Ether() / IP(dst=cache_ip) / TCP() / "GET /index.html HTTP/1.0 nn"
b = str(r)
http.write(b)
print "html page is ready, check your html files folder to check"
http.close()
And cache_ip is the IP of Google than the output should be the HTML page of Google saved in HTML file on my computer... Instad I get this:
ÿÿÿÿÿÿ<¨*â-LEC@ Þ QÚûPP PÛGET /index.html HTTP/1.0
Now I know that there is a much better modulus for the work like requests but my mission is to do it in scapy only. If any one can point the problem and offer a better code for the job written using scapy it will be great
Aucun commentaire:
Enregistrer un commentaire