Chuyển đến nội dung chính

Hướng Dẫn Thực Hành - Using nikto.pl (DVWA): Lesson 13

{ Using nikto.pl }

Section 0. Background Information
  1. What is Damn Vulnerable Web App (DVWA)?
    • Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is damn vulnerable.
    • Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, help web developers better understand the processes of securing web applications and aid teachers/students to teach/learn web application security in a class room environment.
  2. What is Nikto?
    • Nikto is an Open Source (GPL) web server scanner which performs comprehensive tests against web servers for multiple items, including over 6400 potentially dangerous files/CGIs, checks for outdated versions of over 1200 servers, and version specific problems on over 270 servers.
  3. Pre-Requisite Labs
    • Damn Vulnerable Web App (DVWA): Lesson 1: How to Install DVWA in Fedora 14
    • BackTrack: Lesson 1: Installing BackTrack 5 R
  4. Lab Notes
    • In this lab we will do the following:
      1. We will use nikto.pl to scan DVWA for vulnerabilities.
      2. We show you how to manually grab a webserver and operating system banner.
      3. We will show you an old but still common mistake some web administrators/developers make by placing a configuration direction under a web folder.
  5. Legal Disclaimer
       Bài hướng dẫn chỉ dùng cho mục đích học tập
Section 1. Configure Fedora14 Virtual Machine Settings
  1. Open Your VMware Player
    • Instructions:
      1. On Your Host Computer, Go To
      2. Start --> All Program --> VMWare --> VMWare Player
  2. Edit Fedora14 Virtual Machine Settings
    • Instructions:
      1. Highlight fedora14
      2. Click Edit virtual machine settings
  3. Edit Network Adapter
    • Instructions:
      1. Highlight Network Adapter
      2. Select Bridged
      3. Click on the OK Button.

Section 2. Login to Fedora14
  1. Start Fedora14 VM Instance
    • Instructions:
      1. Start Up VMWare Player
      2. Select Fedora14
      3. Play virtual machine
  2. Login to Fedora14
    • Instructions:
      1. Login: student
      2. Password: <whatever you set it to>.

Section 3. Open Console Terminal and Retrieve IP Address
  1. Start a Terminal Console
    • Instructions:
      1. Applications --> Terminal
  2. Switch user to root
    • Instructions:
      1. su - root
      2. <Whatever you set the root password to>
  3. Get IP Address
    • Instructions:
      1. ifconfig -a
    • Notes:
      • As indicated below, my IP address is 192.168.1.106.
      • Please record your IP address.

Section 4. Configure BackTrack Virtual Machine Settings
  1. Open Your VMware Player
    • Instructions:
      1. On Your Host Computer, Go To
      2. Start --> All Program --> VMWare --> VMWare Player
  2. Edit BackTrack Virtual Machine Settings
    • Instructions:
      1. Highlight BackTrack5R1
      2. Click Edit virtual machine settings
  3. Edit Network Adapter
    • Instructions:
      1. Highlight Network Adapter
      2. Select Bridged
      3. Do not Click on the OK Button.

Section 5. Login to BackTrack
  1. Start BackTrack VM Instance
    • Instructions:
      1. Start Up VMWare Player
      2. Select BackTrack5R1
      3. Play virtual machine
  2. Login to BackTrack
    • Instructions:
      1. Login: root
      2. Password: toor or <whatever you changed it to>.
  3. Bring up the GNOME
    • Instructions:
      1. Type startx

Section 6. Open Console Terminal and Retrieve IP Address
  1. Open a console terminal
    • Instructions:
      1. Click on the console terminal
  2. Get IP Address
    • Instructions:
      1. ifconfig -a
    • Notes:
      • As indicated below, my IP address is 192.168.1.105.
      • Please record your IP address.
Section 7. Start Nikto
  1. Start nikto
    • Instructions:
      1. Applications --> BackTrack --> Vulnerability Assessment --> Web Application Assessment --> Web Vulnerability Scanners --> nikto
  2. Update nikto
    • Instructions:
      1. ./nikto.pl -update
  3. Show Options
    • Instructions:
      1. ./nikto.pl -help
  4. Scan with nikto
    • Instructions:
      1. ./nikto.pl -host http://192.168.1.106/dvwa
    • Notes:
      • Replace 192.168.1.106 with the IP Address obtained in (Section 3, Step 3)
  5. View nikto Scan Results
    • Notes:
      1. Right away Nikto is not only able to identify the Apache Web Server version, but also it is outdated.
      2. In addition, Nikto identifies the operating system as Fedora, and the version of PHP.
      3. Nikto, also displays various vulnerabilities whose explanation are found in the Open Source Vulnerabilities Database.

Section 8. OSVDB-877:  Use Telnet to Grab Webserver and Operating System Banner
  1. Use Telnet to Grab Banner
    • Instructions:
      1. telnet 192.168.1.106 80
        • Replace 192.168.1.106 with DVWA's IP Address found in (Section 3, Step 3).
        • Where 80 is the default Webserver Report.
      2. GET index.html
    • Notes:
      • Although the webserver responds back with a "400 Bad Request", it does provide the Webserver and Operating System Banner.
      • OSVDB-877
        • RFC compliant web servers support the TRACE HTTP method, which contains a flaw that may lead to an unauthorized information disclosure. The TRACE method is used to debug web server connections and allows the client to see what is being received at the other end of the request chain.

Section 9. OSVDB-3268:  /dvwa/config/: Directory indexing found.
  1. Browse /dvwa/config with Firefox
    • Instructions:
      1. firefox http://192.168.1.106/dvwa/config
    • Notes:
      • Replace 192.168.1.106 with the IP Address obtained in (Section 3, Step 3)
  2. Investigate /dvwa/config
    • Instructions:
      1. Click on config.inc.php
    • Notes:
      1. When a web directory does not contain index.html, index.php, etc, then all files in that directory will be displayed.
      2. Note, you should never allow a configuration directory to be available to the public.
      3. OSVDB-3268
        • Directory indexing has been found to be enabled on the web server. While there is no known vulnerability or exploit associated with this, it may reveal sensitive or "hidden" files or directories to remote users, or aid in more focused attacks.
  3. Nothing Happened?
    • Note:
      1. The config.inc.php produced nothing.
      2. Typically php, perl, asp, etc script will execute as designed and will not produce output.
  4. Let's test for a tilde
    • Instructions:
      1. http://192.168.1.106/dvwa/config/config.inc.php~
        • Place a tilde(~) after .php
    • Notes:
      1. Some applications create a backup file of the file you are edit, with a "~" following it.
      2. The contents of the php file are displayed to the screen, since the Web Server does not recognize a file as a php script because it ends with "~".

Section 10. Proof of Lab
  1. Proof of Lab
    • Proof of Lab Instructions:
      1. On BackTrack, pull up a terminal window.
      2. cd /pentest/web/nikto
      3. ./nikto.pl -host http://192.168.1.106/dvwa 2>&1 > /var/tmp/nikto.txt
        • Replace 192.168.1.106 with DVWA's IP Address obtained in (Section 3, Step 3).
      4. ls -l /var/tmp/nikto.txt
      5. date
      6. echo "Your Name"
        • Replace the string "Your Name" with your actual name.
        • e.g., echo "John Gray"
      7. Do a <PrtScn>
      8. Paste into a word document
      9. Upload to Www.AnToanThongTin.Edu.Vn

Bài đăng phổ biến từ blog này

Hack the Gibson VM (CTF Challenge)

It’s a boot2root challenge and it does not get over with getting root access. You have to find flag also. So let’s start. First of all download lab from https://download.vulnhub.com/gibson/gibson.ova Now open kali terminal and like always start with first step i.e. netdiscover netdiscover it shows all the hosts those are up in our network and from here we get our target ip. Target IP: 192.168.1.6 As our target is all set we are going to scan it with nmap which will show all the open ports. In this case open ports are only two i.e. 22 and 80. nmap –p- -A 192.168.1.6 As from the above result we have got 80 port open so we will open target ip in browser. It shows an accessible directory. Let’s try opening it as we cannot see anything important here. Oh no such luck with this also. It’s written the result will be found by brute force but there is no place where we can apply brute force. As we do not have any other option so let’s just go to view page source to see if we could get a...

Penetration Testing in PwnLab (CTF Challenge)

In this article we will walkthrough a root2boot penetration testing challenge i.e PwnLab. PwbLab is a vulnerbale framework, based on the concept of CTF (capture the flag), with a bit of security which is a little complicated to bypass. But it’s not impossible. So, let us learn how we can get its access. Download From Here Now to start let us, firstly, consider that we do not know the IP of the PwnLab, therefore search for the IP address before hand and for that there is a command that shows us all the IP’s present in our network, so go to the terminal of you Kali and type : netdiscover Target IP = 192.168.0.105 And to know that we start our penetration testing. So, first, we will now scan with nmap , we will apply an aggressive scan as it gives detailed information and is fast. The command is : nmap -A 192.168.0.105 We have the result of scanning and as you can see there are only three ports open and they are: 80, 111, 3306. Our target IP is 192.168.0.105 as its MAC Vendor is...

Hacking the Heartbleed Vulnerability

Welcome back, my greenhorn hackers! In recent weeks, the Heartbleed vulnerability of OpenSSL has been dominating the information security headlines. This vulnerability enables an attacker to extract data from the server's memory that may contain authentication credentials, cookies, the servers private key, and personally identifiable info (PII) that could be used for identity theft. As a result, websites around the world have been scrambling to close this hole. Fortunately for us, many still have not, and many may never be closed. Basically, OpenSSL is an encryption library used in HTTPS (secure HTTP). The idea is that any data traveling over this secured version of HTTP should be secure and encrypted. During communication, OpenSSL uses a "heartbeat" that echoes back data to verify that the data was received correctly. It's kind of like one machine telling the other, "Yes, I got that data and you can send more now." The Heartbleed vulnerabi...