报错示例: checking for openssl... no configure: error: Package requirements (openssl) were not met: No package 'openssl' found 遇到问题是在编译axel的时候,提示缺少openssl包,如果环境正常的情况下,解决这个问题其实也很容易 sudo apt-get install lib […]
分类: ECW
to record the skills, experience and some other interesting things about the Computer World
DB2 v11.5.4_linuxx64_server_dec 版本云盘共享
出口管制之后,官网下载db2已经变成了一件不太容易的事情,普通的vpn方式很容易被识别。然而找遍全网也没有看到一个国内的镜像,最后只能用vps下载再传回本地,虽然只有linux community版本,但是应该也有一些用: https://pan.baidu.com/s/1xYG0HcxGmz88wcVE9bt6bA 提取码: j5ae
rfc5802-SCRAM的一个简单示例
基于python3的SCRAM基础过程的描述,协议中定义的数据结构和类型此处并没有完整实现
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
import hashlib import os import hmac import sys def xor(str1, str2): return b''.join((a^b).to_bytes(1, sys.byteorder) for a,b in zip(str1,str2)) #define the password, salt and iteration number password = b'Aa123456' salt = os.urandom(16) i = 10000 #client first mesg client_first_message_bare = os.urandom(32) #server first mesg, contain client_nonce and its own nonce server_first_message = os.urandom(32) #generate client proof SaltedPassword = hashlib.pbkdf2_hmac('sha256', password, salt, i) ClientKey = hmac.new(SaltedPassword, b'Client Key', 'sha256').digest() StoredKey = hashlib.sha256(ClientKey).digest() AuthMessage = client_first_message_bare + server_first_message ClientSignature = hmac.new(StoredKey, AuthMessage, 'sha256').digest() ClientProof = xor(ClientKey, ClientSignature) #client send the ClientProof and ClientSignature to the server #server verify the client s_ClientKey = xor(ClientSignature, ClientProof) if hmac.compare_digest(ClientKey, s_ClientKey): print('verify client success') #generate server signature ServerKey = hmac.new(SaltedPassword, b'Server Key', 'sha256').digest() ServerSignature = hmac.new(ServerKey, AuthMessage, 'sha256').digest() #client verify the server #compare the ServerSignature received from server and the one computed at client side c_ServerKey = hmac.new(SaltedPassword, b'Server Key', 'sha256').digest() c_ServerSignature = hmac.new(c_ServerKey, AuthMessage, 'sha256').digest() if hmac.compare_digest(ServerSignature, c_ServerSignature): print('verify server success') |
官方地址: https://tools.ietf.org/html/rfc5802
openssl生成ecdsa和dss证书以及ecdsa证书在s_server中可以正常使用的方法
“佛曰不可说,一是无法说,一是说不得。多言无意,充其量只是在无法连接的平静中创造一点波动,或许可以接续,大多数缺只是搅动一颗妄心。” 生成ecdsa证书私钥: openssl ecparam -name sect233k1 -out sect233k1_ca openssl ecparam -in sect233k1_ca -genkey -noout -out ca.key 生成dss证书私钥: […]
chattr
语法格式: chattr [-RVf] [-v 版本编号 ] [ -p 工程 ] [ mode ] files 说明: chattr 改变linux文件系统上的文件属性 符号模式的格式为 +-=[aAcCdDeFijPsStTu] '+' 操作将被设置的熟悉添加道现有文件的属性中; '-' 操作将属性从现有文件属性中移除; '=' 操作将被设置的属性作为文件的唯一属性 标识符'aAcCdDeFij […]
SQLsmith和SQLines Tools
SQLsmith <mba> "I love the smell of coredumps in the morning" 可以基于当前数据库数据随机生存SQL语句,目前支持PostgreSQL, SQLite 3 and MonetDB。最后更新时间为2018.5,官方地址: https://github.com/anse1/sqlsmith SQLines Tools 可以转换不同 […]
openpyxl操作excel的基本方法
官方指南:https://openpyxl.readthedocs.io/en/stable/styles.html 基本文件操作 #创建新的xlsx文件 import openpyxl #创建工作簿 wb = openpyxl.Workbook() #工作簿总是会带有至少一个worksheet,通过Workbook.active可以选中第一个sheet ws = wb.active #保存文件( […]
scapy用法整理
导入scapy: from scapy.all import * 常用的查看命令: ls() - 不带参数则查看所有可持的layer,也可以指定一个layer名称从而查询此layer的详细详细,例如ls(TCP) lsc() - 查看当前scapy的所有功能列表 help() - 查看功能的帮助,例如help(hexdump)可以查看hexdump的作用和参数介绍 conf - 查看当前的配置信息 […]