-
Notifications
You must be signed in to change notification settings - Fork 9
Stabilized v1.1.2 #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5c637e8
aae975d
891e10e
ac0ebdf
eee9dc2
d40eea1
12923b4
b8da955
f32d0ce
07eeed5
c283244
f6189ed
2957d35
a447d91
a1bbc03
d249c57
4073fe3
e61fe1a
d98dfb2
4e4c211
a00526a
fcbda25
c2373e9
4ab7b1b
fa17445
6f829e9
673c64c
20d78e7
c5b4ffb
a7b606d
60bb93f
4c2cf67
fe8361d
76d6a73
711fa9d
ae7f2f9
ce8ea93
acecfbb
fc6b78a
f84f2b4
607dd31
3b90293
ba2c61f
a3e8e1c
276a9e3
e8d1177
870b09b
3f7a48a
3337e97
bb16fd8
8a955f5
da06773
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -113,25 +113,27 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'VKontakte': [], 'YouTube': [], 'Odnoklassniki': [], 'WeChat': []} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for link in links: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if 'facebook.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
parsed_url = urlparse(link) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hostname = parsed_url.hostname | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if hostname and hostname.endswith('facebook.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
categorized_links['Facebook'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'twitter.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('twitter.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incomplete URL substring sanitization High
The string
twitter.com Error loading related location Loading
Copilot AutofixAI 9 months ago To fix the problem, we need to ensure that the hostname check is robust against subdomain attacks. Instead of using
Suggested changeset
1
datagather_modules/crawl_processor.py
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
categorized_links['Twitter'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'instagram.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('instagram.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
categorized_links['Instagram'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 't.me' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('t.me'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
categorized_links['Telegram'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'tiktok.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('tiktok.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incomplete URL substring sanitization High
The string
tiktok.com Error loading related location Loading
Copilot AutofixAI 9 months ago To fix the problem, we need to ensure that the hostname check is robust and cannot be bypassed by embedding the target string in an unexpected location. The best way to achieve this is to use a more precise check that ensures the hostname is exactly the expected domain or a subdomain of it.
Suggested changeset
1
datagather_modules/crawl_processor.py
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
categorized_links['TikTok'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'linkedin.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('linkedin.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
categorized_links['LinkedIn'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'vk.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('vk.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incomplete URL substring sanitization High
The string
vk.com Error loading related location Loading
Copilot AutofixAI 9 months ago To fix the problem, we need to ensure that the hostname is checked correctly to prevent malicious URLs from bypassing the security check. The best way to do this is to ensure that the hostname matches the exact domain or a subdomain of the allowed host. This can be achieved by checking if the hostname ends with the allowed domain and is preceded by a dot or is exactly the allowed domain.
Suggested changeset
1
datagather_modules/crawl_processor.py
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
categorized_links['VKontakte'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'youtube.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('youtube.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incomplete URL substring sanitization High
The string
youtube.com Error loading related location Loading Copilot AutofixAI 9 months ago Copilot could not generate an autofix suggestion Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
categorized_links['YouTube'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'wechat.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('wechat.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incomplete URL substring sanitization High
The string
wechat.com Error loading related location Loading
Copilot AutofixAI 9 months ago To fix the problem, we need to ensure that the URL hostname is correctly parsed and checked to prevent subdomain attacks. The best way to do this is to use the
Suggested changeset
1
datagather_modules/crawl_processor.py
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
categorized_links['WeChat'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'ok.ru' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('ok.ru'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
categorized_links['Odnoklassniki'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if not categorized_links['Odnoklassniki']: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -211,25 +213,26 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for inner_list in subdomain_socials_grouped: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for link in inner_list: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if 'facebook.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hostname = urlparse(link).hostname | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if hostname and hostname.endswith('facebook.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incomplete URL substring sanitization High
The string
facebook.com Error loading related location Loading
Copilot AutofixAI 9 months ago To fix the problem, we need to ensure that the hostname is correctly validated to prevent malicious URLs from being accepted. The best way to do this is to check that the hostname is either exactly the allowed domain or a subdomain of it. This can be achieved by ensuring the hostname ends with the allowed domain preceded by a dot or is exactly the allowed domain.
Suggested changeset
1
datagather_modules/crawl_processor.py
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sd_socials['Facebook'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'twitter.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('twitter.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incomplete URL substring sanitization High
The string
twitter.com Error loading related location Loading
Copilot AutofixAI 9 months ago To fix the problem, we need to ensure that the hostname of the URL ends with the correct domain, preceded by a dot. This will prevent subdomain attacks where an attacker could use a domain like
Suggested changeset
1
datagather_modules/crawl_processor.py
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sd_socials['Twitter'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'instagram.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('instagram.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incomplete URL substring sanitization High
The string
instagram.com Error loading related location Loading
Copilot AutofixAI 9 months ago To fix the problem, we need to ensure that the hostname check is robust against subdomain attacks. Instead of using
Suggested changeset
1
datagather_modules/crawl_processor.py
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sd_socials['Instagram'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 't.me' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('t.me'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sd_socials['Telegram'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'tiktok.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('tiktok.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sd_socials['TikTok'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'linkedin.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('linkedin.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incomplete URL substring sanitization High
The string
linkedin.com Error loading related location Loading
Copilot AutofixAI 9 months ago To fix the problem, we need to ensure that the hostname is correctly validated to belong to the intended domain. This can be done by checking if the hostname ends with the domain and is either exactly the domain or has a preceding dot to allow for subdomains.
Suggested changeset
1
datagather_modules/crawl_processor.py
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sd_socials['LinkedIn'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'vk.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('vk.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incomplete URL substring sanitization High
The string
vk.com Error loading related location Loading |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sd_socials['VKontakte'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'youtube.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('youtube.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incomplete URL substring sanitization High
The string
youtube.com Error loading related location Loading
Copilot AutofixAI 9 months ago To fix the problem, we need to ensure that the hostname is correctly validated to belong to the intended domain. Instead of using
Suggested changeset
1
datagather_modules/crawl_processor.py
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sd_socials['YouTube'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'wechat.com' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('wechat.com'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incomplete URL substring sanitization High
The string
wechat.com Error loading related location Loading
Copilot AutofixAI 9 months ago To fix the problem, we need to ensure that the hostname check is more robust and cannot be easily bypassed by malicious URLs. The best way to achieve this is to use a stricter check that ensures the hostname is exactly the expected domain or a subdomain of it. We can use the
Suggested changeset
1
datagather_modules/crawl_processor.py
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sd_socials['WeChat'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif 'ok.ru' in link: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
elif hostname and hostname.endswith('ok.ru'): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sd_socials['Odnoklassniki'].append(urllib.parse.unquote(link)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sd_socials = {k: list(set(v)) for k, v in sd_socials.items()} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import sqlite3 | ||
from colorama import Fore | ||
import os | ||
|
||
def manage_dorks(db_name): | ||
db_prep_string = str(db_name) + '.db' | ||
if os.path.exists('dorking//' + db_prep_string): | ||
print(Fore.RED + f"Sorry, but {db_prep_string} database is already exists. Choose other name for your custom DB") | ||
pass | ||
else: | ||
conn = sqlite3.connect('dorking//' + str(db_prep_string)) | ||
cursor = conn.cursor() | ||
|
||
cursor.execute(''' | ||
CREATE TABLE IF NOT EXISTS dorks ( | ||
dork_id INTEGER PRIMARY KEY, | ||
dork TEXT NOT NULL | ||
) | ||
''') | ||
conn.commit() | ||
|
||
def add_dork(dork_id, dork): | ||
try: | ||
cursor.execute('INSERT INTO dorks (dork_id, dork) VALUES (?, ?)', (dork_id, dork)) | ||
conn.commit() | ||
print(Fore.GREEN + "Successfully added new dork") | ||
except sqlite3.IntegrityError: | ||
print(Fore.RED + "Attention, dork_id variable must be unique") | ||
|
||
while True: | ||
dork_id = input(Fore.YELLOW + "Enter dork_id (or 'q' to quit this mode and save changes) >> ") | ||
if dork_id.lower() == 'q': | ||
break | ||
dork = input(Fore.YELLOW + "Enter new dork >> ") | ||
add_dork(int(dork_id), dork) | ||
conn.close() |
Uh oh!
There was an error while loading. Please reload this page.