parsingtheclientwasreallystraightforward,and[@Kevin](https://maplebacon.org/authors/Kevin/) figured out the encoding pretty much instantly too, so all thats left was vector math
whichweeventuallyfiguredoutwassomeformofweirdfiltering,and[@ayna](https://maplebacon.org/authors/aynakeya/) quickly figured out encoding the index.php with base64 can bypass the filter easily
after this we have absolutely no idea what to do - we have arbitrary access to the server which is usually the end goal itself, but theres basically nothing resembling a flag with a fair bit of digging
until we realized theres a message.txt that is in another user's directory, and weird tcpdump perms exist
we still thought this is some form of internet related chall at this point, so my thought was to see if theres any way we can privilege escalate through some exposed service that is only accessible locally
but theres no netstat or ss, and `/proc/net/tcp` didnt have much either aside from connections presumably from reverse shells and a lot of apache instances
there was also a session cookie that was base64 encoded to be an ip, so we were thinking whether we need to leak something from that host too but theres no curl on the server and the endpoint seems largely irresponsive without port scanning
*which pretty much right after we got an announcement right after this that scripted enumeration local or remote arent allowed, which wasnt stated in the rules anywhere btw*
so thats a dead end
and then we got an even funnier announcement: priv esc to root was not allowed, and the chall would be taken down until they figured out what to do with it (which would be after most organizers have woken up) :clown:
apparently some team priv esc'd to root with a misconfiguration on the host, and they didnt have enough protections on the host against that so they were panicking lmao
anyway we were fully expecting this chall to be in the grave considering this ctf is only 48h and reopening it wouldve been unfair considering we get much less time to work on this than other challs but they have the same dynamic scoring
but then another announcement came up a few hours before saying its being redeployed with no compensation and also with officially root off limits now :clown: :clown:
also with this redeployment the session cookie is now gone, which means that dead end is even more dead now
so its time for even more poking to see in what way we can priv esc to the correct user and not root and without scripting
which came up fruitless regardless
at this point we were on the verge of giving up on this chall but then we literally had like 2 challs left only and this is one of them
but i just couldnt be assed to work on it so i went to sleep anyway
turns out [@Kevin](https://maplebacon.org/authors/Kevin/) figured out how we would priv esc to the other user during my sleep LOL
the password was literally just sitting in `/opt/backup`
which after `su`ing with it the message.txt i found sus indeed had the first part of the flag
like how is this a networking chall at this point??????
anyway remember how i mentioned tcpdump had weird perms
[@ayna](https://maplebacon.org/authors/aynakeya/) was playing around with it before he went to sleep since the user we are now in has perms for it
which he found a really weird stream of data that mentions something about "sending this message as a secret" from `sneaky-messager.super-secure-network` but nothing indicative of a flag anywhere
so i picked up on his work and tried to analyse the ICMP packets he got by actually dumping a pcap and exfiltrating it with the reverse shell i had so i can use wireshark with `tcpdump -w /run/lock/data -nnA dst 172.16.238.10 && net 172.16.238.0/24`
and pretty much right after i saw what looks like flag chars in one of the ICMP fields lol
which was easily extractable from the pcap with a scapy script
```py
from scapy.all import *
pcap = rdpcap('dump.pcap')
data = [p[ICMP] for p in pcap if ICMP in p]
print(b''.join([bytes([d.id]) for d in data]).split(b'}'))
```
`magpie{y0u_h4v3_7h3_p0w32_70_54v3_7h3_w021d}`
like genuinely if this chall was just the second part i wouldnt have been this mad lol coz it actually resembles a networking chall
meanwhile with the entire thing its literally just guessing all the way
like this is not pentesting but a ctf chall dude throwing an entire system at us with basically no pointers will never end well