githubEdit

Red Team Notes

Sorted Linux notes, need to separate to different pages and reorganize

circle-check

Linux

Website for searching for shells through random programs such as vi "living off the land binaries": GTFObinsarrow-up-right

Remote Code Execution

Run commands on remote system without a shell through SSH with a "Herefile". HERE can be anything, but it must begin and end with the same word. https://www.cyberciti.biz/faq/linux-unix-osx-bsd-ssh-run-command-on-remote-machine-server/arrow-up-right

ssh <user>@<server> << HERE
 <command1>
 <command2>
HERE

Misc Linux

Raw memory location so no files on disk: /dev/shm/

list all running commands:

ps -eo command`
#change delimiter to \n instead of <space> (loop by line): 
IFS=$'\n'
#Then loop through each line in output: 
for i in $(ps -eo command); do echo $i; done

Cat file directly to clipboard

https://unix.stackexchange.com/questions/211817/copy-the-contents-of-a-file-into-the-clipboard-without-displaying-its-contentsarrow-up-right script to copy contents of file directly to clipboard; Save in PATH location then enjoy!

'new' netstat: ss -lnp | grep 9001 #check if any connections on port 9001

copy files to local machine without file transfer:

pretty print JSON text in console (https://www.howtogeek.com/529219/how-to-parse-json-files-on-the-linux-command-line-with-jq/arrow-up-right). Pipe the JSON output to jq. Example from NASA ISS API: curl -s http://api.open-notify.org/iss-now.json | jq

Check encoding of a text file

vi -c 'let $enc = &fileencoding | execute "!echo Encoding: $enc" | q' <file_to_check> check encoding of a text file (needed especially when doing crypto with python, or cracking passwords with rockyou.txt - hint: needs latin encoding!) https://vim.fandom.com/wiki/Bash_file_encoding_aliasarrow-up-right (how to make an alias for the above command)

If you like this content and would like to see more, please consider buying me a coffeearrow-up-right!

Last updated