【Python】Struct2 探测工具
来源:互联网 发布:4d软件下载 编辑:程序博客网 时间:2024/05/10 07:40
Structs2探测原理
http://mp.weixin.qq.com/s/EhBNkBdVEUm4P7KAwwrlpA
原理说明
探测的原理是打开网页,分析返回结果是否正常
知识点(Python 3.6.1 版本)
1. urllib.request 的使用
2. 日志存储读取
3. 入参分析
开发环境
Windows7 + Python3.6.1
#xiaoqingwang dreamstone_xiaoqw@163.com"For check server use structs"import urllib.requestimport sys# coding=utf-8from tkinter import *class getMsgURL(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.pack() self.entrythingy = Entry(self, width = 58) self.entrythingy.pack() self.contents = StringVar() self.entrythingy.config(textvariable=self.contents) self.entrythingy.bind('<Key-Return>', self.checkURL) def checkURL(self, event): self.url = self.contents.get() print(self.url) checkStructs2(self.url) def checkStructs2(url): print("<URL> -->", url) request = urllib.request.Request(url) try:response = urllib.request.urlopen(request) except Exception as e: print(e) return 0 data = response.read() datautf = data.decode('UTF-8') fo = open('log.html', 'w',encoding='utf-8') fo.write(datautf) fo.close() text = open('log.html', encoding='utf8').read() #print(text.encode('utf8')) print(text.find('<!DOCTYPE', 0)) res = text.find('<!DOCTYPE', 0) if res > -1: print('not use structs2') else: print('use structs2') fo.close() if __name__ == "__main__": url = "http://www.youku.com" if len(sys.argv)== 2: url = sys.argv[1] checkStructs2(url); print(url) else: root = getMsgURL() root.master.title("-> Please Input URL and Press <Enter> !") root.mainloop()
测试结果
遗留问题
待分析的URL没有做处理,不过对于本工具的开发来说,已经不是问题。字符串拼接就可以。
阅读全文
0 0
- 【Python】Struct2 探测工具
- 窗口探测工具
- [JAVA]探测 Lombok 工具
- Struct2
- struct2
- Python 探测图片文件类型
- python探测web服务质量
- whatweb WEB指纹探测工具
- 内核探测工具systemtap简介
- 网页主动探测工具使用
- 内核探测工具systemtap简介
- 内核探测工具systemtap简介
- 内核探测工具systemtap简介
- IE 内存泄漏探测工具
- firewalk ----- 主动网络探测工具
- 内核探测工具systemtap简介
- 网站防火墙探测工具Wafw00f
- python 探测web服务质量方法
- Codeforces Round #422 (Div. 2)
- Nutz中那些好用的工具类
- 深度学习的认识
- c# 简单执行Post
- rpm包解压时遇到存在依赖项的问题
- 【Python】Struct2 探测工具
- 制作电子相册
- 微信小程序开发系列——4.小程序视图页面基础知识
- 函数
- 调用JWT token设置的接口错误
- 「LibreOJ β Round #2」贪心只能过样例 [bitset]【STL】
- PAT (Advanced Level) Practise 1099 Build A Binary Search Tree (30)
- 异步流程控制(js前端)
- 如何解决在Activity中无法获取getSupportFragmentManager()