Link to home
Start Free TrialLog in
Avatar of ammadeyy2020
ammadeyy2020

asked on

nmap scan

i use the following command to scan a webserver,
nmap -A -T4 -F -PN x.x.x.x

it doesnt show port 80 is open

i run wireshark and open browser and type url, it does shows that my pc is connecting to port 80 of x.x.x.x webserver

my question is whats the nmap command to scan all the open ports in the webserver.
Avatar of nasirsh
nasirsh
Flag of Pakistan image

try this. nmap -sP IP address. It will display all the open and closed ports
Actually nmap -sP means skip port scan and only perform IP scan

Try to run the following commands

1- SYN scan
nmap -PN -sS ip.addr.of.server

This disables pings and does a SYN scan

2- ACK scan

nmap -PN -sA ip.addr.of.server
This will disable pings and send packets with ACK bit set and waits for RESET from open ports

3- Connect scan

nmap -PN -sT ip.addr.of.server
This will disable pings and initiate full TCP connect scan



Note: If there is an IDS/IPS infront of the server your scans might get blocked so you can do a custom port scan and choose only specfic ports with the -p option

Good Luck

ASKER CERTIFIED SOLUTION
Avatar of jahboite
jahboite
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i'll just paste that again because EE's rich text editor is making-up html tags as it goes along...
Initiating SYN Stealth Scan at 10:24
Scanning www.experts-exchange.com (64.156.132.140) [1 port]
Packet capture filter (device eth0): dst host 192.168.1.15 and (icmp or ((tcp or udp or sctp) and (src host 64.156.132.140)))
SENT (0.7030s) TCP 192.168.1.15:63649 > 64.156.132.140:80 S ttl=38 id=62410 iplen=44  seq=739136101 win=3072 <mss 1460>
RCVD (0.8750s) TCP 64.156.132.140:80 > 192.168.1.15:63649 SA ttl=43 id=18933 iplen=44  seq=1306958663 win=65535 ack=739136102 <mss 1402>
Discovered open port 80/tcp on 64.156.132.140
Completed SYN Stealth Scan at 10:24, 0.34s elapsed (1 total ports)

Open in new window

Avatar of garima_26
garima_26

To scan all the open ports, nmap command is:

nmap -sS -p <port range> <server.ip.addr>
This command will perform a syn scan and it will list all the open ports.