-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore specific url parameters when following location headers (#3856)
Co-authored-by: Jan Klopper <[email protected]> Co-authored-by: ammar92 <[email protected]>
- Loading branch information
1 parent
50273bd
commit f3c0482
Showing
10 changed files
with
83 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
17 changes: 17 additions & 0 deletions
17
octopoes/bits/ask_url_params_to_ignore/ask_url_params_to_ignore.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import json | ||
from collections.abc import Iterator | ||
from pathlib import Path | ||
from typing import Any | ||
|
||
from octopoes.models import OOI | ||
from octopoes.models.ooi.network import Network | ||
from octopoes.models.ooi.question import Question | ||
|
||
|
||
def run(input_ooi: Network, additional_oois: list, config: dict[str, Any]) -> Iterator[OOI]: | ||
network = input_ooi | ||
|
||
with (Path(__file__).parent / "question_schema.json").open() as f: | ||
schema = json.load(f) | ||
|
||
yield Question(ooi=network.reference, schema_id=schema["$id"], json_schema=json.dumps(schema)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from bits.definitions import BitDefinition | ||
from octopoes.models.ooi.network import Network | ||
|
||
BIT = BitDefinition( | ||
id="ask_url_params_to_ignore", | ||
consumes=Network, | ||
parameters=[], | ||
min_scan_level=0, | ||
module="bits.ask_url_params_to_ignore.ask_url_params_to_ignore", | ||
) |
17 changes: 17 additions & 0 deletions
17
octopoes/bits/ask_url_params_to_ignore/question_schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2019-09/schema", | ||
"$id": "/bit/oois-in-headers", | ||
"type": "object", | ||
"default": {}, | ||
"required": [ | ||
"ignored_url_parameters" | ||
], | ||
"properties": { | ||
"ignored_url_parameters": { | ||
"description": "Comma separated list of url parameters that are ignored when following location headers.", | ||
"type": "string", | ||
"pattern": "^(\\s*(,*)[^,]+,?\\s*)*$", | ||
"default": "session_id, phpsessid, jsessionid, cifd, cftoken, asp.net_sessionid" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters