scan_nmap
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| scan_nmap [2017/09/10 19:07] – created Santi | scan_nmap [2019/01/04 13:06] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== How to scan computers/ | ===== How to scan computers/ | ||
| + | |||
| + | {{ wiki: | ||
| + | |||
| + | In this tutorial we are going to see different ways to discover computers in a network and how to scan their ports to get some extra information about them. To do that we will use [[http:// | ||
| + | |||
| + | First of all, we are going to discover some computers in our network ('' | ||
| <code bash> | <code bash> | ||
| Line 18: | Line 24: | ||
| </ | </ | ||
| - | How to detect the operating system | + | Imagine that you want to guess which operating system |
| + | |||
| + | Now, we are going to scan this computer to try to guess which kind of OS is running and some extra information. First, we will try with the Firewall enabled (the IP address is 192.168.1.40): | ||
| <code bash> | <code bash> | ||
| santi@kalibook: | santi@kalibook: | ||
| - | </code> | + | Starting Nmap 6.49BETA4 ( https://nmap.org ) at 2017-09-10 20:05 CEST |
| + | Nmap scan report for 192.168.1.40 | ||
| + | Host is up (0.00018s latency). | ||
| + | All 1000 scanned ports on 192.168.1.40 are filtered | ||
| + | MAC Address: 08: | ||
| + | Too many fingerprints match this host to give specific OS details | ||
| + | Network Distance: 1 hop | ||
| - | <code bash> | + | OS detection performed. Please report any incorrect results at https:// |
| - | santi@kalibook:$ | + | Nmap done: 1 IP address (1 host up) scanned in 30.73 seconds |
| </ | </ | ||
| - | <code bash> | + | We can see that we did not obtain any information abut the remote computer. Then, we will disabled the default Firewall and we will try again with the same nmap options: |
| - | santi@kalibook:$ | + | |
| - | </ | + | |
| <code bash> | <code bash> | ||
| - | santi@kalibook: | + | santi@kalibook: |
| + | |||
| + | Starting Nmap 6.49BETA4 ( https:// | ||
| + | Nmap scan report for 192.168.1.40 | ||
| + | Host is up (0.00016s latency). | ||
| + | Not shown: 990 closed ports | ||
| + | PORT STATE SERVICE | ||
| + | 135/ | ||
| + | 139/ | ||
| + | 445/ | ||
| + | 5357/ | ||
| + | 49152/tcp open unknown | ||
| + | 49153/tcp open unknown | ||
| + | 49154/tcp open unknown | ||
| + | 49155/tcp open unknown | ||
| + | 49156/tcp open unknown | ||
| + | 49158/tcp open unknown | ||
| + | MAC Address: 08: | ||
| + | Device type: general purpose | ||
| + | Running: Microsoft Windows 2008|10|7|8.1 | ||
| + | OS CPE: cpe:/ | ||
| + | OS details: Microsoft Windows Server 2008 SP2 or Windows 10 Tech Preview, Microsoft Windows 7 SP0 - SP1, Windows Server 2008 SP1, Windows 8, or Windows 8.1 Update 1 | ||
| + | Network Distance: 1 hop | ||
| + | |||
| + | OS detection performed. Please report any incorrect results at https:// | ||
| + | Nmap done: 1 IP address (1 host up) scanned in 103.30 seconds | ||
| </ | </ | ||
| + | |||
| + | Because the firewall was disabled we have obtained a lot of information about the remote computer: open ports, services running, MAC address and some extra information about which version of Windows is running and a approximation about how updated it is (Service Packs installed on remote computer). Now we can see how important is to enable our Firewall in our computer. If some attacker does not know nothing about our computer it will be more difficult to receive any kind of attack from anyone. | ||
| + | |||
| + | And we can also perform an **intensive scan** to get more information about the remote computer such as which version of some services are installed, the computer name, and more. To see one example of discovering some services in the remote computer, we have installed Filezilla FTP Server in the Windows 7 machine. | ||
| <code bash> | <code bash> | ||
| - | santi@kalibook: | + | santi@kalibook: |
| + | |||
| + | Starting Nmap 6.49BETA4 ( https:// | ||
| + | Nmap scan report for 192.168.1.40 | ||
| + | Host is up (0.00024s latency). | ||
| + | Not shown: 989 closed ports | ||
| + | PORT STATE SERVICE | ||
| + | 21/ | ||
| + | 135/ | ||
| + | 139/ | ||
| + | 445/ | ||
| + | 5357/ | ||
| + | |_http-methods: | ||
| + | |_http-server-header: | ||
| + | |_http-title: | ||
| + | 49152/tcp open msrpc Microsoft Windows RPC | ||
| + | 49153/tcp open msrpc Microsoft Windows RPC | ||
| + | 49154/tcp open msrpc Microsoft Windows RPC | ||
| + | 49155/tcp open msrpc Microsoft Windows RPC | ||
| + | 49156/tcp open msrpc Microsoft Windows RPC | ||
| + | 49157/tcp open msrpc Microsoft Windows RPC | ||
| + | 1 service unrecognized despite returning data. If you know the service/ | ||
| + | SF-Port445-TCP: | ||
| + | SF: | ||
| + | SF: | ||
| + | SF: | ||
| + | SF: | ||
| + | SF: | ||
| + | MAC Address: 08: | ||
| + | Device type: general purpose | ||
| + | Running: Microsoft Windows 2008|10|7|8.1 | ||
| + | OS CPE: cpe:/ | ||
| + | OS details: Microsoft Windows Server 2008 SP2 or Windows 10 Tech Preview, Microsoft Windows 7 SP0 - SP1, Windows Server 2008 SP1, Windows 8, or Windows 8.1 Update 1 | ||
| + | Network Distance: 1 hop | ||
| + | Service Info: Host: USUARIO-PC; OSs: Windows, Windows 98; CPE: cpe:/ | ||
| + | |||
| + | Host script results: | ||
| + | |_nbstat: NetBIOS name: USUARIO-PC, NetBIOS user: < | ||
| + | | smb-os-discovery: | ||
| + | | OS: Windows 7 Enterprise N 7600 (Windows 7 Enterprise N 6.1) | ||
| + | | OS CPE: cpe:/ | ||
| + | | | ||
| + | | | ||
| + | | | ||
| + | |_ System time: 2017-09-10T21: | ||
| + | | smb-security-mode: | ||
| + | | | ||
| + | | | ||
| + | | | ||
| + | |_ message_signing: | ||
| + | |_smbv2-enabled: | ||
| + | |||
| + | TRACEROUTE | ||
| + | HOP RTT | ||
| + | 1 0.24 ms 192.168.1.40 | ||
| + | |||
| + | OS and Service detection performed. Please report any incorrect results at https:// | ||
| + | Nmap done: 1 IP address (1 host up) scanned in 99.23 seconds | ||
| </ | </ | ||
| + | |||
| + | From now on we will have to choose a more specific tool depending of the service that we will want to test. Maybe, in this case, because we have found that the remote machine has a FTP service running we could try to discover some vulnerability to check that our system is completely protected. | ||
| + | |||
| + | ===== How to prevent this kind of attack ===== | ||
| + | |||
| + | Maybe scanning ports cannot be consider a kind of attack but sometimes it will be the very first step for preparing an inminent attack in the future. That's why we must protect our computers to not be scanned, and the best way to do that is **enabling our Firewall**. Notice that that simple action can protect your computer against more sophisticated attacks because if the attacker doesn' | ||
| + | |||
| + | ---- | ||
| + | |||
| + | (c) 2017 Hacking Tony | ||
scan_nmap.1505070474.txt.gz · Last modified: 2019/01/04 13:06 (external edit)