未验证 提交 0fb01a56 编写于 作者: X xiexupang 提交者: GitHub

能下载文档,但不能连续下载

上级 34669eaf
......@@ -24,8 +24,6 @@ entry_mailbox = tk.Entry(window, width=66, textvariable=var_mailbox).place(x=110
# # 设置下载进度条
tk.Label(window, text='下载进度:').place(x=50, y=110)
canvas = tk.Canvas(window, width=465, height=22, bg="white")
# 465表示长度,27表示宽度,width=0.4表示粗细
#out_line = canvas.create_rectangle(1.5, 1.5, 465, 23, width=0.4, outline="green")
canvas.place(x=110, y=110)
# 显示下载进度
......@@ -34,25 +32,28 @@ def progress():
fill_line = canvas.create_rectangle(1.5, 1.5, 0, 23, width=0, fill="blue")
x = 500 # 未知变量,可更改
n = 465 / x # 465是矩形填充满的次数
for i in range(x):
n = n + 465 / x
# 以矩形的长度作为变量值更新
canvas.coords(fill_line, (0, 0, n, 60))
window.update()
time.sleep(0.02) # 控制进度条流动的速度
# # 清空进度条
# fill_line = canvas.create_rectangle(1.5, 1.5, 0, 23, width=0, fill="white")
# x = 500 # 未知变量,可更改
# n = 465 / x # 465是矩形填充满的次数
#
# for t in range(x):
# n = n + 465 / x
# # 以矩形的长度作为变量值更新
# canvas.coords(fill_line, (0, 0, n, 60))
# window.update()
# time.sleep(0) # 时间为0,即飞速清空进度条
tk.messagebox.showinfo( # 通知型弹窗
title='下载成功', # 窗口标题
message='文档已发送,邮箱可能会对其进行拦截,请注意查看垃圾箱',
)
# 清空进度条
fill_line = canvas.create_rectangle(1.5, 1.5, 0, 23, width=0, fill="white")
x = 500 # 未知变量,可更改
n = 465 / x # 465是矩形填充满的次数
for t in range(x):
n = n + 465 / x
# 以矩形的长度作为变量值更新
canvas.coords(fill_line, (0, 0, n, 60))
window.update()
time.sleep(0) # 时间为0,即飞速清空进度条
# 清空框内的文档链接
def clear_url():
......@@ -63,7 +64,6 @@ def download_doc():
# 获取输入的文档链接和邮箱
doc_url = str(var_doc_url.get())
mailbox = str(var_mailbox.get())
# 构建并伪装爬虫,让对方以为这是来自一般用户的正常访问
header = {'Accept': 'text/plain, */*; q=0.01',
'Accept-Encoding': 'gzip, deflate',
......@@ -80,7 +80,6 @@ def download_doc():
# 漏洞
url = 'http://39.108.149.27:9999/default.aspx'
# 爬虫要向该漏洞提交的数据
datas = {
'username': '',
......@@ -88,7 +87,6 @@ def download_doc():
'txtUrl': doc_url,
'mail': mailbox,
}
# 爬虫访问该漏洞,提交携带的数据
response = requests.request("POST", url, data=datas, headers=header)
......@@ -103,11 +101,7 @@ def two_threading():
for t in threads:
t.setDaemon(True)
t.start()
t.join()
tk.messagebox.showinfo( # 通知型弹窗
title='下载成功', # 窗口标题
message='文档已发送,邮箱可能会对其进行拦截,请注意查看垃圾箱',)
# 设置清空链接和一键下载按钮
btn_clear = tk.Button(window, text='清空链接', command=clear_url)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册