Hack The Box is an online platform allowing you to test your penetration testing skills and exchange ideas and methodologies with other members of similar interests. It contains several challenges that are constantly updated.
The HTB platform consists of a variety of challenges, grouped into categories such as web application, forensics, cryptography, and more. These challenges are designed to test the user's knowledge and skills in a variety of areas.
To begin, users must first register for an account on the HTB platform. Once registered, users can access the challenges and begin working on them. Each challenge has a set of objectives and a description of the task that needs to be completed.
Users can use a variety of tools and techniques to solve the challenges and gain access to the sensitive information. This may involve using command line tools, writing scripts, or using specialized hacking tools.
Once a user has successfully completed a challenge, they will be awarded points and their progress will be tracked on the platform. Users can also share their solutions and collaborate with others on the HTB platform.
The HTB methodology provides a fun and engaging way for users to test and improve their hacking skills. It is a valuable resource for security professionals and enthusiasts alike.
Many people asked me about the methodology I use to root machines in Hack The Box, so today I will explain in detail how I play Hack The Box machine.
PREPARATION
I create a separate dirctory for every single machine, so that I can save the files, tools and scripts I used in each box sepatately and note-down the important things like password, hash, custom scripts/payloads etc.
HOST FILE
Now you can use IP or URL in the commands or scripts as per your need.
INFORMATION GATHERING
Nmap :
https://nmap.org/download.html
Masscasn :
https://github.com/robertdavidgraham/masscan
Automate Recon / Enum :
you can also use these script to automate the process of enumeration & recon.
AutoRecon : https://github.com/Tib3rius/AutoRecon
nmapAutomator : https://github.com/21y4d/nmapAutomator
WEB ENUMERATION / DIRECTORY AND FILES BRUTE-FORCING :
Nikto :
if Port 80 or 443 is Open, you can use Nikto to collect more information.
https://github.com/sullo/nikto
Gobuster :
https://github.com/OJ/gobuster
Ffuf :
Wfuzz :
https://github.com/xmendez/wfuzz
Use Seclists for More Wordlists : https://github.com/danielmiessler/SecLists
SERVICE ENUMERATION
Exploit DB / Searchsploit :
https://exploit-db.com/searchsploit
SMB Enumeration :
If you’re on a windows box and port 139 or 445 is open, Enumerate SMB.
Enum4Linux :
Enumerate information from Windows and Samba systems : https://kali.org/tools/enum4linux/
FILE TRANSFER IN LINUX
Python HTTP Server :
Netcat :
Base64 :
SCP :
Transfer the file test.file to the other server use the following command :
FILE TRANSFER IN WINDOWS
HTTP Server :
Local System :
Target System :
PSCP :
http://xray.rutgers.edu/~matilsky/documents/pscp.htm
NETCAT
Installation :
Listen :
Chat Server :
Now, type anything and it will show on the listener's shell.
File Transfer :
Reverse Shell :
Netcat is rarely present on production systems and even if it is there are several version of netcat, some of which don’t support the -e option.
If you have the wrong version of netcat installed, Jeff Price points out here that you might still be able to get your reverse shell back like this :
SSH
Installation :
Connection :
Create SSH Keys :
Permission :
SSH Password Cracking Using Key :
Download sshng2john.py
Crack SSH Password Using Hydra :
IMPACKET
Impacket is a collection of Python classes for working with network protocols.
https://github.com/CoreSecurity/impacket
REVERSE SHELL
Pentestmonkey : http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
Reverse Shell Cheatsheet.md : https://github.com/swisskyrepo/PayloadsAllTheThings/
Reverse Shell Cheat Sheet : https://oscp.infosecsanyam.in/shells/reverse-shell-cheat-sheet
SHELL SPAWNING
Interactive tty-shell : https://github.com/cornerpirate/socat-shell
PRIVILEGE ESCALATION
PayloadsAllTheThings : https://github.com/swisskyrepo/PayloadsAllTheThings
Evil-WinRM : https://github.com/Hackplayers/evil-winrm
Linux :
- LinEnum
- LinPEAS
- GTFOBins
- Basic Linux Privilege Escalation
- Linux elevation of privileges ToC
- Linux Smart Enumeration
- Linux - Privilege Escalation.md
- Linux Exploit Suggester
Windows :
- WinPEAS
- Windows elevation of privileges ToC
- WindowsExploits
- Windows Kernel Exploits
- Windows Privilege Escalation Fundamentals
- PowerTools
- Just Another Windows (Enum) Script
- Windows PrivEsc Methods for Pentesters
- Windows Privilege Escalation
- Windows Privilege Escalation Guide
- Windows OS Enumurations
- Windows Privilege Escalation Techniques and Scripts
That's It.. ✌🏾 If You Like This Post, Please Share This With Your Friends.