Advertisement
smirnov

masscan scan parts

Oct 19th, 2019
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.40 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. EU=($(wget -U "Mozilla/5.0" -qO- "https://lite.ip2location.com/ip-address-ranges-by-country" | \
  4. grep "ip-address-ranges" | grep -Po '(?<=href=")[^"]*(?=")' | \
  5. sed '1d;$d' | xargs -I {} echo "https://lite.ip2location.com{}" | \
  6. grep -e russia -e ukraine -e france -e spain -e sweden -e norway -e germany -e finland -e poland \
  7. -e italy -e united-kingdom -e romania -e belarus -e kazakhstan -e greece -e bulgaria -e iceland -e hungary \
  8. -e portugal -e austria -e czech -e serbia -e ireland -e lithuania -e latvia -e croatia -e bosnia -e slovakia -e estonia \
  9. -e denmark -e switzerland -e netherlands -e moldova -e belgium -e armenia -e albania -e macedonia -e turkey -e slovenia \
  10. -e montenegro -e kosovo -e cyprus -e azerbaijan -e luxembourg -e georgia -e andorra -e malta -e liechtenstein -e san-marino -e monaco -e vatican))
  11.  
  12. for c in "${EU[@]}"; do
  13.     wget -U "Mozilla/5.0" --no-cache -qO- "$c" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | awk '{getline subnet; printf("%s-%s\n", $0,subnet)}' >> out.txt
  14.     echo "DONE: $c"
  15. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement