2020年打的第一场比赛,题目不难,时间都花去解密码题了,虽然也没解出几道(还是太菜了
Crypto
warm_up
rsa+rabin+xor
共因子分解 p、q,再求s
又gcd(125794,phi)==2,只能算出 s**2 mod n
所以就有了 pow(s,2,p*q) = c
p,q,c已知幂为2,其实就是rabin加密,可以算出4个s,其中有且仅有一个素数,由此得到s就可以算phi了
1 | import gmpy2 |
flag{79cef3d7-2c49-4cc6-94a3-e058c6c42835}
EasyRSA
共模攻击
1 | n = 27560959918385616419486273009594513460044316476337842585463553105701869531698366304637678008602799005181601310816935394003041930445509801196554897781529962616349442136039951911764620999116915741924245788988332766182305635804754798018489793066811741026902011980807157882639313892932653620491354630354060462594865874663773934670618930504925812833202047183166423043264815905853486053255310346030416687430724204177468176762512566055165798172418622268751968793997676391170773216291607752885987933866163158257336522567086228092863302685493888839866559622429685925525799985062044536032584132602747754107800116960090941957657 |
easy_RSA
就一个知识点
q = (2**1024 - 1) ^ p + 65537 => (q-65537) + p = 2**1024 - 1
p+q == 2**1024-65538
解一元二次方程
1 | from Crypto.Util.number import * |
LCG
LCG to DSA,k存在线性关系
参考
https://github.com/pcw109550/write-up/tree/master/2019/DEFCON/tania
魔改下sage代码,改得不太好,成功率大概百分之五十(虚拟机sage恢复快照恢复没了,没写成exp,拼手速
sage在线https://sagecell.sagemath.org/
1 | p = 130333458067095360348130950721230774751621761834488608409527025002236423782720410777827282553809013041996307514477632173973104508525268490069618923242342738301435251323204357581290464182936651741782879029384520572881285707893688816385746123467926351757503503539294480789448841461659407755817883221473523487973 |
对admin签名
1 | from Crypto.Util import number |
get flag flag{8213638b-3f00-46e4-8250-6ab802ee9906}
题目
1 | #!/usr/bin/env python3 |
Reverse
easyVM
逆指令,人肉汇编,直接口算flag
1 | 0x72, 0xDE, 0xC1, 0xD4, 0x6D, 0x58, 0x6B, 0x2D, 0x87, 0x69, 0xC8, 0x6E, 0xDC, 0x47, 0xD3, 0x61, 0xC6, 0x71, 0x29, 0x7D |
当然更简单的就是angr一把梭,秒出答案
1 | import angr |
babymac
mac逆向,mac虚拟机只剩一个压缩包在移动硬盘,解压完静态看完了(移动硬盘速度实慢),就懒得动态了,很简单就一条方程,直接4个字节、4个字节爆flag完事,速度还行
1 | from Crypto.Util.number import bytes_to_long,long_to_bytes |
WEB
ezupload
过滤了php等等一些字符,传shell,蚁剑连接执行readflag即可
1 | <script language="phP"> |
flag{39b842b4-a290-4fe8-9d83-757ff4a8b4cc}