一、引用的python模块
Crypto:
Python中一个强大的加密模块,提供了许多常见的加密算法和工具。它建立在pyc.ypodome或pyc.ypto等底层加密库之上,为Python程序员提供了简单易用的API,使其可以轻松地实现各种加密功能。
commands:
commands 模块是 Python 的内置模块,它主要有三个函数:
FUNCTIONS
getoutput(cmd)
Return output (stdout or stderr) of executing cmd in a shell.getstatus(file)
Return output of "ls -ld <file>" in a string.getstatusoutput(cmd)
Return (status, 'output) of executing cmd in a shell.
SYS: 基础系统模块
sys模块是与python解释器交互的一个接口。sys 模块提供了许多函数和变量来处理 Python 运行时环境的不同部分。
二、实现过程
python脚本如下:
import crypt
import commands
import sysdef testPass(user,cryptPass,ipaddr):
#dictfile=open('dictionary.txt','r')
start_index=cryptPass.find("$")
finish_inde