Last active
December 19, 2021 15:23
-
-
Save angeloped/0b6356facd0da913e66054cd543e43d2 to your computer and use it in GitHub Desktop.
Client request on .onion domains through TOR proxy.
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
import socks | |
import socket | |
host = 'ifconfig.me' | |
host = 'libraryqtlpitkix.onion' | |
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050, True) | |
s = socks.socksocket() | |
s.connect((host, 80)) | |
message = "GET / HTTP/1.1\r\nHost: {0}\r\n\r\n".format(host) | |
s.sendall(message) | |
reply = s.recv(9069) | |
print reply |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment