-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathextractports
More file actions
25 lines (22 loc) · 796 Bytes
/
extractports
File metadata and controls
25 lines (22 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
#
#Extraer puertos para posterior análisis.
#
#
if [[ -z $1 ]] ; then
echo " "
echo "[x]Necesitas pasar la captura grepeable de nmap."
echo " "
exit
fi
targeted=`cat $1 | grep -oP '\d{1,5}/open' | awk '{print $1}' FS='/' | xargs | tr ' ' ','`
echo "$targeted" | xclip -sel clip
echo " "
echo "$(tput setaf 6)[$(tput setaf 1)+$(tput setaf 6)]Información de escaneo: "
echo ""
echo -n "[$(tput setaf 1)*$(tput setaf 6)]$(tput setaf 3)Puertos disponibles: " && cat $1 | grep -oP '\d{1,5}/open' | awk '{print $1}' FS='/' | xargs | tr ' ' ','
echo " "
echo -n "$(tput setaf 6)[$(tput setaf 1)+$(tput setaf 6)]IP targeteada: " && cat $1 | grep -oP '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u
echo " "
echo "$(tput setaf 4)Puertos copiados en la clipboard."
echo " "