web enumeration is a techniques hackers use when targeting web servers and web sites. When attempting to hack an application with a vulnerabilty, you first have to find out what files, subdomains or directories the applications are vulnerable to. On top of that, you may find hidden files that could give you access to the file server. Perhaps you can access SSH keys, pdfs or find hidden directories. It might be there is a vulnerable app running on one of the sub domains. There are many ways the server could be accessible and web enumeration is the first step.
This course provides a technical guide to web enumeration using Kali Linux. It covers the process of discovering hidden files, directories, and subdomains to map a target's structure. The instruction spans manual techniques, automated scanning with GoBuster, WordPress-specific auditing via WPScan, and general vulnerability assessment using Nikto.
Welcome to the web enumeration course.
In this course you'll learn the most fundamental tools used for enumerating a web target.
So we're gonna specifically target a web, the web target, or a web server.
So a computer running a, exposed to the web for example, the me.com is a website so it could be a target.
And given a target we will scan for hidden files, hidden directories and so on.
So this is a vital skill for hackers because how else you're supposed to know what you're attacking, right?
You have to know as much as possible about your target in order to attack.
It's easy to fall into rabbit holes, there's so many hacking tools and hacking stuff that
it's easy to get really confused and find a lot of tools and just not get anywhere.
So in this course we'll clear things up.
I'll be using Kali Linux which is a free system.
So it's called Kali, K-A-L-I.
But you can run from a live USB so either you can install it onto a USB.
I click on get Kali.
Kali.org slash get Kali.
So you can install it on live USB and then plug it into your computer, restart and you have Kali Linux.
It's also possible to run it on mobile, on the cloud, inside a virtual machine like VirtualBox or on bare metal.
That means just installing it into the computer directly.
So depending on what you prefer, for example let's say Liveboot, you can install Kali Linux 64-bit.
If you have an Apple it runs on that as well.
So you can click on the little download arrow here and when you click that it will download it.
The next thing you have an ISO file.
Once the download is complete you'll see in the left bottom it's a .iso file.
And you can write it to a disk using a tool called Balena Etcher.
So if I search for that, balena.io, then this website you can put the image, the .iso file onto a USB drive.
So just with three steps you have to select the image, select the drive and click flash and you have a Kali drive.
Now alternatively you can just order such a disk from Amazon directly.
So if I go Amazon.com and search for Kali XUSB you'll see you can also order Kali Linux from the internet and plug it in and you should have Kali Linux.
So there are several of those.
Alternatively instead of doing the USB boot you can choose any of the other installations.
For example inside a virtual machine and then run it inside a virtual machine or in the cloud depending on what you prefer.
But either way we'll be using Kali Linux in this course.
It doesn't matter if you run it inside VirtualBox, in the cloud, on mobile or any other way.
But what we'll be teaching about is web enumeration.
So scanning a web target.
So the first thing we could try to do is manual enumeration.
So we don't need to use any software immediately.
We can try by hand scanning to see maybe we can find something quickly.
So obviously you can use your web browser for that.
You might have some server.
You can pick any server.
So I will pick a server on my local network.
I have to be sure that I'm on the same network.
It was on 2.3.
So you'll see I have a simple web server running.
And what you could try to do is just guessing.
So slash hidden for example.
Okay nothing there.
Slash example.
Slash users.
So obviously you could try to guess manually using a word list.
By one try to find information.
Now the browser console might give you some information.
So if you open the URL on your website, which can be any website.
You can go to the developer tools.
So developer tools console.
This exists both in Chrome and Firefox.
This is Firefox so I'm going to go to more tools.
And web developer tools.
So Chrome has a similar one.
We can find some information with this tool.
You'll see a little window pops up in the bottom.
So first you'll see some website code which is not that interesting.
You might find some comments here or some information in the code itself.
You can also right click view page source.
And you might find some information in the comments that shouldn't be exposed.
A comment is always written using text.
So a comment might be written like this inside the HTML.
So you might find a line like that with maybe there's a user John in the system.
You might find something in the HTML code.
You can also find sometimes some information in the network.
So if you click on network and click refresh.
And you click any of them.
For example the slash here.
Click on the headers.
And you might find that which software is being used.
For example our software.
The response header there's a server.
And it tells us okay it's running Ubuntu.
So a Linux system.
And the server software is Nginx version 1.18.
So you can find some basic information using the web developer tools.
Like this operating system your target is using.
And the server software and version.
When doing automated scans we often use word lists.
Now Kali has a lot of word lists by default.
Which you can find in the directory.
User share word lists.
So that's slash user without e.
Share word lists.
So in that directory you can find a lot of directories.
That you can use for automated scanning.
Regardless of whether we will use dir modes, dns modes, file modes.
All of these which we'll talk about in the next lectures.
So you'll see a directory called dir buster.
Which has some useful word lists or directory lists.
It has many different files.
Now there's also the directory dir b.
Inside dir b you also have some useful lists like common.
Small.
Extensions common.
And all of these can be used for scanning right.
So for example we open small.
And it will automatically scan slash b.
Depending on what you define of course.
But let's say you want to do a directory or folder scan.
It will automatically try slash logs.
Slash pages.
Slash servlets.
Slash sources.
Slash statistics.
And so on.
So a lot of word lists are included by default in Kali Linux.
So we didn't really install anything.
This is all included by default.
Now if you want some additional.
You can run sudo apt update.
And the command sudo apt install seglist.
That will install more security lists on your system.
But by default.
You should already be able to do a lot of scanning.
Because as you saw.
Has a lot of files in the directory dir b and dir buster.
Which you can use for automated scans.
Now while you can scan everything manual.
So you can guess.
Directories.
Whatever might exist.
That is like a really tedious process right.
You have to manually go through your list of words.
And try to find it.
So.
What you can do instead.
Is to use a tool called go buster.
Go buster does all of that automatically.
Using a word list.
And it works with any website.
And you can scan for directories with go buster.
So as the name implies.
Go buster is written in a programming language called go.
Online you can easily find it.
So if I search for go buster.
It might take a moment to find.
Depending on your internet speed.
But you can also install it using your package manager.
So you already should have Kali Linux at hand.
We can just open a terminal.
And I'm going to enlarge the fonts.
And we can ignore the browser.
It doesn't matter.
So you can type go buster.
And you'll see it asks to install it.
So you just press yes enter.
Or type the command manually sudo apt install go buster on Kali Linux.
When you press yes.
It will start.
Installing go buster.
So this is a tool you can use to scan any website or any web server automatically.
Using a dictionary.
So there's a lot of commands.
It's a command line program.
So that's why I started the terminal as well.
So if I type go buster.
And I will enlarge this a bit.
Because there's no reason for it to be so small.
So go buster.
And you'll see it has all kind of flags.
And some commands like here.
So scanning for directories and files.
It can scan for subdomains.
And also some other options.
And so that's one of the tools you can use for automatic scans.
You'll see you can specify a word list.
You can do it for both outputs.
You can use multiple threads.
That will make the scanning faster.
You can skip printing the banner.
And there's some other options here.
So let's do a scan.
And in order to do a scan, we'll use the dir mode.
So if you scroll up, you'll see available commands dir.
So that's the mode we'll use.
We'll scan for directories or folders.
So that option will scan for website directories.
So this is a very useful command.
Because it will often tell you what the directory structure of a website is.
So you might find directories like WordPress directories.
If it's running a WordPress system.
Or other directories.
Maybe an admin directory.
It can indicate the type of software they use for creating the website.
Maybe have a content management system.
Or maybe not.
And maybe other things are exposed as well.
So GoBuster allows you to automatically scan a website.
And it returns the directories it found.
So the way to use that is just typing, as you might expect, GoBuster dir.
But it requires some arguments.
So obviously it should know what website should it attack.
So I'm going to attack a website in my local network.
And it uses a dictionary.
So before we tried manually words.
Word by word.
But we will use a word list now.
Dictionary.
So on Kali Linux.
There's a directory called usershare-wordlist.
And that has directory dirb, dirbuster.
Both of them contain word lists.
So, for example, there's the common.txt.
And those contain filenames of directories that might exist.
So it will open all of those links automatically.
So slash reddit, slash redesign, slash redir, slash redirect.
And it will try to open one by one all those URLs.
And see if that exists or not.
So this is just one of the lists.
You'll see there's other lists here.
Now in the directory dirbuster you can find some more.
These are larger.
But let's pick the small one.
So it will try slash index.
So whatever website you scan.
Slash index, slash images, slash downloads, slash 2006, slash news, slash cracks, slash serial.
And so on.
So it will try all of those automatically.
All those words to see if the link exists on the website.
So that's what we're going to do.
So usershare-wordlist, dirbuster, and then a directory.
For example, directory list.
For example, the small list.
So that is the command.
So you need to specify there that you want to do directory scanning.
The URL, minus U, and minus W for the word list.
And there you need to specify the full path.
So usershare-wordlist, slash whatever word list you want to use.
So I'm going to press enter.
And you'll see it found some directories on this target computer.
The directory slash documents, slash admin, slash secrets.
So those probably shouldn't have been exposed.
And GoBuster just found those automatically.
So it will scan.
This is your minus U directory.
Or minus U specifies your target website.
And those it found using the word list.
Now, of course, you can use other word lists.
For example, now I choose small word list.
But there's also a medium list and a large word list.
So you can scan using those as well.
And maybe you'll find some other directories.
So that's something to keep in mind that you might have done a GoBuster scan.
But perhaps you didn't find anything because the word list is too small.
Or perhaps some words, some URLs exist that the folder names are not inside the small word list.
So it's recommended to scan using multiple word lists.
And try to find it.
You might notice I specified the HTTP protocol.
It's HTTP scanning.
Some websites, these days many websites use HTTPS.
Which you can also use.
So you would then change HTTP to HTTPS, whatever website you want to scan.
So that's important as well.
Keep in mind that you scan the right protocol.
So it can be HTTP, it can be HTTPS, depending on the website.
Now, there's some other flags you can use.
For example, you can display cookies with minus C.
You can specify headers with minus H.
There's some other.
So DIR mode is really useful for finding directories on a website.
But it doesn't scan for files.
It just scans for directories that might exist on the website.
So you can do a basic scan with the DIR mode.
Scan your target website with a word list.
If you press enter, it will do a basic scan.
And telling you about the directories that exist on the website.
But what GoBuster also can do is search for files.
So in this case, sorry, we didn't scan the website.
Specify the right URL.
And it will scan the website for directories.
What you can do next is scan those directories for files.
So using the same word list and specify the kind of file extensions you're interested in.
You might find files on the website.
For example, here we have the first one is slash documents.
So we might scan that.
Slash documents.
I'm going to move to the end of the line with control E.
Minus X.
Then I search for .conf.txt.pdf.
And let's see if any files exist in that directory with those extensions.
So .conf.txt.pdf.
So minus X will search for files.
Do note that I am now scanning the documents directory that I got from the results here.
So now it scans the web server for files.
You'll find that it found slash documents slash users.txt.
Slash documents slash passwords.txt.
If you keep it running, it might find some other.
So I'm going to break this because this is just an example.
You'll see I was scanning for the documents directory.
And you can do that for any of the results.
For example, you can do the same thing for the admin and the secret directory.
So I'm going to do that.
I will change that to admin.
And let's see if there's any files in the admin directory.
And yes, it immediately found some.
And if you keep it running, it will scan for files in that directory.
So it's already found two.
Of course, you can do the same thing for the secret directory, which was also one of the results.
Type secret.
And you'll see it found another file.
So minus X will search for files in the directory you specified.
Now keep in mind it will only search for the file extensions that you specified.
So if you want to search for email, you have to specify that.
If you want to search for words, you might have to specify that as well.
So depending on what you want to search for.
So, of course, config files might be very interesting or PDF files, TXT files.
You might want to search for JavaScript files or MP3 files.
But either way, you need to specify what you're looking for.
It's using that word list, but now for searching for files when you specify the minus X flag.
So that will search for files.
Now, sometimes when you have a website, it might show like a certificate error, right?
Like some websites, they don't configure right the certificates.
So you might get a page like this.
So something like this.
Your connection is not private.
It's kind of nonsense.
So depending on which browser you use, but you might get some message like that.
It has a bad certificate.
Like some websites, they don't configure right.
In that case, you can use the minus K flag that will ignore those errors.
So it's just a little trick that you can still use GoBuster if they use bad certificates on the website.
So if you have a website, it might be that it has one or more subdomains.
So here we have a website on my local network, website.hkr.
And we can scan that website using DNS mode.
So any website, let me just enlarge this.
Where's the font?
Any website can have one or more subdomains.
For example, if you have aircom, they might have clients.software.com.
They might have CMS.software.com.
Perhaps port shop.
So these are all called subdomains.
They are part of the website.com.
So in this case, software.com.
And they have all those subdomains.
Now GoBuster can also scan for subdomains using DNS mode.
So that works like this.
You type GoBuster.
And then you'll see they have this mode.
So you can do subdomain enumeration.
So what you can do is type GoBuster DNS.
Then your domain name.
So that was website.hkr for this example.
Then you need to specify a word list.
We can specify some word lists.
For example, the deerbuster one.
And let's pick the small word list.
And then just press enter.
And it will scan the site for domains.
So you'll see it found different subdomains already.
So this is not the only website.
There are several more.
So when you specify DNS instead of deer, it will scan for subdomains.
Now, one thing you might notice is that it's very important to have word lists.
So a word list can mean success or failure in your scan for discovering many hidden directory files and subdomains.
And Kali Linux has an extra list called SecLists that you can install manually.
So if you install SecLists, you can contain many additional word lists.
So you can type sudo apt install SecLists.
So if you do that, it might be with lowercase.
Okay, but it's part of Kali Linux, so let me just search it.
SecLists.
It might be that I first need to run an update, and then I can install SecLists.
So it takes a moment, and then you can install SecLists using the commands with apt.
And these are just additional word lists that you can use instead of just the word lists that you find in user share word lists.
So obviously there are some word lists here.
But there's also the SecLists.
You can also download them from GitHub.
So you'll see they install into user share SecLists when you install them.
And they are lists containing for discovery, so which is what we need.
We also have for fuzzing, passwords, and others.
So this is going to be 1.5 gigabytes, so something to keep in mind is that it can install for a while.
So you can run sudo apt install once the update is complete.
So on Kali Linux you can do apt-y install SecLists.
And that will install 1.5 gigabytes of word lists that you can use for scanning the target host.
Now I'm not going to do this.
If you don't use Kali Linux, you can also run this command and that will install it as well.
All the security lists containing word lists, direct discovery lists, and others.
You can browse around a bit, so you'll see for example DNS, web content.
And you click on that and you'll see many different lists that are included in SecLists.
So very useful when you want to do scanning.
So to install it in Kali Linux, apt-y install SecLists.
So apt-y install SecLists.
That will install the security list on your system.
Now my computer has locked the installation, but that is the command to install SecLists on your computer.
And you would have additional options to scan instead of just the default word lists in Kali Linux.
It can be that the website is running WordPress.
So you can use a tool called WPScan.
WPScan was first created in 2011.
It's been more than 10 years and it still exists, so it's one of the tools that will just be around.
And it allows you to enumerate and research WordPress installations for security vulnerabilities.
So what it might show is sensitive data.
You might find some part with misconfigurations, password policies and other files.
So the tool can be installed easily and it might even be installed by default.
So we just type WPScan and you'll see it is already installed by default.
If you're not using Kali Linux, you can install it with your package manager.
So sudo apt update, so that will update your system.
And you also would need to run, after that, sudo apt install WPScan.
Now on Kali Linux, WPScan is already installed, so we don't need to install anything.
It's installed by default.
So the WPScan has an internal database that it uses for scanning.
So the first thing that I recommend doing before doing any scan is just updating that database.
So WPScan dash dash update.
That will update the internal database that it uses for scanning.
Now as you see, that only takes like a second or so. It's really fast.
That updates the internal database, so we are ready to do some scanning.
Now WPScan can scan any WordPress target.
So if the system or the website you're targeting is running WordPress,
you can find out a lot of information like the active theme and maybe other information as well.
So you can use the command WPScan dash dash url.
And then we would need WordPress installation.
Perhaps there's one on WordPress.org or WordPress.com.
Let's see. WordPress.
So WordPress.com, perhaps that's a WordPress-based website.
So I'm just going to try it.
https://wordpress.com
slash double dash enumerate t
So that will scan WordPress website.
And you'll see this seems to have some security that it blocks that.
But you can scan any website with this command.
So you can use WPScan to target any website and do a scan.
So with the dash dash enumerate flag t, it will do a full scan for looking for a theme.
So if you run that command on your target website, it will scan.
And then enumerate the popular themes.
Try to find out the theme that was being used on the website.
So dash dash enumerate t will scan for themes.
Now it can be important for maybe some themes are vulnerable for security reasons.
So in this case, they seem to be using some custom theme.
But they do have 2022 installed, for example.
They have the 2022 still installed on their server.
So you can scan for themes with the dash dash enumerate t flag.
Now WordPress allows users to install all kinds of plugins.
Those plugins can also have vulnerabilities.
So instead of t, you can specify p.
And with the p flag, it will scan for plugins used on that website.
So if we do a scan, it will start searching for plugins that are used on the website.
Now in this case, it didn't find any plugins for this website.
It can be that the website administrator didn't install any plugins.
But any plugins installed can pose a security risk.
So if you do dash dash enumerate with the p flag, it will scan for plugins on the target website.
Now any WordPress website has a login panel, usually in slash wp-admin,
where the administrator can log in with username passwords.
So how do you find those usernames?
Well, you can use wp-scan and use the u flag for enumerate.
And what wp does behind the scenes is to look for the authors that are used to write the articles.
So dash dash enumerate with the u flag will search the website for usernames.
It will automatically scan and try to find out usernames that exist on the website.
Now this website...
Yeah, so we find some usernames here.
You'll see it automatically found some usernames.
So in order for a hacker to attack it, he would then only need the password.
So it found the usernames with the dash dash enumerate with the u flag.
It finds usernames.
So t to find the team, p to find the plugins, and u to find the usernames on the WordPress.
Now there's also the vulnerability flag, the v flag, that scans the website for vulnerabilities.
For example, you can search for vulnerable plugins that are installed or vulnerable teams using the v flag.
Now wp-scan can also do a password attack.
So if you specify the URL, you can then specify a list of passwords.
So a password list, dash dash password.
It's your password list.
Now Kali Linux has a lot of password lists included.
For example, in the user share word list, there's a password list called rocku.txt.gz.
Now it has a gz on the end.
That means it's compressed like a zip file.
So we're going to copy that to our home directory and right click extract here.
That will extract it.
So refresh the directory.
You'll have rocku.txt, which is a list of 100, I think 40 million passwords.
So we can say home Kali rocku.txt and then a username that you found before.
So before we scanned the WordPress with the like to find usernames and then you can use any username from that list.
So whatever user you found, dash usernames.
For example, the bottom one, paste it.
And if I would press enter, it would then start attacking WordPress with this username and the password list.
And try every password in that list one by one until it finds the correct password.
Of course, during that the password must be in the password list of 40 million passwords.
Now, of course, there's also larger password lists of a billion passwords.
So you can find such lists online.
You can find lots of password lists that you can use for doing such kind of attack.
So WPScan is quite a versatile tool that you can use for finding users, finding plugins, finding teams and also for doing password attacks.
So to gain access into the system using the brute force.
Alternatively, if you scan for plugins and teams, you can see if there's vulnerability in any of those.
For example, if we go to exploitdb.com, we can find out if a plugin is vulnerable or not or a team.
So if you search for WordPress, you can find, for example, a lot of plugins here that are vulnerable.
So that's exploitdb.com.
Now, I mentioned before, you can also add a V in front so it will tell you which plugins are vulnerable.
So that's another way you could attack WordPress.
So WPScan allows you to do targeting WordPress software, so WordPress blocking software.
But not every website is going to run WordPress, right?
So a lot of websites run WordPress, but there's also websites that use others like Drupal.
Or maybe they don't run any software and they just have HTML files.
Maybe it's not blocked, so they use other kind of software.
So WPScan is specifically designed for WordPress.
So, of course, WPScan will only work on WordPress blocks.
So not every website is going to run WordPress block, right?
They might run other blocking software or they might not run a block at all or use other software.
So you can use another scanner called Nikto.
So Nikto has been first released in 2001.
And it's a popular vulnerability scanner because it's free, it's open source.
And it's not specific to applications like WordPress or others.
So Nikto is a really general scanner that can search for scan sensitive files,
outdated service programs or server software misconfigurations.
Now, let's try to type Nikto.
And as Kali Linux never disappoints you, so Nikto is installed by default.
And you can use Nikto to scan any website.
Now, Nikto has multiple modes.
For example, let's do a default basic scan.
So we type Nikto minus H with the target.
Now, of course, this is a target in my local network, so specify whichever target you want.
The IP address or the website.
And press enter.
And you'll see it starts to scan the target website.
So it found some vulnerabilities here.
And also the software.
So it's running Ubuntu Linux with Nginx.
And you'll see it's running a prefile that might be used for testing.
It found some WordPress login stuff and others.
I'm going to press no here.
So it tested very quickly because the server isn't running too much software.
But the basic scan you can do with Nikto minus H and then your IP address or website.
So it can scan for multiple ports.
So, as you might know, a server, a computer, can expose applications on multiple ports.
So the web port is usually port HTTP.
It can be running HTTPS service 443.
And perhaps other services like network file sharing, remote desktop or whatever.
So Nikto allows you to specify the ports with the minus P flag.
For example, minus P 80 and perhaps 8080.
Whatever ports you want to scan. 443.
Now, of course, those ports need to be open.
Otherwise, Nikto can't connect to them either.
So you can check if ports are open using nmap.
So if I type nmap with the target server, you'll see this server on my local network is only running port 80.
So it would only make sense to specify port 80.
But that is the default, so you can leave it out.
That's the scenario.
But it might be that nmap returns a lot of ports and then Nikto can scan all of them.
Now, Nikto also supports many plugins.
So if I type nkto-list-plugins, you'll see there's lots of plugins.
So it can support SSL.
For other stuff, it can scan for a robots.txt file.
It's like different features that many different plugins that can be used in addition with Nikto to more detailed outputs.
That's the basic Nikto file.
You can save your scan information with the minus O flag.
So minus O, let's say report.html.
So that will save the output into report.html.
It takes a moment.
I'm going to press no.
And if I do list the directory, you'll see we have a report.html now that we can open with the browser.
So there's report.html.
I can open that with the browser to see the results.
So in a more presentable way, right?
So it tells us the target IP, the server software and operating system.
And also it will tell you about possible vulnerabilities or interesting files.
Nikto is not dependent on any application, so you can find a lot of different things.
So that is Nikto.
It will give you some general information about the server and also it can find vulnerabilities for you.
You can use the tuning flag for vulnerability scanning.
I'm going to remove all of this.
So minus tuning, zero.
And it will search for file upload vulnerability.
If you specify that, well, obviously this computer or this server doesn't have any.
But with the tuning flag, you can specify what you want to scan.
So you can search for misconfigurations if it's two.
Information disclosure, three.
Injection, four.
So you can search for a lot of default vulnerabilities with the tuning flag.
Now, if you just type Nikto, it will also tell you a lot of the flags that are available for Nikto.
So it's a more general scanner than WPScan and GoBuster.
It really looks for different applications might be on there.
What's the version number and all such kind of things.
And generally scans for vulnerabilities if you let it.