Skip to content

Commit

Permalink
remove filtered ports
Browse files Browse the repository at this point in the history
  • Loading branch information
maldevel committed Sep 12, 2019
1 parent 0fbe248 commit 207ec84
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion grep/nmap-grep-unique-open-ports-comma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# For more see the file 'LICENSE' for copying permission.

if [ $# -eq 1 ]; then
cat $1/*.gnmap | grep "Ports:" | cut -d' ' -f4- | tr ',' '\n' | sed -n -e 's/\/open.*//p' | sed -e 's/^[ \t]*//' | sort -n | uniq | tr '\n' ',' | sed 's/,$//g'
cat $1/*.gnmap | grep "Ports:" | cut -d' ' -f4- | tr ',' '\n' | grep -v 'filtered' | sed -n -e 's/\/open.*//p' | sed -e 's/^[ \t]*//' | sort -n | uniq | tr '\n' ',' | sed 's/,$//g'
echo
else
echo "Please provide a directory path."
Expand Down
2 changes: 1 addition & 1 deletion grep/nmap-grep-unique-open-ports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# For more see the file 'LICENSE' for copying permission.

if [ $# -eq 1 ]; then
cat $1/*.gnmap | grep "Ports:" | cut -d' ' -f4- | tr ',' '\n' | sed -n -e 's/\/open.*//p' | sed -e 's/^[ \t]*//' | sort -n | uniq
cat $1/*.gnmap | grep "Ports:" | cut -d' ' -f4- | tr ',' '\n' | grep -v 'filtered' | sed -n -e 's/\/open.*//p' | sed -e 's/^[ \t]*//' | sort -n | uniq
else
echo "Please provide a directory path."
fi

0 comments on commit 207ec84

Please sign in to comment.