Skip to content

Instantly share code, notes, and snippets.

View cihanmehmet's full-sized avatar
🔍
just do good searching

Cihan Mehmet DOĞAN (CMD) cihanmehmet

🔍
just do good searching
View GitHub Profile
@cihanmehmet
cihanmehmet / nmap_sn.sh
Last active September 25, 2019 11:43
nmap_sn.sh
#!/bin/bash
nmap -sn -iL $1 |grep "Nmap scan report for"|grep -Eo "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"|sort -u |tee $1.txt
echo "Detect IP $(wc -l $1.txt|awk '{ print $1 }' )" "=> result_${1}" "saved"
echo "File Location : "$(pwd)/"result_$1"