> For the complete documentation index, see [llms.txt](https://warsang.gitbook.io/awesome-security-blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://warsang.gitbook.io/awesome-security-blog/flare-on-challenges.md).

# Flare-on Challenges

\
Posting this here. Some of the write-ups are incomplete but I don't really have time to finish this draft. Hope you enjoy the content nevertheless.

### Chall 1 <a href="#chall-1" id="chall-1"></a>

In script.js:

```
const CORRECT_GUESS = 57;
let rightGuessString = WORDS[CORRECT_GUESS];
let flag = rightGuessString + '@flare-on.com';
```

In words.js at offset 57 (index starts at 0): flareonisallaboutcats

### Chall2 <a href="#chall2" id="chall2"></a>

Coords are displayed in window title (4,31) in screenshot below:

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image.png" alt="" height="682" width="744"><figcaption></figcaption></figure>

Coords go from (0,0) \~ to (740,640) -> 0x2e4 ,0x280

Actually when we look in code: 0x2e5 is max

In WinMain; Lumina gives us the Window Register class method

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-1.png" alt="" height="656" width="416"><figcaption></figcaption></figure>

We use RegisterClassExW to register the window class using it's handle; We also have lpfnWndProc which will be the Window's callback; basically the function that will handle all events in the window. A cleartext code example can be found here:\
[https://learn.microsoft.com/en-us/windows/win32/intl/registering-window-classes](https://learn.microsoft.com/en-us/windows/win32/intl/registering-window-classes?ref=warsangs-hobby-blog.ghost.io)

I called it window\_main\_func as this is basically the function we're interested in;

There's a couple of snprintf\_s that are used to create the buffer displayed in the title of the window. [SetWindowTextA](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowtexta?ref=warsangs-hobby-blog.ghost.io) is then called to display this buffer.

We have 10 attempts:

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-2.png" alt="" height="179" width="298"><figcaption></figcaption></figure>

A couple of compares to FLA and REON strings:

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-4.png" alt="" height="512" width="1091"><figcaption></figcaption></figure>

Offset below:

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-5.png" alt="" height="37" width="763"><figcaption></figcaption></figure>

We can find x and y by solving:

0x52414C46 % x = 0x9d

0x6E4F2D45 % y = 0x5e

However, it's faster to break on the right offset and change the value of the remainder. This will trigger the image decryption function and we get:

w1nN3r\_W!<NneR_cHick3n_d1nNer@flare-on.com>

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-3.png" alt="" height="692" width="740"><figcaption></figcaption></figure>

### Chall 3 <a href="#chall-3" id="chall-3"></a>

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-12.png" alt="" height="664" width="1334"><figcaption><p>sdl_setup</p></figcaption></figure>

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-13.png" alt="" height="334" width="699"><figcaption><p>gimme flag pls? loaded in memory for out strcmp</p></figcaption></figure>

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-11.png" alt="" height="589" width="632"><figcaption><p>SDL eventlistener loop</p></figcaption></figure>

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-10.png" alt="" height="598" width="1272"><figcaption><p>hit_flag</p></figcaption></figure>

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-6.png" alt="" height="641" width="839"><figcaption><p>UDLR init</p></figcaption></figure>

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-7.png" alt="" height="694" width="611"><figcaption><p>UDLR sequence</p></figcaption></figure>

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-9.png" alt="" height="612" width="1152"><figcaption><p>strcmp + decrypt_flag</p></figcaption></figure>

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-14.png" alt="" height="950" width="1194"><figcaption><p>flaggy_flag</p></figcaption></figure>

### Chall4 <a href="#chall4" id="chall4"></a>

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-16.png" alt="" height="1114" width="1202"><figcaption><p>argument length comparison</p></figcaption></figure>

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-15.png" alt="" height="1363" width="1183"><figcaption><p>defo a key</p></figcaption></figure>

<div data-full-width="true"><figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-17.png" alt="" height="1282" width="2000"><figcaption><p>loopy_loop</p></figcaption></figure></div>

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-18.png" alt="" height="1413" width="1295"><figcaption><p>decompyled loopy_loop</p></figcaption></figure>

<div data-full-width="true"><figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-20.png" alt="" height="1054" width="2000"><figcaption><p>cyberchef recipe</p></figcaption></figure></div>

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2022/10/image-19.png" alt="" height="1006" width="1565"><figcaption><p>flagy_flag</p></figcaption></figure>

### Chall 5 <a href="#chall-5" id="chall-5"></a>

We see a xor with 0x45

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2023/01/image-42.png" alt="" height="180" width="358"><figcaption><p>xor with 0x45</p></figcaption></figure>

We decode that to POST

<figure><img src="https://warsangs-hobby-blog.ghost.io/content/images/2023/01/image-43.png" alt="" height="572" width="978"><figcaption></figcaption></figure>
