Skip to content

Commit b74c1fe

Browse files
authored
Add files via upload
1 parent a34d5b9 commit b74c1fe

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

searchnse.old

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
if [ "$1" = "-h" ]
3+
then
4+
echo "SEARCH THE NMAP SCRIPTING ENGINE DATABASE
5+
by midnightseer
6+
7+
<arg1> <filter-term>
8+
# arg 1 - search term
9+
# arg 2 - optional: an additional filter-term / search parameter"
10+
exit
11+
fi
12+
filter=$2
13+
function print_divs() {
14+
a=$1
15+
for i in $(seq ${#a})
16+
do
17+
echo -n "="
18+
done
19+
}
20+
SAVEIFS=$IFS # Save current IFS
21+
IFS=$'\n' # Change IFS to new line
22+
db_output=$(grep $1 /usr/share/nmap/scripts/script.db)
23+
if [[ ! -z $filter ]]
24+
then
25+
db_output=$(echo "$db_output" | grep $filter)
26+
fi
27+
db_array=($db_output)
28+
IFS=$SAVEIFS
29+
for line in "${db_array[@]}"
30+
do
31+
script_name=$(echo "$line" | cut -d " " -f5 | sed 's/,//g' | sed 's/"//g')
32+
#echo "nmap --script-help=$script_name"
33+
help_output=$(nmap --script-help=$script_name)
34+
script_args=$(cat /usr/share/nmap/scripts/$script_name | sed -n -e '/-- @args/,/auth.*/ p')
35+
echo -n "="
36+
print_divs $script_name
37+
echo "="
38+
echo " $script_name "
39+
echo -n "="
40+
print_divs $script_name
41+
echo "="
42+
echo "$help_output" | sed -e '1,3d'
43+
echo "Script Supplemental Help:"
44+
echo "$script_args"
45+
done

0 commit comments

Comments
 (0)