ShadowB 0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ShadowB/Core/fileorg.py +38 -0
- ShadowB/Core/randwords.py +76 -0
- ShadowB/GetD/make_cookies.py +27 -0
- ShadowB/GetD/my_data.py +86 -0
- ShadowB/GetD/my_ip.py +12 -0
- ShadowB/GetD/scan.py +72 -0
- ShadowB/Image/check_image.py +39 -0
- ShadowB/Image/export_metadata.py +96 -0
- ShadowB/Image/extr_hidden_files.py +44 -0
- ShadowB/Image/extr_hidden_text.py +39 -0
- ShadowB/Image/makeFile.py +48 -0
- ShadowB/Image/makeText.py +41 -0
- ShadowB/Image/remove_metadata.py +48 -0
- ShadowB/Mail/make_mail.py +36 -0
- ShadowB/Mail/res_msj.py +44 -0
- ShadowB/Mail/send_msj.py +13 -0
- ShadowB/Qrcode/generate.py +35 -0
- ShadowB/Qrcode/scan.py +26 -0
- ShadowB/Safe/clean.py +127 -0
- ShadowB/Safe/cleanText.py +37 -0
- ShadowB/Safe/ext.py +5 -0
- ShadowB/Safe/filename.py +6 -0
- ShadowB/Safe/safeFile.py +171 -0
- ShadowB/__init__.py +44 -0
- ShadowB/captcha.py +73 -0
- ShadowB/core.py +106 -0
- ShadowB/getD.py +28 -0
- ShadowB/image.py +31 -0
- ShadowB/mail.py +21 -0
- ShadowB/passwords.py +47 -0
- ShadowB/qrcode.py +10 -0
- ShadowB/safe.py +80 -0
- ShadowB/search.py +50 -0
- shadowb-0.1.dist-info/LICENSE +21 -0
- shadowb-0.1.dist-info/METADATA +200 -0
- shadowb-0.1.dist-info/RECORD +38 -0
- shadowb-0.1.dist-info/WHEEL +5 -0
- shadowb-0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
try:
|
|
2
|
+
import requests
|
|
3
|
+
except:
|
|
4
|
+
import os
|
|
5
|
+
os.system("pip install requests")
|
|
6
|
+
import requests
|
|
7
|
+
|
|
8
|
+
import random
|
|
9
|
+
import string
|
|
10
|
+
import time
|
|
11
|
+
|
|
12
|
+
BASE_URL = "https://api.mail.tm"
|
|
13
|
+
|
|
14
|
+
def random_string(length=10):
|
|
15
|
+
return "".join(random.choices(string.ascii_lowercase + string.digits, k=length))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def create_temp_email():
|
|
19
|
+
domains_resp = requests.get(f"{BASE_URL}/domains")
|
|
20
|
+
domains_resp.raise_for_status()
|
|
21
|
+
domain = domains_resp.json()["hydra:member"][0]["domain"]
|
|
22
|
+
username = random_string()
|
|
23
|
+
password = random_string(14)
|
|
24
|
+
address = f"{username}@{domain}"
|
|
25
|
+
create_resp = requests.post(
|
|
26
|
+
f"{BASE_URL}/accounts",
|
|
27
|
+
json={"address": address, "password": password},
|
|
28
|
+
)
|
|
29
|
+
create_resp.raise_for_status()
|
|
30
|
+
token_resp = requests.post(
|
|
31
|
+
f"{BASE_URL}/token",
|
|
32
|
+
json={"address": address, "password": password},
|
|
33
|
+
)
|
|
34
|
+
token_resp.raise_for_status()
|
|
35
|
+
token = token_resp.json()["token"]
|
|
36
|
+
return (address,password,token)
|
ShadowB/Mail/res_msj.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
try:
|
|
2
|
+
import requests
|
|
3
|
+
except:
|
|
4
|
+
import os
|
|
5
|
+
os.system("pip install requests")
|
|
6
|
+
import requests
|
|
7
|
+
|
|
8
|
+
import random
|
|
9
|
+
import string
|
|
10
|
+
import time
|
|
11
|
+
|
|
12
|
+
BASE_URL = "https://api.mail.tm"
|
|
13
|
+
|
|
14
|
+
def get_messages(token):
|
|
15
|
+
headers = {"Authorization": f"Bearer {token}"}
|
|
16
|
+
resp = requests.get(f"{BASE_URL}/messages", headers=headers)
|
|
17
|
+
resp.raise_for_status()
|
|
18
|
+
return resp.json()["hydra:member"]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def get_message_details(token, message_id):
|
|
22
|
+
headers = {"Authorization": f"Bearer {token}"}
|
|
23
|
+
resp = requests.get(f"{BASE_URL}/messages/{message_id}", headers=headers)
|
|
24
|
+
resp.raise_for_status()
|
|
25
|
+
return resp.json()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def print_messages_separately(token):
|
|
29
|
+
messages = get_messages(token)
|
|
30
|
+
if not messages:
|
|
31
|
+
print("None")
|
|
32
|
+
return
|
|
33
|
+
|
|
34
|
+
for i, msg in enumerate(messages, start=1):
|
|
35
|
+
sender = msg["from"]["address"]
|
|
36
|
+
date = msg["createdAt"]
|
|
37
|
+
subject = msg["subject"]
|
|
38
|
+
|
|
39
|
+
print("=" * 50)
|
|
40
|
+
print(f"msj #{i}")
|
|
41
|
+
print(f"from : {sender}")
|
|
42
|
+
print(f"date : {date}")
|
|
43
|
+
print(f"subject : {subject}")
|
|
44
|
+
print("=" * 50)
|
ShadowB/Mail/send_msj.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import smtplib
|
|
2
|
+
from email.mime.text import MIMEText
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def send_email(sender, app_password, to, subject, body):
|
|
6
|
+
msg = MIMEText(body)
|
|
7
|
+
msg["Subject"] = subject
|
|
8
|
+
msg["From"] = sender
|
|
9
|
+
msg["To"] = to
|
|
10
|
+
|
|
11
|
+
with smtplib.SMTP_SSL("smtp.gmail.com", 465) as server:
|
|
12
|
+
server.login(sender, app_password)
|
|
13
|
+
server.send_message(msg)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
try:
|
|
5
|
+
import qrcode
|
|
6
|
+
except ImportError:
|
|
7
|
+
os.system(f"{sys.executable} -m pip install qrcode[pil]")
|
|
8
|
+
import qrcode
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def qrcode(text, name="qrcode"):
|
|
13
|
+
output_filename = f"{name}.png"
|
|
14
|
+
try:
|
|
15
|
+
qr = qrcode.QRCode(
|
|
16
|
+
version=1,
|
|
17
|
+
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
|
18
|
+
box_size=10,
|
|
19
|
+
border=4,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
qr.add_data(text)
|
|
24
|
+
qr.make(fit=True)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
img = qr.make_image(fill_color="black", back_color="white")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
img.save(output_filename)
|
|
31
|
+
|
|
32
|
+
print(f"[+] QRCode was generated successfully : '{output_filename}'")
|
|
33
|
+
|
|
34
|
+
except Exception as e:
|
|
35
|
+
print(f"[-] Error : {e}")
|
ShadowB/Qrcode/scan.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
try:
|
|
5
|
+
import cv2
|
|
6
|
+
except ImportError:
|
|
7
|
+
os.system(f"{sys.executable} -m pip install opencv-python")
|
|
8
|
+
import cv2
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def scan(qrcode_path):
|
|
12
|
+
if not os.path.exists(qrcode_path):
|
|
13
|
+
return None
|
|
14
|
+
|
|
15
|
+
try:
|
|
16
|
+
img = cv2.imread(qrcode_path)
|
|
17
|
+
detector = cv2.QRCodeDetector()
|
|
18
|
+
data, bbox, _ = detector.detectAndDecode(img)
|
|
19
|
+
|
|
20
|
+
if bbox is not None and data:
|
|
21
|
+
return data
|
|
22
|
+
else:
|
|
23
|
+
return None
|
|
24
|
+
|
|
25
|
+
except Exception:
|
|
26
|
+
return None
|
ShadowB/Safe/clean.py
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import re
|
|
3
|
+
|
|
4
|
+
try:
|
|
5
|
+
from pypdf import PdfReader
|
|
6
|
+
except:
|
|
7
|
+
import os
|
|
8
|
+
os.system("pip install pypdf")
|
|
9
|
+
from pypdf import PdfReader
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
from better_profanity import profanity
|
|
13
|
+
except ImportError:
|
|
14
|
+
import os
|
|
15
|
+
os.system("pip install better_profanity")
|
|
16
|
+
from better_profanity import profanity
|
|
17
|
+
|
|
18
|
+
custom_bad_words = ["irheb","de3ch","israil","اسرائيل","trump","ارهاب","إرهاب","zab", "zebi", "asba","3asba","nyk","nayek","nik","nik omk","3asba lik","mnayek","fuck","shit","fuck you","fuck u","nik omo","t7chi fih","yatek asba","yatek 3asba","ya3tek 3asba","zok","omk","kiss","زبي","عصب","نيك","امك","برا نيك","يعطك عصبة","عصبة"]
|
|
19
|
+
|
|
20
|
+
def normalize(text):
|
|
21
|
+
text = text.lower()
|
|
22
|
+
text = re.sub(r'[^a-zA-Z0-9\u0600-\u06FF]', '', text)
|
|
23
|
+
return text
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def pdf_to_txt(file):
|
|
30
|
+
try:
|
|
31
|
+
if not file.lower().endswith(".pdf"):
|
|
32
|
+
raise ValueError("Currently, the accepted files are .pdf and .txt")
|
|
33
|
+
|
|
34
|
+
reader = PdfReader(file)
|
|
35
|
+
text = ""
|
|
36
|
+
for page in reader.pages:
|
|
37
|
+
text += page.extract_text() or ""
|
|
38
|
+
|
|
39
|
+
return text
|
|
40
|
+
|
|
41
|
+
except Exception as e:
|
|
42
|
+
print(e)
|
|
43
|
+
return "error"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def txt_to_text(file):
|
|
48
|
+
try:
|
|
49
|
+
if not file.lower().endswith(".txt"):
|
|
50
|
+
raise ValueError("Currently, the accepted files are .pdf and .txt")
|
|
51
|
+
|
|
52
|
+
with open(file, "r", encoding="utf-8") as f:
|
|
53
|
+
text = f.read()
|
|
54
|
+
|
|
55
|
+
return text
|
|
56
|
+
|
|
57
|
+
except Exception as e:
|
|
58
|
+
print(e)
|
|
59
|
+
return "error"
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def is_clean(text,check_list=None):
|
|
64
|
+
if not text:
|
|
65
|
+
print("Maybe there's a mistake, no text was received!")
|
|
66
|
+
return False
|
|
67
|
+
|
|
68
|
+
normalized_text = normalize(text)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
for word in custom_bad_words:
|
|
72
|
+
if word in normalized_text:
|
|
73
|
+
return False
|
|
74
|
+
|
|
75
|
+
if check_list:
|
|
76
|
+
for w in check_list:
|
|
77
|
+
if w in normalized_text:
|
|
78
|
+
return False
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
if profanity.contains_profanity(text):
|
|
82
|
+
return False
|
|
83
|
+
|
|
84
|
+
return True
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def cleann(file,check_list=None):
|
|
89
|
+
if not file:
|
|
90
|
+
print("Maybe there's a mistake, no file was received!")
|
|
91
|
+
return False
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
if file.lower().endswith(".pdf"):
|
|
96
|
+
text = pdf_to_txt(file)
|
|
97
|
+
|
|
98
|
+
elif file.lower().endswith(".txt"):
|
|
99
|
+
text = txt_to_text(file)
|
|
100
|
+
|
|
101
|
+
else:
|
|
102
|
+
print("Currently, the accepted files are .pdf and .txt")
|
|
103
|
+
return "Currently, the accepted files are .pdf and .txt"
|
|
104
|
+
|
|
105
|
+
if text == "error":
|
|
106
|
+
print("An error occurred: Please try again, making sure the file is in PDF format and that it is a text document, not a scanned copy or image!")
|
|
107
|
+
return False
|
|
108
|
+
|
|
109
|
+
normalized_text = normalize(text)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
for word in custom_bad_words:
|
|
113
|
+
if word in normalized_text:
|
|
114
|
+
return False
|
|
115
|
+
|
|
116
|
+
if check_list:
|
|
117
|
+
for w in check_list:
|
|
118
|
+
if w in normalized_text:
|
|
119
|
+
return False
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
if profanity.contains_profanity(text):
|
|
123
|
+
return False
|
|
124
|
+
|
|
125
|
+
return True
|
|
126
|
+
|
|
127
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import re
|
|
3
|
+
try:
|
|
4
|
+
from better_profanity import profanity
|
|
5
|
+
except ImportError:
|
|
6
|
+
import os
|
|
7
|
+
os.system("pip install better_profanity")
|
|
8
|
+
from better_profanity import profanity
|
|
9
|
+
|
|
10
|
+
custom_bad_words = ["irheb","ass","dick","cock","asshole","de3ch","israil","اسرائيل","trump","ارهاب","إرهاب","zab", "zebi", "asba","3asba","nyk","nayek","nik","nik omk","3asba lik","mnayek","fuck","shit","fuck you","fuck u","nik omo","t7chi fih","yatek asba","yatek 3asba","ya3tek 3asba","zok","omk","kiss","زبي","عصب","نيك","امك","برا نيك","يعطك عصبة","عصبة"]
|
|
11
|
+
|
|
12
|
+
def normalize(text):
|
|
13
|
+
text = text.lower()
|
|
14
|
+
text = re.sub(r'[^a-zA-Z0-9\u0600-\u06FF]', '', text)
|
|
15
|
+
return text
|
|
16
|
+
|
|
17
|
+
def is_clean(text,check_list=None):
|
|
18
|
+
if not text:
|
|
19
|
+
return True
|
|
20
|
+
|
|
21
|
+
normalized_text = normalize(text)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
for word in custom_bad_words:
|
|
25
|
+
if word in normalized_text:
|
|
26
|
+
return False
|
|
27
|
+
|
|
28
|
+
if check_list:
|
|
29
|
+
for w in check_list:
|
|
30
|
+
if w in normalized_text:
|
|
31
|
+
return False
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
if profanity.contains_profanity(text):
|
|
35
|
+
return False
|
|
36
|
+
|
|
37
|
+
return True
|
ShadowB/Safe/ext.py
ADDED
ShadowB/Safe/filename.py
ADDED
ShadowB/Safe/safeFile.py
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess
|
|
3
|
+
import sys
|
|
4
|
+
import zipfile
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def _ensure_package(import_name, pip_name=None):
|
|
8
|
+
|
|
9
|
+
pip_name = pip_name or import_name
|
|
10
|
+
try:
|
|
11
|
+
return __import__(import_name)
|
|
12
|
+
except ImportError:
|
|
13
|
+
try:
|
|
14
|
+
subprocess.check_call(
|
|
15
|
+
[sys.executable, "-m", "pip", "install",
|
|
16
|
+
"--break-system-packages", pip_name],
|
|
17
|
+
stdout=subprocess.DEVNULL,
|
|
18
|
+
stderr=subprocess.DEVNULL,
|
|
19
|
+
)
|
|
20
|
+
except Exception:
|
|
21
|
+
return None
|
|
22
|
+
try:
|
|
23
|
+
return __import__(import_name)
|
|
24
|
+
except ImportError:
|
|
25
|
+
return None
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
magic = _ensure_package("magic", "python-magic")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
pyclamd = _ensure_package("pyclamd", "pyclamd")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
BLOCKED_EXTENSIONS = {
|
|
36
|
+
"exe", "bat", "cmd", "apk", "cpp", "py", "js", "html",
|
|
37
|
+
"css", "c", "java", "msi", "vbs", "ps1", "dll", "scr",
|
|
38
|
+
"sh", "rb", "php", "pl", "go", "rs", "ts", "jar", "com",
|
|
39
|
+
"pif", "reg", "hta", "wsf", "lnk"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
EXECUTABLE_SIGNATURES = {
|
|
44
|
+
b"MZ": "Windows PE/EXE",
|
|
45
|
+
b"\x7fELF": "Linux ELF executable",
|
|
46
|
+
b"\xfe\xed\xfa\xce": "Mach-O 32-bit executable",
|
|
47
|
+
b"\xfe\xed\xfa\xcf": "Mach-O 64-bit executable",
|
|
48
|
+
b"\xca\xfe\xba\xbe": "Mach-O fat binary / Java class",
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
EXECUTABLE_LIKE_EXTENSIONS = {"exe", "dll", "com", "scr", "msi"}
|
|
53
|
+
|
|
54
|
+
MAX_ZIP_DEPTH = 1
|
|
55
|
+
MAX_UNCOMPRESSED_SIZE = 200 * 1024 * 1024
|
|
56
|
+
MAX_COMPRESSION_RATIO = 100
|
|
57
|
+
|
|
58
|
+
ZIP_BASED_EXTENSIONS = {"zip", "jar", "apk", "docx", "xlsx", "pptx"}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _get_extension(file_path):
|
|
62
|
+
return os.path.splitext(file_path)[1].lower().lstrip(".")
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _read_header(file_path, n=8):
|
|
66
|
+
try:
|
|
67
|
+
with open(file_path, "rb") as f:
|
|
68
|
+
return f.read(n)
|
|
69
|
+
except OSError:
|
|
70
|
+
return b""
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _is_disguised_executable(file_path):
|
|
74
|
+
|
|
75
|
+
header = _read_header(file_path, 8)
|
|
76
|
+
ext = _get_extension(file_path)
|
|
77
|
+
|
|
78
|
+
if ext in EXECUTABLE_LIKE_EXTENSIONS:
|
|
79
|
+
return False
|
|
80
|
+
|
|
81
|
+
for sig in EXECUTABLE_SIGNATURES:
|
|
82
|
+
if header.startswith(sig):
|
|
83
|
+
return True
|
|
84
|
+
return False
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def _check_zip_bomb(file_path, depth=0):
|
|
88
|
+
|
|
89
|
+
if depth > MAX_ZIP_DEPTH:
|
|
90
|
+
return False
|
|
91
|
+
|
|
92
|
+
try:
|
|
93
|
+
with zipfile.ZipFile(file_path) as zf:
|
|
94
|
+
total_uncompressed = 0
|
|
95
|
+
for info in zf.infolist():
|
|
96
|
+
total_uncompressed += info.file_size
|
|
97
|
+
if total_uncompressed > MAX_UNCOMPRESSED_SIZE:
|
|
98
|
+
return False
|
|
99
|
+
|
|
100
|
+
if info.compress_size > 0:
|
|
101
|
+
ratio = info.file_size / max(info.compress_size, 1)
|
|
102
|
+
if ratio > MAX_COMPRESSION_RATIO:
|
|
103
|
+
return False
|
|
104
|
+
|
|
105
|
+
if info.filename.lower().endswith(".zip"):
|
|
106
|
+
if depth + 1 > MAX_ZIP_DEPTH:
|
|
107
|
+
return False
|
|
108
|
+
tmp_path = f"{file_path}.__nested_{depth}.tmp"
|
|
109
|
+
try:
|
|
110
|
+
with zf.open(info) as nested_file:
|
|
111
|
+
with open(tmp_path, "wb") as tmp:
|
|
112
|
+
tmp.write(nested_file.read())
|
|
113
|
+
nested_ok = _check_zip_bomb(tmp_path, depth + 1)
|
|
114
|
+
if not nested_ok:
|
|
115
|
+
return False
|
|
116
|
+
except (zipfile.BadZipFile, OSError):
|
|
117
|
+
return False
|
|
118
|
+
finally:
|
|
119
|
+
if os.path.exists(tmp_path):
|
|
120
|
+
os.remove(tmp_path)
|
|
121
|
+
except zipfile.BadZipFile:
|
|
122
|
+
return False
|
|
123
|
+
except OSError:
|
|
124
|
+
return False
|
|
125
|
+
|
|
126
|
+
return True
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def _clamav_scan(file_path):
|
|
130
|
+
|
|
131
|
+
if pyclamd is None:
|
|
132
|
+
return None
|
|
133
|
+
try:
|
|
134
|
+
cd = pyclamd.ClamdUnixSocket()
|
|
135
|
+
if not cd.ping():
|
|
136
|
+
cd = pyclamd.ClamdNetworkSocket()
|
|
137
|
+
cd.ping()
|
|
138
|
+
result = cd.scan_file(file_path)
|
|
139
|
+
return result is None
|
|
140
|
+
except Exception:
|
|
141
|
+
return None
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def is_safe(file):
|
|
145
|
+
|
|
146
|
+
if not file or not os.path.isfile(file):
|
|
147
|
+
return False
|
|
148
|
+
|
|
149
|
+
ext = _get_extension(file)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
if ext in BLOCKED_EXTENSIONS:
|
|
153
|
+
return False
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
if _is_disguised_executable(file):
|
|
157
|
+
return False
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
header = _read_header(file, 4)
|
|
161
|
+
looks_like_zip = header.startswith(b"PK\x03\x04") or ext in ZIP_BASED_EXTENSIONS
|
|
162
|
+
if looks_like_zip:
|
|
163
|
+
if not _check_zip_bomb(file):
|
|
164
|
+
return False
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
av_result = _clamav_scan(file)
|
|
168
|
+
if av_result is False:
|
|
169
|
+
return False
|
|
170
|
+
|
|
171
|
+
return True
|
ShadowB/__init__.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from .core import start
|
|
2
|
+
from .core import owner
|
|
3
|
+
from .core import hp
|
|
4
|
+
from .core import team
|
|
5
|
+
from .core import vr
|
|
6
|
+
|
|
7
|
+
from .getD import my_data
|
|
8
|
+
from .getD import my_ip
|
|
9
|
+
from .getD import get_cookies
|
|
10
|
+
from .getD import scan
|
|
11
|
+
from .getD import whm
|
|
12
|
+
|
|
13
|
+
from .safe import ext
|
|
14
|
+
from .safe import extR
|
|
15
|
+
from .safe import name
|
|
16
|
+
from .safe import cleanText
|
|
17
|
+
from .safe import clean
|
|
18
|
+
from .safe import size
|
|
19
|
+
from .safe import safeFile
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
from .passwords import check_strength
|
|
23
|
+
from .passwords import create_password
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
from .image import expMetadata
|
|
27
|
+
from .image import removeMetadata
|
|
28
|
+
from .image import check_img
|
|
29
|
+
from .image import hide_file
|
|
30
|
+
from .image import hide_text
|
|
31
|
+
from .image import extr_file
|
|
32
|
+
from .image import extr_text
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
from .mail import create_email
|
|
36
|
+
from .mail import get_msj
|
|
37
|
+
from .mail import send_msj
|
|
38
|
+
|
|
39
|
+
from .captcha import generate_captcha
|
|
40
|
+
|
|
41
|
+
from .qrcode import generate_qrcode
|
|
42
|
+
from .qrcode import scan_qrcode
|
|
43
|
+
|
|
44
|
+
from .search import search_by_username
|
ShadowB/captcha.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
import random
|
|
4
|
+
import string
|
|
5
|
+
|
|
6
|
+
try:
|
|
7
|
+
from PIL import Image, ImageDraw, ImageFont
|
|
8
|
+
except ImportError:
|
|
9
|
+
os.system(f"{sys.executable} -m pip install pillow")
|
|
10
|
+
from PIL import Image, ImageDraw, ImageFont
|
|
11
|
+
|
|
12
|
+
def generate_captcha(name="captcha"):
|
|
13
|
+
output_filename = f"{name}.png"
|
|
14
|
+
characters = string.ascii_letters + string.digits
|
|
15
|
+
captcha_text = ''.join(random.choice(characters) for _ in range(7))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
width, height = 250, 80
|
|
19
|
+
background_color = (240, 240, 240)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
image = Image.new("RGB", (width, height), color=background_color)
|
|
23
|
+
draw = ImageDraw.Draw(image)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
try:
|
|
27
|
+
font = ImageFont.truetype("arial.ttf", 36)
|
|
28
|
+
except IOError:
|
|
29
|
+
font = ImageFont.load_default()
|
|
30
|
+
|
|
31
|
+
for _ in range(5):
|
|
32
|
+
x1 = random.randint(0, width)
|
|
33
|
+
y1 = random.randint(0, height)
|
|
34
|
+
x2 = random.randint(0, width)
|
|
35
|
+
y2 = random.randint(0, height)
|
|
36
|
+
line_color = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
|
|
37
|
+
draw.line([(x1, y1), (x2, y2)], fill=line_color, width=2)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
for _ in range(500):
|
|
41
|
+
x = random.randint(0, width - 1)
|
|
42
|
+
y = random.randint(0, height - 1)
|
|
43
|
+
pixel_color = (random.randint(100, 200), random.randint(100, 200), random.randint(100, 200))
|
|
44
|
+
draw.point((x, y), fill=pixel_color)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
current_x = 20
|
|
48
|
+
for char in captcha_text:
|
|
49
|
+
|
|
50
|
+
char_color = (random.randint(0, 100), random.randint(0, 100), random.randint(0, 100))
|
|
51
|
+
|
|
52
|
+
current_y = random.randint(15, 30)
|
|
53
|
+
|
|
54
|
+
draw.text((current_x, current_y), char, fill=char_color, font=font)
|
|
55
|
+
|
|
56
|
+
current_x += 30
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
image.save(output_filename)
|
|
60
|
+
|
|
61
|
+
print(f"[+] Captcha code generated successfully : '{output_filename}'")
|
|
62
|
+
print(f"[+] Captcha code : {captcha_text}")
|
|
63
|
+
|
|
64
|
+
return captcha_text
|
|
65
|
+
|
|
66
|
+
# --- تجربة تشغيل الدالة ---
|
|
67
|
+
if __name__ == "__main__":
|
|
68
|
+
# استدعاء الدالة
|
|
69
|
+
generated_code = generate_captcha("my_captcha.png")
|
|
70
|
+
|
|
71
|
+
# لمعرفة أين تم حفظ الصورة تماماً في جهازك (باستخدام المفهوم السابق)
|
|
72
|
+
import os
|
|
73
|
+
print(f"مكان حفظ الصورة الكامل: {os.path.abspath('my_captcha.png')}")
|