SHARE
TWEET

echo_client_tor

DeaD_EyE Oct 7th, 2019 121 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sys
  2. import socks
  3.  
  4. # pip install pysocks [--user] oder in einem venv
  5. # https://pypi.org/project/PySocks/
  6. # tor muss laufen
  7.  
  8.  
  9. def echo_client(host, port, msg, proxy_ip='localhost', proxy_port=9050):
  10.     sock = socks.socksocket()
  11.     sock.set_proxy(socks.SOCKS5, proxy_ip, proxy_port)
  12.     sock.connect((host, port))
  13.     sock.sendall(msg)
  14.     return sock.recv(1024)
  15.  
  16. try:
  17.     msg = input('Bitte Nachricht eingeben: ')
  18. except KeyboardInterrupt:
  19.     sys.exit(1)
  20.  
  21. host, port = 'nnpa3jqbdjoafuzh.onion', 5000
  22. # demo server läuft momentan
  23. # have fun with hacking, server is up
  24.  
  25. try:
  26.     rep = echo_client(host, port, msg.encode())
  27. except Exception as e:
  28.     print(e)
  29. except KeyboardInterrupt:
  30.     pass
  31. else:
  32.     print(rep.decode())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top