Skip to content

Commit 93879ea

Browse files
committed
More commits (will be squashed)
1 parent c53e61a commit 93879ea

File tree

8 files changed

+211
-64
lines changed

8 files changed

+211
-64
lines changed

README.md

Lines changed: 155 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,15 @@ icon:
122122
> [!NOTE]
123123
> You can highlight important information in your articles or docs using different types of callouts (also known as admonitions – or alerts, as used in [the Hugo docs](https://gohugo.io/render-hooks/blockquotes/#alerts)).
124124
125-
For compatibility with HTML and Markdown in both content and layout files, we use a mix of shortcodes and partials to display blockquote alerts. Shortcodes on their own don't work in layout files, so you'll want to call a partial in layout files but use a shortcode (that calls the partial) in Markdown and HTML content files.
125+
For compatibility with both content and layout files, we use a mix of shortcodes and partials to display blockquote alerts. Partials work in layout, but not content files. Shortcodes work in content, but not layout files. So you'll want to call the partial in layout files but use the shortcode (it calls the partial) in content files.
126126

127127
The partial is at `site/layouts/partials/blockquote-alert.html`, and the shortcode is at `site/layouts/shortcodes/blockquote-alert.html`.
128128

129-
There are five alert types. You can use these directly in Markdown and HTML cotent files. Omit the `title` parameter to keep the alert type as the default title (for example, a note alert will have "Note" as its title):
129+
There are five alert types as shown in the examples below. Omit the `title` parameter to keep the alert type as the default title (for example, a note alert will have "Note" as its title). The descriptions for the alert types are borrowed from the Hugo docs:
130130

131131
```
132+
# Shortcodes in content files
133+
132134
{{< blockquote-alert type="note" title="Optional custom title">}}
133135
Useful information that users should know, even when skimming content.
134136
{{< /blockquote-alert >}}
@@ -147,76 +149,135 @@ Key information users need to know to achieve their goal.
147149
148150
----------------
149151
150-
{{< blockquote-alert type="warning" title="This is the title">}}
152+
{{< blockquote-alert type="warning" title="Optional custom title">}}
151153
Urgent info that needs immediate user attention to avoid problems.
152154
{{< /blockquote-alert >}}
153155
154156
----------------
155157
156-
{{< blockquote-alert type="caution" title="This is the title">}}
158+
{{< blockquote-alert type="caution" title="Optional custom title">}}
157159
Advises about risks or negative outcomes.
158160
{{< /blockquote-alert >}}
159161
```
160162

161-
You can include both simple string content, as shown above, and complex nested content with multiple paragraphs and HTML elements:
163+
For layout files, you can call the partial as shown in the examples below. Just like in the shortcode examples, any string passed into the `content` parameter is interpreted as markdown. Use `html` instead `to pass in HTML. Again, the title parameter is optional and will default to the alert type:
164+
165+
```
166+
# Partials in layout files
167+
168+
{{/* These are interpreted as Markdown */}}
169+
{{ partial "blockquote-alert.html" (dict
170+
"type" "note"
171+
"title" "Optional custom title"
172+
"content" "Useful information that users should know, even when skimming content."
173+
) }}
174+
175+
{{ partial "blockquote-alert.html" (dict
176+
"type" "tip"
177+
"title" "Optional custom title"
178+
"content" "Helpful advice for doing things better or more easily."
179+
) }}
180+
181+
{{ partial "blockquote-alert.html" (dict
182+
"type" "important"
183+
"title" "Optional custom title"
184+
"content" "Key information users need to know to achieve their goal."
185+
) }}
186+
187+
{{ partial "blockquote-alert.html" (dict
188+
"type" "warning"
189+
"title" "Optional custom title"
190+
"content" "Urgent info that needs immediate user attention to avoid problems."
191+
) }}
192+
193+
{{ partial "blockquote-alert.html" (dict
194+
"type" "caution"
195+
"title" "Optional custom title"
196+
"content" "Advises about risks or negative outcomes."
197+
) }}
198+
199+
These are also valid:
200+
201+
{{ $alertContent := `This is a tip with **bold text** and _italic_ text.
202+
203+
This is a second paragraph in the same alert.
204+
205+
- List item 1
206+
- List item 2
207+
`}}
208+
209+
{{ partial "blockquote-alert.html" (dict
210+
"type" "tip"
211+
"title" "Optional custom title"
212+
"content" $alertContent
213+
) }}
214+
215+
216+
{{ $alertContent := add
217+
"This is a tip with **bold text** and _italic_ text.\n\n"
218+
"This is a second paragraph in the same alert.\n"
219+
"- List item 1\n"
220+
"- List item 2\n\n"
221+
"`Here's some text in backticks.`"
222+
}}
223+
224+
{{ partial "blockquote-alert.html" (dict
225+
"type" "tip"
226+
"title" "Optional custom title"
227+
"content" $alertContent
228+
) }}
229+
```
162230

163-
Shortcode:
231+
You can include simple string content, as shown above, or complex nested content with multiple paragraphs and HTML elements:
164232

165233
```
166-
{{< blockquote-alert type="tip" title="Custom Title" >}}
234+
# Shortcode in content files
235+
236+
{{< blockquote-alert type="tip" title="Optional custom Title" >}}
167237
This is a tip with **bold text** and _italic_ text.
168238
169239
This is a second paragraph in the same alert.
170240
171241
- List item 1
172242
- List item 2
173243
{{< /blockquote-alert >}}
174-
```
175244
176-
For layout files, you can call the partial like so::
245+
# Partial in layout files
177246
178-
```
179247
{{ partial "blockquote-alert.html" (dict
180248
"type" "tip"
181-
"title" "Pro Tip"
182-
"content" "<p>Use partials to avoid repeating logic.</p>"
249+
"title" "Optional custom title"
250+
"content" "<p>Helpful advice for doing things better or more easily.</p>"
183251
) }}
184-
```
185-
186252
187-
**In Layout Files (calling partial directly)**
188-
189-
```go-html-template
190-
<!-- Simple text -->
191-
{{ partial "blockquote-alert" (dict "type" "important" "content" "This is an important message.") }}
192-
193-
<!-- HTML content -->
194253
{{ partial "blockquote-alert" (dict
195254
"type" "caution"
196255
"title" "Be Careful!"
197256
"content" "<p>This is a <strong>caution</strong> message.</p><p>It has multiple paragraphs.</p>"
198257
) }}
258+
```
199259

200-
<!-- Dynamic content -->
201-
{{ $alertContent := printf "<p>Page last updated: %s</p><p>Author: %s</p>" (.Lastmod.Format "January 2, 2006") .Params.author }}
202-
{{ partial "blockquote-alert" (dict "type" "note" "title" "Page Info" "content" $alertContent) }}
203260
```
261+
{{ $alertContent := `This is a tip with **bold text** and _italic_ text.
262+
263+
This is a second paragraph in the same alert.
264+
265+
- List item 1
266+
- List item 2
267+
`}}
204268
205-
**In Other Partials:**
206269
207-
```go-html-template
208-
{{ define "partials/footer-notice.html" }}
209-
{{ partial "blockquote-alert" (dict
210-
"type" "important"
211-
"title" "Subscribe"
212-
"content" "<p>Want to stay updated? <a href='/subscribe'>Join our newsletter</a>.</p>"
213-
) }}
214-
{{ end }}
215-
```
270+
{{ $alertContent := add
271+
"This is a tip with **bold text** and _italic_ text.\n\n"
272+
"This is a second paragraph in the same alert.\n"
273+
"- List item 1\n"
274+
"- List item 2\n\n"
275+
"`Here's some text in backticks.`"
276+
}}
216277
217278
**NOTE:**
218279
219-
You'll want to handle line breaks properly within the HTML content string when working with complex content. For example, the following will throw a parse error (`html: overlay: parse failed unterminated quoted string in action`):
280+
You'll want to handle line breaks properly within the content string in partials when working with complex content. For example, the following will throw a parse error (`html: overlay: parse failed unterminated quoted string in action`):
220281
221282
```
222283
{{ partial "blockquote-alert" (dict
@@ -227,19 +288,21 @@ You'll want to handle line breaks properly within the HTML content string when w
227288
) }}
228289
```
229290
230-
To fix this, you can:
291+
To fix this, use either of these options:
231292
232293
- Keep everything on a single line
233294
- Use string concatenation (whether in a variable or directly)
234295
235296
```
297+
<!-- Option #1: Keep everything on a single line -->
236298
{{ partial "blockquote-alert" (dict
237299
"type" "caution"
238300
"title" "Be Careful!"
239301
"content" "<p>This is a <strong>caution</strong> message.</p><p>It has multiple paragraphs.</p>"
240302
) }}
241303

242304
---------------
305+
<!-- Option #2: Use string concatenation (whether in a variable or directly) -->
243306

244307
{{ $alertContent := add
245308
"<p>This is a <strong>caution</strong> message.</p>"
@@ -251,7 +314,62 @@ To fix this, you can:
251314
"title" "Be Careful!"
252315
"content" $alertContent
253316
) }}
254-
```
317+
318+
This is a tip with **bold text** and _italic_ text.
319+
320+
This is a second paragraph in the same alert.
321+
322+
- List item 1
323+
- List item 2
324+
```\
325+
326+
327+
-------------------------------------------------------
328+
You can pass Markdown through the shortcode or the partial. In fact, if you use the `content` parameter, it's assumed
329+
you've passed either plain text or markdown and your content is treated as such (passed through markdownify).
330+
To pass and have your content be treated as HTML, use the `html` parameter instead.
331+
332+
(Looking for a cleaner, more readable way to format the content so it doesn't include so many tags)
333+
334+
{{ $alertContent := add
335+
"On **Windows**, you will see a message like:\n\n"
336+
"`ZAP_<version>_windows.exe isn't commonly downloaded.`\n\n"
337+
"To circumvent this warning, click **...** → **Keep** → **Show more** → **Keep anyway**.\n\n"
338+
"On **macOS**, you will see a message like:\n\n"
339+
"`\"ZAP.app\" cannot be opened because the developer cannot be verified.`\n\n"
340+
"To circumvent this warning, go to **System Preferences** > **Security & Privacy**. "
341+
"You will see a message saying that \"ZAP\" was blocked. Click **Open anyway** if you trust the installer.\n"
342+
}}
343+
344+
{{ $alertContent := `
345+
On **Windows**, you will see a message like:
346+
347+
`ZAP_<version>_windows.exe isn't commonly downloaded. Make sure you trust ZAP_<version>_windows.exe before you open it.`
348+
349+
To circumvent this warning, you would need to click on **...** and then **Keep**,
350+
then **Show more** and then **Keep anyway**.
351+
352+
On **macOS**, you will see a message like:
353+
354+
`"ZAP.app" cannot be opened because the developer cannot be verified.`
355+
356+
To circumvent this warning, go to **System Preferences** > **Security & Privacy** at the bottom of the dialog.
357+
You will see a message saying that "ZAP" was blocked. If you trust the installer, click **Open anyway**.
358+
` }}
359+
360+
{{ $alertContent := add
361+
"<p><strong>The ZAP releases are currently unsigned</strong></p>"
362+
"<p>On <strong>Windows</strong>, you will see a message like: "
363+
"<code>ZAP_&lt;version&gt;_windows.exe isn't commonly downloaded. Make sure you trust ZAP_&lt;version&gt;_windows.exe before you open it.</code><br>"
364+
"To circumvent this warning, you would need to click on <strong>...</strong> and then <strong>Keep</strong>, then "
365+
"<strong>Show more</strong> and then <strong>Keep anyway</strong>.</p>"
366+
"<p>On <strong>macOS</strong>, you will see a message like: "
367+
"<code>&quot;ZAP.app&quot; cannot be opened because the developer cannot be verified.</code><br>"
368+
"To circumvent this warning, you would need to go to <strong>System Preferences</strong> &gt; <strong>Security & Privacy</strong> at "
369+
"the bottom of the dialog. You will see a message saying that &quot;ZAP&quot; was blocked. Next to it, if you trust the "
370+
"downloaded installer, you can click <strong>Open anyway</strong>.</p>"
371+
}}
372+
-------------------------------------------------------
255373
256374
#### Layouts
257375
For controlling what HTML is rendered, you need to work with the site templates. In the directory, `site/layouts/`, you'll find a number of HTML files with various template tags. The first file to check out is `site/layouts/_default/baseof.html` - this is the base layout Hugo uses to build your site that templates extend. Hugo has a lookup order for associating a content entry to a template. A single entry whose type is post (`type: post`), Hugo will look for a layout in `site/layouts/post/single.html`, and if that does not exist, it will fallback to `site/layouts/_default/single.html`.

site/content/blog/2025-04-02-zap-updates-march-2025/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ authors:
1515

1616
## Highlights
1717

18-
> [!IMPORTANT]
19-
> The big news last month was the release of [2.16.1](/blog/2025-03-25-zap-2-16-1/)!
18+
{{< blockquote-alert type="important">}}
19+
The big news last month was the release of [2.16.1](/blog/2025-03-25-zap-2-16-1/)!
20+
{{< /blockquote-alert >}}
2021

2122
As part of this release the [Script Console](/docs/desktop/addons/script-console/) now uses the main
2223
[Output](/docs/desktop/ui/tabs/output/) tab instead of its own "Script Output" panel.
@@ -45,8 +46,9 @@ The following significant changes have been made to this website:
4546
* A new [Script Security](/docs/getting-further/script-security/) advanced guide
4647
* Even more [Authentication Tests](/docs/scans/auth/)
4748

48-
> [!NOTE]
49-
> We now have the option to highlight important information, as demonstrated here!
49+
{{< blockquote-alert type="note">}}
50+
We now have the option to highlight important information, as demonstrated here!
51+
{{< /blockquote-alert >}}
5052

5153
## GitHub Pulse
5254
Here are some statistics for the two main ZAP repositories:

site/content/blog/2025-04-09-portswigger-labs-broken-brute-force-protection-ip-block/index.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ Copy-paste the lab URL into the *URL to explore* field and launch your browser w
6161

6262
![launch-test-site-ZAP-configured-browser.png](images/launch-test-site-ZAP-configured-browser.png)
6363

64-
> [!NOTE]
65-
> If you have any issues launching your browser from ZAP, see the following pages for help. ZAP uses add-ons to enhance its core features, including ones which provide webdrivers for interfacing with supported browsers. These are installed by default and expose some configurable options:
66-
>
67-
> 1. [How can I fix 'browser was not found'?](/faq/how-can-i-fix-browser-was-not-found/) - ZAP Docs (FAQ)
68-
> 2. [Manual Explore](/docs/desktop/addons/quick-start/#manual-explore) - ZAP Docs
69-
> 3. [Selenium](/docs/desktop/addons/selenium/) - ZAP Docs
64+
{{< blockquote-alert type="note">}}
65+
If you have any issues launching your browser from ZAP, see the following pages for help. ZAP uses add-ons to enhance its core features, including ones which provide webdrivers for interfacing with supported browsers. These are installed by default and expose some configurable options:
66+
67+
1. [How can I fix 'browser was not found'?](/faq/how-can-i-fix-browser-was-not-found/) - ZAP Docs (FAQ)
68+
2. [Manual Explore](/docs/desktop/addons/quick-start/#manual-explore) - ZAP Docs
69+
3. [Selenium](/docs/desktop/addons/selenium/) - ZAP Docs
70+
{{< /blockquote-alert >}}
7071

7172
Assuming you’ve opened the lab in a browser configured to proxy through ZAP, let’s try to log in with a random password. We want to capture a POST request we can work with in ZAP. I’ll try “randompass”. We’re notified that this is an “Incorrect password”, which is expected:
7273

@@ -96,8 +97,9 @@ After one minute, we can indeed make more login attempts. The idea is that if we
9697

9798
If we enter our own credentials, `wiener:peter`, on every third login attempt, the IP block never activates. Each successful login resets the counter tracking the number of failed login attempts. We can keep going until we’ve tried enough passwords from our wordlist to find the right one for Carlos' account.
9899

99-
> [!NOTE]
100-
> This bypass — taking advantage of a logic flaw to reset the failure counter — enables us to brute-force Carlos’ password and successfully solve this lab. Although not the point of the lab, we can also wait out the IP block since we’re dealing with only a few credentials. This is covered in “Method 2: Wait Out the IP Block”.
100+
{{< blockquote-alert type="note">}}
101+
This bypass — taking advantage of a logic flaw to reset the failure counter — enables us to brute-force Carlos’ password and successfully solve this lab. Although not the point of the lab, we can also wait out the IP block since we’re dealing with only a few credentials. This is covered in “Method 2: Wait Out the IP Block”.
102+
{{< /blockquote-alert >}}
101103

102104
What about changing our IP address? I used the [`X-Forwarded-For`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-For) header successfully in another lab. But the server here appears to block IPs based on the client's actual IP address (determined by the network layer rather than HTTP headers from the application layer), which makes sense in the context of rate-limiting. Rotating IP addresses via a proxy or VPN could work, but we won’t explore that here.
103105

@@ -564,8 +566,9 @@ All functions, except the `log` function, are part of a required interface that
564566

565567
![implementation-error.png](images/implementation-error.png)
566568

567-
> [!NOTE]
568-
> Refer to the default templates for the interfaces required for each script type. You can find these in the Templates section of the Scripts tab. They include documentation comments describing each function and its parameters. You can also create new scripts from the templates.
569+
{{< blockquote-alert type="note">}}
570+
Refer to the default templates for the interfaces required for each script type. You can find these in the Templates section of the Scripts tab. They include documentation comments describing each function and its parameters. You can also create new scripts from the templates.
571+
{{< /blockquote-alert >}}
569572

570573
You can save the file now. Also, check that the script is enabled, as disabled scripts won’t be available for selection when needed. If you missed the *Enable* checkbox earlier, you can right-click the filename in the *Scripts* tab and select *Enable Script(s)*.
571574

@@ -583,10 +586,11 @@ After you open the *Add Payload* dialog, you can add the Payload Generator scrip
583586

584587
Save the payload and return to the main Fuzzer dialog. Then, run the Fuzzer with *Start Fuzzer*.
585588

586-
> [!IMPORTANT]
587-
> You might notice that even though the payloads are generated correctly (as the logs in the script output panel show), the requests are sent in the wrong order. This causes an unexpected IP block early on. As a result, most of the requests are rejected with the message: `You have made too many incorrect login attempts. Please try again in 1 minute(s).`
588-
>
589-
> 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](/docs/desktop/addons/fuzzer/options/) for more detail.
589+
{{< blockquote-alert type="important">}}
590+
You might notice that even though the payloads are generated correctly (as the logs in the script output panel show), the requests are sent in the wrong order. This causes an unexpected IP block early on. As a result, most of the requests are rejected with the message: `You have made too many incorrect login attempts. Please try again in 1 minute(s).`
591+
592+
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](/docs/desktop/addons/fuzzer/options/) for more detail.
593+
{{< /blockquote-alert >}}
590594

591595
You can skip over the next section and head to [Have Username, Got Password](#have-username-got-password).
592596

@@ -715,8 +719,9 @@ You can optionally move the script to the top of the processor list. Then, run t
715719

716720
Once the Fuzzer is done, we can inspect the results. We’re looking for indications of a successful login. So, we’ll sort the results in descending order using the status code column (simply “*Code”* in the UI).
717721

718-
> [!NOTE]
719-
> Both of these solutions are valid. As you might have noticed if you’ve solved a lab more than once, different lab instances can have different password solutions. So, you could see different passwords than shown below.
722+
{{< blockquote-alert type="note">}}
723+
Both of these solutions are valid. As you might have noticed if you’ve solved a lab more than once, different lab instances can have different password solutions. So, you could see different passwords than shown below.
724+
{{< /blockquote-alert >}}
720725

721726
### Method 1: Interleave Wordlists With Valid Credentials
722727

site/content/docs/getting-further/script-security.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ For more details on ZAP’s security posture see the
2222
### Script Capabilities
2323
As noted on the [Script Console](/docs/desktop/addons/script-console/) page:
2424

25-
> [!WARNING]
26-
> Scripts run with the same permissions as ZAP, so do not run any scripts that you do not trust!
25+
{{< blockquote-alert type="warning">}}
26+
Scripts run with the same permissions as ZAP, so do not run any scripts that you do not trust!
27+
{{< /blockquote-alert >}}
2728

2829
All scripts can call other scripts and any command line tools that are accessible to them based on OS permissions.
2930
Scripts can access any online services unless restricted by firewalls or similar.

0 commit comments

Comments
 (0)