PicoCTF 2014 write up cuộc thi đầu tiên
1. Tyrannosaurus Hex - 10
15. Toaster Control - 50
16. Spoof Proof - 60
The contents of the flash drive appear to be password protected. On the back of the flash drive, you see the hexadecimal number 0xf281b7b5 scribbled in ink. The password prompt, however, only accepts decimal numbers. What number should you enter? (Press the Hint button for advice on solving the challenge)
Bài này các bạn chỉ cần google Hex to Dec thì sẽ ra rất nhiều trang web, mình sẽ sử dụng Ubuntu
Gõ lệnh python -> sau đó nhập tương tự 0xf281b7b5 vào là nó sẽ tự tính ra kết quả :D
Answer: 4068587445
2. No Comment - 20
The CD you find has a copy of your father's website: homepage.html. Maybe something is hidden in the site...
Hint: You may want to use your browser to view the source of the web page.
Các bạn vào link trên , thì việc đầu tiên ta làm là quan sát source của thử
Answer: flag_fbfaf37acbd095fc958b4fcf817044293243d3c1
3. Common Vulnerability Exercise - 20
This disc is encrypted. The surprisingly elaborate password hint refers to "the CVE Identifier for a 2014 vulnerability that allowed arbitrary code execution in Firefox via a buffer overflow in a speech codec". If you found this "CVE-ID" thingy, it'd probably be the password.
Thì mình cũng tìm hiểu nhiều các cái CVE , nên khi gặp bài này thì k gì khó cả, bài này thử thách khả năng đọc hiểu + google thôi
password hint refers to "the CVE Identifier for a 2014 vulnerability that allowed arbitrary code execution in Firefox via a buffer overflow in a speech codec"
-> nghĩa là CVE này là 1 lỗ hỏng vào năm 2014 cho phép thực thi bất kì code nào trong firefox thông qua lỗ hỏng tràn bộ đệm trong bộ giải mã âm thanh/lời ( mấy cái codec ấy )
-> giờ ta google theo những gì ta hiểu: cve 2014 firefox buffer overflow speech codec
Ta tìm được trang này ở kết quả tìm kiếm đầu tiên luôn
Answer: CVE-2014-1542
4. Caesar - 20
hint: Is there a cipher named the same as the title of this problem?
:V bài này thì học trên lớp mật mã học cơ bản nhé
Ta bỏ cipher: uiftfdsfuqbttqisbtfjtmofjoakbiirvghubisvjewckyuwlie vào kt.pe thử nào
Nhìn ở ROT25 -> Answer: thesecretpassphraseislneinzjahhqufgtahruidvbjxtvkhd
5. The Valley of Fear - 20
The hard drive may be corrupted, but you were able to recover a small chunk of text. Scribbled on the back of the hard drive is a set of mysterious numbers. Can you discover the meaning behind these numbers? (1, 9, 4) (4, 2, 8) (4, 8, 3) (7, 1, 5) (8, 10, 1)
hint: Might each set of three numbers represent a word in a message?
Nhìn những số trên, mình liên tưởng đến tọa độ, giống trong mặt phẳng Oxy thì tọa độ (x,y) chỉ vị trí
Tương tự trong trường hợp này có thể ( x , y , z ) ở đây x chỉ đoạn văn bản thứ x , y chỉ hàng y , z chỉ từ thứ z
mình thử với ( 1,9,4 ) -> đoạn 1, hàng 9, chữ thứ 4 -> the
(4,2,8) -> đoạn 4 , hàng 2, chữ thứ 8 -> flag
the flag ? ok đúng hướng r , tiếp tục các tọa độ còn lại
(4,8,3) -> đoạn 4 , hàng 8 , chữ thứ 3 -> is
(7,1,5) -> đoạn 7 , hàng 1 , chữ thứ 5 -> Ceremonial
(8,10,1) -> đoạn 8 , hàng 10 , chữ thứ 1 -> plates
-> answer : Ceremonialplates
6. Internet Inspection - 30
On his computer, your father left open a browser with the Thyrin Lab Website. Can you find the hidden access code?
hint: It may be helpful to learn how to 'Inspect Elements' in your browser.
Nhìn vào ta nhận ra là có 1 cái bảng table nó bị che đi -> giờ mình để chuột ở phần bị che ấy, nhấp chuột phải chọn inspect elements
Các bạn sẽ thấy nó có 1 cái div có id checker và nó sẽ đè 1 cái image lên trên cái table của mình, mình xóa luôn nguyên cái div đó thử xem sao
Sau khi xóa xong, cái background kia đã mất, nhưng nó vẫn khá mờ, cơ mà lúc này ta inspect element lại tại vị trí đó, ta có thể thấy hết tất cả nội dung của bảng table đó
Answer: flag_4cb5543cdb221801a5c527be13c14f4742332fda
7. Pickle Jar - 30
The police station offers free pickles to police officers. However, someone stole the pickles from the pickle jar! You find a clue on a USB drive left at the scene of the crime.
Jar? -> Java decompiler nào :D
Ta sẽ sử dụng trang này để decompiler
Nhưng mà -_- sao nó chạy lâu thế
-_- chắc có gì đó sai sai,
mình đem thử file đó vào Ubuntu phân tích thử, extract here, và vào thư mục, ta thấy 1 file pickle.p lạ lạ, mở thử và ta tìm được flag
mình đem thử file đó vào Ubuntu phân tích thử, extract here, và vào thư mục, ta thấy 1 file pickle.p lạ lạ, mở thử và ta tìm được flag
Answer : YOUSTOLETHEPICKLES
8. RoboPhoto - 30
Your father has been known to use the titles of his favorite books as passwords. While you don't remember any of the names of the books, your father keeps a poster for one of them on his wall. Can you figure out the name of the book and unlock the CD?
hint: Google is once again your friend.
Hmm, theo bài thì có vẻ như ông bố này thích sử dụng tựa của những cuốn sách ổng thích làm password, giờ thì poster kia cho ta thấy bìa của cuốn sách, giờ chỉ việc tìm tên là ra flag? easy?
Ta sẽ sử dụng trang này để tìm kiếm hình ảnh
Ok có rất nhiều kết quả, giờ tìm tên và submit thôi :D
Answer: POSITRONIC MAN
9. Grep is Still Your Friend - 40
The police need help decrypting one of your father's files. Fortunately you know where he wrote down all his backup decryption keys as a backup (probably not the best security practice). You are looking for the key corresponding to
daedaluscorp.txt.enc
. The file is stored on the shell server at /problems/grepfriend/keys
.
Hmm nôm na là tìm cái file daedalus.corp.txt.enc trong thư mục /prolems/grepfriends/keys
kết nối server rồi grep tìm thôi :D easy
do server 2014.picoctf.com nó đã tắt r , nên mình không demo được
10. Javascrypt - 40
Tyrin Robotics Lab uses a special web site to encode their secret messages. Can you determine the value of the secret key?
hint: You may want to learn how to use you browser's JavaScript console.
Truy cập trang web, và viewsource ta thấy được 1 đoạn code javascript
Ta đọc code và để ý là function generatekey() -> sẽ tính toán ra flag_số của code thực thi
-> giờ ta chỉ việc tính toán xem số đó là gì
Mình thì sida javascript nên mình code python :v
Answer: flag_3966
11. ZOR - 50
hint: The password gets reduced to a one byte XOR key. That's only 256 possible keys!
theo như hint thì có vẻ như file này đã bị xor với 1 kí tự nào đó -> chỉ có 1 trông 256 key là có thể
giờ thì ta để ý , các chữ cái tHIsMESSAGE.....
có vẻ như chúng không có khoảng trắng nhỉ ?
mình thử xor H và h thử ( vì tự nhiên tHIs là sao, lạ lạ, this chứ nhỉ )
và trùng hợp, nó lại ra hex 20 là space
-> ok có vẻ như key là ' ' nhỉ
thử phân tích với HxD thì thấy đúng thật
giờ mình sẽ viết code xor để tìm ra file gốc thôi :D
toẹt vời
Answer: 40a887b20da9c4a35b135dbfbc11a4
12. Substitution - 50
There's an authorization code for some Thyrin Labs information here, along with someone's favorite song. But it's been encrypted! Find the authorization code.
encrypted.txt
encrypted.txt
hint: You may want to look at what the relative frequencies of letters in english text are.
:v mình thì tính lười, quăng vô quipquip coi ra gì k :v
:v easy Answer: awholenewworld
13. Basic ASM - 60
We found this program snippet.txt, but we're having some trouble figuring it out. What's the value of %eax when the last instruction (the NOP) runs?
hint: You may want to convert the assembly into some equivalent C code, which will be easier to read!
:v bài này chủ yếu thử thách khả năng đọc code thôi
Theo như phân tích đề cho ta các dữ kiện sau đây
ebx = 16882
eax = 1134
ecx = 28967
if ( ebx < eax ):
ebx*= eax
ebx+= eax
eax = ebx
eax-= ecx
else :
ebx*= eax
ebx-= eax
eax = ebx
eax+= ecx
eax = 1134
ecx = 28967
if ( ebx < eax ):
ebx*= eax
ebx+= eax
eax = ebx
eax-= ecx
else :
ebx*= eax
ebx-= eax
eax = ebx
eax+= ecx
tính giá trị của eax trước khi nó qua NOP
:v okay có code r, chạy tính thôi
Answer: 19172021
14. Redacted - 50
You found a letter that may shed light on recent events.
hint: That "super secret access code" looks interesting. I wonder if the info behind the black boxes is really gone for good?
hmm , pdf file? mình sẽ giới thiệu các bạn trang này để xử các thể loại pdf
bỏ file vô và tải file gốc về thôi :v
Answer: one_two_three_four
You found a letter that may shed light on recent events.
hint: That "super secret access code" looks interesting. I wonder if the info behind the black boxes is really gone for good?
hmm , pdf file? mình sẽ giới thiệu các bạn trang này để xử các thể loại pdf
bỏ file vô và tải file gốc về thôi :v
Answer: one_two_three_four
15. Toaster Control - 50
Daedalus Corp. uses a web interface to control some of their toaster bots. It looks like they removed the command 'Shutdown & Turn Off' from the control panel. Maybe the functionality is still there...
hint: Some symbols need to be URL Encoded when included in GET requests.
hint: Some symbols need to be URL Encoded when included in GET requests.
Hmm, nôm na ý đề là có 1 lệnh Shutdown & turn off trong control pane nhưng mà bị xóa mất cái lệnh đó r, nhưng mà chức năng nó vẫn còn đó
Thì cái này làm ta nhớ đến action result
-> khi gọi lệnh thì nó phải gọi đến cái action đúng không, thế nếu xóa lệnh rồi thì action sẽ vẫn còn đó thôi, gọi trực tiếp là được
Buồn cái muốn test cơ mà web die r -_- , cái này thì các bạn chỉ cần chọn 1 command bất kì sau đó ở phần action, thêm vào Shutdown%20%26%20Turn%20Off là được
Thì cái này làm ta nhớ đến action result
-> khi gọi lệnh thì nó phải gọi đến cái action đúng không, thế nếu xóa lệnh rồi thì action sẽ vẫn còn đó thôi, gọi trực tiếp là được
Buồn cái muốn test cơ mà web die r -_- , cái này thì các bạn chỉ cần chọn 1 command bất kì sau đó ở phần action, thêm vào Shutdown%20%26%20Turn%20Off là được
16. Spoof Proof - 60
The police have retrieved a network trace of some suspicious activity. Most of the traffic is users viewing their own profiles on a social networking website, but one of the users on the network downloaded a file from the Thyrin Labs VPN and spoofed their IP address in order to hide their identity. Can you figure out the last name of person that accessed the Thyrin files, and the two source IP addresses they used?
[Example valid flag format: "davis,192.168.50.6,192.168.50.7"]
PCAP file available here. You can also view it on CloudShark
hint: The IP address was changed, but what about the MAC Address?
[Example valid flag format: "davis,192.168.50.6,192.168.50.7"]
PCAP file available here. You can also view it on CloudShark
hint: The IP address was changed, but what about the MAC Address?
Nôm na là giờ mình cần tìm 1 đứa mà nó dùng 2 IP vào cùng 1 trang web đó, submit dưới dạng
name,IP1,IP2
Thì như hint đã nói, fake IP được nhưng MAC thì rất khó để fake
Vậy ta chỉ cần check xem trong các kết nối đến, nếu cùng 1 MAC mà có 2 IP thì sẽ ra kết quả
Mình sẽ vào Menu -> stastics -> Endpoint để xem có bao nhiêu IP và MAC trong gói
name,IP1,IP2
Thì như hint đã nói, fake IP được nhưng MAC thì rất khó để fake
Vậy ta chỉ cần check xem trong các kết nối đến, nếu cùng 1 MAC mà có 2 IP thì sẽ ra kết quả
Mình sẽ vào Menu -> stastics -> Endpoint để xem có bao nhiêu IP và MAC trong gói
Các bạn để ý ở gói thứ 58, địa chỉ 192.168.50.4 đang cố gắng để GET secretfile.txt -> chắc chắn th Attacker đây r, vậy là ta có đc 1 IP rồi, giờ tìm xem tên và địa chỉ còn lại của nó dựa theo MAC thôi
MAC: 08:00:27:2b:f7:02
bằng cách lọc theo các request, ta đã tìm được IP: 192.168.50.3 chính là thằng còn lại có cùng IP MAC , và tên của nó là johnson
Answer: johnson,192.168.50.3,192.168.50.4
17. This is the Endian - 40
This is the end! Solving this challenge will help you defeat Daedalus's cyborg. You can find more information about endianness and the problem here. The flag is the smallest possible program input that causes the program to print "Access Granted".
hint: Integers are 4 bytes (characters) long.
Thì bài này nôm na giờ bạn nhập vào 1 chuỗi sao cho thỏa
answer[0] == 0x52657663 && answer[1] == 0x30646521
MAC: 08:00:27:2b:f7:02
bằng cách lọc theo các request, ta đã tìm được IP: 192.168.50.3 chính là thằng còn lại có cùng IP MAC , và tên của nó là johnson
Answer: johnson,192.168.50.3,192.168.50.4
17. This is the Endian - 40
This is the end! Solving this challenge will help you defeat Daedalus's cyborg. You can find more information about endianness and the problem here. The flag is the smallest possible program input that causes the program to print "Access Granted".
hint: Integers are 4 bytes (characters) long.
Thì bài này nôm na giờ bạn nhập vào 1 chuỗi sao cho thỏa
answer[0] == 0x52657663 && answer[1] == 0x30646521
thì để dễ dàng hơn thì ta nên nhập kiểu ASCII như vậy chỉ cần nhập 8 kí tự là xong
do shell die rồi nên k lấy flag được -_-
18. Intercepted Post - 40
We intercepted some of your Dad's web activity. Can you get a password from his traffic?. You can also view the traffic on CloudShark.
hint: Login is usually done through a POST request. Then, depending on what characters are in Claudio's password, they may be specially encoded...
Bài này yêu chúng ta lấy mật khẩu :D -> khi nhập thông tin thì mật khẩu sẽ được gửi lên với gói HTTP POST, vậy ta giờ sẽ lọc các gói POST 1.1 ra mà mò thôi :D or dùng câu lệnh http contains 'string' trong đó string là từ mà ngta sẽ lưu trữ ví dụ txtMatKhau, passwd, password ,....
câu lệnh mình dùng lọc sẽ là http.response || http contains "pass"
thì ta tìm được
do shell die rồi nên k lấy flag được -_-
18. Intercepted Post - 40
We intercepted some of your Dad's web activity. Can you get a password from his traffic?. You can also view the traffic on CloudShark.
hint: Login is usually done through a POST request. Then, depending on what characters are in Claudio's password, they may be specially encoded...
Bài này yêu chúng ta lấy mật khẩu :D -> khi nhập thông tin thì mật khẩu sẽ được gửi lên với gói HTTP POST, vậy ta giờ sẽ lọc các gói POST 1.1 ra mà mò thôi :D or dùng câu lệnh http contains 'string' trong đó string là từ mà ngta sẽ lưu trữ ví dụ txtMatKhau, passwd, password ,....
câu lệnh mình dùng lọc sẽ là http.response || http contains "pass"
thì ta tìm được
giờ thì tìm và lấy pass thôi :D
Answer: flag{pl$_$$l_y0ur_l0g1n_form$}
Answer: flag{pl$_$$l_y0ur_l0g1n_form$}
19. PNG or Not? - 100
On a corner of the bookshelf, you find a small CD with an image file on it. It seems that this file is more than it appears, and some data has been hidden within. Can you find the hidden data?
hint: The PNG file format has a marker for the end of the image.
Ta nhận được 1 file QR , ta sẽ quét QR thử
và nhận ra được là bị troll :v
ok theo đề bài hint thì có vẻ ta phải check header rồi
Mình sẽ dùng zsteg để check xong có giấu gì trong đó thì may mắn thấy trong file ảnh có chứa 1 file flag.txt :D
On a corner of the bookshelf, you find a small CD with an image file on it. It seems that this file is more than it appears, and some data has been hidden within. Can you find the hidden data?
hint: The PNG file format has a marker for the end of the image.
Ta nhận được 1 file QR , ta sẽ quét QR thử
và nhận ra được là bị troll :v
ok theo đề bài hint thì có vẻ ta phải check header rồi
Mình sẽ dùng zsteg để check xong có giấu gì trong đó thì may mắn thấy trong file ảnh có chứa 1 file flag.txt :D
ở đầu header có chữ 7z -> extract khúc đó vào 1 file mới sẽ ra 1 file 7z
sau đó mở file 7z vừa tạo :D
lấy flag
Answer: EKSi7MktjOpvwesurw0v
sau đó mở file 7z vừa tạo :D
lấy flag
Answer: EKSi7MktjOpvwesurw0v
20. Snapcat - 80
It was found that a Daedalus employee was storing his personal files on a work computer. Unfortunately, he corrupted the filesystem before we could prove it. Can you take a look? Download here.
hint : It seems like data recovery can be performed on the disk.img--maybe you'll find something?
Thì với bài này ta có 1 tool recovery tốt đó là foremost :D có sẵn trong kali
ta chỉ việc chạy lệnh và nhận hàng thôi
Ta đã thấy được trong file img đó có 5 ảnh, và ảnh thứ 2 chính là flag :D
Answer : i_can_has_cheezburger
It was found that a Daedalus employee was storing his personal files on a work computer. Unfortunately, he corrupted the filesystem before we could prove it. Can you take a look? Download here.
hint : It seems like data recovery can be performed on the disk.img--maybe you'll find something?
Thì với bài này ta có 1 tool recovery tốt đó là foremost :D có sẵn trong kali
ta chỉ việc chạy lệnh và nhận hàng thôi
Ta đã thấy được trong file img đó có 5 ảnh, và ảnh thứ 2 chính là flag :D
Answer : i_can_has_cheezburger
21. RSA - 80
A Daedalus Corp spy sent an RSA-encrypted message. We got their key data, but we're not very good at math. Can you decrypt it? Here's the data. Note that the flag is not a number but a number decoded as ASCII text.
hint: This is just plain old RSA decryption.
Đây là 1 bài giải RSA căn bản khi ta đã có đủ dữ kiện N , C và d ta dễ dàng tìm được plaintext ban đầu
Mình đã đổi N, d , C sang dạng dec
sau khi tính toàn ta chỉ việc lấy kết quả bỏ vào ô INT ở trang này là ra flag
Answer: modular_arithmetics_not_so_bad_after_all
22. Droid App - 80
A Daedalus Corp spy sent an RSA-encrypted message. We got their key data, but we're not very good at math. Can you decrypt it? Here's the data. Note that the flag is not a number but a number decoded as ASCII text.
hint: This is just plain old RSA decryption.
Đây là 1 bài giải RSA căn bản khi ta đã có đủ dữ kiện N , C và d ta dễ dàng tìm được plaintext ban đầu
Mình đã đổi N, d , C sang dạng dec
sau khi tính toàn ta chỉ việc lấy kết quả bỏ vào ô INT ở trang này là ra flag
Answer: modular_arithmetics_not_so_bad_after_all
22. Droid App - 80
An Android application was released for the toaster bots, but it seems like this one is some sort of debug version. Can you discover the presence of any debug information being stored, so we can plug this?
You can download the apk here.
You can download the apk here.
hint: Android apk files are notoriously easy to decompile. We heard there are even online services that does this automatically nowadays.
Ta nhận được 1 file APK, thì theo quán tính, ta k mở file apk ra đọc làm gì cả :v ta cứ decompiler đã xem source nó ntn :v
ta sẽ dùng trang này để decompiler
Sau khi compiler xong, ta được 1 file zip, extract và thấy có 1 thư mục picoapp445, check từng file ta tìm được flag :D
Answer: what_does_the_logcat_say
23. Function Address - 60
We found this program file on some systems. But we need the address of the 'find_string' function to do anything useful! Can you find it for us?
hint: objdump or another disassembler may be useful to you. There are only two functions in the binary that are actually created by the user, and one of them is main.
Mình thử chạy file và check thử xem nó bảo gì thì nó yêu cầu ta tìm địa chỉ của find_string
ta có thể tìm với gdb hoặc objdump
Mình tìm với objdump với câu lệnh
objdump -S problem
We found this program file on some systems. But we need the address of the 'find_string' function to do anything useful! Can you find it for us?
hint: objdump or another disassembler may be useful to you. There are only two functions in the binary that are actually created by the user, and one of them is main.
Mình thử chạy file và check thử xem nó bảo gì thì nó yêu cầu ta tìm địa chỉ của find_string
ta có thể tìm với gdb hoặc objdump
Mình tìm với objdump với câu lệnh
objdump -S problem
ta dễ dàng tìm được địa chỉ là : 8048444
Answer: 8048444
Answer: 8048444
Hay đấy :D
Trả lờiXóaThảo ơi. Anh yêu em.
Trả lờiXóa