Hello everyone and welcome to this lesson
in this lesson. We are going to learn about base request
that I've been used by nuclei from
the nuclear template.
As we have seen the info in the ID block.
Now we are going to understand about the request block.
So the request block contains request methods now,
this could be different HTTP methods
like get post put delete options
Etc.
You can also specify if you want to redirect to
happen with the help of redirects.
Each request should be given a path using
a path column.
There are also Dynamic path variables that
you should keep in mind while you are going to write a
custom nuclei template.
As you can see over here on your left here is
the keyword here is the description for each keyword and
the example as well.
Let us understand the first one, which is the base URL.
So whenever you see base URL in the
template, it will replace the base URL
variable with the input URL that
you have supplied.
So the example would look something like this.
The second is the root URL.
Which replaces with the root URL that has been
provided not with the base URL
or the endpoint?
Next is the host name.
So this replaces with
the hostname and the port number that you have supplied during the
scan example would look something like this.
Next is the host which replaces only the
host name, which is
this
Port replaces the port number which is
like this path which replaces with the
path for example slash test a specific
file for example example.txt or
if you want to replace or change the scheme, you
can also do that with this scheme variable.
So it is the Practical time and let's see how we
can use Dynamic variables in nuclei templates.
So as you can see over here, this is our
ID and the info block.
In the request block we have specified the
HTTP method
as get.
You can also see over here the dynamic path that we have
provided. The first is the base URL second is
the root URL then HTTP colon
slash slash hostname host base
URL cooling Port https. Colon
slash slash hacktify.in path.
And then hacktify dot in slash file.
What we are going to do right now is for demonstration.
I have hosted a file
called as file 1.txt inside a
nuclei path on bug bounty hunter.org.
So you can also use this for practicing while
you're creating your custom templates to validate
if your custom templates are working correctly or
no?
Alright, so we are going to test against this target against file
1.txt file and path nuclei.
I'm going to quickly go to my terminal and I'm going
to say eco.
and
the target with the path in
the file both. I'm going
to provide this as a standard input to nuclei and
I'm going to run a template that we have
created just now which is request.yml, which
is this template.
Now, let's provide this template to nuclei and
add - viveen V
stats for verbose which means we will
be able to see what exactly is happening currently.
Once we hit enter you can see the first request has
been sent correctly to this endpoint at
file.txt. Let's open the request
blocks as well and the terminal
both
you can see the second request that was sent
like this, which is for the first
one was the base URL second is the root URL. Next
is the host name that was provided.
Next is the host which was provided
as can be seen over here. The next is the port
number path and file. So let us see
this as well.
So this is the port number which automatically got
added. This is the file path
and this is the file
itself. So I hope
you are in clear idea of dynamic variables
of how it has been used while you can
create the same thing in your nuclei template.
Thank you.