CMD CTRL
CMD CTRL
Reconnaissance
Map Out The Attack Surface Parts Of The Site May Be Hidden. These Techniques
Will Help You Find Them.
Check Robots.Txt
The robots.txt file, found in a site's web root, tells well-behaved web crawlers what parts of the
site to ignore. You're not a well-behaved web crawler, so you can look at those pages. You may
find pages the rest of the site doesn't link to.
Try Some Common URLs
By guessing common page and directory names, you might be able to discover even more
content. A tool like dirbuster can help (but it's probably overkill here).
Look For HTML Comments & Hidden Elements
Look for forms, form fields and links that appear in the page source, but aren't visible on the page.
The CSS style hides an element; remove the styling to make it visible again. Take a
display: none;
Your Google searches aren't private! When testing real applications, don't Google
password hashes or other highly sensitive information - not even in incognito mode.
Attacks
Cross-Site Scripting (XSS) Inject Malicious JavaScript Into A Webpage
XSS allows an attacker to inject client side code (HTML, JavaScript, etc.) into the page such that
it is rendered in the victim's browser. XSS is possible when user input that hasn't been properly
output-encoded is included in a web page. XSS can come in three types:
Reflected: script is provided by the caller, included in the response from the server, and
executed in the browser. E.g. a search term provided in a URL parameter is rendered in the
body of the page.
Persistent: script is stored in a datastore and included the body of the page when it is
rendered. E.g. a forum that allows users to leave comments for one another.
DOM-based: script is included in the page via client-side JavaScript rendering. The
malicious input is never sent to the server. E.g. an application that updates a user's display
name client-side based on provided input. (example.com/welcome/#name=Bob)
What To Look For
Data or text you provided is reflected back to you on the page. If that data isn't properly encoded,
an XSS vulnerability might be present. Examples:
You search for "foo" in the site's search form. The results page says, "Your search for 'foo'
returned no results""
You navigate to example.com/fakePage. The 404 page says, "Sorry, page "fakePage" not
found."
You try to log in as user "bob" and the following error message is returned: "The user 'bob'
does not exist."
Test Cases - Discovery
Once you find a place where your input is being reflected back to you, try one of these tests cases
to see if it's being properly encoded.
- if not properly encoded, causes content to scroll sideways across the page.
<marquee>
bypass that.
- event handlers like
<body onload="alert('xss')"/>" are another XSS injection point.
onload
SQL Injection Execute Arbitrary SQL Commands On The Server. Possible When The
Server Concatenates User-Supplied Data With SQL Code.
What To Look For
https://new-scoreboard.cmdnctrl.net/hacking/guides/cheat_sheet.md 2/4
12/29/2019
Look for places where the application could be querying a SQL database. If a page isn't
CMD+CTRL
completely static, it's probably retrieving information from a database. Think about what SQL
code the application might be running. For example, when a user logs in, the SQL query might
look like:
SELECT \* FROM Users
WHERE Username= '\[user input\]'
AND password = '\[user input\]';
Special Characters
' - a single quote delimits strings in SQL queries. Because most user input is wrapped in
strings, this is usually your first step to breaking out of the string and changing the rest of the
query.
#, - comment signs. A comment sign tells the SQL interpreter to ignore the rest of the line.
--
; - a semicolon ends a SQL comment. This can be used to string multiple SQL commands
together if the database supports it.
OR, - SQL supports boolean operators.
AND
<, - SQL supports comparison operators. Note that comparison uses , not .
= = ==
Test Cases
- a single quote is the simplest discovery test case. If that throws a SQL error, it's a sure
'
backslashes. If the application escapes unsafe characters, this may bypass it.
- inserted into a clause, this forces it to evaluate to true. Good for bypassing
' OR 1=1# WHERE
Cookies
Test Cases
To tamper with a URL parameter, edit it in your address bar, then hit enter. To tamper with a form
parameter, edit it using your browser's developer tools, then submit the form.
File Upload
There are lots of ways to abuse insecure file uploads. An attacker can upload code, then look for
ways to execute it on the server. They can overwrite other files on the server. Or they could upload
malicious scripts or malware that will execute when other users view them.
What To Look For
Any file upload functionality.
Test Cases
Tamper with file names, paths, and extensions. Can you upload a file type that isn't permitted?
Can you upload code and run it?
More Tools & Resources
SQL Injection Cheat Sheet
OWASP XSS Filter Evasion Cheat Sheet
ASCII to Hex - General-purpose text encoding/decoding
CrackStation - online password hash cracker
hashcat - offline password hash cracker
https://new-scoreboard.cmdnctrl.net/hacking/guides/cheat_sheet.md 4/4