Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query #38

Open
jaikishantulswani opened this issue Feb 3, 2023 · 62 comments
Open

Query #38

jaikishantulswani opened this issue Feb 3, 2023 · 62 comments

Comments

@jaikishantulswani
Copy link

@smxiazi What if a default check is also added by adding - just before the parameter value like:
test=1 to test=-1

@jaikishantulswani
Copy link
Author

jaikishantulswani commented Feb 10, 2023

@smxiazi even it only test first 2 parameters on the json body and left the third one untested if the json body is like

{"id":1,"aid":"2","reg":["abc"]}

so it test id aid and left reg without tesitng

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

image

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

image

@jaikishantulswani
Copy link
Author

@smxiazi if you put - in betwen abc with another string like the body

{"id":1,"aid":"2","reg":["abc-xyz"]}

it is not going to test abc-xyz

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

image

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

In order to reduce the number of duplicate packets sent, under the parameters of the same URL, if the parameter name does not change, but the value of the parameter changes, it will not be sent twice.

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

If you want to scan again, you can right click and send it to the plug-in.

@jaikishantulswani
Copy link
Author

@smxiazi it is not working on my
Screenshot from 2023-02-10 13-16-25

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

I don't know. It may take me to get an English version to get rid of these problems, but I'm lazy and it will take a long time.

@jaikishantulswani
Copy link
Author

jaikishantulswani commented Feb 10, 2023

@smxiazi would it be possible to append - before every parameter value

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

Why is there such a requirement? What is the situation in this scenario.

@jaikishantulswani
Copy link
Author

@smxiazi there are also scenarios where the sql error got caught with - and -- before the parameter value. It would also be good if you also add feature to color the request which have sql error messages

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

In this scenario, does it only exist in digital type.

@jaikishantulswani
Copy link
Author

what is digital type

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

Number type

@jaikishantulswani
Copy link
Author

@smxiazi the post body is like :

{"Id":"12","hyp":"1.0."}

so it get caught at hyp parameter whenever we append - or --

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

In this case, it only applies to the "id" parameter, not the "hyp" parameter, right?

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

What is the difference between this case and -1 -0?

@jaikishantulswani
Copy link
Author

@smxiazi it applied to hyp parameter because I use it like

{"Id":"12","hyp":"-1.0."}

and it got a sql issue

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

@jaikishantulswani The value of the parameter of hyp is "1.0." Is this still applicable? Isn't it a string?

@jaikishantulswani
Copy link
Author

yes it is considered as string

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

So "- --" will it apply to integer type and string type?

@jaikishantulswani
Copy link
Author

string type

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

I just went to test that the integer type is applicable, but the string type is not.

@jaikishantulswani
Copy link
Author

@smxiazi here I am getting the error on string type

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

@jaikishantulswani Can you take a picture and show it to me? I feel that my understanding is not quite right.

@jaikishantulswani
Copy link
Author

@smxiazi the request is like

POST /x HTTP/1.1
Host: xyz
Cookie: 
User-Agent: Mozilla/5.0 
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json

{"Id":"12","hyp":"-1.0.0"}

Response

You have an error in your SQL syntax

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

select user from admin where user="xxxx";
and
select user from admin where user="-xxxx";
select user from admin where user="--xxxx";

Then he won't error.

Do you know how to write his back-end statement?

@jaikishantulswani
Copy link
Author

@smxiazi don't know about this side

@jaikishantulswani
Copy link
Author

jaikishantulswani commented Feb 10, 2023

@smxiazi rekon to this SELECT user FROM admin WHERE user='xxxx';
SELECT user FROM admin WHERE user='-xxxx';

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

image

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

no error

@jaikishantulswani
Copy link
Author

jaikishantulswani commented Feb 10, 2023

@smxiazi then why should I am getting this sql issue through the response any idea

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

I can't understand that adding "-" in front of the string, and then the response package will display the sql error statement. I haven't encountered this scenario. I especially want to know about this section. Is there any relevant article.

@jaikishantulswani
Copy link
Author

@smxiazi may be doing negative to the value throwing the issue.

param = -5

sql = "SELECT * FROM table WHERE column = {}".format(-param)

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

Yes, I know that if the value of the parameter is of integer type, it will apply. What I can't understand now is the string type. How can it cause the return package to display the database error message.

@jaikishantulswani
Copy link
Author

jaikishantulswani commented Feb 10, 2023

@smxiazi no idea about that meanwhile can you add color feature by grabbing the common sql error to show the affected request

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

This function has been added, but instead of highlighting it, "Err" has been added.

image

@jaikishantulswani
Copy link
Author

@smxiazi Great, can you add error from this tool which are enough to detect the issue.

https://github.com/eslam3kl/SQLiDetector/blob/main/txt/sql_errors.txt

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

Very good content. I think we can choose some of them, otherwise it will consume too much CPU.

@jaikishantulswani
Copy link
Author

@smxiazi some of the most common which can detect.

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

image

@jaikishantulswani
Copy link
Author

jaikishantulswani commented Feb 10, 2023

@smxiazi looks good or can we also add custom error type like the payload text box

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

Good idea

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

You're really going to give me extra tasks

@jaikishantulswani
Copy link
Author

@smxiazi 👍🏻

@smxiazi
Copy link
Owner

smxiazi commented Feb 10, 2023

The update is completed, and you are also included in the thank you list.

@jaikishantulswani
Copy link
Author

@smxiazi Thank you for this great tool. 💯

@jaikishantulswani
Copy link
Author

@smxiazi It would be helpful if an export feature or filter feature is implemented like if we have thousands of request which are passing through this, so we need to check one by one on which the Err or time delay is happen.
So it is easy for user to export or filter the vulnerable requests to test them further.

@jaikishantulswani
Copy link
Author

@smxiazi one request, can you please provide an unofficial version of the same to replace parameter value with provided payload to test outbound dns interaction like:

Request

GET /path/lame?one=test&two=rest HTTP/1.1
Host: example.com
Cookie:
Sec-Ch-Ua-Mobile: ?0
Connection: close

add outbound dns resource to every parameter one by one on both GET and POST

Mod Request

GET /path/lame?one=myserver.example.com&two=rest HTTP/1.1
Host: example.com
Cookie:
Sec-Ch-Ua-Mobile: ?0
Connection: close

Mod Request

GET /path/lame?one=test&two=myserver.example.com HTTP/1.1
Host: example.com
Cookie:
Sec-Ch-Ua-Mobile: ?0
Connection: close

@smxiazi
Copy link
Owner

smxiazi commented Mar 6, 2023

diy payload can meet your needs.

@jaikishantulswani
Copy link
Author

jaikishantulswani commented Mar 6, 2023

@smxiazi but on diy payloads it is not replacing the whole value as it is doing like ?test=one'
I want to replace whole value and add dns resource like ?test=myserver.example.com

or it would be good to add a checkbox option to test outbound dns interactions

@smxiazi
Copy link
Owner

smxiazi commented Mar 6, 2023

Just today, I just updated the diy payload without default payload

@jaikishantulswani
Copy link
Author

@smxiazi so does it work with dns resource too ?

@smxiazi
Copy link
Owner

smxiazi commented Mar 6, 2023

There is no added dns resource from burp. You can fill in the domain name of your dns in the diy payload.

@jaikishantulswani
Copy link
Author

Hi @smxiazi It is working good with GET values when we use to replace full parameter value with our dns resource but not working well with POST request as in POST request it is appending the dns resource with the value

POST /_ary HTTP/1.1
Host: example.com
Cookie: 
Connection: close

{"filter":"ValueFromOriginalRequesthttps://mydnsresourceexample.com"}

@jaikishantulswani
Copy link
Author

Hi @smxiazi Waiting for an update specially for this as it is not replacing POST parameter with dns resource, it is working good with GET but with POST it is like:

POST /_ary HTTP/1.1
Host: example.com
Cookie: 
Connection: close

{"filter":"ValueFromOriginalRequesthttps://mydnsresourceexample.com"}

@jaikishantulswani
Copy link
Author

Hi @smxiazi Waiting for an update specially for this as it is not replacing POST parameter with dns resource, it is working good with GET but with POST it is like:

POST /_ary HTTP/1.1
Host: example.com
Cookie: 
Connection: close

{"filter":"ValueFromOriginalRequesthttps://mydnsresourceexample.com"}

@smxiazi

@jaikishantulswani
Copy link
Author

@smxiazi waiting for an update on this as this is still not working on json body parameters as you see above and not replacing every parameters, please check.

@jaikishantulswani
Copy link
Author

Hi @smxiazi Waiting for an update specially for this as it is not replacing POST parameter with dns resource, it is working good with GET but with POST it is like:

POST /_ary HTTP/1.1
Host: example.com
Cookie: 
Connection: close

{"filter":"ValueFromOriginalRequesthttps://mydnsresourceexample.com"}

@smxiazi

@smxiazi Waiting for your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants