> For the complete documentation index, see [llms.txt](https://www.xtormin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.xtormin.com/misc/kali-setup.md).

# \[ Kali ] Setup

## Virtualización

### VMWare Worktation Pro

<https://support.broadcom.com/group/ecx/productdownloads?subfamily=VMware%20Workstation%20Pro&freeDownloads=true>

## Terminal

### <mark style="color:purple;">Nerd Fonts</mark>

<https://github.com/ryanoasis/nerd-fonts?tab=readme-ov-file#font-installation>

### <mark style="color:purple;">ZSH + PowerLevel10k</mark>

1. Instalar ZSH:

```bash
apt install zsh
```

2. Obtener el repositorio de [<mark style="color:red;">**powerlevel10k**</mark>](https://github.com/ahillio/powerlevel10k/blob/master/README.md#manual) y añadirlo en el fichero de configuración de <mark style="color:red;">ZSH</mark>**:**

```bash
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
```

3. Ejecutar <mark style="color:red;">**ZSH**</mark> (debería cargarse automáticamente el configurador de **powerlevel10k**):

```bash
zsh
```

<figure><img src="/files/AJFWMvOZ11fhpU9z7Z0n" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Si se quiere volver a ejecutar la configuración, se puede utilizar el comando "p10k configure"
{% endhint %}

4. Si se quiere utilizar una plantilla personalizada, se puede usar la siguiente, por ejemplo:

```
cd $HOME
wget https://raw.githubusercontent.com/xtormin/CyberSnippets/main/configfiles/p10k.zsh
cp p10k.zsh .p10k.zsh
```

<figure><img src="/files/1ArHthZgNkA3bSX36qNy" alt=""><figcaption></figcaption></figure>

Al final del fichero de documentación se encuentran las funciones que he añadido para que se vea de dicha forma, se podría modificar la cadena "xtormin" con la que más te guste:

```
################################[ xtormin : xtormin ]################################

function prompt_xtormin() {
  p10k segment -f 208 -i '🔥' -t 'xtormin'
}

typeset -g POWERLEVEL9K_XTORMIN_FOREGROUND=001
typeset -g POWERLEVEL9K_XTORMIN_BACKGROUND=015
typeset -g POWERLEVEL9K_XTORMIN_ANCHOR_BOLD=true
```

Para realizar el cambio de forma automática en todo el documento, sustituyendo "tu\_user" por lo que desees:

```
sed -i 's/xtormin/tu_user/g' .p10k.zsh
```

## SSH

### Fail2Ban

Instalación y configuración para su ejecución al inicio:

```bash
sudo apt update && sudo apt install fail2ban -y
sudo systemctl enable --now fail2ban
```

Ver el estado:

```bash
sudo systemctl status fail2ban
```

Modificar la configuración:

```bash
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo vim /etc/fail2ban/jail.local
```

Ejemplo de configuración:

```bash
[sshd]
enabled = true
bantime = -1
findtime = 10m
maxretry = 3
```

Reiniciar el servicio y ver el estado:

<pre class="language-bash"><code class="lang-bash"><strong>sudo systemctl restart fail2ban
</strong>sudo systemctl status fail2ban
</code></pre>

Ver logs:

```bash
sudo tail -f /var/log/fail2ban.log
```
