Aliases. Because I'm a lazy bugger.

It may seem ironic given that I spend all day on a computer. If I'm not working doing things on a computer, I'm working doing things on a computer. Despite that, I am actually pretty lazy when it comes to typing. I hate typing any more than I absolutely have to, especially if it's repetitive things like certain commands.

I've created aliases for myself, and I'm so lazy that I even create aliases on the boxes I pop when I'm doing CTFs. For instance, typing ls -larth over and over again sucks. I'd rather just type l.  

Anyway, here are a few aliases I've created for myself on my Kali VM:

# Aliases
                                                                         
# simpleHTTPServers                                                     
alias pyserv="sudo python -m SimpleHTTPServer 80"                       
alias phpserv="sudo php -S 0.0.0.0:80"
alias rubyserv="sudo ruby -run -e httpd . -p 9000"
alias busyserv="sudo busybox httpd -f -p 10000"

# Ncat Listeners
alias nlis443="sudo nc -nvlp 443"
alias nleet="sudo nc -nvlp 31337"
alias nlis4444="sudo nc -nvlp 4444"



# SSH Server Start/Stop/Status
alias sshgo="sudo systemctl start ssh"
alias sshoff="sudo systemctl stop ssh"
alias sshis="sudo systemctl status ssh | egrep active | cut -d ' ' -f 7"


# Start/Stop/Status FTP Server
alias ftpgo="sudo systemctl start proftpd"
alias ftpoff="sudo systemctl stop proftpd"
alias ftpbounce="sudo systemctl restart proftpd"
alias ftpis="sudo systemctl status proftpd | egrep 'Active' | cut -d ' ' -f 7"


# Basic Commands
alias l="ls -la"
alias refresh="source ~/.bashrc"
alias ifconfig="sudo /usr/sbin/ifconfig"

# View nmap scripts
alias nscripts="~/.basicScripts/nscripts.sh"


# My Tun0 IP
alias tun0="sudo ifconfig tun0 | egrep -w "inet" | cut -d ' ' -f 10"


# VPN
alias hbvpn="sudo openvpn ~/Documents/htb/----.ovpn"



# Jump to directory
alias hb="cd ~/Documents/htb/boxes"

I have a bunch of start/stop commands. Listeners, a quick way to check my IP when I'm using the tun0 interface and a few simple http servers (in case I don't have luck with one, or need to set up multiple on different ports).

The second I jump on a box and can create an alias I run alias l="ls -larth".

It's easier and faster.

# View nmap scripts
alias nscripts="~/.basicScripts/nscripts.sh"

Just executes the following script called nscripts.sh:

#! /bin/bash

ls -l /usr/share/nmap/scripts/${1}* | cut -d"/" -f 6

That outputs the following if I run nscripts ftp.

ftp-anon.nse
ftp-bounce.nse
ftp-brute.nse
ftp-libopie.nse
ftp-proftpd-backdoor.nse
ftp-syst.nse
ftp-vsftpd-backdoor.nse
ftp-vuln-cve2010-4221.nse

Or the below output if I run nscripts smb:

smb2-capabilities.nse
smb2-security-mode.nse
smb2-time.nse
smb2-vuln-uptime.nse
smb-brute.nse
smb-double-pulsar-backdoor.nse
smb-enum-domains.nse
smb-enum-groups.nse
smb-enum-processes.nse
smb-enum-services.nse
smb-enum-sessions.nse
smb-enum-shares.nse
smb-enum-users.nse
smb-flood.nse
smb-ls.nse
smb-mbenum.nse
smb-os-discovery.nse
smb-print-text.nse
smb-protocols.nse
smb-psexec.nse
smb-security-mode.nse
smb-server-stats.nse
smb-system-info.nse
smb-vuln-conficker.nse
smb-vuln-cve2009-3103.nse
smb-vuln-cve-2017-7494.nse
smb-vuln-ms06-025.nse
smb-vuln-ms07-029.nse
smb-vuln-ms08-067.nse
smb-vuln-ms10-054.nse
smb-vuln-ms10-061.nse
smb-vuln-ms17-010.nse
smb-vuln-regsvc-dos.nse
smb-vuln-webexec.nse
smb-webexec-exploit.nse

Makes things a whole lot easier, and I don't have to remember a bunch of crap like file paths.