-
Creates a folder with the name you give it
-
Create a .vscode folder with all settings and zsh files
like
vscode setting.json tasks.jsonand 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
.vscodefolder -
before your commit, use
craft.pyto generate the newcreatehackenv.shfilepython3 craft.pywill generatecreatehackenv.shfilewhat 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.jsonandtasks.jsonfor 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.jsondefines the terminal modes in vscodetasks.jsondefines commands which will run just once.current task is msfvenom payload fast generate task.
extension.jsondefines the extension you'd better to install in vscode.it extends vscode with other strong features like code analysis, code completion, etc.
-
env.zshfor 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.4it also will auto set the envirnoment variable of $PROJECT_FOLDER to the folder you just created
you can reuse like
e.g.
cd $PROJECT_FOLDERswitch the pwd back to the project -
source.zshfile will control the zsh shell behavior in vscode terminal with modee.g.
source.zshwill be used when you set env varoiableWEB_DELIVERY_MODEin your new vscode terminal.you will launched a new zsh shell and execute the WEB_DELIVERY_MODE command in the block
meterpreter-handlerwill launch up a new msfconsole with the metasploit rcfile this terminal will called with msfconsole command insource source_metasploit.zshfilenetcat-handlerif you prefer netcat or pwncat-cs to handle reverse shell, you can use this mode terminalweb-deliverywill 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.zshfile.you can use pdteam's simplehttpserver to replace it.
-
kali-orbstackfile will launch orbstack virtual machine - kalilinx, sourcesource_kali-orbstack.zshand process env variables inenv.zshfile 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 $RPASSwill work in kali vm and host machine. and you just need set the env variables inenv.zshfile once. -
metasploit rcfile
metasploit_handler.rcfor you to use in vscode terminal (meterpreter-handler mode)it launched as
msfconsole -r this.rcyou 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