Skip to content

Commit 1150c5c

Browse files
committed
Added writeup for get-the-flag of ekoparty-pre-ctf-2015
1 parent 1f15f73 commit 1150c5c

File tree

1 file changed

+44
-0
lines changed
  • ekoparty-pre-ctf-2015/misc/get-the-flag/chaitan94

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[](ctf=ekoparty-2015)
2+
[](type=misc)
3+
[](tags=scraping)
4+
[](tools=)
5+
[](techniques=)
6+
7+
# Get the flag (misc-50)
8+
9+
Problem description says:
10+
> GET all the flags! literally.
11+
>
12+
> Hints: Source code anyone? GET them all
13+
14+
GET in capital suggests a HTTP GET request, so maybe we should download all the flags from the website?
15+
16+
Worth the try, so I opened up [scoreboard](https://ctf.ekoparty.org/prectf-scoreboard) and ran the following javascript in the console:
17+
18+
```javascript
19+
var flags = [];
20+
var imgs = $("table img");
21+
for (var i=0; i<imgs.size(); ++i) {
22+
var url = imgs[i].src;
23+
var country = url.split('/')[6].split(".")[0];
24+
if (flags.indexOf(country) == -1)
25+
flags.push(country);
26+
}
27+
console.log(flags.join(","));
28+
```
29+
30+
This gives out all the codes of countries, might not be necessarily exhaustive, but good enough data for now.
31+
32+
> "RUS,MNG,UKR,VNM,INT,GBR,USA,TWN,FRA,ARG,COL,ESP,HUN,EUR,BRA,NLD,DEU,URY,IDN,KOR,IND,MEX,BHR,HKG,MKD,BHS,EGY,SMR,JPN,THA,MLT,IRN,CHN,AUS,ITA,AND,CHL,TUR,UZB,ALB,MDA,CAN,BOL,PER,BGR,SVK,AFG,ECU,JOR,ISL,AGO,MAR,DZA,FIN,AZE,CZE,CRI"
33+
34+
Now, we can use wget and download all the flags.
35+
36+
```bash
37+
$ for i in RUS MNG UKR VNM INT GBR USA TWN FRA ARG COL ESP HUN EUR BRA NLD DEU URY IDN KOR IND MEX BHR HKG MKD BHS EGY SMR JPN THA MLT IRN CHN AUS ITA AND CHL TUR UZB ALB MDA CAN BOL PER BGR SVK AFG ECU JOR ISL AGO MAR DZA FIN AZE CZE CRI ; do wget https://ctf.ekoparty.org/static/img/flags/$i.png ; done
38+
```
39+
Now let's look for the flag
40+
```bash
41+
strings *.png | grep EKO
42+
```
43+
Aand there's the flag:
44+
> EKO{misc_challenges_are_really_bad}

0 commit comments

Comments
 (0)