How to compile ? |
GPS requires libnet and libpcap (take a look at the 'links' section for further information).
To compile it with gcc:
bash$ gcc -Wall gps.c services.c -o gps -lpcap `libnet-config --defines --libs`
|
|
Options: |
basic:
|
-s xxx.xxx.xxx.xxx[,yyy.yyy.yyy.yyy[,zzz.zzz.zzz.zzz-ZZZ..]]
|
The list of IP addresses specified here is used by GPS as spoofed source addresses (the host been scanned will think that the packets come from these IPs).
For example: -s 192.168.1.4,192.168.1.7-10,192.168.1.25 tells GPS to use 192.168.1.4/7/8/9/10/25 as spoofed source IP.
Important: if you are scanning a host through the Internet and if you want to get some packets back, you need to specify source IP addresses which belong to your LAN, in order to make the responses to come back on a wire you may sniff.
|
|
-d xxx.xxx.xxx.xxx
|
This option is simply used to specify the target's IP (not the hostname).
|
|
optional:
|
-t scan_type
|
scan_type is the scan mode to use.
The default mode is 'syn', which is the most reliable. The other types are: fin, null, xmas, rand, ack and fwrd. Take a look to the 'features' section for details.
|
|
-w time_to_wait
|
time_to_wait is the time (in seconds) between packets sending end and the sniffer closing.
It is an unelegant way grab enough packets with the sniffer.
The default value is 5 seconds, and is suited if you scan an host on the same LAN.
If you scan an host through the Internet, increase this time to more than 120 seconds (depends on the band width). Some experiments may help..
|
|
-r packets_flow
|
packets_flow influes on the time between each packet sending.
The available packets flows are: insane (default), aggressive, normal, polite and paranoid (deja vu ?).
|
|
-p first_port-last_port
|
first_port and last_port are used to specify a port range (I am sure you didn't guess :).
The default port range is 1-1024.
The port scan order is hopefully randomized.
|
|
-k 0|1
|
This option is used to scan 'well-known' ports (if 1 is specified).
These ports are listed in the services.c file.
Be careful: the use of option -p do not influence this option.
|
|
|
Examples: |
bash# ./gps -s 192.168.1.56 -d 192.168.1.1
|
This is the most basic command line. GPS will perform a SYN scan against 192.168.1.1 using the spoofed IP 192.168.1.56.
|
bash# ./gps -s 192.168.1.10-20,192.168.1.25 -d 192.168.1.1 -t fin -w 3
|
GPS will scan 192.168.1.1 using randomly chosen IPs from 192.168.1.10 to 192.168.1.20 and 192.168.1.25. The scan is a FIN scan, and GPS will wait 3 seconds between the packets sending end and the sniffer closing.
|
bash# ./gps -s 192.168.1.100-200 -d 192.168.1.1 -t rand -p 1-200 -k 0
|
Here is the stealthest scan you may perform with GPS. The IPs are chosen randomly from 192.168.1.100 to 192.168.1.200 and the TCP flags are randomly set (see -t option comment for more details).
GPS will scan ports from 1 to 200 but not the ports listed in services.c.
|
bash# ./gps -s 192.168.1.100-200 -d 192.168.1.1 -t fwrd -p 23 -k 0
|
The FireWall Rules Disclosure mode will test the settings of 192.168.1.1's firewall on port 23.
GPS will use sequentially IPs from 192.168.1.100 to 192.168.1.200 to send ACKs on target's port 23, and determine which IPs are allowed to pass through.
|