So we have two superpass folders. One in /app/app and the other one in /app/app-testing.
After connecting to the mysql.
This is the table where registered users are kept.
0xdf and corum are default.
I tried cracking the hashed_passwords but failed.
We see agile as well. With user corum's password. But I took all the username=passwords in different files to run a brute-force. We know the SSH port is open.
We get a hit!
ssh - corum
I like how ippsec did it. He first ran ps -ef --forest to see all running processes(ps) and detailed tree view (-ef --forest). Which then shows the following.
Two python applications on different ports (5000,5555) and different users (www-data,runner) running. And then he went into / to find files with strings 5555 which exposes the /etc/nginx site configuration files, exposing two different files, one is exposed to the internet and the other one is only accessible internally.
They way ippsec did the box its much cleaner imo.
Once in, I digged deeper into the /app-testing directory. I found this interesting file , but we cannot read it.
Its been used by test_site_interactively.py.
Selenium is used to test web applications directly on browsers like chrome through Python code. And inside this file we see that, its using the contents of creds.txt which are the usernames and passwords, against the application to see if its working.
There is a line here saying --remote-debugging-port=41829. Its a hard-coded port.
And it is open.
This site is also alive.
We cannot access it from outside. It redirects us back to the default site.
We have to access it from localhost. We can tunnel our localhost to SSH. So we can access port 5555 from our localhost.
So I registered a new user here. But it doesn;t reflect on the mysql database.
Previously we saw the line --remote-debugging-port=41829. I found an article that explains the attack path. We can abuse that by creating a tunnel between our host and the linux host.
Once thats done we can connect it to our chrome debugger by going to chrome://inspect/#devices > configure > add localhost:41829 > done. We should see a new remote device.
When inspecting it and going to vault we find some new credentials.
I can use that to ssh in as edwards:d07867c6267dcb5df0af
ssh - edwards
Opening these files gives us two credentials.
Trying them both to get root failed.
But we do know that cred.txt is used by the /app/app-testing/tests/functional/test_site_interactively.py file.
corum@agile:/app/app-testing/tests/functional$ cat test_site_interactively.py
import os
import pytest
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
with open('/app/app-testing/tests/functional/creds.txt', 'r') as f:
username, password = f.read().strip().split(':')
edwards@agile:~/.config/cni/net.d$ sudo -l
[sudo] password for edwards:
Matching Defaults entries for edwards on agile:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
User edwards may run the following commands on agile:
(dev_admin : dev_admin) sudoedit /app/config_test.json
(dev_admin : dev_admin) sudoedit /app/app-testing/tests/functional/creds.txt