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

Method load_scan_file

actions/ssh_connector.py:114–124  ·  view source on GitHub ↗

Load from SQLite database and filter for SSH ports.

(self)

Source from the content-addressed store, hash-verified

112 self.scan = pd.DataFrame(data)
113 if "Ports" not in self.scan.columns:
114 self.scan["Ports"] = None
115 # Ensure Ports column is string type before using .str accessor
116 self.scan["Ports"] = self.scan["Ports"].astype(str)
117 self.scan = self.scan[self.scan["Ports"].str.contains("22", na=False)]
118
119 def ssh_connect(self, adresse_ip, user, password):
120 """Attempt to connect to SSH using only the supplied credentials.
121 Retries up to 3 times on banner/connection errors with backoff."""
122 max_retries = 3
123 for attempt in range(max_retries):
124 ssh = paramiko.SSHClient()
125 ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
126 try:
127 ssh.connect(

Callers 1

run_bruteforceMethod · 0.95

Calls 1

read_dataMethod · 0.80

Tested by

no test coverage detected