Skip to content

Commit 211c8ce

Browse files
feat: Add ShareChat support and browser URL analysis
This commit adds support for the ShareChat platform and introduces a new "Browser" option for direct URL analysis. The changes include: - Adding "sharechat" and "browser" to the platform list in `main.py`. - Implementing a special workflow for the "browser" option to allow users to analyze a URL directly. - Adding legitimate domains and platform-specific advice for ShareChat. - Updating the suspicious URL patterns to include ShareChat. This work is in response to user requests to add more platforms and to interpret the request for browser integration as a feature for URL analysis.
1 parent 17543d4 commit 211c8ce

File tree

4 files changed

+53
-33
lines changed

4 files changed

+53
-33
lines changed
56 Bytes
Binary file not shown.

social_media_analyzer/fake_profile_detector.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@
129129
"Be suspicious of anyone asking for your API keys, passwords, or 2FA codes.",
130130
"Double-check the domain name of the Binance website before logging in (binance.com).",
131131
"Binance support will never ask you to send them cryptocurrency."
132+
],
133+
"sharechat": [
134+
"Be wary of profiles that post a large amount of spam or promotional content.",
135+
"Check for the 'verified' badge on profiles of public figures.",
136+
"Do not engage with users who ask for personal information or money in private chat."
132137
]
133138
}
134139

social_media_analyzer/heuristics.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"signal": ["signal.org"],
3131
"badoo": ["badoo.com"],
3232
"binance": ["binance.com"],
33+
"sharechat": ["sharechat.com"],
3334
"general": ["google.com"]
3435
}
3536

@@ -121,8 +122,8 @@
121122
# These patterns aim to catch URLs that impersonate legitimate domains.
122123
SUSPICIOUS_URL_PATTERNS = [
123124
# Impersonation using subdomains or hyphens
124-
r"https?://(?:[a-z0-9\-]+\.)*(?:facebook|fb|instagram|whatsapp|tiktok|tinder|snapchat|wechat|telegram|twitter|pinterest|linkedin|line|discord|teams|zoom|amazon|alibaba|youtube|skype|vk|reddit|viber|signal|badoo|binance)\.com\.[a-z0-9\-]+\.[a-z]+",
125-
r"https?://(?:[a-z0-9\-]+\.)*(?:facebook|fb|instagram|whatsapp|tiktok|tinder|snapchat|wechat|telegram|twitter|pinterest|linkedin|line|discord|teams|zoom|amazon|alibaba|youtube|skype|vk|reddit|viber|signal|badoo|binance)-[a-z0-9\-]+\.[a-z]+",
125+
r"https?://(?:[a-z0-9\-]+\.)*(?:facebook|fb|instagram|whatsapp|tiktok|tinder|snapchat|wechat|telegram|twitter|pinterest|linkedin|line|discord|teams|zoom|amazon|alibaba|youtube|skype|vk|reddit|viber|signal|badoo|binance|sharechat)\.com\.[a-z0-9\-]+\.[a-z]+",
126+
r"https?://(?:[a-z0-9\-]+\.)*(?:facebook|fb|instagram|whatsapp|tiktok|tinder|snapchat|wechat|telegram|twitter|pinterest|linkedin|line|discord|teams|zoom|amazon|alibaba|youtube|skype|vk|reddit|viber|signal|badoo|binance|sharechat)-[a-z0-9\-]+\.[a-z]+",
126127
# Common URL shorteners
127128
r"https?://bit\.ly",
128129
r"https?://goo\.gl",

social_media_analyzer/main.py

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def main():
66
print("--- Social Media Analyzer ---")
77
print("This tool helps you analyze social media profiles and messages for potential scams.")
88

9-
platforms = ["facebook", "instagram", "whatsapp", "tiktok", "tinder", "snapchat", "wechat", "telegram", "twitter", "pinterest", "linkedin", "line", "discord", "teams", "zoom", "amazon", "alibaba", "youtube", "skype", "vk", "reddit", "email", "viber", "signal", "badoo", "binance"]
9+
platforms = ["facebook", "instagram", "whatsapp", "tiktok", "tinder", "snapchat", "wechat", "telegram", "twitter", "pinterest", "linkedin", "line", "discord", "teams", "zoom", "amazon", "alibaba", "youtube", "skype", "vk", "reddit", "email", "viber", "signal", "badoo", "binance", "sharechat", "browser"]
1010

1111
while True:
1212
print("\nSelect the social media platform you want to analyze:")
@@ -23,39 +23,53 @@ def main():
2323
except ValueError:
2424
print("Invalid input. Please enter a number.")
2525

26-
while True:
27-
print(f"\nWhat do you want to do for {platform.capitalize()}?")
28-
print("1. Analyze a profile for signs of being fake.")
29-
print("2. Analyze a message for phishing or scam attempts.")
26+
if platform == "browser":
27+
url_to_check = input("Please enter the URL you want to analyze: ").strip()
28+
if url_to_check:
29+
is_susp, reason = scam_detector.is_url_suspicious(url_to_check)
30+
print("\n--- URL Analysis Results ---")
31+
if is_susp:
32+
print(f"The URL '{url_to_check}' is SUSPICIOUS.")
33+
print(f"Reason: {reason}")
34+
else:
35+
print(f"The URL '{url_to_check}' does not seem suspicious.")
36+
print(f"Details: {reason}")
37+
else:
38+
print("No URL entered.")
39+
else:
40+
while True:
41+
print(f"\nWhat do you want to do for {platform.capitalize()}?")
42+
print("1. Analyze a profile for signs of being fake.")
43+
print("2. Analyze a message for phishing or scam attempts.")
3044

31-
try:
32-
analysis_choice = int(input("Enter your choice (1-2): "))
33-
if analysis_choice == 1:
34-
profile_url = input(f"Enter the {platform.capitalize()} profile URL to analyze: ").strip()
35-
if profile_url:
36-
fake_profile_detector.analyze_profile_based_on_user_input(profile_url, platform)
37-
else:
38-
print("No profile URL entered.")
39-
break
40-
elif analysis_choice == 2:
41-
message = input("Paste the message you want to analyze: ").strip()
42-
if message:
43-
result = scam_detector.analyze_text_for_scams(message, platform)
44-
print("\n--- Scam Analysis Results ---")
45-
print(f"Score: {result['score']} (Higher is more suspicious)")
46-
print("Indicators Found:")
47-
if result['indicators_found']:
48-
for indicator in result['indicators_found']:
49-
print(f"- {indicator}")
45+
try:
46+
analysis_choice = int(input("Enter your choice (1-2): "))
47+
if analysis_choice == 1:
48+
profile_url = input(f"Enter the {platform.capitalize()} profile URL to analyze: ").strip()
49+
if profile_url:
50+
fake_profile_detector.analyze_profile_based_on_user_input(profile_url, platform)
51+
else:
52+
print("No profile URL entered.")
53+
break
54+
elif analysis_choice == 2:
55+
message = input("Paste the message you want to analyze: ").strip()
56+
if message:
57+
result = scam_detector.analyze_text_for_scams(message, platform)
58+
print("\n--- Scam Analysis Results ---")
59+
print(f"Score: {result['score']} (Higher is more suspicious)")
60+
print("Indicators Found:")
61+
if result['indicators_found']:
62+
for indicator in result['indicators_found']:
63+
print(f"- {indicator}")
64+
else:
65+
print("No specific scam indicators were found.")
5066
else:
51-
print("No specific scam indicators were found.")
67+
print("No message entered.")
68+
break
5269
else:
53-
print("No message entered.")
54-
break
55-
else:
56-
print("Invalid choice. Please try again.")
57-
except ValueError:
58-
print("Invalid input. Please enter a number.")
70+
print("Invalid choice. Please try again.")
71+
except ValueError:
72+
print("Invalid input. Please enter a number.")
5973

6074
if __name__ == '__main__':
6175
main()

0 commit comments

Comments
 (0)