Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/G4LB1T/pstf2
/ functions
Functions
20 in github.com/G4LB1T/pstf2
⨍
Functions
20
◇
Types & classes
1
↓ 2 callers
Function
get_os_string
:param s: user agent or p0f OS fingerprint :return: assumed OS parsed out of the input string
lib/utils.py:46
↓ 1 callers
Function
check_blacklist_asn
Is the ASN suspicious? :param request: :return: True iff ASN hints it is a security tool
lib/fingerprinting/blacklist_checks.py:122
↓ 1 callers
Function
check_last_sec_service_observed_timeout
:return: True iff we've recently seen a service checking our server
lib/fingerprinting/blacklist_checks.py:190
↓ 1 callers
Function
check_link_is_ethernet
Checks if the MTU value is atypical :param request: the HTTP GET headers :return: True iff MTU value is suspicious
lib/fingerprinting/blacklist_checks.py:136
↓ 1 callers
Function
check_obsolete_browser_version
Detect implementations where developers neglected to update their code to reflect contemporary browser versions :param request: :return:
lib/fingerprinting/blacklist_checks.py:168
↓ 1 callers
Function
check_os_mismatches
Compare the declared OS and TCP metadata OS Uses get_os_string to transform to a canonical form :param request: the HTTP GET headers
lib/fingerprinting/blacklist_checks.py:150
↓ 1 callers
Function
check_virus_total_ua
:param request: :return: true iff VirusTotal request is received
lib/fingerprinting/blacklist_checks.py:94
↓ 1 callers
Function
get_asn
Gets asnum for ip using Cymru's API (https://pythonhosted.org/cymruwhois/api.html) Stores in cache for future use using the lru_cache dec
lib/fingerprinting/asn_checker.py:10
↓ 1 callers
Function
get_p0f_data
Wraps p0f's named socket API Wrapper module in use is https://pypi.org/project/p0f/ :param ip: key to query p0f by it :return: p0f's
lib/servers/p0f_wrapper.py:27
↓ 1 callers
Function
get_ptr_record
:param ip: ipv4 as string :return: reversed in-addr-arpa part of the record e.g.: for '203.208.60.1' it will return 'crawl-203-208-60-1.g
lib/utils.py:32
↓ 1 callers
Method
parse_headers
build parsed headers from request :return: headers prepared for fingerprinting stage
lib/servers/http_server.py:16
↓ 1 callers
Function
print_banner
Prints an ASCII art pstf^2 banner :return: None
lib/utils.py:68
↓ 1 callers
Function
reset_last_time_service_observed
Resets the timer for last time we've observed a service to evade from :return:
lib/fingerprinting/blacklist_checks.py:18
↓ 1 callers
Function
run
Wrapper for popen :param cmd: cmd to run as a different process :return: ref to the popened subprocess
lib/utils.py:22
↓ 1 callers
Function
start_logger
(lvl=logging.INFO)
lib/utils.py:8
↓ 1 callers
Function
start_servers
Here we start both p0f and an HTTP server in parallel :return:
lib/servers/__init__.py:10
Method
do_GET
Logic for serving HTTP GET requests :return:
lib/servers/http_server.py:36
Function
do_checks
Main routine for sending to the different checks :param request: :return: True iff request matches blacklist patterns
lib/fingerprinting/blacklist_checks.py:27
Function
start_http_server
Initialize the server, will be started in a differnt thread than p0f so it will co-exist :param server_class: standard python HTTP server
lib/servers/http_server.py:74
Function
start_p0f
Starts p0f's binary :param p0f_bin_path: binary file path on disk :param p0f_fp_path: fingerprint file path on disk :param p0f_iface:
lib/servers/p0f_wrapper.py:12