17 lines
338 B
Python
17 lines
338 B
Python
import os
|
|
import sys
|
|
import socket
|
|
|
|
sys.stdout.reconfigure(encoding="utf-8")
|
|
|
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
s.settimeout(5.0)
|
|
try:
|
|
s.connect(("140.44.4.21", 22))
|
|
banner = s.recv(1024)
|
|
print(f"RAW BANNER (len={len(banner)}): {repr(banner)}")
|
|
s.close()
|
|
except Exception as e:
|
|
print("Error:", e)
|
|
|