Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Commit

Permalink
add docs - helper function : split (#155)
Browse files Browse the repository at this point in the history
* typo update

* Add note to mention mandatory and optional fields

* misc update

* Update nuclei.md

fixed a small typo

* add helper function : split

* update docs helperfunctions split more detail usage

---------

Co-authored-by: Sandeep Singh <[email protected]>
Co-authored-by: sandeep <[email protected]>
Co-authored-by: shubhamrasal <[email protected]>
Co-authored-by: Pj Metz <[email protected]>
  • Loading branch information
5 people authored Jul 14, 2023
1 parent f31443a commit 58cdcdb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/faq/nuclei.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

??? warning "Is it safe to run nuclei?"

We consider two factors to say =="safe"== in context of nuclei -
We consider two factors in regards to calling nuclei =="safe"== -

1. The **traffic** nuclei makes against the target website.
2. The **impact** templates have on the target website.
Expand All @@ -62,7 +62,7 @@

!!! check "Safe Templates"

The nuclei templates project houses a variety of templates which perform fuzzing and other actions which may result in a DoS against the target system (see [the list here](https://github.com/projectdiscovery/nuclei-templates/blob/master/.nuclei-ignore)). To ensure these templates are not accidentally run, they are tagged and excluded them from the default scan. These templates can be only executed when explicitly invoked using the `-itags` option.
The nuclei templates project houses a variety of templates which perform fuzzing and other actions which may result in a DoS against the target system (see [the list here](https://github.com/projectdiscovery/nuclei-templates/blob/master/.nuclei-ignore)). To ensure these templates are not accidentally run, they are tagged and excluded them from the default scan. These templates can only be executed when explicitly invoked using the `-itags` option.

??? info "What is nuclei's license?"

Expand Down
2 changes: 1 addition & 1 deletion docs/kr/templating-guide/protocols/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ http:
# This request will be sent instead to https://api.target.com:443 to verify the token validity
- |
@Host: https://api.target.com:443
GET /api/key={{token} HTTP/1.1
GET /api/key={{token}} HTTP/1.1
Host: api.target.com:443
extractors:
Expand Down
2 changes: 2 additions & 0 deletions docs/templating-guide/helper-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Here is the list of all supported helper functions can be used in the RAW reques
| reverse(input string) string | Reverses the given input | `reverse("abc")` | `cba` |
| sha1(input interface{}) string | Calculates the SHA1 (Secure Hash 1) hash of the input | `sha1("Hello")` | `f7ff9e8b7bb2e09b70935a5d785e0cc5d9d0abf0` |
| sha256(input interface{}) string | Calculates the SHA256 (Secure Hash 256) hash of the input | `sha256("Hello")` | `185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969` |
| split(input string, n int) []string | if split has 2 parameters and second is an int,It splits string as slice of string, and len of each string is n and last of them is no more than n | `split("abcdefg", 2)` | `[ab cd ef g]` |
| split(input string, separator string, optionalChunkSize) []string | if split has 3 parameters or 2 parameters and second is string, It return a string slice where each substring is separated by the separator string and slice length no larger than optionalChunkSize. But if optionalChunkSize is negative, it's no limited and same as optionalChunkSize not set. | 1.`split("ab,cd,efg", ",", 2)` </br> 2.`split("ab,cd,efg", ",", -1)` </br> 3.`split("ab,cd,efg", ",")` | 1.`[ab cdefg] ` </br> </br></br> 2.`[ab cd efg]` </br></br></br> 3.`[ab cd efg]` |
| starts_with(str string, prefix ...string) bool | Checks if the string starts with any of the provided substrings | `starts_with("Hello", "He")` | `true` |
| to_lower(input string) string | Transforms the input into lowercase characters | `to_lower("HELLO")` | `hello` |
| to_unix_time(input string, layout string) int | Parses a string date time using default or user given layouts, then returns its Unix timestamp | `to_unix_time("2022-01-13T16:30:10+00:00")`<br>`to_unix_time("2022-01-13 16:30:10")`<br>`to_unix_time("13-01-2022 16:30:10". "02-01-2006 15:04:05")` | `1642091410` |
Expand Down
5 changes: 5 additions & 0 deletions docs/templating-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,8 @@ info:
metadata:
shodan-query: 'vuln:CVE-2021-26855'
```

!!! info "Note"
While creating a template, it's important to include the following mandatory fields: `id`, `name`, `authors` and `severity`.
If these mandatory fields are missing, then Nuclei will not proceed with such templates.
By following these guidelines, you can ensure that your templates are properly formatted and ready to be used with Nuclei.
2 changes: 1 addition & 1 deletion docs/templating-guide/protocols/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ http:
# This request will be sent instead to https://api.target.com:443 to verify the token validity
- |
@Host: https://api.target.com:443
GET /api/key={{token} HTTP/1.1
GET /api/key={{token}} HTTP/1.1
Host: api.target.com:443
extractors:
Expand Down

0 comments on commit 58cdcdb

Please sign in to comment.