How to Directory Brute Force Properly

NahamSec
30 Jan 202311:44

Summary

TLDRThis video script discusses the importance of proper directory and file brute-forcing techniques in cybersecurity. It emphasizes that using the right word lists and contextualizing brute-force attacks is crucial for effectiveness. The speaker suggests using specific word lists tailored to the technology stack of the target and recommends tools like FF and Dirsearch for the task. The script also advises on leveraging subdomain names and domain keywords to refine brute-force strategies, and encourages viewers to create and maintain their own word lists for better results.

Takeaways

  • 😀 Most people are not utilizing word lists properly for file and directory brute forcing, leading to ineffective results.
  • 🔍 The success of brute forcing relies on contextualizing your approach, not just on having the right word list.
  • 🛠️ It's crucial to use the correct tools for the job; personal preference plays a role, but tools like FF and DirSearch are recommended.
  • 📝 The use of the same word list for every target is ineffective; tailor your word list to the specific technology stack of the target.
  • 💡 Assetnote's word list and SecLists are valuable resources for obtaining targeted word lists for different technologies.
  • 🌐 Understanding the web server's underlying system can help narrow down the list of potential file extensions to check.
  • 🔗 Subdomain names can provide clues about the type of content hosted, guiding the focus of brute forcing efforts.
  • 📊 Combining word lists from different sources can create a more comprehensive master list for brute forcing.
  • 🔎 Brute forcing should be contextual, considering the target's specific characteristics, such as subdomain keywords and known common endpoints.
  • ✅ The process of effective brute forcing involves trial and error, using initial broad lists to find leads, then narrowing down with more specific lists based on findings.

Q & A

  • What is the main issue discussed in the video regarding brute force attacks?

    -The main issue discussed is that most people are not utilizing word lists properly and are not contextualizing their brute force attacks effectively, which leads to inefficiency in finding hidden or forgotten files and directories.

  • Why is it important to contextualize brute force attacks?

    -Contextualizing brute force attacks is important because it allows for a more targeted and efficient approach by considering the specific technology stack, programming languages, and the nature of the target, which can significantly increase the chances of discovering vulnerabilities.

  • What are the two main resources recommended for word listing in the video?

    -The two main resources recommended for word listing are the Asset Notes word list and the SecLists word list, both of which offer extensive collections of potential file and directory names organized by technology stack.

  • Why is it not effective to use the same word list for every target during brute force attacks?

    -Using the same word list for every target is ineffective because different servers and applications may use different programming languages and file extensions. For example, brute forcing for .net files on a Linux server running PHP would be futile.

  • What is the significance of the subdomain name in the context of brute forcing?

    -The subdomain name can provide valuable clues about the target's structure and potential endpoints. For instance, a subdomain with 'API' in it might indicate that the subdomain is used for API purposes, guiding the brute force attack towards API-related routes and files.

  • What tool does the speaker personally prefer for brute forcing?

    -The speaker personally prefers using 'ff' (a tool for finding files and directories) and 'dirsearch' for brute forcing.

  • What is the role of 'all.txt' in the brute forcing process as described in the video?

    -'all.txt' is a combined list of common words for each programming language, used when the specific technology stack is unknown. It increases the chances of identifying the correct file extension and programming language being used by the target.

  • How can the information from a subdomain name be leveraged in brute forcing?

    -The information from a subdomain name can be leveraged by using keywords from the subdomain in the brute forcing process. For example, if the subdomain contains 'API', the attacker might focus on finding API routes and related files.

  • What is the recommended approach after identifying a potential file extension during brute forcing?

    -After identifying a potential file extension, the recommended approach is to perform an extended directory brute forcing using only files with that specific extension, which helps in narrowing down the search and finding more specific vulnerabilities.

  • Why is it suggested to create and maintain your own word list for brute forcing?

    -Creating and maintaining your own word list is suggested because it allows for a more personalized and effective approach. It enables the attacker to add new words based on previous findings, leaks, or discovered directories, making the brute force attacks more tailored to their specific targets.

Outlines

00:00

🔍 Introduction to Effective Directory and File Brute Forcing

The speaker begins by suggesting that many people, including viewers, may not be performing directory and file brute forcing correctly. They emphasize that the issue is not the lack of word lists but rather the improper use and lack of contextualization of these lists. The video aims to demonstrate how to utilize word lists effectively, build upon them, and enhance their accuracy. The speaker encourages viewers to subscribe and support the channel through memberships, which offer exclusive content and help in content creation. The concept of brute forcing is introduced as a method of using word lists to find hidden files and folders on a target system, which could lead to discovering vulnerabilities such as SQL injection or SSRF. Various tools for brute forcing are mentioned, including Burp Suite, Go Buster, and Dirsearch, with a personal preference for FF and Dirsearch. The importance of using the right word list tailored to the target's technology stack is highlighted, and the speaker suggests using specific word lists from sources like Asset Notes and SecLists.

05:01

🔧 Contextualizing Brute Force Attacks for Better Results

The speaker discusses the importance of contextualizing brute force attacks, which involves understanding the target's technology stack and adjusting the word list accordingly. They advise against using the same word list for every target, as this can be ineffective and waste resources. The speaker suggests using a combination of word lists from various sources, such as Asset Notes and SecLists, to create a master list. They also recommend using the 'all.txt' file for a broad initial scan, which contains common words across different programming languages. The focus then shifts to understanding the target's subdomain and domain names to inform the brute forcing strategy. The speaker demonstrates using tools like FF and Dirsearch, and explains how to interpret response codes to identify potential vulnerabilities. They also discuss the significance of subdomain names in guiding the brute forcing process and how domain names can provide clues for directory brute forcing. The speaker concludes by sharing their personal approach to directory and file brute forcing, which involves starting with a broad word list, refining the list based on initial findings, and then focusing on specific file extensions and routes.

10:02

📝 Final Thoughts on Brute Forcing and Future Content

In the concluding part, the speaker summarizes the key points of the video, emphasizing the importance of understanding the context of the target when performing brute force attacks. They stress the need to use the right files and extensions and to create and maintain a personalized word list based on findings and observations. The speaker encourages viewers to engage by commenting on the video, suggesting topics for future videos, and expressing interest in a dedicated video on creating and organizing word lists. They remind viewers to subscribe to the channel and like the video to show support, and they hint at the possibility of creating more content based on viewer feedback. The video ends with a call to action for viewers to apply the knowledge shared and to stay tuned for more educational content.

Mindmap

Keywords

💡Brute Forcing

Brute forcing is a trial-and-error method used to obtain information such as a password or a secret by systematically trying every possible combination. In the context of the video, it refers to the process of attempting to find hidden or forgotten files and folders on a target system by using a list of potential file names or directory names. The video emphasizes the importance of using the right word lists and contextualizing brute force attacks to improve their effectiveness.

💡Word List

A word list in the context of the video is a collection of potential file or directory names that might exist on a target system. These lists are used in brute force attacks to check for the existence of files or directories that could lead to vulnerabilities. The video suggests that using the right word list tailored to the target's technology stack is crucial for effective brute forcing.

💡Technology Stack

The technology stack refers to the set of technologies used in the development and deployment of a software application. In the video, understanding the technology stack of the target system is highlighted as important because it helps in selecting the right word list for brute forcing. For example, if a system is running PHP, using a word list with PHP file extensions would be more effective.

💡Contextualizing

Contextualizing in the video refers to the practice of tailoring the brute force attack to the specific context of the target, such as considering the target's subdomain names, technology stack, and other unique characteristics. This approach is emphasized as a way to increase the chances of discovering hidden assets or vulnerabilities by focusing on relevant file types and directory names.

💡Subdomain

A subdomain is a part of a domain name that is preceded by a period and is used to organize different sections of a website. In the video, the presenter suggests using subdomain names as a clue for what type of content or functionality might be hosted there. For instance, a subdomain with 'api' in its name might indicate that it is used for API endpoints, guiding the brute force attack towards API-related routes.

💡API Endpoints

API endpoints are the URLs that define the resources in an API (Application Programming Interface) and specify the operations that can be performed on them. The video discusses the importance of identifying and brute forcing API endpoints, as they might lead to vulnerabilities such as SQL injection or SSRF (Server-Side Request Forgery).

💡File Extensions

File extensions are the suffixes at the end of a file name that indicate the file type. In the video, the presenter advises using file extensions that are relevant to the target's technology stack. For example, if the target is a .NET application, using .aspx file extensions in the word list would be more effective.

💡Asset Notes

Asset Notes is mentioned in the video as a resource for downloading word lists that are categorized by technology and use case. These word lists can be used in brute force attacks to target specific types of assets, such as API routes or common file names associated with certain technologies.

💡SecLists

SecLists is another resource mentioned in the video for obtaining word lists. It is a collection of multiple types of lists that are used during security assessments, including usernames, passwords, and file names. The video suggests combining word lists from different sources like SecLists and Asset Notes to create a comprehensive list for brute forcing.

💡Directory Brute Forcing

Directory brute forcing is a specific type of brute force attack that focuses on discovering directories or folders on a target system. The video explains that by using the right word list and contextualizing the attack, one can more effectively find hidden directories that might contain sensitive information or lead to vulnerabilities.

Highlights

Many people, including viewers of the video, may not be using their file and directory brute force tools correctly, even if they have the right word lists.

The key to effective brute forcing lies not only in having word lists but in contextualizing brute force attempts to match the technology stack of the target.

Identifying what kind of server is being targeted, such as Linux or Windows, and selecting word lists specific to that server is crucial for efficient brute forcing.

The speaker recommends tools like FF and DirSearch for brute forcing, but ultimately, the choice of tool comes down to personal preference.

Many users make the mistake of using the same word list for every target, which is inefficient. Word lists should be specific to the technology stack of the target.

AssetNote word lists, which are categorized by technology stack, are recommended as a key resource for brute forcing.

If unsure about the target’s programming language, using an all-purpose word list like 'all.txt' is helpful as it contains common words for multiple programming languages.

Cyclist by Dan is another useful resource, containing additional word lists not just limited to web content but also DNS-related data.

Contextualizing brute forcing by analyzing subdomains, like focusing on 'API' in a subdomain, can help direct brute force attempts towards more useful API endpoints.

Understanding the naming conventions within subdomains and paths is key to finding hidden or forgotten files and endpoints.

The speaker uses the example of fuzzing for 'API' routes and API versions (e.g., V1, V2) to demonstrate the method of brute forcing API-specific paths.

Utilizing response codes such as 302, 400, 401 during brute force attempts can indicate the existence of valuable endpoints.

Creating a master word list by combining resources like AssetNote and Cyclist, and organizing them based on extension and technology stack, will improve brute forcing results.

The importance of continuous learning: As more files and endpoints are found during brute force attempts, the word list should be updated with new patterns.

The speaker emphasizes the importance of contextual awareness when brute forcing, which includes understanding the subdomain structure, server technology, and naming conventions of the target.

Custom word lists tailored to specific targets are essential for effective brute forcing, instead of relying solely on generic or pre-made lists.

Transcripts

play00:00

how would you feel if I told you most

play00:02

people including you watching this video

play00:04

are probably not doing your file and

play00:07

directory Brew for sync right and that's

play00:09

not because you don't have the right

play00:10

word list but it's because you're not

play00:12

utilizing those word lists properly and

play00:15

you're not contextualizing your Brute

play00:17

Forces well today I want to show you

play00:19

exactly how to do that how do you use

play00:21

all these current word lists and you

play00:23

build up on it on your own and leverage

play00:25

them to do a better and more accurate

play00:28

word listing but before we jump into

play00:30

this video if you haven't already please

play00:31

hit that subscribe button if you want to

play00:33

support our channels I've actually

play00:34

opened up memberships where you can

play00:36

become a subscriber you can donate to

play00:38

the channel and in return you get

play00:40

exclusive content emotes and also it

play00:42

helps me create more content and overall

play00:44

supports this YouTube channel so we can

play00:47

keep it going alright enough about that

play00:49

let's talk about brute forcing if you're

play00:52

not familiar with brute forcing means

play00:54

the whole idea and the concept is you

play00:56

have a list of words and a list of files

play00:58

or potential folders and you're hoping

play01:00

to find those on your target some of

play01:02

these could be Dev files it could be

play01:03

backups it could be API endpoints it

play01:05

could be API swaggers or the

play01:07

specification for the API and all these

play01:09

different things the reason why we look

play01:11

for those is in hopes of finding an

play01:13

endpoint or something that leads us to

play01:15

an endpoint that could be vulnerable for

play01:17

a SQL injection ssrf idor whatever that

play01:20

is so the whole concept is we want to

play01:23

find hidden or forgotten files and

play01:26

folders well you can do this in a number

play01:27

of different ways the how you do it

play01:29

doesn't matter and by how you do it I

play01:31

mean the tools that you use doesn't

play01:32

really matter it's all I think is

play01:34

personal preference you can use burp

play01:36

Suite I don't recommend it because burp

play01:38

takes a lot of resources on your

play01:39

computer and you also want to do this in

play01:41

the cloud so your IP doesn't get banned

play01:43

but you can also use Forex Buster

play01:45

there's Go Buster there's directory

play01:46

search or Dr search there's FF all all

play01:50

these different tools honestly it all

play01:52

comes down to a personal preference I

play01:54

personally use FF and IR search those

play01:57

are the two tools that I really like but

play01:58

honestly that's up to you what you want

play02:00

to use do me a favor comment down below

play02:02

tell me what you use and why you use it

play02:04

and maybe I will cover it in one of the

play02:06

upcoming videos okay so the tool doesn't

play02:07

really matter we just talked about we

play02:09

can use whatever tool we want the whole

play02:11

concept is finding endpoints the biggest

play02:14

thing that I see people do is they use

play02:16

the same word list for every single

play02:19

Target and unfortunately that's not how

play02:22

it works the example of it is you can

play02:25

hope for finding.net files that end in

play02:27

aspx on a Linux server that's running

play02:30

PHP or another server that's running JSP

play02:32

it doesn't work I'm not saying that you

play02:35

can't have JSP on a Windows machine but

play02:37

I'm just seeing if an application is

play02:39

mostly serving you dot aspx files then

play02:42

doing a brute force with DOT PHP files

play02:44

is kind of useless and it's just taking

play02:47

up your time and resources for no reason

play02:50

so the thing you want to do is you want

play02:52

to find wordless specific by technology

play02:55

stack and what they do and stick around

play02:58

at the end I'll tell you how I do all

play02:59

this but for now I want to cover what

play03:01

are the things that you should have

play03:02

before you get into directory brute

play03:04

forcing well there are two main

play03:05

resources I highly recommend for word

play03:07

listing that you can download them for

play03:09

free the first one is the asset notes

play03:12

word list which you can see on the

play03:13

screen right here they have a ton of

play03:15

them they have API routes you have some

play03:17

for domains and subdomains that we have

play03:20

covered in the past we can also look at

play03:22

they have HTML dot files

play03:25

to have JSP and you can also look for

play03:27

aspx for example you can see they have

play03:30

tons of different ones based on the

play03:33

Technology stock so the number one thing

play03:35

is you want to identify what is this web

play03:38

server running is it a Linux based web

play03:40

server is it windows with Windows you

play03:42

have more leniency there could be PHP on

play03:44

there some people will run PHP or other

play03:46

programming languages on Windows but

play03:48

honestly knowing the system behind it

play03:50

could kind of weave out the ones that

play03:52

you don't need and if I were you what I

play03:54

would do is I would download all these

play03:55

different asp.jsp HTML all these

play03:58

different extensions organize them in my

play04:01

computer and then depending on what that

play04:03

server is I will run this but I also

play04:05

understand that sometimes you may not be

play04:06

in luck and you may not be able to

play04:08

identify what programming language or

play04:10

stack they're using and that's where a

play04:12

all.txt comes in and all.txt is a

play04:15

combination of common words for each

play04:17

programming languages so it could be

play04:19

test.php test.asp test.jsp index and so

play04:23

on you have a list of all these and you

play04:26

want to make sure one of them hits in

play04:28

hopes that you can actually find the

play04:30

programming language that's being used

play04:32

and then director directory brute

play04:34

forcing to that specific language and

play04:36

extension the other option you have for

play04:38

this is using uh cyclist by Dan uh this

play04:41

is also another great resource honestly

play04:43

I would say you can combine the two but

play04:45

this one goes beyond just web it has

play04:46

also DNS stuff but for us we're gonna go

play04:49

to Discovery we can go to web content

play04:52

and also to have different things you

play04:54

can see they have Apache they have

play04:55

common back doors HTTP JavaScript all

play04:58

that stuff some of these are outdated

play05:00

you can see it's five years ago it

play05:02

hasn't been updated but honestly it

play05:04

doesn't hurt to spend a day and combine

play05:07

all the PHP files from this one and the

play05:09

one from asset node combine them into

play05:11

one and having a master webless so I

play05:13

mentioned that you need to contextualize

play05:15

your brute forcing and it doesn't just

play05:17

mean having the right word list having

play05:19

the right extension for that company

play05:21

whatever that asset it also means

play05:23

understanding where and what to root for

play05:25

for example if a subdomain has the

play05:28

keyword API in it chances are they're

play05:30

using that subdomain or that asset for

play05:32

API purposes you're not going to want to

play05:34

look for jspn.net files for example so

play05:37

you want to shift and focus your entire

play05:38

directory brute forcing on finding API

play05:41

routes using some of the files and word

play05:43

lists that I showed you in the earlier

play05:45

in the video but it goes also beyond

play05:46

that it doesn't always have to be

play05:48

site.com API that slash the folder that

play05:52

your directory brute forcing could also

play05:55

be easily guessable based on the domain

play05:58

that we have so let's just look at it on

play06:00

this screen and maybe we'll make more

play06:01

sense so for example imagine we have

play06:03

this subdomain right here it is called

play06:06

one app API hack with no homesick well

play06:10

the first thing is I wanted to do is I

play06:12

see the word API in there it's behind an

play06:14

API zone or subdomain so the indication

play06:17

of it is more than likely this is some

play06:18

sort of an API that I want to Brute

play06:20

Force for the next thing I want to do is

play06:22

I want to find the API route could it be

play06:24

API could it be V1 V2 could it be API V1

play06:29

or V2 and so on there's one more step

play06:32

we're going to look at at the end but

play06:33

I'm going to use fluff for this example

play06:34

and you can see I'm using all that txt

play06:36

my file for all.txt has most of my

play06:40

common words that I look for they're not

play06:43

specific to a extension but it has a lot

play06:45

of different files that I usually look

play06:47

for right off the bat I'm matching for

play06:49

these different responses I'm looking to

play06:52

see if a 302 400 405 401 all these

play06:55

different ones to come back and the URL

play06:57

is right here and we're going to see if

play06:58

this works

play07:00

you know bunch is going by index.html

play07:02

was found of indexation over there a

play07:04

couple of times it's come back it says

play07:06

nothing was found no API routes nothing

play07:08

of important to us doesn't hurt maybe

play07:11

API comes back but it doesn't match any

play07:13

of those response codes that I put in

play07:15

earlier so I'm going to put API in there

play07:17

really quickly again it's going to Brute

play07:19

Force nothing's going to come back

play07:20

that's okay we're gonna do is we're

play07:22

going to take a look at our URL and this

play07:24

is where contextualizing and

play07:25

understanding your asset becomes very

play07:27

important what right here you see is is

play07:29

one Dash app dot API Dot hackwood and

play07:32

homesick this within itself can be

play07:35

broken up in two different things for us

play07:36

through Brute Force One could be that we

play07:38

can look for the word up because that's

play07:40

what's in the subdomain it could be just

play07:42

an app and we're going to fuzz for it

play07:44

we're going to give it a couple minutes

play07:45

nothing comes up we can cancel this as

play07:48

soon as there's nothing there because I

play07:49

know what my word list has in the

play07:50

beginning and then there's the other

play07:52

option of using the word one again one

play07:54

could be

play07:55

the keyword one could be anything it

play07:57

could be a random few letters that means

play08:00

something to the company but us as the

play08:02

hackers they build our hacking on this

play08:03

company we don't know what that means

play08:05

for that one Dash app could be a number

play08:07

of different things but what I'm trying

play08:08

to say is all these different words

play08:09

within the subdomain like the subdomain

play08:11

name one app one Dash app one without

play08:15

the Dash app combined together a

play08:17

combination of one or more of these

play08:19

different words could be a lead for us

play08:21

two sub domain brute force or I'm sorry

play08:23

fall brute force and folder brute force

play08:25

in hopes of finding an asset or an

play08:27

endpoint that was left behind so for

play08:29

this example I'm going to start with one

play08:31

nothing comes back I'm gonna give it a

play08:33

few minutes

play08:34

we're gonna exit out of that we're gonna

play08:36

do one

play08:37

up and see if anything comes back and

play08:39

right off the bat right here you can see

play08:41

that API API V1 both KMS 301 which is

play08:45

redirecting to somewhere else and then

play08:47

you also see that we have API V1

play08:50

swagger.yamo which is probably their

play08:52

specification for that API that came

play08:54

back and said hey this exists that could

play08:57

give us all the different routes within

play08:58

that API and potentially one of those

play09:00

API routes could dump a list of users it

play09:03

could be vulnerable whatever that is

play09:04

that's pretty much how you should

play09:07

approach all your targets when it comes

play09:09

down to brute forcing for a thousand

play09:11

directories early in the video I said

play09:12

that I was going to tell you how I

play09:14

approach my directory and file brute

play09:16

forcing well the first thing is when I

play09:18

find my target I threw all that txt at

play09:20

it I look and see what comes back if

play09:22

nothing absolutely comes back then I

play09:23

look at the sub domain name and I start

play09:25

playing with different keywords I'm not

play09:27

subdomain in hopes that it could be

play09:29

my first lead into finding a folder that

play09:32

exists and then once I have done my

play09:34

all.txt that's what I get my leads in

play09:36

hopes that it gives me hey there is a

play09:38

PHP there's an API route whatever that

play09:40

is that exists right there so for

play09:42

example if says Hey test.php.exists then

play09:44

I'm going to go and do an extended

play09:46

directory brute forcing by just using

play09:49

dot PHP files and then of course just

play09:52

scaling it from there so a lot of it

play09:54

comes from two things one is my historic

play09:56

knowledge the things that I have

play09:57

collected obviously you can do the same

play09:59

you can go to use seclist's raft word

play10:02

list clean it up and use it as your

play10:04

basis for

play10:06

when you want to do it all.txt and then

play10:08

you can create that and add on to it

play10:11

more and more as you find more

play10:13

interesting targets and you need more

play10:14

JavaScript files and that kind of stuff

play10:16

and then of course the second one is you

play10:18

want to have a good word list I highly

play10:19

recommend going to sick list and going

play10:21

to asset notes uh word list combining

play10:24

the two making a good word list for

play10:26

yourself for each extension and having a

play10:28

name properly and just querying them as

play10:30

you go none of the stuff that I talked

play10:31

about throughout this video is a secret

play10:33

it's obviously a lot of top hackers are

play10:35

doing these things including myself I do

play10:37

the same things but a lot of people that

play10:39

I've seen online where they post or they

play10:41

talk about brute forcing they're using

play10:43

the same words as other people and

play10:45

they're not looking at the asset itself

play10:47

so if you're watching this what I want

play10:49

you to do is please keep that in mind

play10:51

the sub domain name is a huge bit of

play10:53

information that you can leverage please

play10:54

please make sure you are understanding

play10:56

the context of where you want to Brute

play10:59

Force you want to make sure using the

play11:00

right files in the right extension and

play11:02

obviously you want to create your word

play11:04

list on your own based on on all these

play11:06

different files that you find leaks that

play11:08

you see maybe a directory listing comes

play11:10

up and you can see a list of files added

play11:12

to your word list and maintain your own

play11:14

okay that's it about brute forcing do me

play11:16

a favor leave me a comment let me know

play11:18

if you want me to dedicate an entire

play11:20

video on how to create your own word

play11:22

list how to organize them how I do mine

play11:24

maybe I'll make that into a video let me

play11:26

know down below if you find that helpful

play11:27

and again if you haven't already

play11:28

subscribe to the channel hit that like

play11:31

button and let me know what you think of

play11:33

this video and what you want to see next

play11:35

okay that's it see you in the next video

play11:38

[Music]

Rate This

5.0 / 5 (0 votes)

相关标签
Web SecurityBrute ForcingWord ListsAPI TestingDirectory FuzzingHacking TechniquesCybersecurityPenetration TestingResource OptimizationTool Recommendations
您是否需要英文摘要?