> For the complete documentation index, see [llms.txt](https://riteshs4hu.gitbook.io/infosec-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://riteshs4hu.gitbook.io/infosec-notes/web-appsec/vulnerable-env-setup.md).

# Vulnerable Env Setup

### Install Debian 12 in VirtualBox

* Download and install [Debian 12](/infosec-notes/linux-server-administrator/debian-installation.md)

### Configure the [Web Server](/infosec-notes/linux-server-administrator/servers-configurations-debian/apache-web-server.md)

* Install Apache web server

  ```bash
  apt install apache2*
  ```

### Install PHP

* Install PHP with common required modules

  ```bash
  apt install php php-common php-cli php-opcache php-gd php-curl php-mysql php-xml php-mbstring php-pear php-dev
  ```

### Configure PHP

* Edit the PHP configuration file

  ```bash
  vim /etc/php/{version}/cli/php.ini
  ```
* Update or add the following settings

  ```ini
  memory_limit = 512M
  max_execution_time = 500
  max_input_vars = 10000
  upload_max_filesize = 2048M
  post_max_size = 2048M
  allow_url_fopen = On
  ```

### Install MySQL

* Download MySQL APT repository package

  ```bash
  wget https://dev.mysql.com/get/mysql-apt-config_0.8.34-1_all.deb
  ```
* Install the MySQL APT configuration package

  ```bash
  apt install ./mysql-apt-config_0.8.34-1_all.deb
  ```
* Update package index

  ```bash
  apt update
  ```
* Install MySQL community server

  ```bash
  apt install mysql-community-server
  ```
* During installation, set the root password when prompted
