-
Creates a folder with the name you give it
-
Create a .vscode folder with all settings and zsh files
like
vscode setting.json tasks.json
and metasploit workspace rcfileworkspace_metasploit.rc
-
Check LaunchOrder.md for the launch order of zsh files and it will explain how they works.
-
directly edit the folder you created via createhackenv.sh
-
edit any files under .vscode
-
and it will auto enabled in vscode
-
fork this repo
-
edit/update/add/delete the files under
.vscode
folder -
before your commit, use
craft.py
to generate the newcreatehackenv.sh
filepython3 craft.py
will generatecreatehackenv.sh
filewhat is craft.py?
it's a python script to create the creathackenv.sh file for you based on current folder vscode configuration.
It will pack the config files with base64 and put it in the creathackenv.sh file.
and createhackenv.sh will decode it and put it in the right place when you create a new hacking environment.
you can customize the createhackenv.sh file by yourself, but you need to make sure the base64 string is correct.
-
add everything and commit, push to your own repo
-
settings.json
andtasks.json
for vscode settingsit is entry point for vscode to load settings and tasks for the project, just like index.
and the detail commands will loadded in other zsh files.
settings.json
defines the terminal modes in vscodetasks.json
defines commands which will run just once.current task is msfvenom payload fast generate task.
extension.json
defines the extension you'd better to install in vscode.it extends vscode with other strong features like code analysis, code completion, etc.
-
env.zsh
for environments variables you want to set. it should be sourcedsource*.zsh
. (recommended to source it in every .zsh file under .vscode folder)e.g.
export RHOST=11.45.1.4
it also will auto set the envirnoment variable of $PROJECT_FOLDER to the folder you just created
you can reuse like
e.g.
cd $PROJECT_FOLDER
switch the pwd back to the project -
source.zsh
file will control the zsh shell behavior in vscode terminal with modee.g.
source.zsh
will be used when you set env varoiableWEB_DELIVERY_MODE
in your new vscode terminal.you will launched a new zsh shell and execute the WEB_DELIVERY_MODE command in the block
meterpreter-handler
will launch up a new msfconsole with the metasploit rcfile this terminal will called with msfconsole command insource source_metasploit.zsh
filenetcat-handler
if you prefer netcat or pwncat-cs to handle reverse shell, you can use this mode terminalweb-delivery
will cd into the $PROJECT_WEB_DELIVERY folder and start a python http server for you to delivery web files. It based onsource source_web-delivery.zsh
file.you can use pdteam's simplehttpserver to replace it.
-
kali-orbstack
file will launch orbstack virtual machine - kalilinx, sourcesource_kali-orbstack.zsh
and process env variables inenv.zsh
file inside env. it will also control the zsh behavior but in kali vm.you can easily inject environment variables into the kali vm with this mode. and reuse command outside.
like
evil-winrm -i $RHOST -u $RUSER -p $RPASS
will work in kali vm and host machine. and you just need set the env variables inenv.zsh
file once. -
metasploit rcfile
metasploit_handler.rc
for you to use in vscode terminal (meterpreter-handler mode)it launched as
msfconsole -r this.rc
you can use it to set up your own meterpreter handler with custom options / operations
like use multi/handler set payloads lhost lport etc and run as job in background
- env.zsh and source_*.zsh will load before zshrc