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

Script to solve burp labs or for bug bounty #340

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

timruff
Copy link

@timruff timruff commented May 17, 2023

Just simple script to add IP random to X-Forwarded-For: in Header request.
For section HTTP Sender

@thc202
Copy link
Member

thc202 commented May 17, 2023

Would be good to mention the original script, maybe it can be removed too since the HTTP Sender applies to fuzzer messages as well.

@timruff
Copy link
Author

timruff commented May 17, 2023

I can't get random_x_forwarded_for_ip.js to work in Fuzzer HTTP processor. In the fuzzer the script does not appear, in the response the x-forwarded-for-ip does not appear.
The only way to do it was the script I put.

Copy link
Author

@timruff timruff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove name and add comment to script origine

@timruff
Copy link
Author

timruff commented May 17, 2023

I'm sorry, I just understood how to use the random_x_forwarded_for_ip.js script, I see how why my script is not necessary. Thanks for the time spent on the problem.

@timruff timruff closed this May 17, 2023
@thc202 thc202 reopened this May 17, 2023
@thc202
Copy link
Member

thc202 commented May 17, 2023

It's the other way around, this script supersedes the other script and why was suggesting to remove the other script, though both cover their own use cases.

@@ -1,4 +1,4 @@
// @author Ruffenach Timothée
// The original script comes from the Fuzzer HTTP Processor section under the name random_x_forwarded_for_ip.js
Copy link
Member

@thc202 thc202 May 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not saying to remove the name, just mention the other script. This is for maintenance purposes, if changes are done in one script they most likely need to be done in both.

@@ -0,0 +1,84 @@
# Version 1.0
# @author RUFFENACH Timothée
# Script inspired from https://02108124551050482571.googlegroups.com/attach/54c6e34f6fe20/message_processor.js?part=0.1&view=1&vt=ANaJVrEJuACewYorhYYa_zyhyMSug06pmlERCqfYdLsukQBC3OW3LATuXG1WHk_Fw9a0nhexG8ykFDuFgBGYrKAg_pOQ61M36MwC9SOBGvK4KLZn3eDkNzY (dot run on owasp 2.12.0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dot run on owasp 2.12.0

?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

legacy script in javascript don't run with owasp 2.12.0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not a ZAP issue that's a JRE issue. If you're using a Java 11 JRE it'll still run.

Also OWASP is the organization ZAP is the project/product 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to the thread/post rather than the attachment, which should be more reliable.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't found the original post.

# The script fuzz in mode pitchfork.
# To Use : Enable script.
# In fuzzer Add 2 EmptyNull with good number.
# Select two 2 files and launch the fuzzer.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a double space between launch and the.

Comment on lines 55 to 59
fileChooser.setMultiSelectionEnabled(True)
filePath1 = ""
result = fileChooser.showOpenDialog(None)

if result == JFileChooser.APPROVE_OPTION:
selectedFiles = fileChooser.getSelectedFiles()
for file in selectedFiles:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to allow multi-select? If only single files could be selected wouldn't that remove the need to loop?

Also since this logic is the same for both files can't it just be extracted to a method?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in the EDT also.

# Script inspired from https://02108124551050482571.googlegroups.com/attach/54c6e34f6fe20/message_processor.js?part=0.1&view=1&vt=ANaJVrEJuACewYorhYYa_zyhyMSug06pmlERCqfYdLsukQBC3OW3LATuXG1WHk_Fw9a0nhexG8ykFDuFgBGYrKAg_pOQ61M36MwC9SOBGvK4KLZn3eDkNzY (dot run on owasp 2.12.0)
# The script fuzz in mode pitchfork.
# To Use : Enable script.
# In fuzzer Add 2 EmptyNull with good number.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# In fuzzer Add 2 EmptyNull with good number.
# In the Fuzzer add 2 EmptyNull payloads with a good number of iterations.

@timruff
Copy link
Author

timruff commented May 20, 2023

I made some correction and integrated the multiple payloads management.

@kingthorin
Copy link
Member

Why are more and more files being added to this PR?

@kingthorin
Copy link
Member

timruff added 16 commits June 5, 2023 22:03
Signed-off-by: Timothée Ruffenach <[email protected]>
Signed-off-by: Timothée Ruffenach <[email protected]>
Signed-off-by: Timothée Ruffenach <[email protected]>
Signed-off-by: Timothée Ruffenach <[email protected]>
@timruff
Copy link
Author

timruff commented Jun 5, 2023

I'm doing courses on zap proxy to do burp suite labs with zap proxy. I need to make scripts to fix labs or bounty bugs. I don't know much about git hub it my first contribution on other project with github.

@kingthorin
Copy link
Member

Okay that makes more sense I guess. They're all useful. Might want to tweak the title/subject and maybe make it draft (until you've included everything you're thinking of).

@timruff timruff changed the title add script AddHeaderXForwarderdForRandomIP.js Script to solve burp labs or for bug bounty Jun 5, 2023
Copy link
Member

@kingthorin kingthorin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't get through all the "standalone" scripts, but here's more feedback.

Comment on lines 23 to 24
if (init == False):
initialise()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "shouldInit" should be more clear to future users/maintainers?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok Im have rename to shouldInit


# Called after receiving the fuzzed message from the server
def processResult(utils, fuzzResult) :
global isChek,time
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isCheck?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename isCheck by choice

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point was that it's misspelled here.

Comment on lines 29 to 30
time = getNumber(1,50000,"how many time do you want ?")
isCheck = JOptionPane.showConfirmDialog(None, "more high or equal (YES) esle less or equal (NO)", "Confirm", JOptionPane.YES_NO_OPTION)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This English is rough, I'm happy to help but I need a better description of what's meant here.

They should both start with capitals and there's a type in "else".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the sentences for more understanding, sorry my native language is not english

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, that's why I was offering to help 👍

Comment on lines 37 to 42
if isCheck == JOptionPane.YES_OPTION and (int(fuzzResult.getHttpMessage().getTimeElapsedMillis()) >= time):
return bool(1)
elif isCheck == JOptionPane.NO_OPTION and (int(fuzzResult.getHttpMessage().getTimeElapsedMillis()) <= time):
return bool(1)
else:
return bool(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason these can't just return true or false?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok i have changed by TRUE and FALSE


# ask stings to find
while entry == "":
entry = getString("what character string do you want to find ?")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
entry = getString("what character string do you want to find ?")
entry = getString("What character string do you want to find ?")

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the changes and make correction of other sentence

while number == -1:
number = chooseNumber()

# choose file user
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, is here the files of users are add. i have modified the comment by "add files chosen by the user"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really worth including this? Aren't the URLs specific to your lab/academy instance at the time?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but in the course I said to change the address.
it is possible to make a dialog box in zest to ask for the URLs ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm good question, I've never tried that with zest. Hopefully someone else on the team can answer.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
In Edit Zest Scrip the prefix seems modifiable but that the modification it is impossible to save it.

payloadprocessor/full_HTML_encode.py Outdated Show resolved Hide resolved
biid = getString("what is your biid ?")

# Get number for update info
update = getNumber(1,3600, "how many time do you want refresh information ?")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
update = getNumber(1,3600, "how many time do you want refresh information ?")
update = getNumber(1,3600, "How many times do you want refresh information ?")


def main():
global biid
biid = getString("what is your biid ?")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
biid = getString("what is your biid ?")
biid = getString("What is your biid ?")

Will "biid" be clear to a user because I have no idea what it is.

Copy link
Author

@timruff timruff Jun 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The biid is a token of burp collaborator protection, i wireshark the token name is biid. Look link https://www.onsecurity.io/blog/persistent-access-to-burp-suite-sessions-step-by-step-guide/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the meaning of biid but I know that it stores the user's secret key.
I replaced What is your biid ? by What is your secret key (biid) ?
The capital letters have been put.

@kingthorin
Copy link
Member

It's going to be really hard for us to review this and move it along if you don't pick a "line in the sand".

You can always create another branch or something for future contribs.

Comment on lines +1 to +3
# @author Timothée Ruffenach
# Version 1.0
# decode HTML Entities
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not valid comment for JavaScript (there are others that need to be corrected).

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

Successfully merging this pull request may close these issues.

3 participants