InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties…

Follow publication

Wireshark twoo — Forensics| PicoCTF Write-up | 100 Points

Karthikeyan Nagaraj
InfoSec Write-ups
Published in
4 min readDec 28, 2022

--

Description:

Tool Used — Wireshark

Task File:

Analysis

GET /flag HTTP/1.1
Host: 18.217.1.57
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9

HTTP/1.0 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 73
Server: Werkzeug/1.0.1 Python/3.6.9
Date: Mon, 10 Aug 2020 01:39:19 GMT

picoCTF{bfe48e8500c454d647c55a4471985e776a07b26cba64526713f43758599aa98b
import re
import base64

result = ''

def val(s):
for c in s:
if not c.isalpha() and not c.isnumeric() and not c == '{' and not c == '}' and not c == '_':
return False
return True

# Make sure to write the Actual name of csv you used to save.
# Here I saved my csv file as capture.csv

with open('capture.csv', 'r') as f:
line = f.readline()
while line:
if 'Standard query' in line:
m = re.search(r"Standard query .+ A (.+)", line)
b64_portion = m[1].split('.')[0]
b64_decoded = base64.b64decode(b64_portion)

try:
ascii_portion = b64_decoded.decode('utf-8')

except:
pass

else:
if val(ascii_portion) and not result.endswith(ascii_portion):
result += ascii_portion

line = f.readline()

print('Flag:', result)
Ans: picoCTF{dns_3xf1l_ftw_deadbeef}
Author: Karthikeyan Nagaraj

From Infosec Writeups: A lot is coming up in the Infosec every day that it’s hard to keep up with. Join our weekly newsletter to get all the latest Infosec trends in the form of 5 articles, 4 Threads, 3 videos, 2 GitHub Repos and tools, and 1 job alert for FREE!

--

--

Published in InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Written by Karthikeyan Nagaraj

Entrepreneur | Writer | Cyber Security Consultant | AI Researcher TopMate - https://topmate.io/cyberw1ng

No responses yet