9.6
把当前所有文件打包打/tmp/backup.tar.gz(/home/ctf不然打包)
1
  | 
tar -zcvf /tmp/backup.tar.gz .
  | 
 
扫c段。
 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
  | 
import requests
from concurrent.futures import ThreadPoolExecutor
def get_ip(url):
    try:
        resp = requests.get(url, timeout=5)
        if resp.status_code == 200:
            # 在URL前后添加双引号
            formatted_url = f'"{url}"'
            with open("host.txt", "a") as f:
                f.write(formatted_url + "\n")
            print(formatted_url)
    except requests.RequestException as e:
        pass  # 忽略连接超时等错误
if __name__ == "__main__":
    # 清空或创建host.txt文件
    open("host.txt", "w").close()
    
    # 生成URL列表
    urls = [f"http://192-168-1-{i}.pvp6430.bugku.cn" for i in range(1, 255)]
    
    # 使用线程池并发请求
    with ThreadPoolExecutor(max_workers=100) as executor:
        executor.map(get_ip, urls)
  | 
 
wc了,好久没打,白名单那里出问题,浪费大把时间,刚把源码打包结束了。