...so for now, i modified the script with a counter in the loop - it is set up to 50 simultaneous nmap's then break for 20 seconds... but actual i am not as happy with that
[code]#!/bin/bash
# Script origin written by ???
#
# Strongly enhanced by Flo M.
. linux.config
# Check if any nmap is running....
ps aux | grep -v grep | grep 'nmap -v -O -oN nmap.txt' > /dev/zero
if [ "$?" == "0" ]; then
echo
echo "Some other nmap processes of openaudit running..."
echo "Use 'ps aux | grep nmap' to find out!"
echo "Quitting now...!"
echo
exit 1
fi
function portscan {
# A directory of each ip is needed to prevent overlapping...
mkdir "$NMAP_NET.$a"
cd "$NMAP_NET.$a"
# Starting the portscan...
nmap_file="nmap.txt"
nmap_input=`nmap -v -O -oN $nmap_file $NMAP_NET.$a`
nmap_output=`cat $nmap_file`
# Transfer to openaudit...
wget -q --post-data="submit=submit&add=$nmap_output" http://"$OASERVER"/oa/admin_nmap_input.php
# Cleaning up...
cd ..
rm -rf "$NMAP_NET.$a"
}
i=0
for ((a=$NMAP_START; a <= $NMAP_END ; a++)); do
portscan $a &
let i++
if [ $i -ge 50 ]; then
sleep 20
i=0
fi
done
[/code]