PRIMARY CATEGORY → ZSH
In this Setup environment, all the following Shell Functions are declared in the custom.zsh script
Then, the custom.zsh script is sourced from the .zshrc file as follows →
IMPORTANT
In the above code, an absolute path is used instead of the Tilde Expansion
~
This is because the Root’s .zshrc file is a symbolic link to the non-privilege user’s .zshrc
Note that the
.config/zsh
directory only exists in/home/al3xbb
but not in/root
Custom.zsh Source File → See here
Terminal/Screen
Shell Functions related to the Terminal and Screen actions →
clearScreenAndScrollback
It clears the Screen Content and Scrollback Buffer through the C-l
keybind
Function
More info here
Pentesting
Shell Functions related to the Pentesting Process →
Most of the functions are Non-POSIX-Compliant as ZSH is the Targeted Shell
mkt
It creates a Pentesting Folder Structure to store all documentation related to the target 🎯
Function
IMPORTANT
Note that the above function is Non-POSIX Compliant due to Bash Specific Functionalities such as
local
,[[ ]]
shell keyword, Brace Expansion{ }
or indexed arraysTherefore, It is not destined to POSIX Compliant shells like sh or dash
If POSIX Compliant is needed →
validateIP
This function simply checks if the IP Address entered as an argument is valid
It is used by the setTarget function
Function
setTarget
It sets the Target’s IP Address and Hostname as one of the Polybar Bar’s Modules
This function prints the above data into the /home/al3xbb/.config/bin/target
file
Then the Polybar Module carries out an action based on that File’s Content as follows →
- If Empty → “No target” as Polybar’s Bar Content
- If not Empty → File’s Content as the Polybar’s Bar Content, i.e. the IP Address and Hostame
Function
clearTarget
This functions empties the /home/al3xbb/.config/bin/target
file
Therefore, as mentioned in the setTarget function, the Polybar Module sets “No Target” as Polybar Bar’s Content
Function