Technology news and Jobs arrow Information Technology News arrow Introduction to Linux penetration testing with nmap
Introduction to Linux penetration testing with nmap E-mail
by David M Williams   
Tuesday, 14 August 2007
Port scanning

With some rudimentary information now under our belt, it’s time to step things up a notch. Port scanning tries to reveal any entry points into a system. A web server, for example, must have port 80 open. Even if a firewall protects all else on the machine, by necessity of its function in delivering web pages it must have this port unlocked. Maybe it also has some form of remote access available or more. Port scanning attempts to make these matters known.

Port scanning is a noisy process; it effectively knocks on each port seeking a response. You might be concerned this would show in log files but the most common method of scanning takes advantage of more low-level TCP/IP protocol stack fundamentals. Specifically, when TCP/IP tries to connect two computers it begins with a flag known as SYN. This attempts to initiate handshaking. If the remote server is prepared to handle the request it responses with SYN/ACK. The port scanning application gets this reply then discontinues the handshaking. Because this doesn’t proceed, it doesn’t register with the service on the target machine and consequently is not logged.


To perform such “stealth” scanning with nmap, use the –sS flag. This attempts a SYN scan and lists as output the open ports found on the target, along with the service name usually associated with those ports.


Note that nmap won’t automatically try every single port – all 65,535 of them – because this would take a very long time. Instead, it works on a list of almost 2,000 common services. The problem here is an admin may well be running a service on a non-standard port so as to hide it by obscurity. The –p flag accepts a range of ports for nmap to try; use –p1-65535 to scan every single port from port 1 through to port 65535. This may potentially take a very long time to complete, especially if you are probing over the Internet rather than a LAN.


Fingerprinting


The services discovered may give insight into the target host’s operating system because certain services either alone or in conjunction with others are only found in particular OS’s. Although you could try and figure this out, nmap will again help by using built-in heuristics. Use the –O flag, followed as always by the target hosts in whichever input format you choose, to have nmap try this.




 
< Next story in category   Previous story in the category >
iTWire user statistics Visitors last 30 days
694,279
Subscribers 15,210
#1 independent technology news advertise here
  •   *  
  • Search
  • AdvSeach
  • Login
  • Events
  • FreeStuff

- Advertisement -

Featured Whitepapers

Follow iTWire on Twitter

About iTWire

iTWire is all about technology news, information, jobs and community for the IT and telecommunications industry professional. Subscribe to our free ICT daily newsletter