MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _normalize_port_value

Function _normalize_port_value

webapp_modern.py:3992–4009  ·  view source on GitHub ↗

Normalize a port entry string for consistent comparisons

(port_entry)

Source from the content-addressed store, hash-verified

3990 if not line or line.startswith('Interface:') or line.startswith('Starting') or line.startswith('Ending'):
3991 continue
3992
3993 parts = re.split(r'\s+', line)
3994 if len(parts) < 2:
3995 continue
3996
3997 ip_candidate, mac_candidate = parts[0], parts[1]
3998 if not (_is_valid_ipv4(ip_candidate) and MAC_REGEX.match(mac_candidate)):
3999 continue
4000
4001 vendor = ' '.join(parts[2:]).strip() if len(parts) > 2 else ''
4002 hosts[ip_candidate] = {
4003 'mac': _normalize_mac(mac_candidate),
4004 'vendor': vendor
4005 }
4006
4007 return hosts
4008
4009
4010def build_pseudo_mac_from_ip(ip):
4011 try:
4012 octets = [int(part) for part in ip.split('.')]

Callers 3

update_wifi_network_dataFunction · 0.85
execute_manual_attackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected