rgbCTF2020 [Writeup]

H0j3n
4 min readJul 13, 2020

--

An online Infosecurity competition organized by the RGBsec CTF team.

WEB

This whole CTF is really just one big web challenge

[Typeracer]

Typeracer

If we take a look at their obf.js we will see something like this.

Obfuscate Javascript

So from here what I did was to decode hex with python3. So what happens is the value hex will be decoded and you can understand more the javascript.

a = """<put everything inside here>
"""
print(a)

Then I try to play with a breakpoint on source using Chrome then I found this.

obf.js

So we got our flag encoded with base64.

Flag encoded bas64
FLAG : rgbCTF{w40w_j4v42cr1p7_12_4nn0y1ng}

[TicTacToe]

If we take a look at obj.fs we found something like this.

Then we decode the hex using the same technique on Typeracer. After taking a look at the javascript there is one variable that captures my eye which is _0x4055. So by breakpoint the variable we can found the flag.

FLAG : rgbCTF{h4h4_j4v42cr1p7_ev3n72_AR3_c00L}

BEGINNER

[Sanity Check]

Sanity Check

Make sure we can get this at least haha

FLAG : rgbCTF{g0_g3t_th4t_j4m!}

[Basic Challenge]

To get the flag go to [1] and [2] decode like this

Binary > Hex > Base64 > Octal > FLAG

And we will get the flag

FLAG : rgbCTF{c0ngr4ts_0n_b3ing_B4SIC}

[Joke Check!]

You can use [2] to get the flag which brute force caesar cipher

Cipher = crmNEQ{l_nstnvpy_nlpdlc_dlwlo}FLAG : rgbCTF{a_chicken_caesar_salad}

[Shoob]

By using [4]. We can try all kinds of techniques in stego and we can check if we get any interesting images or information.

FLAG : rgbCTF{3zier_4haN_s4n1ty}

[A Fine Day]

Sujd jd bgxopksbm ljsu tg tqqjgb xjkubo. Tqqjgb xjkubod tob t qvor vq dhidsjshsjvg xjkubo. Jsd nbp xvgdjdsd vq slv ghribod, t tgm i. Sv bgxopks t cbssbo, rhcsjkcp jsd kctxb jg sub tckutibs (dv t=0, i=1, bsx.) ip t, tgm subg tmm i. Qjgtccp stnb suts rvm 26 tgm xvgwbos js itxn jgsv t xutotxsbo.
Sub tqqjgb xjkubo jdg's obtccp suts dsovgf. Djgxb js'd rvm 26, subob tob vgcp t qbl uhgmobm mjqqbobgs nbpd, lujxu xtg ib btdjcp iohsb qvoxbm. Tgpltp, ubob'd pvho qctf: ofiXSQ{t_qjgb_tqqjgb_xjkubo}

So by using [3] . We can get the flag.

FLAG : rgbCTF{a_fine_affine_cipher}

[Simple RSA]

So we are give n,c and e

n = 5620911691885906751399467870749963159674169260381
e = 65537
c = 1415060907955076984980255543080831671725408472748

So by getting the prime numbers from n using [5]

p = 255097177
q = 22034393943473183756163118460342519430053

You can any tools or script or your own ways but I use my script.

from Crypto.Util.number import inverse
import binascii
import codecs
c = 1415060907955076984980255543080831671725408472748
e = 65537
n = 5620911691885906751399467870749963159674169260381
p = 255097177
q = 22034393943473183756163118460342519430053
phi = (p-1) *(q-1)
d = inverse(e,phi)
m = pow(c,d,n)
bytes_object = bytes.fromhex(hex(m)[2:])
print(bytes_object)

By running this script we can get our flag.

FLAG : rgbCTF{brut3_f0rc3}

[Quirky Resolution]

So we are given a png file and what I did was using Stegoveritas with the image. By looking at the image there is several images that looks different.

Since it looks like a QR code so I use zbarimg to scan and we got the flag :)

FLAG : rgbCTF{th3_qu1rk!er_th3_b3tt3r}

[Pieces]

So we have a java file and I have reversed it and get the alphabet for each symbol. Here is code to get the flag.

a = {"a":"0/","b":"1|","c":"1/","d": "2|","e": "2/","f": "3|", "g":"3/","h": "4|", "i":"4/" ,"j":"5|", "k":"5/", "l":"6|" ,"m":"6/", "n":"7|" ,"o":"7/" ,"p":"8|", "q":"8/" ,"r":"9|", "s":"9/", "t":":|", "u":":/", "v":";|", "w":";/","x":"<|","y":"</","z":"="}

ans = ["9|","2/","9/",":|","4/","7|","8|","4/","2/","1/","2/","9/"]
realflag = ""

for i in ans:
for j in a:
if i == a[j]:
realflag += j
print(realflag)

[r/ciphers]

By using [3] we can get the flag.

FLAG : rgbCTF{just_4sk_th3_int3rn3t_t0_d3crypt_it}

--

--

No responses yet