Entorno Pentesting y Hacking
I’m someone who often installs virtual machines for my testing, and I’ve become very accustomed to working in that environment as it’s more efficient for me. I find it frustrating to work in a regular Kali environment now, it’s quite challenging for me haha.
I’m going to share my personal configuration of Bspwm + Polybar + VSC + nvim + Kitty + Spotify with you, which can be installed on any Linux distribution designed for Penetration Testing, Ethical Hacking, CTFs, etc.
I must say that I’m not a developer, so the code is quite straightforward. It lacks validations and could be infinitely improved. When installing, we’ll see how everything is set up. I’ve kept it this way to catch any errors. It serves its purpose, which is to install the entire environment on top of a freshly installed image. I encourage you to modify it to your liking. It’s something I’m planning to do myself as I prepare for OSCP, and I take any opportunity to practice scripting.”
Good Luck
- this ordered seed list will be replaced by the toc
Considerations
For control purposes I have used the latest version of Kali so far, which is release 2024.1, which you can download from the ISO
Before installing anything I will explain a little how the script of the three different versions works:
I recommend you to read the whole post before installing in environment.
scriptMode
The first version is the basic installation that consists of bspwn + polyvar + picom + powerlevel10k + kitty + zsh + vsc + neovim, this suite is only for building in the environment and may take between 20 to 25 minutes.
Depending on the time of installation, a console-setup window will appear, give ok and continue.
At some point it will change, you will log out, at this moment you will have to restart the system and to start the session choose the BSPWN option.
I have automated the entire installation, so you no longer need to configure either zsh or powerlevel10k; these will load automatically. If you wish to edit anything, it’s in the configuration file. Neither fzf nor neovim needs to be configured separately. Just open any file, and the dependencies for neovim will be installed. Don’t forget that this must be done for the low-privileged user as well as root.
Shortcut kitty | Comando |
---|---|
Nueva pestaña | ctrl+shift+t |
Cerrar pestaña | ctrl+shift+q |
Siguiente pestaña | ctrl+shift+right |
Pestaña anterior | ctrl+shift+left |
Siguiente diseño | ctrl+shift+l |
Mover pestaña adelante | ctrl+shift+. |
Mover pestaña atrás | ctrl+shift+, |
Establecer título de pestaña | ctrl+shift+alt+t |
Nueva ventana | ctrl+shift+enter |
Nueva ventana del sistema operativo | ctrl+shift+n |
Cerrar ventana | ctrl+shift+w |
ctrl + shift + z | zoom |
- see more in the link
All of us who use this type of environment are used to seeing our IP and VPN from Hack the box. This is also implemented in the following way, for example.
To configure the IP and name of the HTB machine we use.
# file: "set target"
settarget 10.10.10.4 Blue
And to clean.
# file: "clean target"
cleartarget
It is also used to clear the target when there is no IP set, and if you click on the target IP you will copy it to the clipboard.
Still, I like my environment to be simple, so I have removed what I don’t need and implemented the following.
The location of the window will always tell you where you are located, no matter if you are between terminals, watching a video or whatever.
The interfaces for ctf’s.
Resizing applications is something that I really like because certain applications fit into the environment bar with just one click.
The implementation of spotify to hack with my favorite music.
Like most of us who have customized our environments, we have learned this thanks to s4vitar and even used his environment. But in the exercise of wanting to know more, how could I set up my own environment? I reached the conclusion of using the forest template since it has many utilities already implemented that can be taken advantage of, unlike the simple one that we all learned and replicated.
hackerMode
There’s not much to explain in this way, just that it will install everything from scriptMode plus the entire LaTeX suite for report writing. Since there are too many dependencies and fonts, etc., it takes about 35 to 40 minutes depending on your internet speed.
musicMode
This version installs scriptMode and also installs hackerMode, as well as everything necessary for Spotify to work. Although it’s my favorite, I don’t have it installed because it uses a lot of resources. I don’t recommend it for systems with less than 16GB of RAM. Also, it takes between 35 and 40 minutes to install.
You log in and you’re ready to go.
This looks like this, and also the letters move.
Installation
I have implemented everything so you don’t do anything, just clone the following repository and copy the following commands.
# file: "execute commands"
git clone https://github.com/4xLoff/Entorno.git
cd Entorno
chmod +x helpers.sh
sudo ./helpers.sh -i musicMode
You can choose the mode you prefer, -i scriptMode , -i hackerMode , -i musicMode , I invite you to read the code, although I do some verification, it must be run this way because I am handling dual user assignment to install. the tool, since it is the way to install the relevant tools for each low-privileged and root user.
hotkeys
Shortcut | Description |
---|---|
super + Enter | Terminal Emulator - /usr/bin/kitty |
super + d | Program Launcher - rofi |
super + Escape | Reload sxhkd configuration |
super + alt + {q,r} | Quit/Restart bspwm |
super + {_,shift + }q | Close/Kill window |
super + m | Toggle between tiled and monocle layout |
super + y | Send newest marked window to newest preselected window |
super + g | Swap current window with biggest window |
super + {t,shift + t,s,f} | Set window state |
super + ctrl + {m,x,y,z} | Set window flags |
super + {_,shift + }{Left,Down,Up,Right} | Focus window in given direction |
super + {p,b,comma,period} | Focus next/previous window on current desktop |
super + {_,shift + }c | Focus next/previous window on current desktop |
super + bracket{left,right} | Focus next/previous desktop on current monitor |
super + {grave,Tab} | Focus last window/desktop |
super + {o,i} | Focus older/newer window in focus history |
super + {_,shift + }{1-9,0} | Focus or send to given desktop |
super + ctrl + alt + {Left,Down,Up,Right} | Preselect direction |
super + ctrl + {1-9} | Preselect ratio |
super + ctrl + alt + space | Cancel preselection for focused window |
super + ctrl + shift + space | Cancel preselection for focused desktop |
super + alt + {Left,Down,Up,Right} | Expand window |
super + alt + shift + {Left,Down,Up,Right} | Contract window |
super + ctrl + {Left,Down,Up,Right} | Move floating window |
super + {Left,Down,Up,Right} | Custom move window |
super + shift + f | Open Firefox |
super + shift + g | Open Chrome |
super + b | Open BurpSuite Community Edition |
super + shift + o | Open Obsidian |
super + q | Lock screen with i3lock-fancy |
🎉 Congratulations, you now have your own Environment!. 🎉