Final Report Sample
Final Report Sample
Web-Application
XXX XXX
School of Engineering and Technology School of Engineering and Technology
Indiana University-Purdue University Indianapolis Indiana University-Purdue University Indianapolis
Indianapolis, Indiana Indianapolis, Indiana
Abstract – Cross-site scripting, also known as web application uses input from a user within the
XSS, is a known category of vulnerabilities that output it generates without validating or encoding
uses client-side coding to exploit websites, such as it.” XSS participants usually include the intruder
forums, messaging, search, and networking sites, (person intending to commit a crime and steal
requiring user input [6]. This code injection flaw sensitive data), web server (source of the vulnerable
occurs when malicious scripts are erroneously website), and victim (usually the intended targeted)
[6].
accepted as authorized because the website input
is not controlled, validated, or sanitized by the JavaScript is a popular client-side coding
application before it is processed. According to language leveraged by developers to make static
the OWASP (Open Web Application Standards websites more, lightweight, dynamic, and
Project) foundation [4], “Flaws that allow these responsive [11]. For this reason, it is commonly
attacks to succeed are quite widespread and occur used by evil intruders to execute XSS attacks. A
anywhere a web application uses input from a host environment, commonly the web browser, is
user within the output it generates without
required to run JavaScript [10]. The code is
validating or encoding it.” Participants include
processed locally (on the client-side) versus
the attacker, vulnerable website, and victim who
remotely (on the web server-side) for efficiency.
is usually being targeted for their sensitive data
JavaScript code is normally embedded between
[6].
HTML <script> tags, directly or indirectly, source
file or inline. However, a malicious cross-site script
Keywords – Cross-site scripting, XSS, JavaScript,
can be obscured in a URL (Universal Resource
Stored XSS, Reflected XSS, DOM-based XSS,
Locators) or hidden between other HTML opening
DOM, XHR, cookies, payload, security headers,
and closing tags.
filtering, encoding, escaping
I. INTRODUCTION
Cross-site scripting, also known as XSS, is a
known category of vulnerabilities that uses client-
side coding to exploit websites requiring user input,
such as forums, messaging, search, and networking
websites [6]. This code injection flaw occurs when
malicious scripts are erroneously accepted as
authorized because the website input is not
controlled, validated, or sanitized by the application
before it is processed. According to the OWASP Figure 1: HTML opening and closing tags
foundation [4], “Flaws that allow these attacks to
succeed are quite widespread and occur anywhere a
Most host resources are restricted (e.g., download the malicious content and potentially be a
operating systems, local files), but JavaScript has victim of the intruders' malfeasance [7]. The
access to a considerable number of objects that keyword in this attack is persistent since the
increase its function. For example, the DOM attacker gets data continuously and repeatedly if the
(Document Object Model) is not JavaScript, but malicious script is never detected and removed from
JavaScript can use it like an API (Application the server [7]. A threat actor's code could remain on
the website indefinitely [5]. Future visitors could
Programming Interface) to structurally change most
have their browser or session compromised,
elements on an HTML page [10]. XMLHttpRequest resulting in the attacker stealing cookies and
(XHR) objects allow you to send HTTP (Hypertext swindling victims into divulging private data [5].
Transfer Protocol) requests to a remote server using The attacker could hijack accounts, impersonate
JavaScript [10]. XHR “is a dynamic API for client- users, create a keylogger using the victims' browser,
server data transfer [12].” Instead of resetting the mine information, turn on a camera, and perform
entire page in a web browser when a request is other improprieties [5].
made to the server, developers utilize XHR to
perform data transfers without a full page reload
[11]. Trusted Security [15] mentions that XHR is
convenient for an intruder since it can be set to run
in the background asynchronously [15]. It will not
be obvious to the victim that their browser is under
attack and the malicious requests are being sent
[15].
[1] https://informcontentclub.com/qa/why-do-most-
websites-use-javascript.html
[2] https://blog.hubspot.com/website/cross-site-
scripting
[3] https://www.kali.org/tools/xsser/
[4] https://owasp.org/www-community/attacks/xss/
[5] https://www.skillsoft.com/course/a8-and-a3-
cross-site-attacks
Figure 14: db.py [6] Gilberto Najera-Gutierrez, et al. Improving Your
Penetration Testing Skills: Strengthen Your
III. EVALUATION Defense Against Web Attacks with Kali Linux and
In our project proposal, we aimed to create a Metasploit. Packt Publishing, 2019.
website using HTML with a form view for [7]
simulating a stored cross-site scripting attack. In our https://www.youtube.com/watch?v=ABwS2MIxFP
project, we not only demonstrated a stored XSS Q
attack but a reflected attack as well. We decided to [8]
utilize Python Flask which we did not initially plan https://www.youtube.com/watch?v=yJSnggHSH1U
in the project proposal until further research. [9] https://learning.oreilly.com/videos/web-
security-common/9781788835077/
[10] Antani, V. (2016). Mastering javascript:
Explore and master modern Javascript techniques in
order to build large-scale web applications. Packt
Publishing.
[11] Associates), G. D. (gosselin &. (2014).
Javascript - the web warrior series. Cengage
Learning, Inc.
[12] Mamta03. "United States: W3C Issues New
Draft for XMLHttpRequest Specifications."
TendersInfo (Mumbai, India), sec. NEWS, 28 Aug.
2009. NewsBank: America's News Magazines,
infoweb.newsbank.com/apps/news/document-
view?p=AMNP&docref=news/12A60A7D81136B
D0.
[13]
https://www.acunetix.com/blog/articles/preventing-
xss-attacks/
[14] https://developer.mozilla.org/en-
US/docs/Web/HTTP/CSP
[15] https://www.trustedsec.com/blog/tricks-for-
weaponizing-xss/
[16] Ayala, L. (2016). Cybersecurity lexicon.
Apress.