Home Projects Blog

A cheatsheet for me and for you

Here's a place to store my notes/commands which I keep on forgetting because I never use them enough to memorise it. Sometimes the man pages are just too verbose and too long to look through :(

Might move it to a self-hosted wiki in the future, who knows?

I could probably improve the look of this page but that'll probably happen soon.

General stuff

Login with an SSH private key with ssh -i sshPrivateKey user@8.8.8.8

File transfer when ssh'd into a server scp fileName username@hostname:~/Location

Find any files without the "Permission Denied" error occuring. find / -type f -name "fileName" 2>&1 | grep -v -i "permission denied"

Works by redirecting STDERR (2) to STDOUT (1)

Audio/Visual

HDMI output off: xrandr --output HDMI-1-1 --auto --output eDP-1-1 --auto

HDMI output on: xrandr --output eDP-1-1 --mode 1920x1080 --output HDMI-1-1 --off

Remember to switch audio output with Pavucontrol.

CTF stuff

Crypto <3

Follow these links to factor super duper large numbers, here, and here

Also Yafu deserves a good mention here, will update on how to use it when I next use it.

Steganography

Simple enough to use: binwalk -e fileName; steghide --extract -sf fileName; foremost fileName;

zsteg fileName; exiftool fileName;

Reverse Engineering

Use objdump -d binaryName to disassemble the binary into assembly instructions.

Use objdump -t binaryName to print out the symbols (also function names).

Use strace -s 64 and ltrace -s 64 to look at system and library calls. Or do both with ltrace -S.

Enumeration/OSINT

Nmap

nmap -sV -sC -vv ipAddr where the arguments represent:

OSINT

Probably the only link apart that will be useful apart from Google: OSINT framework

Password Cracking

Hashcat

The different attack modes are:

There's a lot of hashes out there, here are all of them.

An plain standard command is:

 
              # dictionary mode with a SHA512 hash and rockyou.txt
              
./hashcat -a 0 -m 1800 exampleHash.txt /usr/share/dict/rockyou.txt
Below is one example of mask mode being used, here are more.
 
              # mask mode with a bcrypt/blowfish hash with a prehash in regex form [A-Z0-9]{4}
              
./hashcat -a 3 -m 3200 exampleHash.txt -1 ?l?d?u ?1?1?1?1

JohnTheRipper

Use the relevant binary such as ./unshadow,./ssh2john ./zip2john to get the relevant hash and store it in some file. Then use JTR with:

 
  ./john --wordlist=/usr/share/dict/rockyou.txt exampleHash.txt