Heist
Easy - Linux
Recon
HTTP and Looting Cisco IOS Config
On an initial visit to the HTTP service, we see a login page. We have no creds yet, so let's keep searching. There's a guest login available, and visiting that, we see a few support messages and a Cisco config attachment. At the time, I have been attending a CCNA (Cisco Certified Network Associate) course at my college, so I was familiar with the layout of the config. Most of the config is irrelevant to us, but the security lines should catch your eye.
To understand how to identify the encrypted text, we need to first understand how Cisco IOS stores configurations. Let's take this line for example:
enable
tells the router to enable a mode for PRIV EXEC mode, in this a secret password to log in. In this context, the secret
word indicates that it is encrypted in Cisco Type 5, which is essentially a 1,000 iteration MD5 with a salt.
The next two lines indicate something similar to above. In this case, these configuration lines are used for SSH authentication. We see a username
declaration, a password
type, then the ciphered password. Instead of Type 5, we see it's using Type 7 now. Thankfully, instead of using MD5, the ciphertext is utilizing the Vigenère cipher which is essentially a simple alphabetical substitution encryption and can be decrypted easily. Let's record these usernames and decrypt/decipher these passwords.
To crack Type 5: https://www.ifm.net.nz/cookbooks/cisco-ios-enable-secret-password-cracker.html
Or: john --format=md5crypt --fork=4 --wordlist=/usr/share/wordlists/rockyou.txt hashes.txt
To crack Type 7: https://www.firewall.cx/cisco-technical-knowledgebase/cisco-routers/358-cisco-type7-password-crack.html
To learn more about Cisco password, view this page: https://www.router-switch.com/faq/six-types-of-cisco-password.html
Don't forget to record the user in the support thread we gained guest access to for his username!
Brute Forcing
Now that we have some possible credentials to test for, let's get to crackin'. Remember in the support thread, Hazard asked for a access to the Windows server. Let's use hydra
to brute force SMBv2.
Now that we have some valid creds, let's record it and enumerate Windows services.
Enumeration
Logging in to SMB with these creds didn't give much, plus there weren't any shares to note. WinRM also didn't allow us in.
Let's get our hands on CrackMapExec to brute force RID's. I honestly had to take a peek at the walkthrough to get pointed in the right direction.
Time for brute forcing to see if our small list of creds might work here.
Seems like Chase has the password we have as well. How about WinRM/SMB'ing him?
Now that we're in Chase, let's grab the flag in Desktop and view a todo.txt.
yada yada dump firefox memory, grep for post request string, get password, pwned. I just went through the walkthrough for the end, I don't have any reason to just copy paste another walkthrough on mine.
Last updated