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 ...
随机推荐
- mongodb的安装与使用(三)之 pymongo
(一)连接MongoClient 连接MongoDB我们需要使用PyMongo库里面的MongoClient,一般来说传入MongoDB的IP及端口即可,第一个参数为地址host,第二个参数为端口po ...
- Codeforces Round #590 (Div. 3) C. Pipes
链接: https://codeforces.com/contest/1234/problem/C 题意: You are given a system of pipes. It consists o ...
- Java日期工具类DateUtils详解(转)
jar包 appache下的 common-lang3 一. 对指定的日期新增年.月.周.日.小时.分钟.秒.毫秒 public static Date addDays(Date date, int ...
- vue_03 练习
1.有以下广告数据(实际数据命名可以略做调整) ad_data = { tv: [ {img: 'img/tv/001.png', title: 'tv1'}, {img: 'img/tv/002.p ...
- [Algorithm] Find The Vowels
// --- Directions // Write a function that returns the number of vowels // used in a string. Vowels ...
- Finding Lane Lines on the Road
Finding Lane Lines on the Road The goals / steps of this project are the following: Make a pipeline ...
- 部署lnmp
装包 1.安装依赖包 yum - y install gcc openssl-devel pcre-devel zlib-devel 2.解源码包 .tar.gz 3.切换到解压缩后的目录,配置参数 ...
- 记录二:tensorflow2.0写MNIST手写体
最近学习神经网络,tensorflow,看了好多视频,查找了好多资料,感觉东西都没有融入自己的思维中.今天用tensorflow2.0写了一个MNIST手写体的版本,记录下学习的过程. 复现手写体识别 ...
- 关于keepalive
linux内核配置有一项tcp_keepalive_time,即tcp的保活定时器.当网络上两个建立连接的进程都没有数据向对方发送的时候,tcp会隔段时间发送一次保活数据,以保持连接,间隔时间就是tc ...
- python并发——进程间同步和通信
一.进程间同步 对于一些临界资源,不能使用并发无限消耗,就需要设置专门的临界标示,比如锁或者信号量等 from multiprocessing import Process, Lock import ...
