-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwp_config.py
More file actions
executable file
·57 lines (50 loc) · 1.69 KB
/
wp_config.py
File metadata and controls
executable file
·57 lines (50 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import json
import os
import sys
folder_path = os.path.dirname(os.path.abspath(__file__))
secret = "wp_secret.py"
if not os.path.exists(secret):
with open(secret, 'w+') as f:
print("DATABASE_URL_ASYNC = 'postgresql+asyncpg://<database username>:<password>@localhost:5432/<db_name>'", file=f)
print(f"Please, edit {secret}", file=sys.stderr)
exit(0)
else:
from wp_secret import DATABASE_URL_ASYNC, WPSCAN_API
DEFAULT_CONFIG = {
"wp_hub": {
"folder_path": folder_path,
"output_folder": f"./output/",
"wordlist_folder": f"./wordlists/",
"color_output": True,
},
"wp_dorker": {
'max_search_result_urls_to_retucewlrn_per_dork': 5,
'rewrite_link_list': True,
'dork_filter' : "site:.cz"
},
"wp_db": {
"DATABASE_URL_ASYNC": DATABASE_URL_ASYNC,
},
"wp_scanner": {
'max_workers': 10,
'cewl_input': " --min_word_length 5 --depth 1 -w {} {} ",
'wpscan_api': WPSCAN_API,
}
}
global CONFIG
def generate_default():
with open("config.json", 'w') as f:
json.dump(CONFIG, f, indent=4)
def load_config(config_file="config.json"):
global CONFIG
CONFIG = DEFAULT_CONFIG.copy()
if os.path.exists(config_file):
with open(config_file, 'r') as f:
file_config = json.load(f)
CONFIG.update(file_config)
os.makedirs(CONFIG['wp_hub']['output_folder'], mode=0o777, exist_ok=True)
os.makedirs(CONFIG['wp_hub']['wordlist_folder'], mode=0o777, exist_ok=True)
load_config()
if __name__ == "__main__":
if '--generate_default' in sys.argv:
generate_default()