一
倒霉蛋子:今天周一,今天不下雨,今天我出去去图书馆,今天 图书馆不开门!!!!!!!!! 🙄 ╥﹏╥…
后来去 新华书店
看了一会JavaScript
和python
,能看懂的部分极其相似,语法也很像,关键是不用装解释器,一个egde
和vscode
搞定一切
后来整ubuntu server
一开始装Ubuntu16.04,ssh一直没搞好,vnc
没问题,(8.4更新),不知道咋手欠
vnc连不上了,局域网内通过 ipconfig/ifconig(win/wsl)还有扫描5900,22端口,
192.168.1.0/24
后来把路由器拔了网线怼上面
开的双路由(因为这边户型比较奇怪,光猫自带路由和tp的一个路由,
) · dhcp给光猫分·,少一层nat转发
代码来源于 网络
,本代码严禁用于非法用途,后果自负
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
| import socket
import threading
def is_port_open(ip, port):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(1)
result = s.connect_ex((ip, port))
if result == 0:
print(f"Port {port} is open on {ip}")
s.close()
except socket.error:
pass
print_lock = threading.Lock()
ip_prefix = "192.168.1."
port_number = 22
def scan_ports(start, end):
for i in range(start, end):
ip = ip_prefix + str(i)
is_port_open(ip, port_number)
num_threads = 60
threads = []
start_ip = 1
end_ip = 255
ips_per_thread = (end_ip - start_ip + 1) // num_threads
for i in range(num_threads):
start = start_ip + (i * ips_per_thread)
end = start + ips_per_thread if i < num_threads - 1 else end_ip + 1
thread = threading.Thread(target=scan_ports, args=(start, end))
thread.start()
threads.append(thread)
for thread in threads:
thread.join()
print("Port scanning is complete.")
|
之前挺想用pycharm
,现在一点点都不想用,收费啊,还有局限性,不如 vscode(个人感觉,无鄙视等意思)
效果图: