os:kali:css
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| os:kali:css [2023/06/21 06:41] – [Virtualbox Additions tools] warnaud | os:kali:css [2024/11/09 15:20] (current) – [Additional packages] warnaud | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Introduction ====== | ||
| + | Kali VM for course/ | ||
| + | Based on Kali 2022.1 &.2 .3\\ | ||
| + | ====== Notes ====== | ||
| + | - Default Keymap is in **English us** use the menu and type keyboard to change in a GUI | ||
| + | - :!: **__not for use in production__** :!: | ||
| + | - sudo without password, 99% of the following commands were run in a root user shell -> [[https:// | ||
| + | ====== VM ====== | ||
| + | From: [[https:// | ||
| + | Docs: [[https:// | ||
| + | Unzip the file downloaded then import the .vbox file, using " | ||
| + | |||
| + | ====== TO DO FIRST ====== | ||
| + | Things to do to make this VM work on our environment: | ||
| + | - Download and import into [[https:// | ||
| + | - Verify or change settings (copy/ | ||
| + | - snapshot, so the next modifications can be reversed to the original state. | ||
| + | - resize display once logged in (see underneath login/pass) type " | ||
| + | - Add what you miss (bookmarks/ | ||
| + | |||
| + | |||
| + | ==== Display size ==== | ||
| + | using Display in Settings and set it up doesn' | ||
| + | {{ : | ||
| + | |||
| + | ==== Lock screen ==== | ||
| + | Menu > Settings > Power Manager then in the Tab " | ||
| + | * Automatically lock the session: Never | ||
| + | * Uncheck "Lock screen when system is going to sleep" | ||
| + | ==== Missing packages ==== | ||
| + | <code bash> | ||
| + | Then as root | ||
| + | <code bash> | ||
| + | apt update && apt install -y htop ccze dfc iftop libreoffice libreoffice-l10n-de libreoffice-l10n-fr clipit zaproxy | ||
| + | </ | ||
| + | ===== Autologin ===== | ||
| + | Here for the **kali** user, replace by yours if you made another | ||
| + | <code bash> vi / | ||
| + | <code perl> | ||
| + | [Seat:*] | ||
| + | autologin-user=kali | ||
| + | autologin-user-timeout=0</ | ||
| + | |||
| + | |||
| + | ===== New user (OPTIONAL) ===== | ||
| + | <code bash> useradd -m warnaud | ||
| + | usermod -aG ad, | ||
| + | chsh -s / | ||
| + | passwd warnaud</ | ||
| + | Log-out and log in to update all **ENV** variables ($SHELL etc ...) | ||
| + | |||
| + | ===== SUDO ===== | ||
| + | The group **kali-trusted** can launch sudo commands without password | ||
| + | <code bash> usermod -aG kali-trusted kali</ | ||
| + | __Note__: replace kali by your user if you prefer to have a dedicated user | ||
| + | |||
| + | ==== Additional packages ==== | ||
| + | |||
| + | === Docker === | ||
| + | :!: doesn' | ||
| + | <code bash> | ||
| + | apt install -y curl gnupg2 apt-transport-https ca-certificates | ||
| + | echo "deb [arch=amd64 signed-by=/ | ||
| + | curl -fsSL https:// | ||
| + | cd | ||
| + | apt update | ||
| + | apt install -y docker-ce docker-ce-cli containerd.io | ||
| + | systemctl enable docker --now | ||
| + | usermod -aG docker kali | ||
| + | curl -s https:// | ||
| + | mv docker-compose-linux-x86_64 / | ||
| + | chmod +x / | ||
| + | </ | ||
| + | == Python2 == | ||
| + | <code bash> | ||
| + | sudo apt install -y python2 python2.7-dev libpython2-dev | ||
| + | curl https:// | ||
| + | sudo python2 get-pip.py | ||
| + | sudo python2 -m pip install -U setuptools wheel | ||
| + | </ | ||
| + | === Volatility === | ||
| + | <code bash> | ||
| + | cd /opt | ||
| + | git clone https:// | ||
| + | echo "#! / | ||
| + | / | ||
| + | chmod +x / | ||
| + | git clone https:// | ||
| + | ln -s / | ||
| + | |||
| + | python2 -m pip install -U distorm3 yara pycrypto pillow openpyxl pytz ipython capstone | ||
| + | python2 -m pip install -U --no-use-pep517 ujson | ||
| + | sudo python2 -m pip install yara | ||
| + | sudo ln -s / | ||
| + | </ | ||
| + | === Yara rules === | ||
| + | <code bash> | ||
| + | mkdir /opt/yara | ||
| + | cd /opt/yara | ||
| + | git clone https:// | ||
| + | </ | ||
| + | === Volatility-check script === | ||
| + | <code bash> | ||
| + | cd /opt | ||
| + | git clone https:// | ||
| + | chmod o+x / | ||
| + | ln -s / | ||
| + | </ | ||
| + | ===== Snort ===== | ||
| + | ==== First try ==== | ||
| + | |||
| + | From : [[ https:// | ||
| + | <code bash>apt install dh-autoreconf pkg-config cmake | ||
| + | cd /opt | ||
| + | git clone https:// | ||
| + | cd libdaq | ||
| + | ./bootstrap | ||
| + | ./configure | ||
| + | make install | ||
| + | ldconfig | ||
| + | |||
| + | cd /opt | ||
| + | git clone https:// | ||
| + | cd snort3 | ||
| + | ./ | ||
| + | |||
| + | </ | ||
| + | DOESN' | ||
| + | ==== Second try ==== | ||
| + | |||
| + | From: [[https:// | ||
| + | <code bash> | ||
| + | apt install -y gcc libpcre3-dev zlib1g-dev libluajit-5.1-dev libpcap-dev openssl libssl-dev libnghttp2-dev libdumbnet-dev bison flex libdnet autoconf libtool | ||
| + | cd /opt | ||
| + | mkdir snort_src | ||
| + | cd snort_src | ||
| + | wget https:// | ||
| + | tar xvzf daq-2.0.7.tar.gz | ||
| + | cd daq-2.0.7 | ||
| + | autoreconf -f -i | ||
| + | ./configure && make && make install | ||
| + | cd / | ||
| + | wget https:// | ||
| + | tar xvzf snort-2.9.20.tar.gz | ||
| + | cd snort-2.9.20 | ||
| + | ./configure --enable-sourcefire CPPFLAGS=" | ||
| + | ldconfig | ||
| + | groupadd snort | ||
| + | useradd snort -r -s / | ||
| + | mkdir -p / | ||
| + | mkdir -p / | ||
| + | mkdir -p / | ||
| + | chmod -R 5775 /etc/snort | ||
| + | chmod -R 5775 / | ||
| + | chmod -R 5775 / | ||
| + | chown -R snort:snort /etc/snort | ||
| + | chown -R snort:snort / | ||
| + | chown -R snort:snort / | ||
| + | touch / | ||
| + | touch / | ||
| + | touch / | ||
| + | cp / | ||
| + | cp / | ||
| + | cd / | ||
| + | wget https:// | ||
| + | tar xvzf community.tar.gz | ||
| + | cp / | ||
| + | sudo sed -i ' | ||
| + | vi / | ||
| + | </ | ||
| + | DOESN' | ||
| + | ==== Third try ==== | ||
| + | From : [[https:// | ||
| + | <code bash> | ||
| + | vi / | ||
| + | </ | ||
| + | <code perl> | ||
| + | deb http:// | ||
| + | </ | ||
| + | :!: bullseye as kali is now rolling release so put a current version **might** -> **testing** doesn' | ||
| + | <code bash>apt update | ||
| + | apt install snort</ | ||
| + | :!: comment the line **deb http:// | ||
| + | ==== Configure ==== | ||
| + | <code bash> | ||
| + | You can change the default IP range of $HOME_NET (**default is 10.0.2.0/ | ||
| + | ==== Test ==== | ||
| + | <code bash> vi / | ||
| + | <code perl> | ||
| + | alert tcp any any -> any any (msg:" | ||
| + | </ | ||
| + | <code bash> | ||
| + | snort -A console -i eth0 -u snort -g snort -c / | ||
| + | Now launch a web browser or anything that goes on the internet using tcp stack | ||
| + | ==== Update ==== | ||
| + | Uncomment the line in **/ | ||
| + | ===== Brave ===== | ||
| + | <code bash> | ||
| + | apt install apt-transport-https curl | ||
| + | |||
| + | sudo curl -fsSLo / | ||
| + | |||
| + | echo "deb [signed-by=/ | ||
| + | |||
| + | apt update | ||
| + | |||
| + | apt install brave-browser | ||
| + | </ | ||
| + | |||
| + | ===== Nala ===== | ||
| + | You can add [[https:// | ||
| + | <code bash> | ||
| + | echo "deb https:// | ||
| + | wget -qO - https:// | ||
| + | apt update | ||
| + | apt install nala | ||
| + | </ | ||
| + | |||
| + | ====== Exam preparation ====== | ||
| + | You can quickly script the files where you'll answer the challenge for the exam: | ||
| + | <code bash> | ||
| + | FIRSTNAME=" | ||
| + | touch ~/ | ||
| + | </ | ||
| + | :!: Change FIRSTNAME/ | ||
| + | |||
| + | ====== Detailed installation ====== | ||
| + | __**(if you install from scratch with the ISO - not needed if you already imported the OVA/premade images)**__ | ||
| + | ===== visudo ===== | ||
| + | css user is member of the sudo group | ||
| + | <code bash> | ||
| + | <code perl> | ||
| + | |||
| + | ===== Virtualbox Additions tools ===== | ||
| + | :!: not mandatory, only for barebone install, images from Kali have necessary tools already installed | ||
| + | Insert the virtual CD :!: DOESN' | ||
| + | <code bash>cd / | ||
| + | sudo bash ./ | ||
| + | sudo usermod -aG vboxsf kali | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== HyperV ===== | ||
| + | Under hyperV you should set this option to get the most of the VM | ||
| + | <code bash> | ||
| + | C: | ||
| + | |||
| + | |||
| + | ===== Slow Web browser ===== | ||
| + | if your web browser seems laggy or make your whole VM laggy, just activate the 3D acceleration: | ||
| + | |||
| + | |||
| + | ===== References ===== | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
