Scanning All Vulnerability Disclosure Programs For Automated API Hacking

NahamSec
9 Sept 202409:48

Summary

TLDRIn this video, the host introduces Swagger Jacker, a tool by Bishop Fox, which revolutionizes API testing by identifying accessible and unauthenticated endpoints. It also generates wordlists from Swagger files, aiding in bug bounty hunting and research. The host shares a dataset of 800 domains and over 100,000 subdomains for public use and demonstrates how to use Swagger Jacker for API endpoint analysis, authentication testing, and creating targeted wordlists. The video also covers brute-forcing API specs and encourages viewers to explore the tool for bug bounty and security research.

Takeaways

  • 🔧 The tool 'Swagger Jacker' by Bishop Fox was introduced and is praised for its utility in API testing and access.
  • 🔑 It's particularly useful for identifying unauthenticated API access, making it a 'game changer' for security testing.
  • 📄 Swagger Jacker can generate wordlists from Swagger files, aiding in targeted reconnaissance and vulnerability discovery.
  • 🔍 The speaker scanned various bug bounty programs to find Swagger files, demonstrating a methodical approach to gathering data.
  • 💾 The dataset includes approximately 800 domains and over 100,000 subdomains, which are available for public use on GitHub.
  • 🛠 The tool 'Lima' is mentioned for distributing workload across AWS Lambda functions, though it's not publicly available.
  • 🔗 Swagger Jacker automates the process of checking API endpoints, reducing the manual effort typically required in security assessments.
  • 🔐 It can be used to test leaked credentials against APIs to determine if they provide access to the company's infrastructure.
  • 📝 The 'prepare' argument in Swagger Jacker outputs curl commands for API calls, streamlining the process of manual testing.
  • 📊 The tool can create a wordlist of endpoints, which is beneficial for targeted attacks on large infrastructures with numerous APIs.
  • 🔎 Swagger Jacker includes a brute force feature to discover API specifications, expanding its utility beyond just using known Swagger files.

Q & A

  • What is Swagger Jacker, and who developed it?

    -Swagger Jacker is a tool developed by Bishop Fox that helps users test APIs for unauthenticated access and generate wordlists based on Swagger files. It's open-source and easy to install.

  • What are the primary features of Swagger Jacker?

    -Swagger Jacker allows users to test API endpoints for unauthenticated access, generate wordlists from leaked Swagger files, and automate the process of inspecting APIs across various domains.

  • How does Swagger Jacker help in bug bounty hunting?

    -Swagger Jacker helps bug bounty hunters by automating the process of testing and collecting data from various APIs. It can also generate endpoint lists and authenticate requests using leaked credentials, making it a valuable tool for API hacking.

  • What is the significance of leaked Swagger specs for a bug bounty hunter?

    -Leaked Swagger specs can reveal the endpoints of APIs, which can then be tested for vulnerabilities such as unauthorized access. This makes the specs a potential 'gold mine' for bug bounty hunters seeking to exploit unprotected APIs.

  • How does the tool handle large-scale API testing?

    -The user divides the domains into batches of 10,000 and feeds them into a private tool that distributes the workload across AWS Lambda functions. Swagger Jacker is then used to automate the inspection of these endpoints.

  • What customization options does Swagger Jacker offer?

    -Swagger Jacker allows users to add specific headers (like authorization headers with leaked credentials) to test if they can authenticate to an API. It also supports a 'prepare' mode, which outputs curl commands for each endpoint, making it easier to build tooling around the data.

  • What is the process of generating wordlists using Swagger Jacker?

    -Users can create wordlists by dumping all the endpoints from various Swagger files into a file. These wordlists are helpful for bug bounty hunters targeting large infrastructures with many APIs, as they can identify common or potentially vulnerable API endpoints.

  • What is the advantage of using Swagger Jacker over manual methods?

    -Swagger Jacker automates processes that would otherwise be done manually, such as gathering API endpoints and testing them for access. It saves time by performing these tasks in bulk and helps reduce human error in API testing.

  • Can Swagger Jacker perform brute force attacks on APIs?

    -Yes, Swagger Jacker has a brute force feature that can send thousands of requests to test various paths on an API. This helps in identifying any available API documentation or endpoints that can be accessed without proper authorization.

  • How can users benefit from the data collected with Swagger Jacker?

    -Users can use the collected data, such as API endpoint lists or wordlists, to improve their reconnaissance during bug bounty hunting. The data can also be fed into other tools like Nuclei or httpx for further analysis.

Outlines

00:00

🛠️ Swagger Jacker: A Game Changer for API Testing

The speaker introduces Swagger Jacker, a tool by Bishop Fox, which has significantly improved their API testing workflow. This tool is particularly useful for checking API accessibility and identifying unauthenticated access points, making it a 'game changer' for security researchers. It also generates wordlists based on Swagger files, which can be used for targeted testing. The speaker shares their dataset of about 800 domains and over 100,000 subdomains collected from various disclosure programs on HackerOne, intending to support the community's bug bounty hunting and research efforts. The video also mentions a course update with a discount code for the first 10 users.

05:01

🔍 Leveraging Swagger Jacker for API Reconnaissance

The speaker demonstrates how Swagger Jacker can be used to automate the testing of APIs by accepting a list of Swagger file URLs and checking each endpoint's status. They also show how to use the tool to test leaked credentials against an infrastructure's APIs to verify authentication capabilities. Additionally, Swagger Jacker can prepare cURL commands for each API endpoint, aiding in further manual or automated testing. The tool can also generate a comprehensive wordlist from multiple Swagger files, which is beneficial for targeted reconnaissance against large infrastructures. The speaker concludes by encouraging viewers to use Swagger Jacker for its automation capabilities in API hacking and reconnaissance, especially for bug bounty hunters.

Mindmap

Keywords

💡Swagger Jacker

Swagger Jacker is a tool developed by Bishop Fox, introduced in the video as a 'game changer' for API testing. It allows users to test the accessibility of APIs and check for unauthenticated access, which is crucial in security assessments and bug bounty hunting. The tool automates the process of identifying endpoints and their statuses, streamlining what would otherwise be a manual and time-consuming task.

💡API

An API, or Application Programming Interface, is a set of rules and protocols for building and interacting with software applications. In the context of the video, APIs are the focus of testing and security analysis, as they can be vulnerable to unauthorized access or other security flaws. The video discusses how Swagger Jacker can be used to identify and test these APIs for potential issues.

💡Unauthenticated Access

Unauthenticated access refers to the ability to access a system or service without requiring a user to log in or provide credentials. The video highlights the importance of checking for unauthenticated access points in APIs, as these can be significant security vulnerabilities. Swagger Jacker is praised for its ability to quickly identify such vulnerabilities.

💡Wordlist

A wordlist is a collection of words or terms used for various purposes, such as password cracking or, in this case, API endpoint enumeration. The video describes how Swagger Jacker can generate wordlists from Swagger files, which can then be used to automate the testing of API endpoints, making the process more efficient.

💡Bug Bounty

A bug bounty is a reward offered by organizations to ethical hackers who find and report security vulnerabilities in their systems. The video discusses how Swagger Jacker can be a valuable tool for bug bounty hunters, as it helps them identify and exploit vulnerabilities in APIs more effectively.

💡GitHub

GitHub is a platform for version control and collaboration that allows developers to work on projects together. In the video, it is mentioned as a place where developers might inadvertently leak Swagger files, which can then be used by security researchers to identify potential vulnerabilities in an organization's API infrastructure.

💡AWS Lambda

AWS Lambda is a serverless computing service provided by Amazon Web Services. It is mentioned in the video as part of the process for distributing workload across multiple functions, which is used to scan for Swagger files and other API-related information. This demonstrates the integration of cloud services in modern security testing workflows.

💡Nuclei

Nuclei is an open-source project for automated vulnerability assessment using a simple YAML-based DSL (Domain Specific Language). The video references using Nuclei to scan for specific routes that may contain Swagger files, illustrating its use in conjunction with other tools like Swagger Jacker for comprehensive security assessments.

💡Automation

Automation in the context of the video refers to the use of tools and scripts to perform repetitive tasks, such as scanning for vulnerabilities or testing API endpoints, without manual intervention. Swagger Jacker is highlighted as an example of automation that can significantly speed up and enhance the efficiency of security testing.

💡Reconnaissance

Reconnaissance, often shortened to 'recon', is the act of gathering preliminary information about a target, such as its infrastructure or potential vulnerabilities. The video describes how the presenter uses tools like Swagger Jacker to automate parts of the recon process, particularly in the context of bug bounty hunting.

💡Endpoints

Endpoints in the context of APIs are the specific URLs that define a location for accessing a service or resource. The video discusses how Swagger Jacker can be used to identify and test these endpoints, which is crucial for understanding the attack surface of an API and identifying potential security flaws.

Highlights

Introduction to Swagger Jacker by Bishop Fox and its impact on API testing.

Swagger Jacker allows unauthenticated access testing, making it a game-changer for bug bounty hunters.

Generates word lists from leaked Swagger specs to identify API endpoints, streamlining the process for API reconnaissance.

The speaker scanned around 800 domains and 100,000 subdomains from VDPs on HackerOne for testing.

The tool can automate the discovery of vulnerable API routes, making it highly efficient for bug bounty hunters.

Swagger Jacker uses a combination of APIs, endpoints, and their corresponding HTTP methods to identify exploitable routes.

The speaker cleans up Swagger files and feeds them to Swagger Jacker for scanning and analyzing API endpoints.

The tool supports using leaked credentials to test API authentication mechanisms, adding a layer of versatility.

Swagger Jacker’s 'prepare' command allows users to view curl commands for each API request, making it easy to build custom tooling.

The tool enables the creation of highly specific word lists based on targeted API infrastructure, which is valuable for large-scale companies.

The brute force feature helps identify hidden or undocumented API routes by testing 2,000 possible paths.

API Swagger specs are not vulnerabilities themselves but contain valuable information for deeper API exploration.

Swagger Jacker integrates with AWS Lambda to distribute workloads for large-scale testing, enhancing scalability.

Open-source and free to use, Swagger Jacker is simple to install and can handle multiple targets simultaneously.

In the closing, the speaker highlights the value of automation in API reconnaissance and invites suggestions for future tools and videos.

Transcripts

play00:00

a few weeks ago during one of my live

play00:01

streams one of my viewers I think it was

play00:03

yaser introduced me to this tool called

play00:05

swagger jacker by Bishop Fox and it has

play00:09

been a game changer the reason why I

play00:12

love this tool so much is because it

play00:13

allows you to do multiple things first

play00:15

and foremost it allows you to just test

play00:18

and see if any of these apis are

play00:20

accessible and if you are looking for

play00:22

unauthenticated access this tool is an

play00:25

absolute Game Changer the second thing

play00:27

that I love about it is the fact that it

play00:29

allows me to generate wordless so if I

play00:31

give it a bunch of different bu bount

play00:33

programs where the Swagger file has been

play00:35

leaked it grabs all the Swagger specs

play00:37

and it spits out a word list depending

play00:40

on the end points that are referenced

play00:42

within that file I thought about what is

play00:43

the better way to make a piece of

play00:45

content around this then scanning every

play00:48

V disclosure program minus some of the

play00:50

ones that I had to remove for legal

play00:52

purposes and seeing how many instances

play00:55

of swagger I can find and then feeding

play00:57

it to swagger jacker and seeing what it

play01:00

does if you are interested in my data

play01:02

set there's about 800 domains that I've

play01:04

just collected from the vdps on hacker

play01:06

one there's over 100,000 subdomains that

play01:09

I'm going to link into GitHub I'll put

play01:11

it down in the description and the pin

play01:13

comments so if you want to get access to

play01:15

them it is free for you you can use them

play01:16

for your bug bounty hunting and research

play01:18

or whatever else you want to do but then

play01:20

I'm going to also go a step further and

play01:22

if the data is clean enough and I see if

play01:24

it's worth it I may also share the word

play01:27

list with you but before we jump into

play01:29

the video I got to make two Qui quick

play01:30

announcements number one this is not a

play01:31

sponsored video Bishop Fox did not

play01:33

sponsor this so if you're Bishop Fox

play01:35

wink come and sponsor me for the next

play01:37

video and two a lot of you guys have

play01:38

been asking for the course update and an

play01:41

update was just released and for the

play01:44

next 10 people that use the code on the

play01:46

screen right here you will get the

play01:47

course for $35 and then after that it's

play01:50

going to jump up to $40 to $50 so go

play01:53

down below click on the link use this

play01:54

code right here and get it at a

play01:56

discounted rate all right now let's jump

play01:58

into the video okay so so let's first

play02:00

take a look at our data this is pretty

play02:03

much every domain that I scan for again

play02:05

this is just almost every bug Bounty

play02:07

program that I have access to and then I

play02:09

don't want to spend too much time doing

play02:10

a lot of reconnaissance and you can see

play02:12

I had to clean this up but I did a

play02:13

little bit of Recon and this is pretty

play02:16

much everything that I have found the

play02:18

way I did this is by just dividing my

play02:21

entire flow into different batches of

play02:23

10,000 domains and then just feeding it

play02:25

to nuclei and having it look for

play02:27

specific routes that may have a swap .

play02:30

Json file so that's just the the

play02:32

foundation of how I've done it and if

play02:33

you're curious have done it I use a

play02:34

private tool called Lima it's not

play02:36

available online to use it unfortunately

play02:38

but it is something that I use that just

play02:40

distributes the workload across a bunch

play02:41

of AWS Lambda functions now let's take a

play02:44

look at SJ or swagger jacker and again

play02:46

this is a project by our friends at

play02:49

Bishop Fox not sponsored it's open

play02:51

source it's free you can use it super

play02:53

easy to download it it is a binary with

play02:55

go you can just install it and then you

play02:57

can just point to it and it does a

play02:59

couple of cool things things the first

play03:00

thing that I think is really really cool

play03:01

to do with this is just being able to

play03:04

give an automate flag to it and then

play03:06

giving it the URL of every single

play03:08

Swagger that you have so in this case

play03:10

what I have done here is I think this is

play03:12

the file that I've created you can see

play03:14

all of these different ones let me just

play03:15

make sure it's a right one it's API docs

play03:18

final right here and let me just clean

play03:20

it up there we go all these that you see

play03:22

on the screen right here is just a Json

play03:24

file unfortunately there are some that

play03:26

were just swaggered at HTML I took those

play03:27

out already but this is a everything

play03:30

that has a Json format in it and we can

play03:32

just go to one of them just to see what

play03:34

it looks like you can see it is just uh

play03:37

the entire specs for that API now we can

play03:40

just do some really fun stuff like just

play03:42

maybe feed this into JS and having use

play03:45

uh XRS feed it to SJ or swagger jacker

play03:48

and then just giving us uh the automate

play03:51

I'll look at the Imports in just a sec

play03:52

but we can do automate and then now this

play03:55

will look at every single one of these

play03:57

end points will put the route where it's

play03:59

supposed to go and then it will it's

play04:01

going to give us the exact myth that it

play04:03

was used and the status of it so this is

play04:05

something really really cool because a

play04:07

lot of times what I would do especially

play04:08

on my streams or even when I'm doing bug

play04:10

bounty hunting and looking across the

play04:11

entire infrastructure is I would just

play04:13

have to do this manually I would find

play04:15

some script that maybe grabbed every

play04:17

single endpoint with bash and then

play04:18

cleaned it up and then maybe did some

play04:20

other calls that did it all for me and

play04:22

it was just very tedious and with this

play04:24

tool with swagger jacker you can do it

play04:26

all at once and if you have a list of

play04:28

every single AP

play04:30

documentation for a Target you can just

play04:32

feed it into this and look for the ones

play04:33

that come back at the 200 so for example

play04:35

this one I know this one isn't a 200

play04:37

because uh there is a syntax error but

play04:39

if you scroll down there's a bunch of

play04:41

them that are coming back and you can

play04:42

see the status for each of them and kind

play04:44

of take a look at them deeper and figure

play04:47

out what you want to do next so that's

play04:49

just one use case of it I think what's

play04:50

cooler about this is that you can kind

play04:52

of look for lead credentials on GitHub

play04:56

and then leverage swagger jacker to see

play04:58

if it actually allows you to

play05:00

authenticate to any apis on this

play05:02

company's infrastructure so let me just

play05:04

paint you the picture and by just

play05:05

showing you what I mean in here what we

play05:07

can do here is one is if you look at the

play05:10

specs or the help right here it allows

play05:12

you to do a help and you can with help

play05:15

you can see the headers so you can

play05:16

actually set a specific header that says

play05:18

hey if you are doing this testing for me

play05:21

so if I was to send these again with um

play05:25

our targets right here so if I were to

play05:26

do this again and do automate

play05:31

automate and pass all of these URLs to

play05:34

it I can also set a header that says

play05:36

authorization and giving the leaked

play05:39

credentials here and just looking at if

play05:41

it actually does allow us to

play05:43

authenticate to any of the apis across

play05:46

that entire infrastructure that's one of

play05:48

the things that I really found helpful

play05:50

or useful with this tool but wait there

play05:52

is two more things that I want to show

play05:53

you the second thing that kind of also

play05:55

goes hand inand with what I just talked

play05:56

about is just using the prepare argument

play05:58

here so what just going to do is we're

play05:59

going to copy this again and instead of

play06:01

automate I'm going to write prepare and

play06:03

what prepare does is it's going to tell

play06:05

you how you can use these different

play06:07

calls using the curl command so I'm

play06:10

going to actually do a t- a and we call

play06:12

this output.txt and hopefully this works

play06:16

as you can see right now it is dumping

play06:17

every single one of those requests right

play06:19

here and it's telling us that it

play06:20

requires a get uh for this one

play06:23

specifically this is what it looks like

play06:25

uh if I want to do authorization I have

play06:27

authorization one I think that's what I

play06:28

gave it on a but what I can do now here

play06:31

is I can just do a cat for this and I

play06:35

can just grip for curl and this would be

play06:37

a beautiful thing to have for us because

play06:39

one now we know exactly what the apis

play06:41

look like I can actually maybe build

play06:43

some tooling around this if I wanted to

play06:44

to take it a step further or I can just

play06:46

use this and add the headers manually

play06:48

into this one and then observe what

play06:50

status it comes with I can also just

play06:52

take the URLs and dump him and maybe Fe

play06:54

them to nuclei or httpx to get some more

play06:57

information so that's another use case

play06:59

but there one more thing that I really

play07:00

really really enjoyed with swagger

play07:03

jacker and that is just getting a list

play07:06

of all the end points available across

play07:08

all these bug bounding programs dumping

play07:10

into a file and just creating my own

play07:13

word list which if you're going after a

play07:15

large infrastructure maybe you're going

play07:17

after a large company that has tons of

play07:19

apis having something like this is very

play07:22

helpful because sometimes you don't know

play07:23

what's hosted on these apis and maybe

play07:25

the naming conventions or some of the

play07:27

applications are the same so what you

play07:28

can do here is is you can do the same

play07:30

thing we can cat for the same exact file

play07:32

we're going to go after all these

play07:34

different ones it's getting cleaned up

play07:35

but then we can type in in points here I

play07:38

think that's how you do it let's make

play07:40

sure we got this right I'm going to call

play07:42

this uh words.txt and it's going to

play07:45

start dumping every single one of these

play07:47

into uh a file for us outside the ones

play07:50

that are erroring out right here we have

play07:51

to clean this up but it's really cool to

play07:53

have this especially if you are just

play07:55

looking at one single Target obviously

play07:58

uh this data is a little bit wonky and a

play08:00

little bit not it's not the cleanest

play08:02

data that I've had because I'm just

play08:03

doing this for the sake of content and

play08:05

I'm masing every bug Bounty program but

play08:07

on a single Target having something like

play08:09

this allows you to create word lists

play08:11

that are very very specific to your

play08:13

target so keep that in mind the next

play08:15

time you find a very cool you can see on

play08:17

my screen I have a ton of different apis

play08:18

rest apis these are very very uh good

play08:21

data to have but just keep that in mind

play08:23

the next time you find a Swagger file

play08:25

that by itself is not a vulnerability

play08:27

but it is a gold mine uh information as

play08:30

a bonus content for all of you Recon

play08:32

lovers don't worry if you don't know how

play08:34

to look for API specs and maybe you just

play08:37

don't have a good word list don't worry

play08:38

it actually also allows you to Brute

play08:40

Force for it so right here on the screen

play08:41

you can see I'm using SJ I'm saying hey

play08:43

brute force and I want to you at this

play08:46

URL right here and if I feed it that I

play08:48

think it makes about yeah it says 2,000

play08:50

requests right here they have 2,000

play08:51

different paths that they look for and

play08:53

then once it hits one that has your data

play08:56

it's going to actually spit it out and

play08:57

then you can actually use this to do

play08:59

what we have talked about throughout

play09:01

this entire video so it does have

play09:03

everything built in I think it's one of

play09:04

the cooler automation meets API hacking

play09:07

especially if you're a bug Bounty Hunter

play09:09

this should be definitely in your tool

play09:11

bit so if you don't use it already go

play09:13

ahead and download it from the geub link

play09:15

that I will put down in the description

play09:17

as well all right that's it I hope you

play09:19

like this video it's been a while since

play09:20

I've made some uh Recon automated

play09:22

hacking video let me know in the

play09:24

comments do you like stuff like this do

play09:25

you want to see more videos of me using

play09:27

tools like this and if you do maybe you

play09:29

have a tool suggestion that you want to

play09:30

see in the next video Drop It in a

play09:31

comment and I will hopefully make a

play09:33

video on it in the upcoming weeks all

play09:35

right that's it I will see you all in

play09:36

next week's video peace

play09:46

[Music]

Rate This

5.0 / 5 (0 votes)

الوسوم ذات الصلة
API TestingBug BountySwagger JackerAutomationSecurity ToolsHacking TechniquesReconnaissanceGitHub LeaksAWS LambdaNuclei Templates
هل تحتاج إلى تلخيص باللغة الإنجليزية؟