当前位置:网站首页>批量检测不同url的指定端口(py脚本)
批量检测不同url的指定端口(py脚本)
2022-06-10 18:49:00 【活着Viva】
适用范围
不能造成巨大动静的情况下使用。
使用之前
- 修改想要扫描的端口
- 修改含有url的文件路径(前提要有一个带有url的文件)
import requests
# ***************
# ****修改端口***
# ***************
port = ':8083'
header = {
'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36'
}
# 含有url的文件
file = r"C:\Users\Xuhaizhao\Desktop\ip.txt"
url_lis_200 = []
# 文件读取
with open(file,'r') as f:
content = f.read()
content_lis = content.split('\n')
for url in content_lis:
url = url + port
try:
r = requests.get(url,headers=header,timeout = 1)
print(f'[+] {
url}的响应码:{
r.status_code}') # 响应码
# 排除不允许访问或找不到的网页
if r.status_code != 400 and r.status_code != 403 and r.status_code != 404:
url_lis_200.append(url)
except:
print(f'{
url}请求超时')
print('-'*50)
print('*********可访问的url*********')
for i in url_lis_200:
print(f'{
i}')
ip文件格式
域名格式自行修改
效果图

边栏推荐
- 【C语言进阶】指针的进阶【中篇】
- Source code analysis of Tencent libco collaborative process open source library (II) -- persimmon starts from the soft pinch, and the sample code officially begins to explore the source code
- How to increase the monthly salary of software testing from 10K to 30K? Only automated testing can do it
- [01] every high-quality author deserves to be seen. Let's take a look at this week's high-quality content!
- Easily learn pytoch full convolution neural network to realize expression recognition
- DDD landing practice repeat record of theoretical training & Event storm
- Morris traversal of binary tree
- Domain Driven Design (VI) - Architecture Design
- Mongodb unique index
- Nature Biotechnol | 李家洋/余泓团队利用平铺删除策略打破性状连锁,突破水稻产量瓶颈
猜你喜欢
随机推荐
2022.05.25 (lc_718_longest repeating subarray)
Easily learn pytoch full convolution neural network to realize expression recognition
Basic improvement - tree DP supplement
SAR image focusing quality evaluation plug-in
The team of nature biotechnol | Li Jiayang / Yu Hong used the tile deletion strategy to break the linkage of traits and break through the bottleneck of rice yield
掌握高性能计算前,我们先了解一下它的历史
2022.05.26 (lc_1143_longest common subsequence)
This article introduces you to j.u.c's futuretask, fork/join framework and BlockingQueue
Mixin -- mixed
[01] every high-quality author deserves to be seen. Let's take a look at this week's high-quality content!
Tencent libco collaboration open source library source code analysis full series summary blog
How to add independent hotspots in VR panoramic works?
Basic model and properties of SAR echo signal
2022最强版应届生软件测试面试攻略,助你直通大厂
Computer:成功教你如何使用一招—就能找回以前的密码(曾经保存的密码但当前显示为******号的密码)
Mongodb 唯一索引
Mongodb unique index
Key and encryption mechanism in financial industry
2022.05.28 (lc_516_longest palindrome subsequence)
大学生毕业季找房,VR全景看房帮你线上筛选









