Bashed 15.08.2021


NMap


FeroxBuster

403       11l       32w      290c http://10.10.10.68/.hta
301        9l       28w      308c http://10.10.10.68/css
301        9l       28w      308c http://10.10.10.68/dev
403       11l       32w      295c http://10.10.10.68/.htaccess
403       11l       32w      295c http://10.10.10.68/.htpasswd
301        9l       28w      310c http://10.10.10.68/fonts
301        9l       28w      311c http://10.10.10.68/images
200      161l      397w     7743c http://10.10.10.68/index.html
301        9l       28w      307c http://10.10.10.68/js
301        9l       28w      308c http://10.10.10.68/php
403       11l       32w      299c http://10.10.10.68/server-status
301        9l       28w      312c http://10.10.10.68/uploads

user.txt

2c281f318555dbc1b856957c7147bfc1


Privilages Escalation

(scriptmanager : scriptmanager) NOPASSWD: ALL

Zatem można uruchomić każdą komendą bez użycia hasła przy użyciu użytkownika scriptmanager

sudo -u scriptmanager /bin/bash
id
uid=1001(scriptmanager) gid=1001(scriptmanager) groups=1001(scriptmanager)
uname -a
Linux bashed 4.4.0-62-generic #83-Ubuntu SMP

Exploit pasuje

https://www.exploit-db.com/exploits/41458

root.txt

cc4f0afe3a1026d402ba10329674a8e2


Porada: Nie nazywać exploitów jako exploit, kernel potrafi wywalić taki proces



Inny sposób na root to sprawdzić jakie pliki scriptmanager może uruchamiać. Możliwa jest modyfikacja takiego programu, tak by uzyskać reverse shell z rootem. ( Bo można jako scriptmanager uruchamiać programy z sudo)