View difference between Paste ID: xNaZxRGA and tYpwpauW
SHOW: | | - or go back to the newest paste.
1
# Extract nmap information
2
function extractPorts(){
3
	ports="$(cat $1 | grep -oP '\d{1,5}/open' | awk '{print $1}' FS='/' | xargs | tr ' ' ',')"
4
	ip_address="$(cat $1 | grep -oP '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}' | sort -u | head -n 1)"
5
	echo -e "\n[*] Extracting information...\n" > extractPorts.tmp
6
	echo -e "\t[*] IP Address: $ip_address"  >> extractPorts.tmp
7
	echo -e "\t[*] Open ports: $ports\n"  >> extractPorts.tmp
8
	echo $ports | tr -d '\n' | xclip -sel clip
9
	echo -e "[*] Ports copied to clipboard\n"  >> extractPorts.tmp
10
	cat extractPorts.tmp; rm extractPorts.tmp
11
}