Basics
Context
It's confusing that tools and attacks and exploits often don't make the required context clear. Does a tool / attack / exploit operate:
- Across the public internet to the target ?
- Only from another machine in same LAN as the target ?
- From a logged-out state ?
- From a logged-in state ?
- Require fooling a legitimate user into doing something ?
- Require that you've obtained source code from the server ?
- Require that you've managed to get shell access to the target ?
- Require that you have a root shell on the target ?
Resources
Some apps, tools, attacks, or exploits may require that you have specific resources:
- A public domain and web site that you control.
- A static IP address, and an incoming port open to your machine.
- A burner email address.
- A burner phone number.
To receive SMS: FreePhoneNum.com - A burner credit-card.
- Money (real or fake) to order products.
- If you spend your real money to get behind a paywall or buy a subcription, you may get into an area that has a lot fewer bug-bounty hunters in it, or may be considered lower-risk by the developers.
- An address to ship to.
- Accounts on Shodan and other online-database-type sites.
Attack Surfaces
- The web app (pages shown to user).
- The mobile app (app on smartphone).
- Any other app UI (voice call to phone-menu, SMS interface, etc).
- The browser and add-ons in it.
- APIs (exposed by any server your code can talk to).
- Libraries (that are exposed to your code).
- Servers (that run web app, database, API, authentication, CMS, etc).
- Containers or Operating Systems (that are exposed to your code).
- Repositories that may contain credentials or source code or comments.
Attack Targets/Patterns
- Get web/app server to send attacker's SQL commands to database server:
SQL Injection (SQLi). - Get web/app server to send attacker's commands to back-end app server or to any desired server:
Server-Side Request Forgery (SSRF). - Get web/app server to send attacker's commands to its underlying OS:
Command Injection. - Get template engine in web app to do attacker's bidding:
Server-Side Template Injection (SSTI). - Get web app to return pages with attacker's code in them:
Code Injection or XSS. - Get web app to return contents of files:
File Inclusion. - Get web/app server to send malicious page to another user (first step):
- Store malicious scripting or link in database: via Stored XSS or Open Redirect or SQLi.
- Store malicious scripting in Web/App Server: via Code Injection.
- Get page or user to go somewhere malicious: Cross-Site Scripting.
- Do web app operations using creds of that user: Cross-Site Request Forgery (CSRF).
- Do something malicious to user's browser or machine: Browser Exploitation.
- Some terms likely are complete one-step operations: File Inclusion.
- Some terms likely are first step (setup): Code Injection, SSTI.
- Some terms are second step (payload): Browser Exploitation.
- Some terms are first+second step combined: XSS, CSRF.
- Some terms can be any of those: SQLi, Command Injection, SSRF.
- SQLi to read entire table of database back in a page right away. Or,
- SQLi to put malicious script into database, user gets page with script, script does Request Forgery to Web/App Server. Or,
- Code Injection to disable parameter-checking in pages in Web/App Server, SQLi on page to get data out of database.
What you'll do
Probably you'll:
- Start ZAP and Firefox, and browse the application manually for a while.
- Use the results recorded in ZAP to tweak ZAP, telling it about such things as session token names and login credentials.
- Run scans and attacks in ZAP and see what it reports.
- Explore any vulns, through ZAP and manually in the browser.
- Start Metasploit and try to exploit vulns.
- Run appropriate specific tools, such as sqlmap, WPScan, CMSmap, etc.
- Write reports on anything you've found, double-checking manually in a clean setup.
- Try to broaden or chain any vulns and exploits.
- Learn more about the application.
- Review project checklist, see if you've checked everything.
- Iterate as needed.
Aakash Choudhary's "Bug-Hunting-Mentality"
ZeroSec's "LTR101: WebAppTesting - Methods to the Madness"
Marcin Szydlowski's "Inter-application vulnerabilities and HTTP header issues. My summary of 2018 in Bug Bounty programs."
bitvijays's "CTF Series : Vulnerable Machines" (lots of techniques)
OWASP's "Category:Attack"
OWASP Testing Guide v4 Table of Contents
Prasanthi Eati's "10 Most Common Web Security Vulnerabilities"
Gwendal Le Coguic's "Vulnerabilities list"
Detectify's "OWASP Top 10 Vulnerabilities Explained"
David Schutzs "OWASP Top 10 Like I'm Five - BSidesBud2019"
Hacksplaining
You can look at OWASP Top 10 for most common types of vulnerabilities. But look back into the previous years of this list, for some items that have been pushed off the list but still are worth testing.
Sakurity Network's "Why OWASP Top 10 is no longer relevant" (4/2017)
Attacks And Vulnerabilities
Unsafe Input Handling
Code Injection
File Upload
Script Injection
SQL Injection (SQLi)
Server-Side Template Injection (SSTI)
Client-Side Template Injection (CSTI)
Client-side HTTP Parameter Pollution (CSHPP)
Server-side HTTP Parameter Pollution (SSHPP)
Insecure Direct Object Reference (IDOR)
Open Redirect
Unsafe API Input Handling
An API essentially is a complete additional attack surface, subject to many of the same vulnerabilities that a web app may have: SQLi, IDOR, etc.
XML External Entities (XXE)
Insecure Deserialization
Insecure API
Ajax
Exploitation
Directory Traversal
On-site Request Forgery (OSRF; AKA 'session riding')
Cross-Site Request Forgery (CSRF or XSRF)
Server-Side Request Forgery (SSRF)
Command Injection
Privilege Escalation
Remote Code Execution (RCE)
Combined / Other
Cross-Site Scripting (XSS)
Cross-Site Leaking (XS-Leak, XS-Search)
File Inclusion (LFI, RFI)
Insecure CORS (Cross Origin Resource Sharing)
Cookie Tampering
Macro Mosaic's "Hack SAML Single Sign-on with Burp Suite"
Barrow's "Use Remote Port Forwarding to Slip Past Firewall Restrictions Unnoticed"
CrackerHacker's "Upload a Shell to a Web Server and Get Root (RFI): Part 1"
CrackerHacker's "Upload a Shell to a Web Server and Get Root (RFI): Part 2"
Ceos3c's "Obtaining Domain Credentials through a Printer with Netcat"
Printer Exploitation Toolkit
Weird forms of IP address (overflows, different bases, http://127.1 instead of http://127.0.0.1, http://1.1.257 instead of http://1.1.1.1, http://0xC0A80001 or http://3232235521 instead of http://192.168.0.1, etc) or domain name, to get past a blacklist or filter. Called "URL obfuscation" ?
sii / sipcalc
David Anderson's "Fun with IP address parsing"
Chris Siebenmann's "My uncertainty over whether an URL format is actually legal"
Weird / unicode encodings in email addresses, URLs, JavaScript code, etc:
Christopher Bleckmann-Dreher's "How does 🙈 or 💩 affect our S�curity?" (slide show)
Cache poisoning: if there is a cache between clients and server, set HTML request headers such as X-Host, X-Forwarded-Host, X-Original-Url, X-Rewrite-URL, and cache returns malicious data. Need to know which headers and parameters are used in cache matching (which are in the cache key). Use Param Miner extension for Burp.
posrtswigger.net/blog/practical-web-cache-poisoning
Some ways of transferring a file to a target: FTP, SFTP, TFTP, SCP, WebDAV, shell (run netcat or ncat or something), file-share (NFS, Samba, etc), web app's Upload/Attachment features, object API (SOAP, REST) over HTTP.
Some ways of connecting to a target: HTTP, Telnet, RDP, SSH, VNC, TeamViewer.
For most attack types, you can type "TYPE payloads" or "TYPE exploits" into a search engine and get links to lots of useful cheat-sheets. For example, search for "XSS payloads".
EdOverflow / bugbounty-cheatsheet / CRLF Injection || HTTP Response Splitting
EdOverflow / bugbounty-cheatsheet / Open Redirect
Jayson Grace's "Web Application Penetration Testing Notes"
Jayson Grace's "Pentesting notes and snippets"
Arr0way's "Penetration Testing Tools Cheat Sheet"
k2haxor / HACK-THEM-ALL
Raj Chandel's "Hacking Articles"
swisskyrepo / PayloadsAllTheThings
amanvir's "Security Issues in Modern JavaScript"

Shankar R's "Bug Hunting Methodology(Part-3)" (tips and snippets)
Targets
Wordpress
CMS
Apache
Nginx
Application-configuration attacks
Application-logic or business-logic attacks
Client-Side SQL Injection / Local Storage
Mobile Attacks
Thick App / Desktop App Attacks
Attack Tips and Tactics
Starting
Quick try at a site
[From Jason Haddix's "How To Shot Web" (PDF)]
- Visit the search, registration, contact, password reset, and comment
forms and hit them with your polyglot (XSS) strings.
- Scan those specific functions with Burp's built-in scanner.
- Check your cookie, log out, check cookie, log in, check cookie. Submit old cookie, see if access.
- Perform user enumeration checks on login, registration, and password reset.
- Do a reset and see if: the password comes plaintext, uses a URL based
token, is predictable, can be used multiple times, or logs you in automatically.
- Find numeric account identifiers anywhere in URLs and rotate them for context change.
- Find the security-sensitive function(s) or files and see if vulnerable to
non-auth browsing (IDORs), lower-auth browsing, CSRF, CSRF protection
bypass, and see if they can be done over HTTP.
- Directory brute for top short list on SecLists.
- Check upload functions for alternate file types that can execute code (XSS or PHP etc).
From /u/cym13 on reddit 5/2019:
- Build a list of websites with bug bounty programs. Make sure that they have similar terms and conditions.
Always abide by those terms and conditions. The reason why I recommend restricting yourself to similar terms
is to limit confusion.
- Explore those sites. You need to know them well, what technologies they use, how they're structured,
their subdomains, etc. Enumeration is paramount.
- Subscribe to /r/netsec, /r/security, /r/bugbounty, anything that gives you security articles daily.
Read them. If you don't understand search, ask or store them for later, but it's important to understand
as much as possible. This will build your arsenal.
- Now oftentimes you'll see an article that lights a bulb, for example a remote code execution for websites
using Ruby on Rails. At that point you should think "Oh, I know these two sites in my list that use RoR,
I should try this technique there!".
- Repeat. Expend your list of targets regularly but not too often that you don't remember them well.
This technique is not perfect, but it'll help grow your understanding of what's possible, will get you
to actually try things without feeling too down when you don't find anything (and most most of the time
you won't) and it might even give you an edge against other hunters since you may very well be the first
to try that technique on that website.
- Always remember: the worst possible thing isn't that you don't find anything, it's that you don't
give yourself a chance to try. Learn on labs if you want, in books if you want, but this should never
be a substitute to going out there to try stupid stuff.
For beginners, from InsiderPhD's "Finding Your First Bug" series (video):
IDOR or API bugs are good places for a beginner to start. They don't require deep technical knowledge, and persistence can pay off, but being methodical and systematic and keeping notes are important. Make sure your report specifies the business impact: instead of "changed parameter X in the URL and the server accepted it", something like "was able to buy expensive product Y for $1".
- If someone else has found a bug in one part of the app, look for similar in other parts.
- If you find a vulnerability, even if it is out of scope, note it.
Maybe you can chain vulns together to get something more serious.
- File upload is a tricky area. Upload an unexpected file format and see what happens.
See "file polyglots".
- Is the app transmitting state up from server to hidden parts of client (cookie,
session variable, hidden form elements, preset URL parameters) and then back down to server ?
Maybe it can be modified.
If the state value is encrypted, try decrypting it. Or play with input values to see if there is a pattern in the resulting encrypted values. Or re-use the encrypted value from one context in another context. - Is the app relying on the Referer header to preserve the proper sequence through operations ?
It can be modified.
- Privilege (auth-z): functions that should be admin-only, but a normal user can do them.
Common functions: add/delete user, start project/campaign, change acct info, customer analytics view, payment processing view, any view with PII.
Burp plug-in Autorize:
browse admin page, login as normal, request admin page again.
- If site uses HTTPS, make sure ALL of it uses HTTPS.
Grab all URLs and try requesting each of them via HTTP.
Burp site map, copy all URLs into file, then
force_http_req_threaded.py
- Indirect object reference (IDOR):
in URL, change userid or order number by 1, try negative values.
OWASP page on IDOR.
- On retail sites, change price to negative (to get refund), or skip payment step and
go straight to shipping step.
- According to Hackerone security report 2018 (see charts in
Lukas Weichselbaum's "Securing web apps"),
most-commonly-reported vulnerabilities are XSS, information disclosure, improper authentication, violation
of secure design principles. Least-commonly-reported are SQL injection, code injection, business logic errors, crypto.
I don't know if this means: concentrate on XSS and authentication etc because lots of bugs everywhere,
or: concentrate on SQL and code injection and business logic because less competition.
I would tend to think injection problems are so well-known that such bugs are rare.
- Any time you see a "helper" or "connector" thing, check the API and traffic.
It probably represents a place where a developer ran into a security or API roadblock and
needed to overcome it. There may not be proper authentication or encryption.
From /u/Metasploit-Ninja on reddit 1/2019:
Re: misconfigurations:
For pentesting, the vast majority of findings you come across are misconfigurations. Could be screw ups in group policy or bad password policies, etc but I see a lot of things like default creds for web instances like Apache Tomcat (tomcat:tomcat or admin:admin), etc.
I also see a lot of misconfigurations in Vmware Enterprise setups where a customer will have a PCI-DSS/CDE network that is supposed to be segmented from the regular enterprise/production network but isn't fully. For example, there might be a vSphere/vCenter instance that connects to all the VMware Hosts and the customer might have a host for just PCI and others for their regular production network but the vCenter/vSphere can connect to all of them. So if you compromised credentials like a VMware admin in the regular production network, you can just use vCenter/vSphere to jump into a PCI/CDE host then compromise the VMs or even take a snapshot of the VMs you want and download them from the datastore. I see this in a LOT of different places and people don't even think about it. They just see how info flows physically and logically but not how it flows virtually.
Also, I'll see two-factor setups with things like 2FA Duo where they have it set to "open" if the user getting the 2FA request doesn't press anything. This is because Duo communicates via cloud and if something happens to the connection, you can't login to critical systems so by default it fails open. If you have a fairly stable connection, you wouldn't want it that way. If an attacker gets creds and tries to login lets say at 3am and you are sleeping, it would time out and they would then get in without you pressing anything. Oops.
I also see a lot of OWA instances where you can enumerate users because of timing attack vulnerabilities associated with their instance. For example, if you gather a list of users from LinkedIn, social media sites, Google, etc, you can create a list and throw it against the OWA server and if the user is actually present, it will usually respond back with a valid/invalid error after 0.2 seconds. If the user doesn't exist in Active Directory, it will respond back after ~13-15 seconds. See Metasploit module auxiliary/scanner/http/owa_login for info on that and options.
I could go on but those are common ones I see all the time.
Craig Hays' "Bug Bounty Hunting Tips #1 - Always read the source code"
Somdev Sangwan's "Finding vulnerabilities in Source Code"
Craig Hays' "Develop a Process and Follow It"
Sean's "One company: 262 bugs, 100% acceptance, 2.57 priority, millions of user details saved"
EdOverflow / bugbounty-cheatsheet / bugbountytips.md
Bugcrowd forum discussion "How do you approach a target?"
Jean Fleury's "So You Want To Become a Bug Bounty Hunter?"
Aakash Choudhary's "Bug-Hunting-Tips/Tricks"
Sanyam Chawla's "Bug Bounty Methodology (TTP- Tactics, Techniques, and Procedures) V 2.0"
sehno's "Bug Bounty Checklist for Web App"
gowsundar's "Book of BugBounty Tips"
Stök and Jason Haddix: "If you're not doing this you're missing out" (video)
When you think you've found a bug
Gather samples of as many types of sensitive data as you can (not as much data as you can). Can you list all users ? Get passwords for user accounts or for accounts on other systems or services ? Get log files ? Get configuration files that show other network devices ? Get PII for users ? Get version numbers of OS and software ? Get encrypted files to try to crack later ?
Can you use this to do another exploit, a better one ?
Kunal Pandey's "Avoid rookie mistakes and progress positively in bug bounty"
Does the same bug exist in other apps that use the same module ?
Offensive Security by Automation's "Open Redirection: A Case Study"
Interesting thoughts: LiveOverflow's "What is a Security Vulnerability?" (video)
