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

Function pwn_perform_update

webapp_modern.py:10127–10153  ·  view source on GitHub ↗

Run git pull against /opt/pwnagotchi. Does NOT touch any service.

()

Source from the content-addressed store, hash-verified

10125 # Update or add entry
10126 if ip in existing_data:
10127 # Merge data - PRESERVE ALL EXISTING PORTS (including deep scan results)
10128 existing_ports_before = len(existing_data[ip]['ports'])
10129
10130 if hostname and hostname != 'Unknown':
10131 existing_data[ip]['hostname'] = hostname
10132 if mac and mac != 'Unknown':
10133 existing_data[ip]['mac'] = mac
10134 existing_data[ip]['alive'] = alive
10135
10136 # CRITICAL: Add new ports to existing set, don't replace
10137 existing_data[ip]['ports'].update(ports)
10138
10139 existing_ports_after = len(existing_data[ip]['ports'])
10140 # Only log significant port changes to reduce noise
10141 if existing_ports_after > existing_ports_before and (existing_ports_after - existing_ports_before) >= 3:
10142 logger.info(f"[PORT PRESERVATION] {ip}: Added {existing_ports_after - existing_ports_before} new ports (total: {existing_ports_after})")
10143
10144 existing_data[ip]['last_seen'] = current_time
10145 # Reset failure counter on successful scan
10146 existing_data[ip]['failed_ping_count'] = 0
10147 existing_data[ip]['last_successful_ping'] = current_time
10148 else:
10149 # New entry
10150 existing_data[ip] = {
10151 'hostname': hostname,
10152 'alive': alive,
10153 'mac': mac,
10154 'ports': ports,
10155 'last_seen': current_time,
10156 'failed_ping_count': 0,

Callers

nothing calls this directly

Calls 2

_execute_pwn_git_updateFunction · 0.85
infoMethod · 0.80

Tested by

no test coverage detected