Difference between revisions of "nmap random source IP spoofing script"

From thelinuxwiki
Jump to: navigation, search
Line 10: Line 10:
 
   SOURCEIP=`echo $((RANDOM%=223))"."$((RANDOM%=255))"."$((RANDOM%=255))"."$((RANDOM%=254))`
 
   SOURCEIP=`echo $((RANDOM%=223))"."$((RANDOM%=255))"."$((RANDOM%=255))"."$((RANDOM%=254))`
 
   echo "running nmap with spoofed source IP $SOURCEIP"
 
   echo "running nmap with spoofed source IP $SOURCEIP"
  nmap -n --max-retries 1 --host-timeout 1 -e eth1 -sS -S $SOURCEIP $DSTIP -Pn -p 80
 
 
   nmap -n --max-retries 1 --host-timeout 1 -e eth1 -sS -S $SOURCEIP $DSTIP -Pn -p $RNDPORT
 
   nmap -n --max-retries 1 --host-timeout 1 -e eth1 -sS -S $SOURCEIP $DSTIP -Pn -p $RNDPORT
 
  done
 
  done
  
 
[[category:nmap]]
 
[[category:nmap]]

Revision as of 01:00, 9 May 2013


#!/bin/bash

LIMIT=$1 DSTIP=$2
for i in `seq $LIMIT` do echo "limit = $LIMIT" RNDPORT=`echo $((RANDOM%=65535))` SOURCEIP=`echo $((RANDOM%=223))"."$((RANDOM%=255))"."$((RANDOM%=255))"."$((RANDOM%=254))` echo "running nmap with spoofed source IP $SOURCEIP" nmap -n --max-retries 1 --host-timeout 1 -e eth1 -sS -S $SOURCEIP $DSTIP -Pn -p $RNDPORT done