CpawCTF writeup(1)

# 0 まず
高校1年のもちもちといいます。セキュリティキャンプ2021やCODEBLUE2022に参加してモチベが爆上がりしてるのでCTFの勉強を久しぶりに再開しました。とりあえず初日なので初心者向けのCTFであるCpawCTFのLevel 1を全完した
# 1 Test Problem
cpaw{this_is_Cpaw_CTF}
# 2 Classical Cipher
https://www.geocachingtoolbox.com/index.php?lang=en&page=caesarCipher

cpaw{Caesar_cipher_is_classical_cipher}
# 3 Can you execute ?
```
motimotipurinn:/mnt/c/Users/user/Downloads$ file exec_me
exec_me: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=663a3e0e5a079fddd0de92474688cd6812d3b550, not stripped
motimotipurinn:/mnt/c/Users/user/Downloads$ ./exec_me
cpaw{Do_you_know_ELF_file?}
```
cpaw{Do_you_know_ELF_file?}
# 4 Can you open this file ? 
```
motimotipurinn:/mnt/c/Users/user/Downloads$ file open_me
open_me: Composite Document File V2 Document, Little Endian, Os: Windows, Version 10.0, Code page: 932, Author: v, Template: Normal.dotm, Last Saved By: v, Revision Number: 1, Name of Creating Application: Microsoft Office Word, Total Editing Time: 28:00, Create Time/Date: Mon Oct 12 04:27:00 2015, Last Saved Time/Date: Mon Oct 12 04:55:00 2015, Number of Pages: 1, Number of Words: 3, Number of Characters: 23, Security: 0
motimotipurinn:/mnt/c/Users/user/Downloads$ mv open_me open_me.doc
```
Name of Creating Application: Microsoft Office Wordとあるのでファイルの拡張子を.docにすることでフラグが見える
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1539611/ef6f0472-cf5f-fdd0-7e7f-bed67e9178eb.png)
cpaw{Th1s_f1le_c0uld_be_0p3n3d}
# 5 HTML Page
BurpでしばいたらResponeseのRowに普通にフラグが書いてあった
```
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 01 Nov 2022 12:48:50 GMT
Content-Type: text/html
Content-Length: 7344
Connection: close
Last-Modified: Fri, 01 Sep 2017 11:55:24 GMT
ETag: "1cb0-5581f6fa70300"
Accept-Ranges: bytes

<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->

    <meta name="keyword" content="ctf,flag">
    <meta name="description" content="flag is cpaw{9216ddf84851f15a46662eb04759d2bebacac666}">
    <meta name="author" content="takahoyo">
```
cpaw{9216ddf84851f15a46662eb04759d2bebacac666}
# 6 River
```
motimotipurinn:/mnt/c/Users/user/Downloads$ identify -verbose river.jpg
Image: river.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Mime type: image/jpeg
  //省略
    exif:GPSInfo: 638
    exif:GPSLatitude: 31/1, 35/1, 69/25
    exif:GPSLatitudeRef: N
    exif:GPSLongitude: 130/1, 32/1, 64659/1250
    exif:GPSLongitudeRef: E
    exif:GPSVersionID: 2, 3, 0, 0
 
```
Latitudeが緯度、Longitudeが軽度なので
31+(35/60)+(69/25/3600)のように計算してGoogle mapにぶちこめばいい
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1539611/7305244d-3c11-d9f7-e5bf-9b6440056fc0.png)
cpaw{koutsukigawa}
Windowsユーザーはフォトから情報ってとこ押したらMAPを直接出現させられることを確認しました
# 7 pcap
Wiresharkとかバイナリエディターでファイル開くだけ
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1539611/4bfe46dc-f2c0-0830-2da6-d5e6fd4644a3.png)
オタク君さぁ...
cpaw{gochi_usa_kami}
# 8 HashHashHash!
https://hashtoolkit.com/decrypt-hash/?hash=

逆変換できないハッシュを無限個データベースにしてる暇人の力を借りていく
cpaw{Shal}
# 9 並べ替えろ!
```py
data=[15,1,93,52,66,31,87,0,42,77,46,24,99,10,19,36,27,4,58,76,2,81,50,102,33,94,20,14,80,82,49,41,12,143,121,7,111,100,60,55,108,34,150,103,109,130,25,54,57,159,136,110,3,167,119,72,18,151,105,171,160,144,85,201,193,188,190,146,210,211,63,207]
data.sort(reverse=True)
print(''.join(map(str, data)))
```
```
motimotipurinn:/mnt/c/dev/pydev$ python3 pico.py 
2112102072011931901881711671601591511501461441431361301211191111101091081051031021009994938785828180777672666360585755545250494642413634333127252420191815141210743210
```
cpaw{2112102072011931901881711671601591511501461441431361301211191111101091081051031021009994938785828180777672666360585755545250494642413634333127252420191815141210743210}

# 終わりに
ちょっと簡単すぎたから明日はLevel2やります
後編です

https://qiita.com/motimotipurinn/items/d1242a0d70c73c0f21e9