一些二进制学习笔记和题目WP
1.查壳ELF64 无壳kali中运行用户输入两次flag,程序验证后输出提示,程序退出2.IDA静态分析main:int __cdecl main(int argc, const char **argv, const char **envp) { int stat_loc; // [rsp+4h] [rbp-3Ch] BYREF int i; // [rsp+8h] [rbp-38h] __pid_t pid; // [rsp+Ch] [rbp-34h] char s2[24]; // [rsp+10h] [rbp-30h] BYREF unsigned __int64 v8; // [rsp+28h] [rbp-18h] v8 = __readfsqword(0x28u); pid = fork(); if ( pid ) { waitpid(pid, &stat_loc, 0); } else { for ( i = 0; i <= strlen(&flag); ++i ) {
1.查壳PE64 无壳2.IDA静态分析main:__int64 sub_1400118C0() { char *v0; // rdi __int64 i; // rcx size_t v2; // rax char v4[36]; // [rsp+0h] [rbp-20h] BYREF int j; // [rsp+24h] [rbp+4h] char Str1[224]; // [rsp+48h] [rbp+28h] BYREF __int64 v7; // [rsp+128h] [rbp+108h] v0 = v4; for ( i = 82i64; i; --i ) { *(_DWORD *)v0 = -858993460; v0 += 4; } for ( j = 0; ; ++j ) { v7 = j; if ( j > j_strlen(Str2) ) // str2="{hello_world}" break;
TEA在 Tea 算法中其最主要的识别特征就是 拥有一个 magic number :0x9e3779b9 。当然,这 Tea 算法也有魔改的,感兴趣的可以看 2018 0ctf Quals milk-tea。TEA算法的特征是delta值和16字节的密钥(128位)以及32轮迭代这些东西可以魔改,如果没魔改过,插件可以识别出该算法,否则需要算法结构手动找x-=0x61c88647和x+=0x9e3779b9,这两个值是等价的1.算法原理在密码学中,微型加密算法(Tiny Encryption Algorithm,TEA)是一种易于描述和执行的块密码,通常只需要很少的代码就可实现。其设计者是剑桥大学计算机实验室的大卫 · 惠勒与罗杰 · 尼达姆。在安全学领域,TEA(Tiny Encryption Algorithm)是一种分组加密算法,它的实现非常简单,通常只需要很精短的几行代码。TEA算法使用64位的明文分组和128位的密钥,它使用Feistel分组加密框架,需要进行64轮迭代,但是作者认为32轮已经足够了,所以32轮迭代加密后最后得到的密文就是64位。简单的说就是,TEA加密解
一、原理以下算法分析基于 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
一、简单加解密原理(1)加密图中的E是公钥(E和 φ(N)互为质数),N是公共模数(质数 P 、Q相乘得到N),MOD就是模运算(2)解密图中的D是私钥(私钥由这个公式计算得出E * D % φ(N) = 1),N是公共模数(质数 P 、Q相乘得到N),MOD就是模运算,φ(N)是欧拉函数(由这个公式计算得出φ(N) = (P-1)(Q-1))。二、例题及解题脚本--RE49-signin此题中:密文:ad939ff59f6e70bcbfad406f2494993757eee98b91bc244184a377520d06fc35大整数N:103461035900816914121390101299049044413950405173712170434161686539878160984549公钥E:655371.先通过N算出P和Q:方法一、通过大素数分解网站http://factordb.com/index.php方法二、用离线暴力破解工具yafu(使用教程见工具目录下README)进入文件目录后打开cmd,输入yafu-x64 factor(),括号内填要分解的大素数得到P=282
Norman1z