# \[ 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.xtormin.com/misc/kali-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
