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

blog: Add PortSwigger lab walkthrough (Broken brute-force protection, IP block) #2976

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

Conversation

Wryhder
Copy link

@Wryhder Wryhder commented Feb 17, 2025

@kingthorin I tried to add callouts/admonitions (called alerts in the Hugo docs) like this to match the look in the Notion doc, but it doesn't seem to work:

> [!NOTE]
> Useful information that users should know, even when skimming content.

Can I add a template for alerts as shown in the docs here?

@psiinon
Copy link
Member

psiinon commented Feb 17, 2025

Logo
Checkmarx One – Scan Summary & Details3a6ffd5d-efd9-4832-83f8-5e9a3d1bf2e6

Great job, no security vulnerabilities found in this Pull Request

@kingthorin
Copy link
Member

I'm fine with that being added.

@psiinon, @thc202 do we want those in a separate PR then rebase the blog on top after accepted/merged??

@Wryhder Wryhder deleted the branch zaproxy:main February 18, 2025 19:33
@Wryhder Wryhder closed this Feb 18, 2025
@Wryhder Wryhder deleted the main branch February 18, 2025 19:33
@Wryhder Wryhder restored the main branch February 18, 2025 19:34
@Wryhder Wryhder reopened this Feb 18, 2025
@Wryhder Wryhder force-pushed the main branch 5 times, most recently from f7f341e to 1e54b34 Compare February 20, 2025 17:56
@Wryhder
Copy link
Author

Wryhder commented Feb 20, 2025

Leaving a comment here about force-pushed changes. I added the sign-off trailer.

EDIT: @kingthorin I don't remember being prompted to sign the CLA when I created this PR. Do I need to create a PR to the CLA repo?

@kingthorin
Copy link
Member

Nope you're good, CLA isn't enabled for this repo. Thanks for checking though.

@Wryhder Wryhder marked this pull request as draft February 21, 2025 16:53
@Wryhder
Copy link
Author

Wryhder commented Feb 21, 2025

@kingthorin I was working through a different lab and realized I got some details in this walkthrough mixed up with details from another lab. I'll correct the inaccuracies and let you know when this is ready for review again.

@kingthorin
Copy link
Member

Thanks for the heads up. I hadn't gone to look at the lab at all, so we easily could have missed that.....

@psiinon
Copy link
Member

psiinon commented Feb 26, 2025

Thanks for this! As you've probably noticed we've got another Portswigger lab PR outstanding #2973 so we'll aim to get that one published first and then focus on this one 😁

@kingthorin
Copy link
Member

This can be rebased now

chibbyalucard added 5 commits March 28, 2025 02:20
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'll try to do a thorough review of the text and details over the next few days.


For eagle-eyed readers, you may notice that the URLs in the screenshots vary slightly. This is because this article was written using multiple lab instances:

 
Copy link
Member

Choose a reason for hiding this comment

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

Are these all really needed?

Copy link
Author

@Wryhder Wryhder Mar 28, 2025

Choose a reason for hiding this comment

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

Do you mean the  ? I used them to add some extra spacing where the text feels too tight against images or code blocks. I was thinking it'd be good for readability. Should I use CSS instead?

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm leave it for now, I’ll try it live tomorrow


## Resources

1. [Authentication vulnerabilities](https://portswigger.net/web-security/authentication) - PortSwigger Web Security Academy
Copy link
Member

Choose a reason for hiding this comment

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

Seems to be some extra leading space

Comment on lines 296 to 302
1. [Authentication vulnerabilities](https://portswigger.net/web-security/authentication) - PortSwigger Web Security Academy
2. [Burp to ZAP Feature Map](https://www.zaproxy.org/docs/burp-to-zap-feature-map/) - Zaproxy Docs
3. [PortSwigger Lab Walkthroughs With ZAP](https://www.zaproxy.org/tags/portswigger-lab/) - Zaproxy Docs
4. [Zaproxy Docs](https://www.zaproxy.org/docs/)
5. [Migration Guide from Nashorn to GraalJS](https://www.graalvm.org/latest/reference-manual/js/NashornMigrationGuide/) - GraalJS Docs
6. [GraalJS Compatibility](https://www.graalvm.org/latest/reference-manual/js/JavaScriptCompatibility/) - GraalJS Docs
7. [Java Interoperability](https://www.graalvm.org/jdk21/reference-manual/js/JavaInteroperability/) - GraalJS Docs
Copy link
Member

Choose a reason for hiding this comment

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

The hyphen notes at the end don't really seem to add much

@Wryhder Wryhder marked this pull request as ready for review March 28, 2025 02:55
@Wryhder
Copy link
Author

Wryhder commented Mar 28, 2025

I'll try to do a thorough review of the text and details over the next few days.

Alright, thank you!

chibbyalucard added 2 commits March 28, 2025 04:27
Signed-off-by: chibbyalucard <[email protected]>
Signed-off-by: chibbyalucard <[email protected]>
Signed-off-by: chibbyalucard <[email protected]>
Comment on lines +613 to +614
> This is due to the Fuzzer’s concurrency settings. You can enable sequential execution by setting the number of execution threads to 1. However, this slows down the Fuzzer a great deal. An alternative is to throttle requests with a small delay of 100–200 milliseconds. See [Options Fuzzer screen](https://www.zaproxy.org/docs/desktop/addons/fuzzer/options/) for more detail.

Copy link
Author

@Wryhder Wryhder Mar 28, 2025

Choose a reason for hiding this comment

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

@kingthorin Just marking out sections where I'd especially appreciate your help whenever you can take a look. I tried to make sure the ZAP-specific details are accurate, but I'm not completely certain about some parts.

Comment on lines +712 to +718
`processMessage` is executed on each message before it is sent to the server. This enables us to alter payloads as needed or to introduce delays between requests.

We didn’t need to use the `utils` and `message` parameters in `processMessage`. Still, it’s worth noting that they are injected by default when `processMessage` is called. This is similar to how the `resolve` and `reject` functions are passed as arguments to the executor function in the JavaScript Promise API. In other words, these parameters are not defined in the script’s global scope; their scope is limited to `processMessage`.

Since our script manages the entire fuzzing session and `processMessage` is executed on every message, we can use the `count` variable as an iteration counter. It tracks the number of times `processMessage` is called. Or, in other words, how many requests the Fuzzer has processed. After every three requests, we pause for one minute before sending the next.

Finally, because ZAP runs on the Java Virtual Machine (JVM), we can access the Java API from guest languages like JavaScript. Depending on how you installed ZAP, you might have manually installed a JVM yourself beforehand, or it might have been installed automatically as a dependency.
Copy link
Author

Choose a reason for hiding this comment

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

Here, too. Thanks a bunch!

Signed-off-by: chibbyalucard <[email protected]>
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