You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+161-40
Original file line number
Diff line number
Diff line change
@@ -16,10 +16,10 @@ $ pip install cython
16
16
17
17
### Installation
18
18
19
-
After fulfilling the prerequisites, you can directly clone this repository or download the source from our [releases](https://github.com/eiji98/CTFdScraper/releases).
19
+
After fulfilling the prerequisites, you can directly clone this repository or download the source from our [releases](https://github.com/hanasuru/CTFdScraper/releases).
Simple CTFd-based scraper for challenges gathering
43
44
44
45
positional arguments:
45
46
user Username/email
46
-
passwd User password
47
+
passwd Password
47
48
url CTFd platform url
48
49
49
50
optional arguments:
50
51
-h, --help show this help message and exit
51
-
--data data Populate from chall.json
52
+
--data data Populate from challs.json
53
+
--proxy proxy Request behind proxy server
52
54
--path path Target directory, default: CTF
53
-
--worker worker Number of threads, default: 3
55
+
--worker worker Number of threads, default: 10
54
56
--scheme scheme URL scheme, default: https
55
-
--override Overrides old chall file
56
-
--no-download Don't download chall assets
57
+
--enable-cloud Permit file download from a cloud drive, default=False
58
+
--override Override existed chall file
59
+
--no-download Don't download chall file
60
+
--export Export challenges directory as zip, default=False
57
61
58
62
```
59
-
### Collect challenges
63
+
### Collect challenges by credentials
60
64
61
65
By default, you need to define `username`, `password`, and `CTFd` url respectively (use HTTPS by default).
62
66
63
67
```bash
64
68
$ python ctfd.py user passwd https://some-domain
65
69
```
66
70
67
-
Alternatively, you can also populate only the challenges from an existed `challs.json`. Unfortunately, you need to pass `username` & `password` in order to download the [internal files](https://github.com/CTFd/CTFd/issues/789) . Furthermore, check the [examples](./examples/CTF/challs.json).
71
+
### Enable Cloud-files download
72
+
73
+
By default, this option are disabled due to file size issues where user accidentally spend most of internet quotas from downloading a large file. Otherwise, you can enable this opting by passing `--enable-cloud` argument
74
+
75
+
```bash
76
+
$ python ctfd.py user passwd https://some-domain --enable-cloud
77
+
```
78
+
79
+
Currently, only `Google-drive` and `Dropbox` that are supported.
80
+
81
+
As a note, the review that shows size output may be wrong (false positive) due to the usage of request.get(url, stream=True) in order to get the `Content-Length` header
82
+
83
+
### Override existed challenges file
84
+
85
+
During CTF competition, the organizer may update the current binary/file. Unfortunately, by default `CTFdScraper` couldn't override the existed challenges file. If you insist to modify the current binary/file, you need to pass `--override` argument
86
+
87
+
```bash
88
+
$ python ctfd.py user passwd https://some-domain --override
89
+
```
90
+
91
+
### Collect challenges by existed `challs.json`
92
+
93
+
Alternatively, you can also populate only the challenges from an existed `challs.json`. Additionally, you can also combine with `--enable-cloud`&`--override` to download files from a cloud drive. Furthermore, check the [examples](./examples/CTF/Arkavidia/challs.json).
68
94
69
95
```bash
70
96
# Populate challenges only from existed data
71
-
$ python2 ctfd.py --data challs.json
97
+
$ python ctfd.py --data challs.json
72
98
73
99
# Populate challenges alongwith files
74
100
$ python ctfd.py user passwd https://some-domain --data chall.json
To be able to conduct a requests behind proxy you need to pass `--proxy proxy-server` argument or manually add `export http_proxy="http://host:port"`.
109
+
110
+
```bash
111
+
$ python ctfd.py user passwd https://some-domain --proxy 127.0.0.1:8080
112
+
113
+
# or set up an environtment variable
114
+
$ export http_proxy = "http://127.0.0.1:8080"
115
+
$ export https_proxy = "http://127.0.0.1:8080"
116
+
```
117
+
118
+
### Wrap up the CTFd folder into a Zip file
119
+
120
+
For archiving purpose, you can save the `CTFd` folder as a Zip file by passing the `--export` argument
121
+
122
+
```bash
123
+
$ python ctfd.py user passwd https://some-domain --export
75
124
```
76
125
77
126
Lastly, the collected challenge will be saved to `CTF/${ctf_name}`
@@ -84,63 +133,135 @@ directory. You can customize the path by passing `--path pathname`argument.
84
133
```bash
85
134
$ tree
86
135
.
87
-
├── challs.json
88
-
├── Crypto
89
-
│ ├── 007-1
90
-
│ │ ├── chall.zip
91
-
│ │ └── README.md
92
-
│ └── Simple Math
93
-
│ ├── chall.zip
94
-
│ └── README.md
95
-
└── Web
96
-
├── ArkavPay
97
-
│ ├── ArkavPay.zip
98
-
│ └── README.md
99
-
├── Balasan Buruk
100
-
│ └── README.md
101
-
└── Edit Your Source
102
-
└── README.md
136
+
└── Online Playground CTF for Beginner
137
+
├── challs.json
138
+
├── Cryptography
139
+
│ ├── Base64
140
+
│ │ └── README.md
141
+
│ └── Single-Byte XOR Cipher
142
+
│ └── README.md
143
+
├── Forensic
144
+
│ ├── Data Exfil
145
+
│ │ └── README.md
146
+
│ └── Volatility 4
147
+
│ └── README.md
148
+
├── Pwn
149
+
│ ├── cariuang
150
+
│ │ └── README.md
151
+
│ └── vault
152
+
│ └── README.md
153
+
├── Reverse
154
+
│ ├── IFEST-password
155
+
│ │ └── README.md
156
+
│ └── Password
157
+
│ └── README.md
158
+
└── Web
159
+
├── babyPHP
160
+
│ └── README.md
161
+
└── Optimus Prime
162
+
└── README.md
103
163
```
104
164
105
-
### Challenge README
165
+
### Challenge README.md
106
166
107
167
```
108
-
# Balasan Buruk [344 pts]
168
+
# Optimus Prime [50 pts]
109
169
110
170
**Category:** Web
111
171
**Solves:** 23
112
172
113
173
## Description
114
-
>Saya baru saja belajar mata kuliah Jaringan Komputer, sebagai Tugas Besar, saya ditugaskan untuk membuat HTTP server sederhana tanpa menggunakan library HTTP apapun.
174
+
>Optimus Prime is coming
115
175
116
-
`http://3.0.19.78:15001`
176
+
http://18.139.8.91:3015/
117
177
118
-
Author: didithilmy
178
+
author: Arkavidia5
119
179
120
180
**Hint**
121
-
*
181
+
*-
122
182
123
183
## Solution
124
184
125
185
### Flag
126
186
```
127
187
128
-
129
188
## Demo
130
189
131
-
For instances, here is the demonstration of CTFdScraper.
190
+
For instances, here is the demonstration of CTFdScraper. For simplicity, the svg file was removed
191
+
192
+
### Scrape using credentials
193
+
194
+
```bash
195
+
▶ python ctfd.py test 12345 http://playgroundctf.xyz
196
+
✔ Login Success
197
+
✔ Found 43 new challenges
198
+
✔ Found 24 files (0.5 MB downloaded)
199
+
200
+
[Summary]
201
+
✔ Web (3)
202
+
✔ Reverse (3)
203
+
✔ Cryptography (9)
204
+
✔ Forensic (10)
205
+
✔ Intro (7)
206
+
✔ Survey (1)
207
+
✔ Pwn (5)
208
+
✔ Hacktoday 2019 - Penyisihan (5)
209
+
210
+
[Finished in 3.44 second]
211
+
```
212
+
213
+
### Scrape using cloud drive support
132
214
133
-

215
+
```bash
216
+
▶ python ctfd.py test 12345 http://playgroundctf.xyz --enable-cloud
217
+
✔ Login Success
218
+
✔ Loaded 43 challs from challs.json
219
+
⚠ There are no new challenges
220
+
✔ Found 26 files (143.0 MB downloaded)
221
+
222
+
[Summary]
223
+
✔ Web (3)
224
+
✔ Reverse (3)
225
+
✔ Cryptography (9)
226
+
✔ Forensic (10)
227
+
✔ Intro (7)
228
+
✔ Survey (1)
229
+
✔ Pwn (5)
230
+
✔ Hacktoday 2019 - Penyisihan (5)
231
+
232
+
[Finished in 9.56 second]
233
+
```
134
234
235
+
### Scrape using existed `chall.json`
236
+
237
+
```bash
238
+
▶ python ctfd.py --data challs.json
239
+
✔ Loaded 43 challs from challs.json
240
+
✔ Found 24 files (0.0 MB downloaded)
241
+
242
+
[Summary]
243
+
✔ Web (3)
244
+
✔ Reverse (3)
245
+
✔ Cryptography (9)
246
+
✔ Forensic (10)
247
+
✔ Intro (7)
248
+
✔ Survey (1)
249
+
✔ Pwn (5)
250
+
✔ Hacktoday 2019 - Penyisihan (5)
251
+
252
+
[Finished in 0.09 second]
253
+
254
+
```
135
255
136
256
## Authors
137
257
138
-
* **eiji98** - *Initial work*
139
-
See also the list of [contributors](https://github.com/eiji98/CTFdScraper/contributors) who participated in this project.
258
+
***hanasuru** - *Initial work*
259
+
260
+
See also the list of [contributors](https://github.com/hanasuru/CTFdScraper/contributors) who participated in this project.
140
261
141
262
## License
142
263
143
-
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
264
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
0 commit comments