sergio_educacionit

conn_monitor.sh

Apr 28th, 2026
146
0
Never
5
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4.  
  5. host="$1"
  6.  
  7. func_netstat () {
  8.  
  9. echo "Conexiones activas:"
  10. netstat -tn | grep ESTABLISHED
  11.  
  12. }
  13.  
  14.  
  15. while :;do
  16.  
  17. clear
  18. echo "Esperando conexion del host '$host'"
  19.  
  20. func_netstat
  21. if func_netstat | grep ":80" | grep $host; then
  22.  
  23. echo se contro el host $host
  24. echo escaneando ip
  25. nmap $host
  26.  
  27. break # interrumpe el bucle
  28. fi
  29.  
  30. sleep 0.5
  31.  
  32. done
  33.  
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
Add Comment
Please, Sign In to add comment