Hiển thị các bài đăng có nhãn Nmap. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn Nmap. Hiển thị tất cả bài đăng

Thứ Tư, 4 tháng 12, 2013

NMAP NSE

NMAP is a very powerful “port scanner” that has become the defacto standard for network admins and penetration testers alike. Since NMAP stands for “network mapper”, I think port scanner is too generic a name to give NMAP, it packs a lot of power that studied users can gain invaluable information about any host scanned.

Performing basic scans with NMAP is rather simple, but did you know that there are over 300 scripts that extend the already awesome scanner? That’s right, there are several hundred unique NSE scripts included with every install of NMAP in “/usr/local/share/nmap/scripts” in BackTrack, that are written in the lua programming language that are waiting to explored by you. NSE stands for NMAP Scripting Engine and provides significant extensibility to NMAP such as vulnerability detection, vulnerability exploitation, discovery, and sophisticated version detection. Some popular NSE scripts can find hosts infected with Conficker, identify DNS servers that allow unauthenticated zone additions and modifications, heck, you can even scan for stuxnet infection.

To learn more about a script there are a couple of options. First, all script documentation is available online at NMAP.org/nsedoc/, simply click on a category or scripts to see the 340 currently available scripts. The second option is to use the cli and use the –script-help option.

Script Help Example: nmap –script-help script_name

Some scripts will provide argument info from the help output, for those that do not, using the online documentation may be best. If you feel like reading coder comments, sometimes using vi or vim to open the script will provide more details on the script usage.
Here are some usage examples that you can try to begin the exploration of the powerful NSE scripts.

SMB Vulns (MS08-067, Conficker Test) (Xem Video)


MS-SQL Discovery


HTTP HEADERS


Spend some time on the nsedoc site and ‘ls’ in the scripts directory to explore available NSE scripts. Don’t see what you are looking for? Well, learn lua and you can write your own NSE scripts too! Here is an excellent video from Defcon 18, a little old but still great info including a walk through of writing a NSE script.
NMAP is truly a versatile tool that I know I leverage almost daily. Don’t hesitate to experiment and find all the cool things you can do with NMAP. The greatest hackers are life long learners, always curious, and do not accept limitations. Stretch yourself and the tools you use to the fullest, you never know, you may stumble onto something new.

Script smb-check-vulns

Checks for vulnerabilities:
  • MS08-067, a Windows RPC vulnerability
  • Conficker, an infection by the Conficker worm
  • Unnamed regsvc DoS, a denial-of-service vulnerability I accidentally found in Windows 2000
  • SMBv2 exploit (CVE-2009-3103, Microsoft Security Advisory 975497)
  • MS06-025, a Windows Ras RPC service vulnerability
  • MS07-029, a Windows Dns Server RPC service vulnerability 
nmap --script smb-check-vulns.nse -p445 <host>
sudo nmap -sU -sS --script smb-check-vulns.nse -p U:137,T:139 <host>

Script Output

Host script results:
| smb-check-vulns:
| MS08-067: NOT VULNERABLE
| Conficker: Likely CLEAN
| regsvc DoS: regsvc DoS: NOT VULNERABLE
| SMBv2 DoS (CVE-2009-3103): NOT VULNERABLE
| MS06-025: NO SERVICE (the Ras RPC service is inactive)
|_ MS07-029: NO SERVICE (the Dns Server RPC service is inactive)

Script smb-vuln-ms10-054

Tests whether target machines are vulnerable to the ms10-054 SMB remote memory corruption vulnerability.
The vulnerable machine will crash with BSOD.
The script requires at least READ access right to a share on a remote machine. Either with guest credentials or with specified username/password.

Example Usage


nmap  -p 445 <target> --script=smb-vuln-ms10-054 --script-args unsafe

Script Output

Host script results:
| smb-vuln-ms10-054:
| VULNERABLE:
| SMB remote memory corruption vulnerability
| State: VULNERABLE
| IDs: CVE:CVE-2010-2550
| Risk factor: HIGH CVSSv2: 10.0 (HIGH) (AV:N/AC:L/Au:N/C:C/I:C/A:C)
| Description:
| The SMB Server in Microsoft Windows XP SP2 and SP3, Windows Server 2003 SP2,
| Windows Vista SP1 and SP2, Windows Server 2008 Gold, SP2, and R2, and Windows 7
| does not properly validate fields in an SMB request, which allows remote attackers
| to execute arbitrary code via a crafted SMB packet, aka "SMB Pool Overflow Vulnerability."
|
| Disclosure date: 2010-08-11
| References:
| http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-2550
|_ http://seclists.org/fulldisclosure/2010/Aug/122
 

Script distcc-cve2004-2687

Detects and exploits a remote code execution vulnerability in the distributed compiler daemon distcc. The vulnerability was disclosed in 2002, but is still present in modern implementation due to poor configuration of the service.

Example Usage


nmap -p 3632 <ip> --script distcc-exec --script-args="distcc-exec.cmd='id'"

Script Output

PORT     STATE SERVICE
3632/tcp open distccd
| distcc-test:
| VULNERABLE:
| distcc Daemon Command Execution
| State: VULNERABLE (Exploitable)
| IDs: CVE:CVE-2004-2687
| Risk factor: High CVSSv2: 9.3 (HIGH) (AV:N/AC:M/Au:N/C:C/I:C/A:C)
| Description:
| Allows executing of arbitrary commands on systems running distccd 3.1 and
| earlier. The vulnerability is the consequence of weak service configuration.
|
| Disclosure date: 2002-02-01
| Extra information:
|
| uid=118(distccd) gid=65534(nogroup) groups=65534(nogroup)
|
| References:
| http://distcc.googlecode.com/svn/trunk/doc/web/security.html
| http://http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2004-2687
| http://http://www.osvdb.org/13378
|_ http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2004-2687 
 

Script http-dlink-backdoor

Detects a firmware backdoor on some D-Link routers by changing the User-Agent to a "secret" value. Using the "secret" User-Agent bypasses authentication and allows admin access to the router.
The following router models are likely to be vulnerable: DIR-100, DIR-120, DI-624S, DI-524UP, DI-604S, DI-604UP, DI-604+, TM-G5240
In addition, several Planex routers also appear to use the same firmware: BRL-04UR, BRL-04CW

Example Usage


nmap -sV --script http-dlink-backdoor <target>

Script Output

PORT   STATE SERVICE REASON
80/tcp open http syn-ack
| http-dlink-backdoor:
| VULNERABLE:
| Firmware backdoor in some models of D-Link routers allow for admin password bypass
| State: VULNERABLE
| Risk factor: High
| Description:
| D-Link routers have been found with a firmware backdoor allowing for admin password bypass using a "secret" User-Agent string.
|
| References:
|_ http://www.devttys0.com/2013/10/reverse-engineering-a-d-link-backdoor/

Script http-huawei-hg5xx-vuln (Video)

Detects Huawei modems models HG530x, HG520x, HG510x (and possibly others...) vulnerable to a remote credential and information disclosure vulnerability. It also extracts the PPPoE credentials and other interesting configuration values.
Attackers can query the URIs "/Listadeparametros.html" and "/wanfun.js" to extract sensitive information including PPPoE credentials, firmware version, model, gateway, dns servers and active connections among other values.

Example Usage


  • nmap -p80 --script http-huawei-hg5xx-vuln <target>
  • nmap -sV http-huawei-hg5xx-vuln <target>

Script Output

PORT   STATE SERVICE VERSION
80/tcp open http Huawei aDSL modem EchoLife HG530 (V100R001B122gTelmex) 4.07 -- UPnP/1.0 (ZyXEL ZyWALL 2)
| http-huawei-hg5xx-vuln:
| VULNERABLE:
| Remote credential and information disclosure in modems Huawei HG5XX
| State: VULNERABLE (Exploitable)
| Description:
| Modems Huawei 530x, 520x and possibly others are vulnerable to remote credential and information disclosure.
| Attackers can query the URIs "/Listadeparametros.html" and "/wanfun.js" to extract sensitive information
| including PPPoE credentials, firmware version, model, gateway, dns servers and active connections among other values
| Disclosure date: 2011-01-1
| Extra information:
|
| Model:EchoLife HG530
| Firmware version:V100R001B122gTelmex
| External IP:xxx.xxx.xx.xxx
| Gateway IP:xxx.xx.xxx.xxx
| DNS 1:200.33.146.249
| DNS 2:200.33.146.241
| Network segment:192.168.1.0
| Active ethernet connections:0
| Active wireless connections:3
| BSSID:0xdeadbeefcafe
| Wireless Encryption (Boolean):1
| PPPoE username:xxx
| PPPoE password:xxx
| References:
| http://routerpwn.com/#huawei
|_ http://websec.ca/advisories/view/Huawei-HG520c-3.10.18.x-information-disclosu

Script http-phpmyadmin-dir-traversal

Exploits a directory traversal vulnerability in phpMyAdmin 2.6.4-pl1 (and possibly other versions) to retrieve remote files on the web server.

Script http-tplink-dir-traversal (Video)

Exploits a directory traversal vulnerability existing in several TP-Link wireless routers. Attackers may exploit this vulnerability to read any of the configuration and password files remotely and without authentication.
This vulnerability was confirmed in models WR740N, WR740ND and WR2543ND but there are several models that use the same HTTP server so I believe they could be vulnerable as well. I appreciate any help confirming the vulnerability in other models.

Script dns-zeustracker

Checks if the target IP range is part of a Zeus botnet by querying ZTDNS @ abuse.ch. Please review the following information before you start to scan:

Example Usage


nmap -sn -PN --script=dns-zeustracker <ip>

Script Output

Host script results:
| dns-zeustracker:
| Name IP SBL ASN Country Status Level Files Online Date added
| foo.example.com 1.2.3.4 SBL123456 1234 CN online Bulletproof hosted 0 2011-06-17
|_ bar.example.com 1.2.3.5 SBL123456 1234 CN online Bulletproof hosted 0 
 

Script dns-fuzz

Launches a DNS fuzzing attack against DNS servers.
The script induces errors into randomly generated but valid DNS packets. The packet template that we use includes one uncompressed and one compressed name.
Use the dns-fuzz.timelimit argument to control how long the fuzzing lasts. This script should be run for a long time. It will send a very large quantity of packets and thus it's pretty invasive, so it should only be used against private DNS servers as part of a software development lifecycle.

Example Usage


nmap --script dns-fuzz --script-args timelimit=2h <target>

Script Output

Host script results:
|_dns-fuzz: Server stopped responding... He's dead, Jim.

Script rdp-vuln-ms12-020

Checks if a machine is vulnerable to MS12-020 RDP vulnerability.

Example Usage


nmap -sV --script=rdp-ms12-020 -p 3389 <target>

Script Output

PORT     STATE SERVICE        VERSION
3389/tcp open ms-wbt-server?
| rdp-ms12-020:
| VULNERABLE:
| MS12-020 Remote Desktop Protocol Denial Of Service Vulnerability
| State: VULNERABLE
| IDs: CVE:CVE-2012-0152
| Risk factor: Medium CVSSv2: 4.3 (MEDIUM) (AV:N/AC:M/Au:N/C:N/I:N/A:P)
| Description:
| Remote Desktop Protocol vulnerability that could allow remote attackers to cause a denial of service.
|
| Disclosure date: 2012-03-13
| References:
| http://technet.microsoft.com/en-us/security/bulletin/ms12-020
| http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-0152
|
| MS12-020 Remote Desktop Protocol Remote Code Execution Vulnerability
| State: VULNERABLE
| IDs: CVE:CVE-2012-0002
| Risk factor: High CVSSv2: 9.3 (HIGH) (AV:N/AC:M/Au:N/C:C/I:C/A:C)
| Description:
| Remote Desktop Protocol vulnerability that could allow remote attackers to execute arbitrary code on the targeted system.
|
| Disclosure date: 2012-03-13
| References:
| http://technet.microsoft.com/en-us/security/bulletin/ms12-020
|_ http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-0002

Script samba-vuln-cve-2012-1182

Checks if target machines are vulnerable to the Samba heap overflow vulnerability CVE-2012-1182.
Samba versions 3.6.3 and all versions previous to this are affected by a vulnerability that allows remote code execution as the "root" user from an anonymous connection.
CVE-2012-1182 marks multiple heap overflow vulnerabilities located in PIDL based autogenerated code. This check script is based on PoC by ZDI marked as ZDI-CAN-1503. Vulnerability lies in ndr_pull_lsa_SidArray function where an attacker is under control of num_sids and can cause insuficient memory to be allocated, leading to heap buffer overflow and posibility of remote code execution.
Script builds a malitious packet and makes a SAMR GetAliasMembership call which triggers the vulnerability. On the vulnerable system, connection is droped and result is "Failed to receive bytes after 5 attempts". On patched system, samba throws an error and result is "MSRPC call returned a fault (packet type)".

Example Usage


nmap --script=samba-vuln-cve-2012-1182  -p 139 <target>

Script Output

PORT    STATE SERVICE
139/tcp open netbios-ssn

Host script results:
| samba-vuln-cve-2012-1182:
| VULNERABLE:
| SAMBA remote heap overflow
| State: VULNERABLE
| IDs: CVE:CVE-2012-1182
| Risk factor: HIGH CVSSv2: 10.0 (HIGH) (AV:N/AC:L/Au:N/C:C/I:C/A:C)
| Description:
| Samba versions 3.6.3 and all versions previous to this are affected by
| a vulnerability that allows remote code execution as the "root" user
| from an anonymous connection.
|
| Disclosure date: 2012-03-15
| References:
| http://www.samba.org/samba/security/CVE-2012-1182
|_ http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-1182

Script ftp-vuln-cve2010-4221

Checks for a stack-based buffer overflow in the ProFTPD server, version between 1.3.2rc3 and 1.3.3b. By sending a large number of TELNET_IAC escape sequence, the proftpd process miscalculates the buffer length, and a remote attacker will be able to corrupt the stack and execute arbitrary code within the context of the proftpd process (CVE-2010-4221). Authentication is not required to exploit this vulnerability.

Example Usage


nmap --script ftp-vuln-cve2010-4221 -p 21 <host>

Script Output

PORT   STATE SERVICE
21/tcp open ftp
| ftp-vuln-cve2010-4221:
| VULNERABLE:
| ProFTPD server TELNET IAC stack overflow
| State: VULNERABLE
| IDs: CVE:CVE-2010-4221 BID:44562 OSVDB:68985
| Risk factor: High CVSSv2: 10.0 (HIGH) (AV:N/AC:L/Au:N/C:C/I:C/A:C)
| Description:
| ProFTPD server (version 1.3.2rc3 through 1.3.3b) is vulnerable to
| stack-based buffer overflow. By sending a large number of TELNET_IAC
| escape sequence, a remote attacker will be able to corrup the stack and
| execute arbitrary code.
| Disclosure date: 2010-11-02
| References:
| http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-4221
| http://osvdb.org/68985
| http://www.metasploit.com/modules/exploit/freebsd/ftp/proftp_telnet_iac
| http://bugs.proftpd.org/show_bug.cgi?id=3521
|_ http://www.securityfocus.com/bid/44562

 

 

 

 

 

 

 

 


 

Thứ Tư, 20 tháng 11, 2013

Hướng Dẫn Quét Mạng Nmap: Lesson 14 Create an Inventory File with nmap

{ Create an Inventory File with nmap }

Section 0. Background Information
  1. What is NMAP
    • Nmap (Network Mapper) is a security scanner used to discover hosts and services on a computer network, thus creating a "map" of the network. To accomplish its goal, Nmap sends specially crafted packets to the target host and then analyzes the responses. Unlike many simple port scanners that just send packets at some predefined constant rate, Nmap accounts for the network conditions (latency fluctuations, network congestion, the target interference with the scan) during the run.
  2. Why Create an Inventory List?
    • One of the first stages of a Risk Assessment is to know what devices are on your network.  This lab will demonstrate how to create a very basic inventory list that can be later used to assess criticality and vulnerability.
     
  3. Pre-Requisite
    • BackTrack: Lesson 1: Installing BackTrack 5 
  4. Lab Notes
    • In this lab we will do the following:
      1. We will conduct a NMAP network scan using operating system detection.
      2. We will use a perl program to parse the nmap results and create an inventory list.
  5. Legal Disclaimer - Đào Tạo An Ninh Mạng Www.AnToanThongTin.Edu.Vn

Section 1. Login to BackTrack
  1. Start Up VMWare Player
    • Instructions:
      1. Click the Start Button
      2. Type Vmplayer in the search box
      3. Click on Vmplayer
  2. Open a Virtual Machine
    • Instructions:
      1. Click on Open a Virtual Machine
  3. Open the BackTrack5R1 VM
    • Instructions:
      1. Navigate to where the BackTrack5R1 VM is located
      2. Click on on the BackTrack5R1 VM
      3. Click on the Open Button
  4. Edit the BackTrack5R1 VM
    • Instructions:
      1. Select BackTrack5R1 VM
      2. Click Edit virtual machine settings
  5. Edit Virtual Machine Settings
    • Instructions:
      1. Click on Network Adapter
      2. Click on the Bridged Radio button
      3. Click on the OK Button
  6. Play the BackTrack5R1 VM
    • Instructions:
      1. Click on the BackTrack5R1 VM
      2. Click on Play virtual machine

Section 2. Login to BackTrack
  1. Login to BackTrack
    • Instructions:
      1. Login: root
      2. Password: toor or <whatever you changed it to>.
  2. Bring up the GNOME
    • Instructions:
      1. Type startx
Section 3. Bring up a console terminal
  1. Start up a terminal window
    • Instructions:
      1. Click on the Terminal Window
  2. Obtain the IP Address
    • Instructions:
      1. ifconfig -a
    • Note(FYI):
      • My IP address 192.168.1.109.
      • In your case, it will probably be different.
      • Notice my mask is 255.255.255.0, which is a /24 network.
Section 4. Create NMAP Data File
  1. Create NMAP Data File
    • Instructions:
      1. mkdir -p NMAP
      2. cd NMAP/
      3. nmap -O 192.168.1.0/24 | tee nmap-test.txt
        • Replace the first three octets 192.168.1 with the first three octets of your IP Address obtain in (Section 3, Step 2).
        • Replace /24, with your network mask also obtain in (Section 3, Step 2).
    • Note(FYI):
      1. Make Directory called NMAP.
      2. Change Directory to NMAP
      3. Scan the entire 192.168.1.0 network using operating system detection.
     
  2. Verify NMAP Data File
    • Instructions:
      1. ls -l nmap-test.txt
      2. head nmap-test.txt
    • Note(FYI):
      1. Long List file nmap-test.txt
      2. Show the first 10 lines of nmap-test.txt

Section 5. Download the NMAP Parser
  1. Download NMAP Parser
    • Instructions:
      1. wget http://www.computersecuritystudent.com/SECURITY_TOOLS/NMAP/lesson3/parse_nmap.pl.TXT
      2. mv parse_nmap.pl.TXT parse_nmap.pl
      3. chmod 700 parse_nmap.pl
      4. perl -c parse_nmap.pl
    • Note(FYI):
      1. Wget is a free utility for non-interactive download of files from the Web
      2. Rename File from parse_nmap.pl.TXT to parse_nmap.pl
      3. Change the file permissions to where only the root user has read, write and execute permission.
      4. Check the syntax of the perl program

Section 5. Generate Inventory List using nmap_parser.pl
  1. Generate Inventory List (Non-Verbose Mode) 
    • Instructions:
      1. ./parse_nmap.pl nmap-test.txt
    • Note(FYI):
      1. Supply the perl program (parse_nmap.pl) with the nmap file (nmap-test.txt) you created.
     
  2. Generate Inventory List (Verbose Mode) 
    • Instructions:
      1. ./parse_nmap.pl nmap-test.txt -V
    • Note(FYI):
      1. Supply the perl program (parse_nmap.pl) with the nmap file (nmap-test.txt) you created and the verbose option (-V).
     
  3. View Output File
    • Instructions:
      1. ls -l nmap-output.txt
      2. more nmap-output.txt
    • Notes(FYI):
      1. Long list the nmap-output.txt file.
      2.  More is a filter for paging through text one screenful at a time.
     
Section 6. Proof of Lab
  1. Proof of Lab
    • Instructions
      1. ls -l *nmap*
      2. date
      3. echo "Your Name"
        • Put in your actual name in place of "Your Name"
        • e.g., echo "John Gray"
    • Proof Of Lab Instructions:
      1. Press the <Ctrl> and <Alt> keys
      2. Press the <PrtScn> key
      3. Paste into a word document
      4. Upload to website Www.AnToanThongTin.Edu.Vn

Hướng Dẫn Quét Mạng Nmap: Lesson 3 Use ZENMAP and NMAP on BackTrack 5

{ Use ZENMAP and NMAP on BackTrack 5 R }

Section 0. Background Information
  1. NMAP
    • Nmap (Network Mapper) is a security scanner used to discover hosts and services on a computer network, thus creating a "map" of the network. To accomplish its goal, Nmap sends specially crafted packets to the target host and then analyzes the responses. Unlike many simple port scanners that just send packets at some predefined constant rate, Nmap accounts for the network conditions (latency fluctuations, network congestion, the target interference with the scan) during the run
     
  2. Pre-Requisite
    • BackTrack: Lesson 1: Installing BackTrack 5 
  3. Lab Notes
    • In this lab we will do the following:
      1. Use Zenmap to conduct a quick, intense and network scan.
      2. Use Nmap to conduct a quick and intense scan.
  4. Legal Disclaimer - Đào Tạo An Ninh Mạng Www.AnToanThongTin.Edu.Vn

Section 1. Login to BackTrack
  1. Start Up VMWare Player
    • Instructions:
      1. Click the Start Button
      2. Type Vmplayer in the search box
      3. Click on Vmplayer
  2. Open a Virtual Machine
    • Instructions:
      1. Click on Open a Virtual Machine
  3. Open the BackTrack5R1 VM
    • Instructions:
      1. Navigate to where the BackTrack5R1 VM is located
      2. Click on on the BackTrack5R1 VM
      3. Click on the Open Button
  4. Edit the BackTrack5R1 VM
    • Instructions:
      1. Select BackTrack5R1 VM
      2. Click Edit virtual machine settings
  5. Edit Virtual Machine Settings
    • Instructions:
      1. Click on Network Adapter
      2. Click on the Bridged Radio button
      3. Click on the OK Button
  6. Play the BackTrack5R1 VM
    • Instructions:
      1. Click on the BackTrack5R1 VM
      2. Click on Play virtual machine
  7. Login to BackTrack
    • Instructions:
      1. Login: root
      2. Password: toor or <whatever you changed it to>.
  8. Bring up the GNOME
    • Instructions:
      1. Type startx
Section 2. Bring up a console terminal
  1. Start up a terminal window
    • Instructions:
      1. Click on the Terminal Window
  2. Obtain the IP Address
    • Instructions:
      1. ifconfig -a
    • Note(FYI):
      • My IP address 192.168.1.111.
      • In your case, it will probably be different.
Section 3. Log into Damn Vulnerable WXP-SP2
  1. Start Up Damn Vulnerable WXP-SP2.
    • Instructions:
      1. Click on Damn Vulnerable WXP-SP2
      2. Click on Edit virtual machine Settings
    • Note(FYI):
      • For those of you not part of my class, this is a Windows XP machine running SP2.
     
  2. Edit Virtual Machine Settings
    • Instructions:
      1. Click on Network Adapter
      2. Click on the Bridged Radio button
      3. Click on the OK Button
     
  3. Play Virtual Machine
    • Instructions:
      1. Click on Damn Vulnerable WXP-SP2
      2. Click on Play virtual machine
     
  4. Logging into Damn Vulnerable WXP-SP2.
    • Instructions:
      1. Username: administrator
      2. Password: Use the Class Password or whatever you set it.
     
  5. Open a Command Prompt
    • Instructions:
      1. Start --> All Programs --> Accessories --> Command Prompt
     
  6. Obtain Damn Vulnerable WXP-SP2's IP Address
    • Instructions:
      1. ipconfig
    • Note(FYI):
      • In my case, Damn Vulnerable WXP-SP2's IP Address 192.168.1.110.
      • This is the IP Address of the Victim Machine that will be scanned by NMAP.
      • Record your Damn Vulnerable WXP-SP2's IP Address.
      • See the below picture to calculate your subnet mask.

Section 5. Perform Zenmap Quick Scan
  1. Start Zenmap
    • Note(FYI):
      • Make sure you are on the BackTrack5R1 VM Machine
    • Instructions:
      1. zenmap
     
  2. Perform a quick scan by doing the following: (See Below). 
    • Note(FYI):
      • Replace 192.168.1.110 with Damn Vulnerable WXP-SP2's IP Address obtained from (Section 3, Step 6).
    • Instructions:
      1. Target: 192.168.1.110
      2. Profile:  Select Quick Scan
      3. Click the Scan Button.
     
  3. Output Analysis
    • Notes(FYI):
      1. Nmap's quick scan displays the following basic network metrics:
        • If the host is up.
        • How many ports are closed.
        • Which ports are open and their service name.
          • e.g., 21 (ftp)
        • Also, the MAC address is display with Nmap's guess of the OS being VMware.
     
Section 6. Zenmap Intense Scan
  1. Perform Intense Scan
    • Note(FYI):
      • Replace 192.168.1.110 with Damn Vulnerable WXP-SP2 IP Address obtained from (Section 3, Step 6).
    • Instructions:
      1. Target: 192.168.1.110
      2. Profile:  Select Intense Scan
      3. Click the Scan Button. 
     
  2. Version Analysis
    • Notes(FYI):
      1. Notice the results are more verbose.
      2. The actual version of the service was added to service name.
        • You can use this information to investigate possible exploits.
        • For Example, Microsofts ISS http 5.1 webserver.

Section 7. Nmap Network Scan
  1.   Subnet Ping Scan
    • Note(FYI):
      • Obtained the subnet mask of your Damn Vulnerable WXP-SP2 from (Section 3, Step 6).
    • Instructions:
      1. Change Target to the subnet address of Damn Vulnerable WXP-SP2.
        • In my case, 192.168.1.0/24
        • Notice, that I replaced the last octet of my IP address with a 0.
        • The /24 represents the subnet mask.
      2. Change Profile to: Ping Scan
      3. Click Scan
  2. Topology Analysis
    • Instructions:
      1. Click on the Topology Tab.
      2. Click on Fisheye
      3. Click on Controls
        • This will allow you to increase the size of the network rings.
      4. Click on the Zoom Arrow
    • Note(FYI):
      • This will give you a visual representation of how your network is laid out.
      • When presenting a customer or management with a penetration testing analysis, this would be a good picture to throw into the report
Section 8. Performing NMAP Scans
  1. Perform Quick NMAP Scan
    • Instructions(FYI):
      • Replace 192.168.1.110 with Damn Vulnerable WXP-SP2 IP Address obtained from (Section 3, Step 6)
    • Instructions:
      1. nmap -T4-F 192.168.1.110 | tee /var/tmp/nmap.quick.txt
        • nmap - is the NMAP scanner.
        • | tee /var/tmp/nmap.quick.txt - View output and sent it to file nmap.quick.txt.
  2. Perform Intense NMAP Scan
    • Instructions(FYI):
      • Replace 192.168.1.110 with Damn Vulnerable WXP-SP2 IP Address obtained from (Section 3, Step 6)
    • Instructions:
      1. nmap -p 1-65535 -T4 -A -v 192.168.1.110 | tee /var/tmp/nmap.intense.txt
        • nmap - is the NMAP scanner.
        • | tee /var/tmp/nmap.intense.txt - View output and sent it to file nmap.intense.txt.

Section 9. Proof of Lab
  1. Proof of Lab
    • Proof Of Lab Instructions:
      1. Do a PrtScn of the below commands
      2. Paste into a word document
      3. Upload to website Www.AnToanThongTin.Edu.Vn
    • Instructions
      1. ls -l /var/tmp/nmap*
      2. date
      3. echo "Your Name"
        • Put in your actual name in place of "Your Name"
        • e.g., echo "John Gray"

Hướng Dẫn Quét Mạng Nmap: Lesson 2 Basic Usage

{ Nmap Basic Usage }

Section 0: Background Information
  1. NMAP
    • Nmap (Network Mapper) is a security scanner used to discover hosts and services on a computer network, thus creating a "map" of the network. To accomplish its goal, Nmap sends specially crafted packets to the target host and then analyzes the responses. Unlike many simple port scanners that just send packets at some predefined constant rate, Nmap accounts for the network conditions (latency fluctuations, network congestion, the target interference with the scan) during the run.
  2. Prerequisite
    • Nmap: Lesson 1: Installing Nmap
  3. Lab Notes
    • In this lab we will do the following:
      1. We will use the PENTEST-WXP VM (Attacker) to NMAP scan the Damn Vulnerable WXP-SP2 VM (Victim)
  4. Legal Disclaimer  (Đào Tạo An Toàn Thông Tin Www.AnToanThongTin.Edu.Vn)
Section 1: Power On PENTEST-WXP
  1. Edit Virtual Machine Settings
    • Instructions:
      1. Click on PENTEST-WXP
      2. Click on Edit virtual machine
  2. Configure Network Adapter
    • Instructions:
      1. Select Network Adapter
      2. Click the radio button "Bridged: Connected directly to the physical network."
      3. Click the Okay button
  3. Start PENTEST-WXP
    • Instructions:
      1. Click on PENTEST-WXP
      2. Click on Play virtual machine
  4. Send Ctrl+Alt+Del
    • Instructions:
      1. Virtual Machine --> Send Ctrl+Alt+Del
  5. Logging into Damn PENTEST-WXP.
    • Instructions:
      1. Username: administrator
      2. Password: Use the Class Password or whatever you set it.
  6. Open a Command Prompt
    • Instructions:
      1. Start --> All Programs --> Accessories --> Command Prompt
  7. Obtain PENTEST-WXP's IP Address
    • Instructions:
      1. ipconfig
    • Note(FYI):
      • This is the IP Address of the Scanning Machine.
      • In my case, PENTEST-WXP's IP Address is 192.168.1.111.
      • Your IP Address will be different. 
      • Record your PENTEST-WXP's IP Address.
Section 2: Power On Damn Vulnerable WXP-SP2
  1. Start Up Damn Vulnerable WXP-SP2.
    • Instructions:
      1. Click on Damn Vulnerable WXP-SP2
      2. Click on Edit virtual machine Settings
    • Note(FYI):
      • For those of you not part of my class, this is a Windows XP machine running SP2.
  2. Edit Virtual Machine Settings
    • Instructions:
      1. Click on Network Adapter
      2. Click on the Bridged Radio button
      3. Click on the OK Button
  3. Play Virtual Machine
    • Instructions:
      1. Click on Damn Vulnerable WXP-SP2
      2. Click on Play virtual machine
  4. Logging into Damn Vulnerable WXP-SP2.
    • Instructions:
      1. Username: administrator
      2. Password: Use the Class Password or whatever you set it.
  5. Open a Command Prompt
    • Instructions:
      1. Start --> All Programs --> Accessories --> Command Prompt
  6. Obtain Damn Vulnerable WXP-SP2's IP Address
    • Instructions:
      1. ipconfig
    • Note(FYI):
      • In my case, Damn Vulnerable WXP-SP2's IP Address 192.168.1.116.
      • This is the IP Address of the Victim Machine that will be attacked by Metasploit.
      • Record your Damn Vulnerable WXP-SP2's IP Address.

Section 3: Perform Nmap Quick Scan
  1. Perform NMAP Quick Scan
    • Instructions:
      1. Make sure you are on the PENTEST-WXP VM Machine
      2. Start Up NMAP by clicking on your NMAP icon located on your desktop.
  2. Perform a quick scan by doing the following: (See Below). 
    • Note(FYI):
      • Replace 192.168.1.116 with Damn Vulnerable WXP-SP2's IP Address obtained in (Section 2, Step 6).
    • Instructions:
      1. Target: 192.168.1.116
        • You will be using PENTEST-WXP to scan Damn Vulnerable WXP-SP2.
      2. Profile:  Select Quick Scan
      3. The Click Scan.
  3. Output Analysis
    • Notes(FYI):
      1. Nmap's quick scan displays the following basic network metrics:
        • If the host is up.
        • How many ports are closed.
        • Which ports are open and their service name.
          • e.g., 21 (ftp)
        • Also, the MAC address is display with Nmap's guess of the OS being VMware.
  4. Click on the Ports / Hosts tab
    • Instructions:
      1. Click on the Ports/Hosts Tab
    • Notes(FYI):
      • This tabs represents all the open ports, protocol, state and service names.
  5. Click on Host Details
    • Instructions:
      1. Click on the Host Details Tab
    • Notes(FYI):
      • This tab represents the status of the host and its corresponding IP and MAC Addresses information.

Section 4: Nmap Intense Scan
  1. Perform Intense Scan
    • Note(FYI):
      • Replace 192.168.1.116 with Damn Vulnerable WXP-SP2's IP Address obtained in (Section 2, Step 6).
    • Instructions:
      1. Target: 192.168.1.116
      2. Change Profile to: Intense scan, all TCP ports
      3. Click Scan.
  2. Version Analysis
    • Notes(FYI):
      1. Notice the results are more verbose.
      2. The actual version of the service was added to service name.
        • You can use this information to investigate possible exploits.
        • For Example, Microsofts ISS http 5.1 webserver.
  3. Operating System Footprinting Analysis
    • Notes(FYI):
      1. The OS details shows us that the actual OS is Windows XP, and it is running SP2.
        • In this case, an attacker might start salivating due to the MS08-067 exploit for SP2.
  4. Host Script Results Analysis
    • Notes(FYI):
      • Nmap runs nbstat to determine the NetBIOS name and user. 
        • This information could be used for a brute force attack.
      • Notice that SMB is running.
        • The Server Message Block (SMB) Protocol is a network file sharing protocol, and as implemented in Microsoft Windows is known as Microsoft SMB Protocol.
      • SMB Critical Updates

Section 5: Nmap Network Scan
  1. Subnet Ping Scan
    • Instructions:
      1. Change Target to the subnet address of Damn Vulnerable WXP-SP2.
        • In my case, 192.168.1.0/24
        • Notice, that I replaced the last octet of my IP address with a 0.
      2. Change Profile to: Ping Scan
      3. Click Scan
  2. Nmap Output Analysis
    • Instructions:
      1. Big Red Arrow #1
        • This displays a list of all the devices that returned an ICMP packet.
        • You can click on each host to get their specific details.
      2. Big Red Arrow #2
        • This displays a general list of all the devices found which includes
          • IP Address
          • MAC Address
          • And guess as to what it is.
  3. Topology Analysis
    • Instructions:
      1. Click on the Topology Tab.
      2. Click on Fisheye
        • This will allow you to increase the size of the network picture.
      3. Click on Controls
        • This will allow you to increase the size of the network rings.
    • Note(FYI):
      • This will give you a visual representation of how your network is laid out.
      • When presenting a customer or management with a penetration testing analysis, this would be a good picture to throw into the report.

Section 6: Proof of Lab
  1. Open a Command Prompt
    • Instructions:
      1. Start --> All Programs --> Accessories --> Command Prompt
  2. Proof of Lab Instruction:
    • Note(FYI):
      • Replace 192.168.1.116 with Damn Vulnerable WXP-SP2's IP Address obtained in (Section 2, Step 6).
    • Instructions:
      1. nmap -O 192.168.1.116
      2. date /t
      3. echo "Your Name"
        • Replace the string "Your Name" with your actual name.
        • e.g., echo "John Gray"
    • Proof of Lab Instructions:
      1. Press the PrtScn Button on your keyboard
      2. Paste into a word document
      3. Upload to website Www.AnToanThongTin.Edu.Vn