TNFModding

Basic Auto Dumper [sh file]

Jul 11th, 2021 (edited)
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. export pktname
  2.  
  3. interface=eth0
  4. dumpdir=/root/dumps
  5.  
  6. while /bin/true; do
  7. pkt_old=`grep $interface: /proc/net/dev | cut -d : -f2 | awk '{ print $2 }'`
  8. sleep 1
  9. pkt_new=`grep $interface: /proc/net/dev | cut -d : -f2 | awk '{ print $2 }'`
  10.  
  11. pkt=$(( $pkt_new - $pkt_old ))
  12. echo -ne "\r$pkt packets/s\033[0K"
  13.  
  14. if [ $pkt -gt 1000 ]; then
  15. echo -e "\n`date` Under Attack. Capturing..."
  16. pktname="dump_`date +%d-%m-%y_%H:%M:%S`.pcap"
  17. tcpdump -i $interface -t -w $dumpdir/dump_`date +%d-%m-%y_%H:%M:%S`.pcap -c 10000
  18. echo "`date` Packets Captured. Sleeping..."
  19. sleep 1800
  20. fi
  21. done
Add Comment
Please, Sign In to add comment