-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5094d3e
commit 76bc32e
Showing
18 changed files
with
238 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,42 @@ | ||
from enum import Enum | ||
VALID_NETWORK_TYPES = [ | ||
"clearnet", | ||
"i2p", | ||
"onion", | ||
"invalid" | ||
] | ||
|
||
|
||
class network_type(Enum): | ||
CLEARNET = "clearnet" | ||
I2P = "i2p" | ||
ONION = "onion" | ||
INVALID = "invalid" | ||
VALID_CONTENT_TYPES = [ | ||
"general", | ||
"forums", | ||
"news", | ||
"stolen", | ||
"drugs", | ||
"hacking", | ||
"marketplaces", | ||
"cryptocurrency", | ||
"leaks", | ||
"adult", | ||
"carding", | ||
"scams", | ||
"ransomware", | ||
"databases", | ||
"money_laundering", | ||
"counterfeit", | ||
"malware", | ||
"botnets", | ||
"exploits", | ||
"spam", | ||
"chemicals", | ||
"weapons", | ||
"human_trafficking", | ||
"csam", | ||
"doxing", | ||
"extortion", | ||
"espionage", | ||
"propaganda", | ||
"terrorism", | ||
"government_leaks", | ||
"c2_panels", | ||
"ddos", | ||
"apt" | ||
] |
44 changes: 26 additions & 18 deletions
44
crawler/crawler_instance/local_shared_model/card_extraction_model.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,43 @@ | ||
from dataclasses import dataclass, field | ||
from typing import List, Optional | ||
|
||
from crawler.constants.enums import VALID_NETWORK_TYPES, VALID_CONTENT_TYPES | ||
|
||
|
||
@dataclass | ||
class card_extraction_model: | ||
m_title: str = "" | ||
m_url: str = "" | ||
m_content: str = "" | ||
m_base_url: str = "" | ||
m_network: str = "" | ||
m_important_content: str = "" | ||
m_content_type: str = "general" | ||
m_title: str | ||
m_url: str | ||
m_base_url: str | ||
m_content: str | ||
m_important_content: str | ||
m_network: str | ||
m_content_type: str | ||
m_weblink: List[str] = field(default_factory=list) | ||
m_dumplink: List[str] = field(default_factory=list) | ||
m_extra_tags: List[str] = field(default_factory=list) | ||
m_sections: List[str] = field(default_factory=list) | ||
m_name: str = "" | ||
m_email_addresses: List[str] = field(default_factory=list) | ||
m_industry: Optional[str] = None | ||
m_phone_numbers: List[str] = field(default_factory=list) | ||
m_addresses: List[str] = field(default_factory=list) | ||
m_social_media_profiles: List[str] = field(default_factory=list) | ||
m_websites: List[str] = field(default_factory=list) | ||
m_company_name: Optional[str] = None | ||
m_industry: Optional[str] = None | ||
m_job_title_or_position: Optional[str] = None | ||
m_associated_entities: List[str] = field(default_factory=list) | ||
m_aliases_or_alternate_names: List[str] = field(default_factory=list) | ||
m_logo_or_images: List[str] = field(default_factory=list) | ||
m_business_categories: List[str] = field(default_factory=list) | ||
m_services_or_products: List[str] = field(default_factory=list) | ||
m_public_records: List[str] = field(default_factory=list) | ||
m_online_activity: List[str] = field(default_factory=list) | ||
m_leak_date: Optional[str] = None | ||
m_last_updated: Optional[str] = None | ||
m_data_size: Optional[str] = None | ||
m_country_name: Optional[str] = None | ||
m_revenue: Optional[str] = None | ||
|
||
def __post_init__(self): | ||
required_fields = ["m_title", "m_url", "m_content", "m_base_url", "m_important_content"] | ||
|
||
for field_name in required_fields: | ||
if getattr(self, field_name) is None: | ||
raise ValueError(f"The field '{field_name}' is required and cannot be None.") | ||
|
||
if self.m_network not in VALID_NETWORK_TYPES: | ||
raise ValueError(f"Invalid network type provided: {self.m_network}. Must be one of {', '.join(VALID_NETWORK_TYPES)}.") | ||
|
||
if self.m_content_type not in VALID_CONTENT_TYPES: | ||
raise ValueError(f"Invalid content type provided: {self.m_content_type}. Must be one of {', '.join(VALID_CONTENT_TYPES)}.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
from crawler.request_manager import check_services_status, parse_leak_data | ||
from shared_collector.scripts._nerqnacjmdy3obvevyol7qhazkwkv57dwqvye5v46k5bcujtfa6sduad import \ | ||
_nerqnacjmdy3obvevyol7qhazkwkv57dwqvye5v46k5bcujtfa6sduad | ||
from shared_collector.scripts._zone_xsec import _zone_xsec | ||
|
||
check_services_status() | ||
|
||
if __name__ == "__main__": | ||
parse_sample = _nerqnacjmdy3obvevyol7qhazkwkv57dwqvye5v46k5bcujtfa6sduad() | ||
parsed_data, raw_parse_mapping = parse_leak_data({"server": "socks5://127.0.0.1:9150"}, parse_sample) | ||
parse_sample = _zone_xsec() | ||
parsed_data, raw_parse_mapping = parse_leak_data(blocked_media=True, proxy={"server": "socks5://127.0.0.1:9150"}, model=parse_sample) | ||
print(parsed_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.