Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dd840f3

Browse files
mzfrmzfr
mzfr
authored and
mzfr
committed
Solution for drone motion
1 parent dd5a251 commit dd840f3

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

‎INShAck-2019/drone/README.md‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Drone Motion
2+
3+
__DESCRIPTION__
4+
5+
We intercepted a drone flying above a restricted area and retrieved a [log](https://static.ctf.insecurity-insa.fr/5e97cfb3f4c64201c201a1703440c397f91be74b.tar.gz) from its memory card.
6+
7+
Help us find out what this drone was doing above our heads!
8+
9+
Flag must match the regex: INSA\{[a-f0-9]+\}
10+
11+
__SOLUTION__
12+
13+
This was a simple one we just simply had to plot the values of x, y, z to get the flag.
14+
15+
```python
16+
import re
17+
import matplotlib.pyplot as plt
18+
19+
lines = open("sensors.log").readlines()
20+
21+
coords = []
22+
x_coords = []
23+
y_coords = []
24+
z_coords = []
25+
cur_X,cur_Y,cur_Z = 0,0,0
26+
27+
for line in lines:
28+
match = re.findall("\[drone\]\(DEBUG\)> dir: \(x=(-?\d.\d+),y=(-?\d+.\d+),z=(-?\d.\d+)\)", line)
29+
if match:
30+
x,y,z = map(float, match[0])
31+
cur_X += x
32+
cur_Y += y
33+
cur_Z += z
34+
x_coords.append(cur_X)
35+
y_coords.append(cur_Y)
36+
z_coords.append(cur_Z)
37+
38+
ax = plt.plot(x_coords, y_coords, '-')
39+
plt.axis('equal')
40+
plt.savefig("test.png", dpi=1000)
41+
```
42+
43+
This would give us the flag
44+
45+
![alt text](flag.png)
46+
47+
This challenge was also solved by none other than __@unblvr__
48+
49+
`P.S` - In starting for some reason we were confused on with `E` and `F` but the later we realized that `F`'s middle line is smaller then `E`'s

‎INShAck-2019/drone/flag.png‎

373 KB
Loading[フレーム]

‎INShAck-2019/drone/parse.py‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import re
2+
import matplotlib.pyplot as plt
3+
4+
lines = open("sensors.log").readlines()
5+
6+
coords = []
7+
x_coords = []
8+
y_coords = []
9+
z_coords = []
10+
cur_X,cur_Y,cur_Z = 0,0,0
11+
12+
for line in lines:
13+
match = re.findall("\[drone\]\(DEBUG\)> dir: \(x=(-?\d.\d+),y=(-?\d+.\d+),z=(-?\d.\d+)\)", line)
14+
if match:
15+
x,y,z = map(float, match[0])
16+
cur_X += x
17+
cur_Y += y
18+
cur_Z += z
19+
x_coords.append(cur_X)
20+
y_coords.append(cur_Y)
21+
z_coords.append(cur_Z)
22+
#print(x,y,z)
23+
24+
25+
26+
ax = plt.plot(x_coords, y_coords, '-')
27+
plt.axis('equal')
28+
#plt.ylim(-500,500)
29+
plt.savefig("test.png", dpi=1000)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /