Python Network Security Programming-1
UNIX口令破解
1.程序运行需求:
其中dictionary.txt文件为破解口令的字典文件,passwords.txt文件为临时存放UNIX系统密码的文件
2.程序源码:
import crypt
# 以hash方式加密的unix口令,的一般形式为:HXajgneuer/jids 其中前两位“HX”一般称为salt ,剩下的字符不影响哈希结果
# salt是此哈希的盐值,长度是8位,超过8的后面的位数将不影响哈希的结果。
# 在正常情况下,进行加密的时候,这个盐值是随机字符串。
def testPass(cryptPass):
# 根据字典通过crypt函数判断密码
salt = cryptPass[0:2] # 读哈希值得前两位
dictFile = open('dictionary.txt','r')
for word in dictFile.readlines():
word = word.strip('\n') # 清除头尾空格,回车符等
# print(word,salt)
cryptWord = crypt.crypt(word,salt) #使用字典数据利用crypt函数构造密码
# print(cryptWord,cryptPass)
if cryptWord==cryptPass:
print("[+] Found Fassword: " + word + "\n")
else:
print("[-] PassWord Not Find !\n") def main():
passFile = open('passwords.txt')
for line in passFile.readlines():
if ":" in line:
user = line.split(':')[0] #将password中的数据以 “:” 分为user和password两部分,此为user部分
cryptPass = line.split(':')[1].strip('\n') #此为password部分
print("[*] Cracking Password For: "+user)
testPass(cryptPass) #调用检测比对函数 if __name__ == '__main__':
main()
Python Network Security Programming-1的更多相关文章
- python network programming tutorial
关于网络编程以及socket 等一些概念和函数介绍就不再重复了,这里示例性用python 编写客户端和服务器端. 一.最简单的客户端流程: 1. Create a socket 2. Connect ...
- android9.0适配HTTPS:not permitted by network security policy'
app功能接口正常,其他手机运行OK,但是在Android9.0的手机上报错 CLEARTEXT communication to 192.168.1.xx not permitted by netw ...
- Android版本28使用http请求报错not permitted by network security policy
Android版本28使用http请求报错not permitted by network security policy android模拟器调试登录的时候报错 CLEARTEXT communic ...
- 《Network Security A Decision and Game Theoretic Approach》阅读笔记
网络安全问题的背景 网络安全研究的内容包括很多方面,作者形象比喻为盲人摸象,不同领域的网络安全专家对网络安全的认识是不同的. For researchers in the field of crypt ...
- Azure PowerShell (13) 批量设置Azure ARM Network Security Group (NSG)
<Windows Azure Platform 系列文章目录> 刚刚在帮助一个合作伙伴研究需求,他们的虚拟机全面的网络安全组(Network Security Group, NSG)会经常 ...
- Network Security Services If you want to add support for SSL, S/MIME, or other Internet security standards to your application, you can use Network Security Services (NSS) to implement all your securi
Network Security Services | MDN https://developer.mozilla.org/zh-CN/docs/NSS 网络安全服务 (NSS) 是一组旨在支持支持安 ...
- Network Security Threats
Network Security Combination of low-cost powerful computing and high-performance networks is a two-e ...
- Firewall & Network Security
Firewall & Network Security 防火墙 & 网络安全 NAT Gateway VPC Virtual Private Cloud refs https://en ...
- Python Lambda & Functional Programming
Python Lambda & Functional Programming 函数式编程 匿名函数 纯函数 高阶函数 # higher-order functions def apply_tw ...
随机推荐
- nagios监控oracle
本人最近在弄nagios,想用nagios监控oracle,看了网上的很多教程,步骤都是如下.1.由于 nagios 脚本需要读取 oracle 相关文件.所以运行 nagios 的用户需要定义为 o ...
- BZOJ 4009: [HNOI2015]接水果 (整体二分+扫描线 树状数组)
整体二分+扫描线 树状数组 具体做法看这里a CODE #include <cctype> #include <cstdio> #include <cstring> ...
- Codeforces Round #455 (Div. 2) 909D. Colorful Points
题 OvO http://codeforces.com/contest/909/problem/D CF 455 div2 D CF 909D 解 算出模拟的复杂度之后就是一个很水的模拟题 把字符串按 ...
- XHTML测试题
1.XHTML 指的是? A.EXtra Hyperlinks and Text Markup Language B.EXtensible HyperText Marking Language C.E ...
- 【记录】springboot项目的maven的pom.xml文件第一行报错 Unknown Error
原因 : maven的插件版本的问题,造成与IDE的不兼容 解决办法 :在pom中加上 <maven-jar-plugin.version>3.1.1</maven-jar-plug ...
- 修改tomcat控制台的标题
Tomcat的bin目录下,创建一个名为setenv.bat的文件. setenv.bat 编辑内容 : set TITLE = 想要命名的标题名称 保存修改.重新启动. 第二种. 修改tomca ...
- Failed to execute goal maven-gpg-plugin 1.5 Sign
问题描述: 解决办法:跳过maven-gpg-plugin <build> <pluginManagement> <plugins> <plugin> ...
- 求两个排序数组的交集和并集----时间复杂度O(n+m)
问题: 给你两个排序的数组,求两个数组的交集. 比如: A = 1 3 4 5 7, B = 2 3 5 8 9, 那么交集就是 3 5,n是a数组大小,m是b数组大小. 思路: (1)从b数组遍历取 ...
- Content:"\2715",特殊字符和图标
原文 项目中用到的一些特殊字符和图标 html代码 <div class="cross"></div> css代码 1 2 3 4 5 6 7 8 9 10 ...
- 继承关系下的this关键字
继承关系下的this关键字 在继承关系下,父类中的this关键字并不总是表示父类中的变量和方法.this关键字的四种用法如前文所述,列举如下. 1) this(paras…); 访问其他的构造方法 2 ...
