1 of 72

BUG BOUNTY WORKSHOP

FUNSHOP

2 of 72

AGENDA

  • Intro
  • Bug Bounty Definition
  • How to select a target
  • Passive Recon Techniques
  • Hacking with Burp Suite
  • Importance of understanding an application flow
  • Better Bug Bounty Report
  • Keep up with all the new trends
  • Live Burp Suite Session
  • Recap | Wrapping up

3 of 72

Intro

4 of 72

#whoami

  • Prateek Tiwari - @prateek_0490
  • Security Lead @ Zomato
  • Security Consultant, Occasional Bug Bounty Hunter
  • Email: prateek0490@gmail.com

5 of 72

Hey you! What’s Bug Bounty?

6 of 72

What’s Bug Bounty?

  • Bug Bounty is a reward offered to individuals who identifies and report bugs or security vulnerabilities in a computer program/system or software.
  • The reward could be in any form - from goodies to hard cash or just acknowledgement.

7 of 72

How to select a target?

8 of 72

How to select a target?

Assets in scope:

  • Priority to wildcard {*.example.com}
  • Mobile Apps

Paying attention to out of scope / exclusions list:

  • XSS
  • CSRF
  • Subdomain Takeovers

Meh “really? Do you even care about Security 🤔”

9 of 72

Diving deep into the target, Passive..sh Recon

10 of 72

Diving deep into the target using passive..sh Recon

Find all the **ASSETS** that belongs to that organisation. Assets?

    • Domains?
    • Subdomains?
    • 3rd Party Services used by Organisation (GitHub, Jira, Trello, Jenkins, GitLab, etc...)
    • IP Ranges?
    • iOS / Android Apps?
    • Doesn’t ends [n number of assets] ..….

11 of 72

Subdomains | Asset(s) Identification

12 of 72

CSP Headers

13 of 72

gist.github.com

14 of 72

gist.github.com

Cost of Human Errors :(

15 of 72

Trello, Jira, Gitlab ...

Even though if an organization's Jira instance has an auth, administrators set up "public" projects, they forget “public” means public for everyone. This could sometime give you keys to kingdom.

16 of 72

Trello, Jira, Gitlab ...

Thanks Ed :)

17 of 72

fofa.so - chinese version of shodan

18 of 72

shodan.io

19 of 72

IP Ranges

20 of 72

IP Ranges

21 of 72

IP Ranges

Sir, I’ve found the IP Space now what?

22 of 72

IP Range - now what?

  • Fire NMap and run NSE Scripts on those discovered IP Ranges
  • Perform content discovery (file/folder bruteforcing) on every discovered asset
    • BurpSuite
    • Dirsearch, Dirbuster
    • Wfuzz

23 of 72

Oh the mobile apps are in scope, what should I look for?

Did you know? You can find leakage of sensitive data in mobile apps without even installing them on your phone. Howwww?

24 of 72

Oh the mobile apps are in scope, what should I look for?

Short Cut:

25 of 72

Oh the mobile apps are in scope, what should I look for?

Long Route:

  • Download the apk, you can do it from https://apkpure.com/
  • Upload the apk at https://apkscan.nviso.be/, run the Scan and wait for the results.

26 of 72

Oh the mobile apps are in scope, what should I look for?

VIRUSTOTAL

27 of 72

Hacking with BurpSuite

Setting the right Scope

28 of 72

Hacking with BurpSuite

29 of 72

Hacking with BurpSuite

Keeping an eye on these issues list, always handy and helps a lot!

30 of 72

Hacking with BurpSuite

BURP SPIDER

  • Turn off Passive Scanning
  • Set Forms to auto submit
  • Set scope to advanced control and use a target name instead of regex (something like zomato instead of .zomato.com or .*\.zomato\.com$), you will be surprised to see the results and after effects of it 😲
  • Browse all URLs, make all requests POST/GET/PUT whatever, then spider all hosts recursively
  • Profit (More Targets)!

Will cover up in Live Session

31 of 72

Hacking with BurpSuite

Did you know? You don’t always need an automated Script to demonstrate the impact of any data leak [PIIs].

Intruder for the win!

32 of 72

Hacking with BurpSuite

Using “Repeater tab” to find:

  • XSS
  • SQLi
  • Privilege Escalation
  • IDOR(s)
  • More Bugs

33 of 72

Hacking with BurpSuite

  • Using “Repeater tab” to find XSS, SQLi, IDOR(s), Privilege Escalation
  • Catch a Request which accepts user input and throw it into a repeater tab.
  • Start Fuzzing the parameters.

34 of 72

Hacking with BurpSuite

SQLi(s)�id=1’

id=1‘’

id=1’-sleep(10)-’

id=1"

id=1"“

id=1"-sleep(10)-”

id=1/sleep(10)

35 of 72

Hacking with BurpSuite

  • IDOR(s) are always easy, playing with the id parameters. Manipulate the create requests.

  • id=1 > id=2 > Easy Money

36 of 72

Hacking with BurpSuite

Easy Privilege Escalation with Repeater

  • Have 2 different user accounts, one low privileged user and other one with some level of permissions.
  • Catch the request in BURPSUITE, throw them into a “Repeater tab” replace the cookies of a high level privileged user with low level privileged user, see if it’s a success!

37 of 72

Hacking with BurpSuite

JS for the WIN

38 of 72

Feeding these in tool

python linkfinder.py -i /Desktop/z.burp -b -o cli

39 of 72

Shooting in Dark? Understand the application flow to find bugs

40 of 72

Shooting in Dark? Understand the application flow to find more bugs

You’re doing it wrong -

  • If you haven’t spent good amount of time to study the target.
  • If you haven’t understood the privileges and functionalities of a user.
  • If you haven’t checked their available docs, neither gathered all the information about the target.

What happens next if you haven’t done your homework?

41 of 72

Shooting in Dark? Understand the application flow to find more bugs

What happens next if you haven’t done your homework?

42 of 72

Shooting in Dark? Understand the application flow to find more bugs

Researchers have a tendency to jump on the target application and start attacking them. What happens then?

YOU END UP GETTING DUPE

43 of 72

Shooting in Dark? Understand the application flow to find more bugs

44 of 72

Shooting in Dark? Understand the application flow to find more bugs

If you’ve invested good amount of time on a target, you will:

  • Get better understanding about how the target app works.
  • Know what parameters are usually being used by the target app.
  • Understand the functionalities & privileges of the user’s in target app.
  • Be able to identify what parameters to use when you discover tons of endpoints in JS files.

Found an internal endpoint in JS and immediately knew what parameters to use based on my past research

45 of 72

Shooting in Dark? Understand the application flow to find more bugs

46 of 72

Shooting in Dark? Understand the application flow to find more bugs

Read the Docs = Get a BUG?

47 of 72

Shooting in Dark? Understand the application flow to find more bugs

Few Nice Reads:

48 of 72

Better Bug Bounty Report

better bug reports

49 of 72

Better Bug Bounty Report

better bug reports

better relationship

50 of 72

Better Bug Bounty Report

better bug reports

better relationship

better bounties

51 of 72

Sharing from other side of the fence

What you shouldn’t do?

52 of 72

Sharing from other side of the fence

  • What you shouldn’t do?
  • Follow up after 5 mins of report submission
  • Bounty Plz!
  • Contacting someone from Security Team on Twitter asking for an update.

53 of 72

Sharing from other side of the fence

The Wrong Way,

How not to submit a report?

54 of 72

Sharing from other side of the fence

The Right Way -

  • Introduction
  • Details
  • Steps to reproduce (POC)
  • Impact

55 of 72

Sharing from other side of the fence

Before reporting, always think from organization’s point of view and think from the other side -

Understand companies nature of business

Seeing an image of other users on a company like Zomato? Seriously are you kidding me? That’s not sensitive at all - Closing it as N/A

VS

Viewing others uploaded images on an Image Sharing Site

56 of 72

Sharing from other side of the fence

Mantra to build a strong relationship with Security team

  • Be Professional with your communication
  • While Submitting a report, provide detailed report with clear steps to reproduce
  • Don’t bug or spam them, prepare a schedule for follow up’s
  • Don’t do this - send a LinkedIn invite, or DM on Twitter asking for an update

57 of 72

Keeping up with new trends

….Staying on top of new hacking trends can help you earn more bounties.

58 of 72

Keeping up with new trends

Sir, what should we do to keep up with all the new trends?

#BugBounty #BugBountyTip #TogetherWeHitHarder

Subscribe to topics like Information Security, Bug Bounty, Infosec, etc..

59 of 72

Keeping up with new trends

IT’S ALL ABOUT SOURCES

60 of 72

Keeping up with new trends

61 of 72

Profit!! Time to earn bounties...

62 of 72

Profit!! Time to earn bounties...

63 of 72

Profit!! Time to earn bounties...

64 of 72

LIVE BURP SUITE SESSION

65 of 72

#bugbountytip

66 of 72

#bugbountytip

67 of 72

#bugbountytip

68 of 72

#bugbountytip

Waybackurls

Scrape URLs using - https://github.com/tomnomnom/waybackurls/

root@pt:~/tools/recon/waybackurl$ cat domains.txt | waybackurls > urls

root@pt:~/tools/recon/waybackurl$ cat urls | grep ".js"

69 of 72

#bugbountytip

Bringing few more #tips:

  • Search for developers, QA on Stackoverflow
  • Always run wfuzz / dirsearch on all subdomain(s) found to discover more content, more bounties?
  • Earlier this year, I got a bounty for redacted.corp.com/documentation and found an excel spreadsheet of the database, eehhh, easy money 😳
  • Can’t CSRF delete method? Few frameworks / API(s) allows to “fake” methods by additional parameters, ex:
    • Adding a parameter such as: method=delete | _method=delete -> API will parse it as a Delete request.

70 of 72

#bugbountytip

Sir, please one more! Okay, take this ezzy money!

  • Always check if Strict transport security is enforced? Many a times, hxxp://redacted.com is not redirected to https, many companies are interested to hear about “Weak Login function over HTTP”.

71 of 72

Recap | Let’s Roll It Back

  • Dive deep into the target using Passive techniques:
    • Virustotal
    • crt.sh
    • censys.io
    • https://transparencyreport.google.com/https/certificates?hl=en
    • https://developers.facebook.com/tools/ct
    • CSP Headers
    • Don't forget the third party services, those are so helpful and always helps you to learn more about the target
  • Shodan.io and fofa.so will give you a lot of juicy stuffs.
  • Always give a shot at Mobile Apps - use apkscan.nviso.be | virustotal …
  • Submit better reports, think from the other side about the impact before submitting.
  • Keeping up with what’s happening around will help you earn more bounties.

72 of 72

Thank You