Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified social_media_analyzer/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified social_media_analyzer/__pycache__/heuristics.cpython-312.pyc
Binary file not shown.
Binary file modified social_media_analyzer/__pycache__/scam_detector.cpython-312.pyc
Binary file not shown.
101 changes: 101 additions & 0 deletions social_media_analyzer/fake_profile_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,107 @@
"Check the 'About' section for inconsistencies or lack of information.",
"Look at the age of the account and the history of posts.",
"Be suspicious of friend requests from people you don't know, especially if you have no mutual friends."
],
"telegram": [
"Be wary of unsolicited messages from users or bots, especially those promoting investments or crypto.",
"Check the username for slight misspellings of official channels or known contacts.",
"Never share personal codes or login information with anyone on Telegram."
],
"twitter": [
"Look for newly created accounts with very few tweets but high follower counts (often bots).",
"Be suspicious of accounts that primarily tweet suspicious links or participate in crypto scams.",
"Check the bio and tweets for poor grammar or generic content."
],
"pinterest": [
"Be cautious of pins that lead to suspicious websites unrelated to the pin's content.",
"Look for profiles with very few boards or pins but a high number of followers.",
"Be wary of accounts that leave spammy comments with links."
],
"linkedin": [
"Be suspicious of profiles with generic job titles and descriptions.",
"Check for inconsistencies in work history or education.",
"Be wary of connection requests from individuals with no mutual connections or a sparse profile."
],
"line": [
"Be cautious of messages from unknown accounts, especially those with links or QR codes.",
"Scammers may impersonate official accounts; check for the green shield icon for verified accounts.",
],
"discord": [
"Be wary of direct messages from users you don't share a server with.",
"Never click on suspicious links or download files from unknown users.",
"Be cautious of friend requests from users with no mutual friends or servers in common."
],
"teams": [
"Be wary of messages from external accounts you don't recognize.",
"Do not share sensitive company information with unverified contacts.",
"Report any suspicious activity to your IT department."
],
"zoom": [
"Be cautious of unexpected meeting invitations or links.",
"Ensure the meeting host is someone you know and trust.",
"Do not share personal information in public chat during a meeting."
],
"amazon": [
"Be wary of seller profiles with little to no feedback or very new accounts.",
"Check product reviews for signs of being fake or paid.",
"Be suspicious of sellers who ask you to complete a transaction outside of Amazon's official platform."
],
"alibaba": [
"Verify the seller's credentials, such as their 'Gold Supplier' status and business license.",
"Be cautious of prices that are significantly lower than the market average.",
"Use Alibaba's Trade Assurance for secure payments and to protect against fraud."
],
"youtube": [
"Be wary of comments with suspicious links, especially on popular videos.",
"Check the 'About' page of a channel for contact information and creation date.",
"Look for channels with high subscriber counts but low video views or engagement."
],
"skype": [
"Be cautious of contact requests from people you don't know.",
"Never send money or share personal information with unknown contacts.",
"Scammers may impersonate Microsoft or Skype support to gain access to your account."
],
"vk": [
"Be suspicious of profiles with very little personal information or photos.",
"Check for a large number of 'friends' but low engagement on posts.",
"Be wary of messages with links to third-party sites, especially for games or prizes."
],
"reddit": [
"Check a user's post and comment history for signs of spam or bot-like activity.",
"Be cautious of unsolicited private messages with investment opportunities or suspicious links.",
"Look at the age of the Reddit account (cake day) and their karma score."
],
"email": [
"Carefully examine the sender's email address for any misspellings or unusual domains.",
"Be suspicious of emails that create a sense of urgency or pressure.",
"Never click on links or download attachments from unsolicited or unexpected emails.",
"Check for generic greetings like 'Dear Customer' instead of your name.",
"In Gmail, look for the 'verified sender' checkmark for well-known brands."
],
"viber": [
"Be wary of messages from unknown numbers, especially those containing links or asking for money.",
"Check the profile of unknown contacts for any suspicious information.",
"Viber will never ask for your personal information or login details in a message."
],
"signal": [
"Be cautious of message requests from people you don't know.",
"Signal is end-to-end encrypted, but that doesn't protect you from scams if you interact with a scammer.",
"Do not share your PIN or personal information with anyone."
],
"badoo": [
"Be wary of users who immediately ask to move the conversation to another platform.",
"Look for the 'verified user' badge on profiles.",
"Be cautious of profiles that seem too good to be true or have professional-level photos."
],
"binance": [
"Be suspicious of anyone asking for your API keys, passwords, or 2FA codes.",
"Double-check the domain name of the Binance website before logging in (binance.com).",
"Binance support will never ask you to send them cryptocurrency."
],
"sharechat": [
"Be wary of profiles that post a large amount of spam or promotional content.",
"Check for the 'verified' badge on profiles of public figures.",
"Do not engage with users who ask for personal information or money in private chat."
]
}

Expand Down
30 changes: 26 additions & 4 deletions social_media_analyzer/heuristics.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,27 @@
"tinder": ["tinder.com", "gotinder.com"],
"snapchat": ["snapchat.com"],
"wechat": ["wechat.com"],
"general": ["google.com", "twitter.com", "linkedin.com"] # Other common safe domains
"telegram": ["telegram.org", "t.me"],
"twitter": ["twitter.com", "x.com"],
"pinterest": ["pinterest.com"],
"linkedin": ["linkedin.com"],
"line": ["line.me"],
"discord": ["discord.com", "discord.gg"],
"teams": ["teams.microsoft.com", "microsoft.com"],
"zoom": ["zoom.us"],
"amazon": ["amazon.com"],
"alibaba": ["alibaba.com"],
"youtube": ["youtube.com", "youtu.be"],
"skype": ["skype.com"],
"vk": ["vk.com"],
"reddit": ["reddit.com", "old.reddit.com"],
"email": [],
"viber": ["viber.com"],
"signal": ["signal.org"],
"badoo": ["badoo.com"],
"binance": ["binance.com"],
"sharechat": ["sharechat.com"],
"general": ["google.com"]
}


Expand Down Expand Up @@ -44,7 +64,9 @@
"guaranteed", "risk-free", "earn money fast", "work from home easy",
"investment opportunity", "high return", "get rich quick",
"inheritance", "unclaimed funds", "nigerian prince",
"free followers", "pro account for free", "verified badge" # Social media specific
"free followers", "pro account for free", "verified badge", # Social media specific
"forex", "fx trading", "guaranteed profit", "trading signal", "forex robot",
"metatrader", "mt4", "mt5", "copy trading", "pamm"
]

# Generic greetings/salutations that can be suspicious in unsolicited contexts
Expand Down Expand Up @@ -100,8 +122,8 @@
# These patterns aim to catch URLs that impersonate legitimate domains.
SUSPICIOUS_URL_PATTERNS = [
# Impersonation using subdomains or hyphens
r"https?://(?:[a-z0-9\-]+\.)*(?:facebook|fb|instagram|whatsapp|tiktok|tinder|snapchat|wechat)\.com\.[a-z0-9\-]+\.[a-z]+",
r"https?://(?:[a-z0-9\-]+\.)*(?:facebook|fb|instagram|whatsapp|tiktok|tinder|snapchat|wechat)-[a-z0-9\-]+\.[a-z]+",
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]+",
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]+",
# Common URL shorteners
r"https?://bit\.ly",
r"https?://goo\.gl",
Expand Down
76 changes: 45 additions & 31 deletions social_media_analyzer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def main():
print("--- Social Media Analyzer ---")
print("This tool helps you analyze social media profiles and messages for potential scams.")

platforms = ["facebook", "instagram", "whatsapp", "tiktok", "tinder", "snapchat", "wechat"]
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"]

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

while True:
print(f"\nWhat do you want to do for {platform.capitalize()}?")
print("1. Analyze a profile for signs of being fake.")
print("2. Analyze a message for phishing or scam attempts.")
if platform == "browser":
url_to_check = input("Please enter the URL you want to analyze: ").strip()
if url_to_check:
is_susp, reason = scam_detector.is_url_suspicious(url_to_check)
print("\n--- URL Analysis Results ---")
if is_susp:
print(f"The URL '{url_to_check}' is SUSPICIOUS.")
print(f"Reason: {reason}")
else:
print(f"The URL '{url_to_check}' does not seem suspicious.")
print(f"Details: {reason}")
else:
print("No URL entered.")
else:
while True:
print(f"\nWhat do you want to do for {platform.capitalize()}?")
print("1. Analyze a profile for signs of being fake.")
print("2. Analyze a message for phishing or scam attempts.")

try:
analysis_choice = int(input("Enter your choice (1-2): "))
if analysis_choice == 1:
profile_url = input(f"Enter the {platform.capitalize()} profile URL to analyze: ").strip()
if profile_url:
fake_profile_detector.analyze_profile_based_on_user_input(profile_url, platform)
else:
print("No profile URL entered.")
break
elif analysis_choice == 2:
message = input("Paste the message you want to analyze: ").strip()
if message:
result = scam_detector.analyze_text_for_scams(message, platform)
print("\n--- Scam Analysis Results ---")
print(f"Score: {result['score']} (Higher is more suspicious)")
print("Indicators Found:")
if result['indicators_found']:
for indicator in result['indicators_found']:
print(f"- {indicator}")
try:
analysis_choice = int(input("Enter your choice (1-2): "))
if analysis_choice == 1:
profile_url = input(f"Enter the {platform.capitalize()} profile URL to analyze: ").strip()
if profile_url:
fake_profile_detector.analyze_profile_based_on_user_input(profile_url, platform)
else:
print("No profile URL entered.")
break
elif analysis_choice == 2:
message = input("Paste the message you want to analyze: ").strip()
if message:
result = scam_detector.analyze_text_for_scams(message, platform)
print("\n--- Scam Analysis Results ---")
print(f"Score: {result['score']} (Higher is more suspicious)")
print("Indicators Found:")
if result['indicators_found']:
for indicator in result['indicators_found']:
print(f"- {indicator}")
else:
print("No specific scam indicators were found.")
else:
print("No specific scam indicators were found.")
print("No message entered.")
break
else:
print("No message entered.")
break
else:
print("Invalid choice. Please try again.")
except ValueError:
print("Invalid input. Please enter a number.")
print("Invalid choice. Please try again.")
except ValueError:
print("Invalid input. Please enter a number.")

if __name__ == '__main__':
main()
Loading