Skip to content

Commit f96cbfd

Browse files
committed
adding first post and beginning to set up
1 parent d499be6 commit f96cbfd

File tree

13 files changed

+140
-27
lines changed

13 files changed

+140
-27
lines changed

_config.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,37 @@ theme: jekyll-theme-chirpy
99
lang: en
1010

1111
# Change to your timezone › https://kevinnovak.github.io/Time-Zone-Picker
12-
timezone:
12+
timezone: America/Chicago
1313

1414
# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
1515
# ↓ --------------------------
1616

17-
title: Chirpy # the main title
17+
title: Slavetomints' Blog # the main title
1818

19-
tagline: A text-focused Jekyll theme # it will display as the subtitle
19+
tagline: A place for my thoughts, ideas, and work # it will display as the subtitle
2020

2121
description: >- # used by seo meta and the atom feed
22-
A minimal, responsive and feature-rich Jekyll theme for technical writing.
22+
The blog for Slavetomints, featuring writeups, guides, and whatever else she wants.
2323
2424
# Fill in the protocol & hostname for your site.
2525
# E.g. 'https://username.github.io', note that it does not end with a '/'.
26-
url: ""
26+
url: "https://slavetomints.github.io"
2727

2828
github:
29-
username: github_username # change to your GitHub username
29+
username: Slavetomints # change to your GitHub username
3030

31-
twitter:
32-
username: twitter_username # change to your Twitter username
31+
# twitter:
32+
# username: twitter_username # change to your Twitter username
3333

3434
social:
3535
# Change to your full name.
3636
# It will be displayed as the default author of the posts and the copyright owner in the Footer
37-
name: your_full_name
38-
email: example@domain.com # change to your email address
37+
name: Slavetomints
38+
email: slavetomints@gmail.com # change to your email address
3939
links:
4040
# The first element serves as the copyright owner's link
41-
- https://twitter.com/username # change to your Twitter homepage
42-
- https://github.com/username # change to your GitHub homepage
41+
# - https://twitter.com/username # change to your Twitter homepage
42+
- https://github.com/slavetomints # change to your GitHub homepage
4343
# Uncomment below to add more social links
4444
# - https://www.facebook.com/username
4545
# - https://www.linkedin.com/in/username

_data/contact.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
- type: github
44
icon: "fab fa-github"
55

6-
- type: twitter
7-
icon: "fa-brands fa-x-twitter"
6+
#- type: twitter
7+
# icon: "fa-brands fa-x-twitter"
88

99
- type: email
1010
icon: "fas fa-envelope"

_data/share.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ platforms:
1616

1717
# Uncomment below if you need to.
1818
#
19-
# - type: Linkedin
20-
# icon: "fab fa-linkedin"
21-
# link: "https://www.linkedin.com/sharing/share-offsite/?url=URL"
19+
- type: Linkedin
20+
icon: "fab fa-linkedin"
21+
link: "https://www.linkedin.com/sharing/share-offsite/?url=URL"
2222
#
2323
# - type: Weibo
2424
# icon: "fab fa-weibo"
@@ -37,14 +37,14 @@ platforms:
3737
# - label: photog.social
3838
# link: "https://photog.social/"
3939
#
40-
# - type: Bluesky
41-
# icon: "fa-brands fa-bluesky"
42-
# link: "https://bsky.app/intent/compose?text=TITLE%20URL"
40+
- type: Bluesky
41+
icon: "fa-brands fa-bluesky"
42+
link: "https://bsky.app/intent/compose?text=TITLE%20URL"
4343
#
44-
# - type: Reddit
45-
# icon: "fa-brands fa-square-reddit"
46-
# link: "https://www.reddit.com/submit?url=URL&title=TITLE"
44+
- type: Reddit
45+
icon: "fa-brands fa-square-reddit"
46+
link: "https://www.reddit.com/submit?url=URL&title=TITLE"
4747
#
48-
# - type: Threads
49-
# icon: "fa-brands fa-square-threads"
50-
# link: "https://www.threads.net/intent/post?text=TITLE%20URL"
48+
- type: Threads
49+
icon: "fa-brands fa-square-threads"
50+
link: "https://www.threads.net/intent/post?text=TITLE%20URL"

_posts/.placeholder

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
title: Quick Recovery
3+
date: 2024-12-23 19:47:SS +/-0600
4+
categories: [Capture The Flags, 1337Up Live 2024]
5+
tags: [ctf, 1337up, misc, writeups]
6+
---
7+
8+
Challenge description:
9+
10+
> Hey, check this QR code ASAP! It's highly sensitive so I scrambled it, but you shouldn't have a hard time reconstructing - just make sure to update the a_order to our shared PIN. The b_order is the reverse of that 😉
11+
12+
Downloading the attached file and extrating its contents leads us to have a `gen.py` file and a `obscured.png` file. What is the png?
13+
14+
![the original qr code](assets/img/1337up-2024/quick-recovery/qr_code.png)
15+
16+
Huh, that looks pretty scrambled. Well, lets run the python script!
17+
18+
*Note: You will need to install pillow with pip if you haven't already.*
19+
20+
```terminal
21+
┌─[slavetomints@parrot]─[~/CTFS/1337UP2024/misc/quick_recovery]
22+
└──╼ $python gen.py
23+
Traceback (most recent call last):
24+
File "/home/slavetomints/CTFS/1337UP2024/misc/quick_recovery/gen.py", line 5, in <module>
25+
qr_code_image = Image.open("qr_code.png")
26+
^^^^^^^^^^^^^^^^^^^^^^^^^
27+
File "/home/slavetomints/.pyenv/versions/3.11.2/lib/python3.11/site-packages/PIL/Image.py", line 3469, in open
28+
fp = builtins.open(filename, "rb")
29+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30+
FileNotFoundError: [Errno 2] No such file or directory: '/home/slavetomints/CTFS/1337UP2024/misc/quick_recovery/qr_code.png'
31+
```
32+
Hm, looks like it needs to read from `qr_code.png`, lets copy the `obscured.png` file and rename the copy.
33+
34+
Lets take a closer look at the python code
35+
36+
```python
37+
from PIL import Image, ImageDraw
38+
from itertools import permutations
39+
import subprocess
40+
41+
qr_code_image = Image.open("qr_code.png")
42+
width, height = qr_code_image.size
43+
half_width, half_height = width // 2, height // 2
44+
45+
squares = {
46+
"1": (0, 0, half_width, half_height),
47+
"2": (half_width, 0, width, half_height),
48+
"3": (0, half_height, half_width, height),
49+
"4": (half_width, half_height, width, height)
50+
}
51+
52+
53+
def split_square_into_triangles(img, box):
54+
x0, y0, x1, y1 = box
55+
a_triangle_points = [(x0, y0), (x1, y0), (x0, y1)]
56+
b_triangle_points = [(x1, y1), (x1, y0), (x0, y1)]
57+
58+
def crop_triangle(points):
59+
mask = Image.new("L", img.size, 0)
60+
draw = ImageDraw.Draw(mask)
61+
draw.polygon(points, fill=255)
62+
triangle_img = Image.new("RGBA", img.size)
63+
triangle_img.paste(img, (0, 0), mask)
64+
return triangle_img.crop((x0, y0, x1, y1))
65+
66+
return crop_triangle(a_triangle_points), crop_triangle(b_triangle_points)
67+
68+
69+
triangle_images = {}
70+
for key, box in squares.items():
71+
triangle_images[f"{key}a"], triangle_images[f"{key}b"] = split_square_into_triangles(
72+
qr_code_image, box)
73+
74+
a_order = ["1", "2", "3", "4"] # UPDATE ME
75+
b_order = ["4", "3", "2", "1"] # UPDATE ME
76+
77+
final_positions = [
78+
(0, 0),
79+
(half_width, 0),
80+
(0, half_height),
81+
(half_width, half_height)
82+
]
83+
84+
reconstructed_image = Image.new("RGBA", qr_code_image.size)
85+
86+
for i in range(4):
87+
a_triangle = triangle_images[f"{a_order[i]}a"]
88+
b_triangle = triangle_images[f"{b_order[i]}b"]
89+
combined_square = Image.new("RGBA", (half_width, half_height))
90+
combined_square.paste(a_triangle, (0, 0))
91+
combined_square.paste(b_triangle, (0, 0), b_triangle)
92+
reconstructed_image.paste(combined_square, final_positions[i])
93+
94+
reconstructed_image.save("obscured.png")
95+
print("Reconstructed QR code saved as 'obscured.png'")
96+
```
97+
{: file="gen.py" }
98+
99+
it looks like the `a_order` and `b_order` are influencing how the image gets rearranged, lets change them to
100+
101+
```python
102+
a_order = ["1", "3", "2", "4"] # UPDATE ME
103+
b_order = ["4", "2", "3", "1"] # UPDATE ME
104+
```
105+
106+
![better image](assets/img/1337up-2024/quick-recovery/obscured.png)
107+
108+
Hey!, now while it is split in half, lets take a screenshot of each half and rearrange those so that its in order. Sure, we could try finding the correct arrangement of numbers, but for a first try I'll take it.
109+
110+
![QR1](assets/img/1337up-2024/quick-recovery/qr1.png)
111+
112+
![QR2](assets/img/1337up-2024/quick-recovery/qr2.png)
113+
114+
FLAG: `INTIGRITI{7h475_h0w_y0u_r3c0n57ruc7_qr_c0d3}`
13.6 KB
Loading

assets/img/1337up-2024/quick-recovery/obscured.png:Zone.Identifier

Whitespace-only changes.
2.69 KB
Loading

assets/img/1337up-2024/quick-recovery/qr1.png:Zone.Identifier

Whitespace-only changes.
2.9 KB
Loading

0 commit comments

Comments
 (0)