Created
January 21, 2020 14:35
-
-
Save chasgames/bd061a4faa312c3ea8256cd3aac23545 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### One-liner in bash to expand all subnets and save to new file | |
while read p; do $(nmap -n -sL $p | awk '/Nmap scan report/{print $NF}' >> allips); done < allipsubnets | |
### One-liner in bash to get all the IPs and find them in txt file. | |
### ^ used to find compare IP at starting line, otherwise can pick an IP within IP. e.g. 1.1.1.1 will find 21.1.1.1 | |
while read p; do $(grep -n "^$p" ~/myfolder/*.txt >> output &); done < allips | |
### for reference ### | |
#while read p; do $(grep -iRnw ~/myfolder/*.txt --exclude={file1,file2,file3} -e "$p" >> output &); done < allips |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment