Xampp & XSS Attacks
Xampp & XSS Attacks
Xampp & XSS Attacks
XAMPP is the title used for a compilation of free software. The name is an acronym, with
each letter representing one of the five key components. The software packet contains the
web server Apache, the relational database management system MySQL (or MariaDB), and
the scripting languages Perl and PHP. The initial X stands for the operating systems that it
works with: Linux, Windows, and Mac OS X.
• Apache: The open source web server Apache is the most widely used server
worldwide for delivery of web content. The server application is made available as a
free software by the Apache Software Foundation.
• PHP: the server-side programming language PHP enables users to create dynamic
websites or applications. PHP can be installed on all platforms and supports a number
of diverse database systems.
• Perl: the scripting language Perl is used in system administration, web development,
and network programming. Like PHP, Perl also enables users to program dynamic
web applications.
Alongside these core components, this free-to-use Apache distribution contains some other
useful tools, which vary depending on your operating system. These tools include the mail
server Mercury, the database administration tool phpMyAdmin, the web analytics software
solutions Webalizer, OpenSSL, and Apache Tomcat, and the FTP servers FileZilla or
ProFTPd.
• Config: allows you to configure the XAMPP as well as the individual components
• Netstat: shows all running processes on the local computer
• Shell: opens a UNIX shell
• Explorer: opens the XAMPP folder in Windows Explorer
• Services: shows all services currently running in the background
• Help: offers links to user forums
• Quit: closes the XAMPP Control Panel
In the Control Panel, you can start and stop individual modules
Download and place DVWA -Master folder in htdocs in Xampp folder which is in C:/ by default
Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into
trusted websites. XSS attacks occur when an attacker uses a web application to send malicious code,
generally in the form of a browser side script, to a different end user. The end user’s browser has no
way to know that the script should not be trusted, and will execute the script. Because it thinks the
script came from a trusted source, the malicious script can access any cookies, session tokens, or
other sensitive information retained by the browser and used with that site
Now have a look over a small script which would generate an alert window. So in the text area given
for message I will inject the script which gets stored in the server.
A small script which would generate an alert window. So in the text area given for message I will
inject the script which gets stored in the server.
It might be possible that the web application server has more than one vulnerabilities, let
assume if it is also having SQL injection vulnerability then it becomes very easy for an
attacker to retrieve the data from its database using stolen cookies.
For example in DVWA I switch from XSS to SQL injection; now copy its URL with user
ID=1.
1) Reflected XSS – This attack occurs, when a malicious script is not being saved on the web
server but reflected in the website’s results.
2) Stored XSS – This attack occurs when a malicious script is being saved on the web server
permanently.
3) DOM – This occurs, when the DOM environment is being changed, but the code remains
the same.
1) Reflected XSS
This occurs when the malicious results are being returned after entering the malicious code.
Reflected XSS code is not being saved permanently. In this case, the malicious code is being
reflected in any website result. The attack code can be included in the faked URL or HTTP
parameters.
It can affect the victim in different ways – by displaying faked malicious page or by sending
a malicious email.
Example:
With intercept turned off in the Proxy "Intercept" tab, visit the web application you are
testing in your browser.
Visit the page of the website you wish to test for XSS vulnerabilities.
Return to Burp.
In this example we have used a payload that attempts to perform a proof of concept pop up in
our browser.
Click "Go".
Persistent XSS
In this type of attack, the malicious code or script is being saved on the web server (for
example, in the database) and executed every time when the users will call the appropriate
functionality. This way stored XSS attack can affect many users. Also as the script is being
stored on the web server, it will affect the website for a longer time.
One of the most frequent targets are websites that allow users to share content, including
blogs, social networks, video sharing platforms and message boards. Every time the infected
page is viewed, the malicious script is transmitted to the victim’s
Stored cross-site scripting (also known as second-order or persistent XSS) arises when an
application receives data from an untrusted source and includes that data within its later
HTTP responses in an unsafe way.
Suppose a website allows users to submit comments on blog posts, which are displayed to
other users. Users submit comments using an HTTP request like the following:
postId=3&comment=This+post+was+extremely+helpful.&name=Carlos+Montoya&email=
carlos%40normal-user.net
After this comment has been submitted, any user who visits the blog post will receive the
following within the application's response:
comment=%3Cscript%3E%2F*%2BBad%2Bstuff%2Bhere...%2B*%2F%3C%2Fscript%3
E
Any user who visits the blog post will now receive the following within the application's
response:
The script supplied by the attacker will then execute in the victim user's browser, in the
context of their session with the application.
This type of attack occurs when the DOM environment is being changed, but the client-side
code does not change. When the DOM environment is being modified in the victim’s
browser, then the client side code executes differently.