Hi everyone. So in this lesson we are
going to understand about simple post-based matcher.
So far we have learned about how we
can send in match get based request. But
now we are going to understand and learn
about post-based requests and
how to match them.
So this specific lesson focuses on post-based
matcher in the body.
So you can see on the screen currently. There is
a sample template in which we can see that the
method that has been used is post and
we are matching a condition Apple in the
matches condition block, which has been
supplied in the body.
So it is the Practical time and let us see
how we can do this practically.
So I have already written a simple post body.yml template
as you can see over here.
So let's understand this template quickly. The first
is the ID block. The second is the info block
which says the name of the template which is simple post-based
matched in the body.
The most important part comes here now, which is
the request Block in which we can see we have
changed the method from get to post
which means we are going to submit a
form data.
The path is the base URL / nuclei
test underscore post dot
PHP.
You can see we are also supplying a body in which
we are giving a parameter called as search and
a value which is apple as we
can see over here and we have learned already. That body
is always in the form of a key pair
value.
We are also supplying some headers over here.
You can see a Content length header
content type header and accept header
over here.
Let's see the matches condition now in the
matches condition. We have specified that we want to
match two conditions. The first matcher is
a word type which is Apple
and the second one is
This status code which is 200, okay.
Look carefully we are matching the word which
is Apple in the body.
So let's save this quickly and let's
run this template on our Target.
Now for testing that this template has been
created correctly or no, you can always
go back to ymlint paste your
template over here and see this green valid yml
message if you get that message, which
means your template is correct and valid without
any errors.
Now we are going to use this template over here.
At this endpoint which is nuclei test
underscore post.php.
Here we can see that there is a search
box. So I'm going to search here something. So let's
say I search for Apple.
When I do that, you can see up reflection that
we get which gives us a message which means
you searched the results for Apple.
Let's capture this request as
well. So
I'm going to quickly go.
in my burp suit
open the browser.
Let me start The Intercept on let me
search for Apple again.
And you can see a request was successfully captured.
This is a post request to
a specific endpoint that we are currently sending
a request to and in the body you
can see search equals to Apple.
Let's in this request to repeater.
Let's see the response for this we can see we got a
200 response and exactly the same output that
we saw on our browser which gives us
the result saying your searched results
for Apple.
Nice, let us change this to Batman and
let's hit send and you can
see we get the output as we have
searched for Batman.
Alright, so let us test our template now,
so let's go to http history.
And let's run our template that we have written. Let's
save this template.
The name of the template is simple underscore get
Dot. Yml.
Let's go to the terminal.
The template name is simple post body Dot.
Yml.
so
we're going to specify the same name and hit enter.
Let's wait for this to run and you can see we were
successfully able to find based on
the matches condition that we have specified in
our template.
Let us also debug this and hit enter.
Here you can see this is the output of debug in
which we can see the protocol response variables.
You can see the curl command the Matched
condition the host name
for which the request was sent the header
date body server fully
qualified domain name scheme HTTP
used top level domain Arc Port
80 status code 200 exetera.
So this is additional information that you
can see that has been sent in the background which can
be seen with the help of hyphen Deepak
flag.
Let's scroll down and see you can see this is
the HTTP response and in the response, it
has successfully matched Apple in the
body.
Let's go back to Pursuit and let's see the request
here as well.
We can see the new request over here that
was sent via nuclei.
Which was a post request.
Which had search equals to Apple in the
template itself.
And we can see it successfully matched Apple over
here as well.
So I hope you guys understood that how you
can write quickly your first.
Post-based matcher body template.
Thank you.