// HackTheBox  ·  writeup

Constellation

HackTheBox Medium Pythonexiftoolpdftotextpdfimages
Threat Intelligence

Scenario

This medium-difficulty Sherlock requires a deft application of Open Source Intelligence (OSINT) skills to unravel a convoluted web of deceit and betrayal.

As the story unfolds, you are tasked with investigating a suspected insider threat. The scenario begins with the SOC team’s recent discovery of potential malicious activities within Forela’s organization. A suspect employee’s workstation, now secured and thoroughly examined, yields the first clues. Your primary objective is to analyze several unusual URLs extracted from the employee’s computer memory by the Senior DFIR Analyst.

Executive Summary

A group calling itself AntiCorp recruited a Forela employee over Discord and paid them to leak internal data. The only artifacts are two URLs recovered from the employee’s memory: a Discord CDN link to a PDF of exfiltration instructions, and a Google search URL. Discord snowflake IDs and Google’s ei parameter turned both into exact UTC times, showing the DM channel opening, the PDF arriving, and the employee searching for how to archive a folder with tar about four minutes later. The PDF itself named the insider and the group, and its metadata exposed a forged creation date and an author handle that pivots to a person’s public profile.

Artifacts

Timestamp note: Every time question wants YYYY-MM-DD HH:MM:SS in UTC. The PDF metadata is in UTC+01:00, so convert before submitting.

Initial Access

Q1 — When did the suspect first start Direct Message (DM) conversations with the external entity (A possible threat actor group which targets organizations by paying employees to leak sensitive data)? (UTC)

The Discord CDN path in URL 1 is /attachments/<channel_id>/<attachment_id>/<filename>. A DM is a channel, and channel IDs are snowflakes: the top bits are milliseconds since the Discord epoch (2015-01-01). Shift the channel ID right 22 bits, add the epoch offset and the result is when the conversation was created, which is the first DM.

python3 -I -c "import datetime as d;i=1152635915429232640;print(d.datetime.fromtimestamp(((i>>22)+1420070400000)/1000,d.timezone.utc))"
Click flag to reveal 2023-09-16 16:03:37
Q2 — What was the name of the file sent to the suspected insider threat?

The last path segment of the same Discord URL is the filename, before the query string of expiry and signature parameters.

grep -o 'attachments/[^?]*' IOCs.txt
Click to reveal answer NDA_Instructions.pdf
Q3 — When was the file sent to the suspected insider threat? (UTC)

Decode the second ID in the path, the attachment ID, the same way. It marks when the upload happened, which is the moment the file was sent in the DM.

python3 -I -c "import datetime as d;i=1156461980652154931;print(d.datetime.fromtimestamp(((i>>22)+1420070400000)/1000,d.timezone.utc))"

Tip: Don’t use the ex= expiry parameter as the send time. It is when the link stops working, not when it was created.

Click flag to reveal 2023-09-27 05:27:02
Q8 — What is the name of the person suspected of being an Insider Threat?

The PDF opens with a greeting addressed to the recipient by name, thanking them for getting in touch.

pdftotext NDA_Instructions.pdf - | head -3
Click to reveal answer Karen Riley
Q7 — What is the name of the Hacker group responsible for bribing the insider threat?

The same greeting names the sender, and the PDF’s Producer, Creator and Author metadata repeat it, so the group name is consistent across content and metadata.

exiftool NDA_Instructions.pdf | grep -E 'Producer|Creator|Author'

Gotcha: The format hint suggests a single word, but the group’s name includes the leetspeak suffix. Submitting just AntiCorp is wrong.

Click flag to reveal AntiCorp Gr04p
Q9 — What is the anomalous stated creation date of the file sent to the insider threat? (UTC)

The Create Date field is in the year 2054, decades after the file was sent, which is the anomaly. ExifTool prints it with a +01:00 offset, so subtract an hour to get UTC.

exiftool NDA_Instructions.pdf | grep -i 'date'
Click to reveal answer 2054-01-17 21:45:22
Q10 — The Forela threat intel team are working on uncovering this incident. Any OpSec mistakes made by the attackers are crucial for Forela's security team. Try to help the TI team and confirm the real name of the agent/handler from Anticorp.

The PDF’s Author field is [email protected], an operator handle left in the metadata. Searching that handle on LinkedIn surfaced one profile titled with the group name, and its name is the answer. This answer was reasoned rather than read straight from an artifact: nothing in the evidence names the person, so the link rests on the handle search returning a profile titled with the group name.

exiftool -Author NDA_Instructions.pdf
Click flag to reveal Abdullah Al Sajjad
Q11 — Which City does the threat actor belong to?

The profile found in Q10 lists the actor’s location. LinkedIn only shows the full profile to a logged-in browser, so open it in an authenticated session rather than fetching it from the command line. The profile, titled Security Expert at AntiCorp Gr04p, gives the city and region.

Tip: Unauthenticated requests to LinkedIn are blocked, so this one is a browser job.

Click to reveal answer Bahawalpur

Collection

Q4 — The suspect utilised Google to search something after receiving the file. What was the search query?

URL 2 is a Google search URL. The q parameter holds the query actually submitted.

grep -oE '[?&]q=[^&]*' IOCs.txt
Click flag to reveal how to zip a folder using tar in linux
Q5 — The suspect originally typed something else in search tab, but found a Google search result suggestion which they clicked on. Can you confirm which words were written in search bar by the suspect originally?

The oq (original query) parameter keeps what was typed before the suggestion was picked. It is cut off mid-word because the suggestion was clicked as soon as it appeared. It matches step 3 of the PDF, which tells the reader to archive the folders with tar.

grep -o 'oq=[^&]*' IOCs.txt

Gotcha: oq is URL-encoded with + for spaces. Decode it as is: the capital H stays, even though the format hint is all lowercase.

Click to reveal answer How to archive a folder using tar i
Q6 — When was this Google search made? (UTC)

Google’s ei parameter begins with a base64url-encoded Unix timestamp (little-endian 32-bit). Decoding it gives 05:31:45 UTC. The millisecond epoch in the sxsrf parameter (1695792705892) lands on the same second, which confirms it. The search came about four and a half minutes after the PDF was sent.

python3 -I -c "import base64,struct,datetime as d;t=struct.unpack('<I',base64.urlsafe_b64decode('Qb4TZeL2M9XPxc8PwLa52Ag=')[:4])[0];print(d.datetime.fromtimestamp(t,d.timezone.utc))"
Click flag to reveal 2023-09-27 05:31:45

Attack Summary

PhaseAction
Initial AccessAntiCorp opens a DM channel with the Forela employee on Discord
Initial AccessAttacker uploads NDA_Instructions.pdf, a step-by-step exfiltration guide
CollectionEmployee searches Google for how to archive a folder with tar
ExfiltrationPDF instructs uploading the archive to an attacker S3 bucket with the AWS CLI

Forensic Timeline

Timestamp (UTC)Event
2023-09-16 16:03:37Discord DM channel with the threat actor created
2023-09-27 05:27:02NDA_Instructions.pdf sent to the insider
2023-09-27 05:31:45Insider searches Google for how to zip a folder using tar
2054-01-17 21:45:22Forged creation date in the PDF metadata

IOCs

TypeValue
FileNDA_Instructions.pdf
URLhxxps[://]cdn[.]discordapp[.]com/attachments/1152635915429232640/1156461980652154931/NDA_Instructions.pdf
Discord channel ID1152635915429232640
Threat actorAntiCorp Gr04p
Operator handleCyberJunkie@AntiCorp[.]Gr04p
S3 buckets3://hahaha-you-lose-forela/

MITRE ATT&CK

TechniqueIDDescription
Valid AccountsT1078Recruited insider’s own access to Forela systems
Archive Collected Data: Archive via UtilityT1560.001PDF instructs tar -czvf on the database and backup folders

Defender Takeaways

Insiders recruited off-platform leave almost no corporate telemetry. The recruitment happened on Discord and the guidance was a PDF fetched from its CDN. Web proxy logs showing downloads from cdn.discordapp.com by employees with access to databases are the earliest signal available.

Memory-resident URLs carry more than they look like. Discord snowflakes and Google ei and sxsrf values encode exact times, so two URLs were enough to build a timeline. Capture and decode them during triage instead of treating the URL as an opaque string.

Document metadata is an OpSec leak worth checking on every attacker file. The PDF named its own author handle and used a forged 2054 creation date, both of which stand out immediately in ExifTool and give threat intel something to pivot on.

Watch for bulk archiving and cloud uploads from database hosts. The PDF’s plan was tar on the data folders, then aws s3 cp to an external bucket. Alert on tar of database and backup directories followed by AWS CLI use from servers that never run it.

Conclusion

The insider never got as far as exfiltration in the evidence, but the attacker’s own instructions and metadata identified the group, the handler handle and the recipient. The lesson is that a single Discord URL and a PDF yield a full timeline and attribution pivots, if you know how to decode them.