flagKashi CTF

Managed to solve all the web challenges

91/753

For Pwn, Rev and more Misc checkout my teammate writeup : https://mikimiku.gitbook.io/more-more-pwn/contests/ctf-tours/kashi-ctf-2025arrow-up-right


1

Corporate Life 1

The Request Management App is used to view all pending requests for each user. It’s a pretty basic website, though I heard they were working on something new.

Anyway, did you know that one of the disgruntled employees shared some company secrets on the Requests Management App, but it's status was set denied before I could see it. Please find out what it was and spill the tea!

starting off the challenge we were greeted by a weird app that gave us pending data in the challenge description we were told that there was an employee that shared some company secrets on the request management app and the status was set to denied this will be very helpful in the future

enumeration

when we check the network of the web page we can see lots of interesting files

in the code above there is an interesting endpoint called /v2-testing

from the code above we learnt how the /v2-testing endpoint works by doing a POST request into the /api-v2 and we can filter data from the request this makes sql injections a possibility in the web app

this is an example of filtering the department of the api

if we try to make an error as you can see the error message said error databse communication this is interesting

i tried doing injections in the name but im not sure if its vulnerable now i tried the other data in the filter part as you can see when we tried to do it' OR '1'='1 it actually works and theres nothing wrong this means that we found an sqli

knowing that we can try to get the flag by giving the status denied

and look at that we actually found the flag

2

Corporate Life 2

The disgruntled employee also stashed some company secrets deep within the database, can you find them out?

this is the second part of the corporate life challenge and its saying about a new secret that the employee saved deep within the database this means we have to try access the database more

the first thing i did was try to find how any columns were used

we can use UNION to try and select the columns after using 7 it will give an error this makes us knkow the total of column used and we can continue to gain data now i want to know which sql is the server using

when using sqlite_version() the server actually returned the sql version that they are using this means we found what sql the server is using

after searching about sqlire sqli i found this github that is really helpful at solving the challenge

and i selected sql from the sqlite_schema to gain more information about the database and i found an interesting table called flags which had a secret_flag knowing this we can just select the flag from the table

and we can just combine the parts of the flag to get the flag

3

SuperFastAPI

Made my verty first API!

However I have to still integrate it with a frontend so can't do much at this point lol.

starting off the challenge we were greeted by a weird flag we can try to find other endpoints and found out theres an endpoint called /docs after getting that info i immediately went to that endpoint

well this is interesting a place to access the apis i created a user called test and then tried to get the flag but the website said only admins can get the flag

so i tried creating updating my user and giving it the role admin unexpectedly it actually worked then i tried to get the flag again

and as easy as that we solved all the web challenges

4

Lost Frequencies

Zeroes, ones, dots and dashes Data streams in bright flashes

111 0000 10 111 1000 00 10 01 010 1011 11 111 010 000 0

NOTE: Wrap the capitalized flag in KashiCTF{}

from the chall desc we can already expect that this is a morse code by zeroes -> dots and ones -> dashes

the code above will do just that

and then a simple cyber chef and we got the flag

KashiCTF{OHNOBINARYMORSE}

5

Key Exchange

the code elliptic curve cryptography and AES encryption the goal of the challenge is to exchange keys using ECC and then encrypt the flag using AES with a key derived from the shared secret then we can decrypt the flag

the curve follows the equation y^2= x^3 + ax + b (mod p)

the server generates a random private key called n_A creates a public key P_A using the base point G

this public key will be shared and we are going to provide our public key coordinates (P_B_x, P_B_y) and the server will take it

once our public key is accepted the server calculates a shared secret S by multiplying its private key n_A with the our public key P_B the shared secret x-coordinate S.x will be used in the next steps for encryption.

the shared secret x-coordinate is hashed using the SHA-1 algorithm AES in CBC mode is then used to encrypt the flag with a random IV then we will get the encrypted flag and the IV after the server makes it

after that we can solve the challenge and get the flag

first we can connect to the netcat using socket then we will get the server data and put it in the received variable

then we can generate our own ECC private key using the SigningKey.generate() then our public key will be derived from our private key and the coordinates of P_B_x and P_B_y are extracted

then we are going to send the public key to ther server to initiate the process of sharing secret to the server

then we will take data from the server until we get "Message: "

then the encrypted data is parsed and decoded from JSON format from that the IV and ciphertext are extracted from the parsed data

the AES encryption key is derived by hashing the shared secret using the SHA-1 hash function. The first 16 bytes of the SHA-1 hash are used as the key for AES decryption the client then performs AES decryption in CBC mode using the derived key and the IV provided by the server The decrypted message, presumably a flag is unpadded and printed as the final result

└─$ python3 dec.py

Received from server:

Received from Weierstrass: Here are the curve parameters (NIST P-384) p = 39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319 a = -3 b = 27580193559959705877849011840389048093056905856361568521428707301988689241309860865136260764883745107765439761230575 And my Public Key: (3566202173137821722130092688383305924997463575472886405441749267614553800694432962044692633891912189270771281119570,20370024990198787978523063066932992609529336596289645449862709577314425763441145558827878335172048252128011578352787)

Send to Weierstrass: Public Key x-coord: Sent Public Key x-coord: 27871206782627841017690054619484714724887553500931550506348846946398623960977733778994851543914370573191638858627662 Sent Public Key y-coord: 848511266713431150848423780814604077994361267687146716818688105948906818181396067256876072795799500811233309902020 Full response from server: Public Key y-coord: Received from Weierstrass: Message: {"iv": "ddb97c1429c6ffe5ba471468187b71cc", "ciphertext": "e58652bc2e568027635549e2b41114873c66277867207745046994cb19c3b2dc25bc5bc08484b40c5fa699df5089b4493b315929009b4c86a49c3fc0a4452f80a13d3f77716550e063254e0a93df501bedc3bedcf7f062c784fc737575d637ea"}

Decrypted flag: NaeusGRX{L_r3H3Nv3h_kq_Sun1Vm_O3w_4fg_4lx_1_t0d_a4q_lk1s_X0hcc_Dd4J_slAQEbh3}

Hint: DamnKeys

after getting the encrypted flag the server also gave us a hint the flag the flag still looks like a cipher text so i began to think that the hint is actually the key to getting the real flag

after doing a vigenere decode we actually solved the challenge

6

Easy Jail 1

I made this calculator. I have a feeling that it's not safe :(

Suffering hasn't begun

we were given the source code of the server and as we can see the server will take our input and then put in the calc function which will use our input in eval() to run without filter this is very dangerous we can input import('os').system('cat /flag.txt')

and we solved the challenge

7

Restaurant

I just asked for my favourite pasta and they gave me this. Are these guys STUPID? Maybe in the end they may give me something real. (Wrap the text in KashiCTF{})

we were given a pasta picture then i tried checking if its a stegano file and i tried checking the metadata nothing was wrong but when i tried checking the hex i found something interesting

the file should finish in the ffd9 part but there were extra data after the file footer and this is weird i didnt notice until the event was over that this was a bacon cipher

KashiCTF{theywerereallllycooking}

Last updated