![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
网安python技巧
睡不醒的张同学
简单的网安爱好者
展开
-
Python--弱口令字典爆破
语言:python 脚本名:burteForce.py 使用模块requests、sys 原理:通过对比登录失败与登录成功的差异性来判断是否成功 cms网站后台管理,登录成功后会重定向跳转到后台管理页面,此时bp抓包,响应行的状态码应该是302,通过对比登录失败与登录成功的状态码来进行字典爆破 注意:requests模块中post传参,需要传递 allow_redirects=False,意为传参后不进行跳转 源码: # burteForce.py import re...原创 2021-09-18 11:19:47 · 2515 阅读 · 4 评论 -
Python -- 主机存活检测程序设计
系统:windows 编写软件:VScode 语言:Python 主要模块:scapy 安装scapy模块: pip install scapy 主机发现代码: # 主机发现.py from scapy.all import * for i in range(1,255): dst = "10.9.67.{}".format(i) pkt = IP(src = "10.9.67.65", dst = dst)/ICMP() res = sr1(pkt, time原创 2021-09-17 09:37:22 · 729 阅读 · 1 评论 -
Python -- linux 系统编程爆破用户密码(shadow 文件)
主机:centos/kali 系统:linux系统 语言:Python 主要模块:crypt 脚本:burp.py 字典:list.txt 代码: import crypt passwd = '$6$pKDCUxnEw.7MW7yo$NBsVfzLwOsU0pMg0nPKu/T/La/b7ymVGhoPtVJx60/LHOdnR7y.1YUcwwb40Et.wOBtrPUc4xD1ayjl6Tzvhu.' f = open("list.txt","r") _pass = " " for i原创 2021-09-17 09:22:15 · 1326 阅读 · 1 评论 -
Python -- 十六进制与字符串的相互转换
# 字符串与十六进制的转义 # coding utf-8 char = input("请输入字符串") _char = char.encode().hex() print(char + " 的十六进制序列是:" + _char) _char1 = bytes.fromhex(_char).decode() print(_char + " 十六进制转字符串是 :" + _char1) 运行结果: ...原创 2021-09-17 09:12:02 · 4793 阅读 · 0 评论