Skip to content

Commit

Permalink
grep scripts fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
maldevel committed Mar 11, 2020
1 parent b49146b commit 16745b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# This file is part of PenTestKit
# Copyright (C) 2017-2018 @maldevel
# Copyright (C) 2017-2020 @maldevel
# https://github.com/maldevel/PenTestKit
#
# PenTestKit - Useful tools for Penetration Testing.
Expand Down Expand Up @@ -35,21 +35,20 @@ if [ $# -eq 1 ]; then
space=","
hostports=""

echo "### $host"
echo
echo -n "* "

for port in $ports; do
openport=$(expr match "$port" '\(.*\(open\|open|filtered\)/\(tcp\|udp\).*\)')
if [ -n "$openport" ]; then
hostports=$hostports$(echo $openport|sed 's|/| |g'|sed -n -e 's/open.*//p'|sed 's/ *//g')$space
fi
done

if [ -n "$hostports" ]; then
echo "### $host"
echo
echo "* $hostports"
echo
cleanport=$(echo $openport|sed 's|/| |g'|sed -n -e 's/open.*//p'|sed 's/ *//g')" "
echo -n $cleanport
fi
done

echo
echo
done
else
echo "Please provide a directory path."
fi
File renamed without changes.

0 comments on commit 16745b4

Please sign in to comment.