How I Almost Got Hacked By A Recruiter
A fake recruiter sent a malicious Next.js project that, when started, would fetch and execute code from a typosquatted domain, giving the attacker full access to the victim's computer. The frontend also collected the victim's IP and location.
I got a message on LinkedIn that looked pretty standard, but the offer was exceptionally tempting.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The project contained a backdoor that fetched and executed remote code via eval() on server start, disguised as a normal dependency.
Impact
If the project had been run, the attacker could have gained full access to the victim's computer, including private keys, browser passwords, and SSH keys.
What the attacker needed
Victim receives a LinkedIn message; victim downloads and runs the project
The fix
The author avoided running the project and used a virtual machine to analyse it safely; the malicious repository should be reported and taken down.
How it was found
- Received a LinkedIn message from a fake recruiter offering a job.
- Was sent a Bitbucket repository with a coding task.
- Downloaded the repository and inspected the code before running it.
- Found a backdoor in server/middlewares/validator/index.js that fetches and evals remote code.
- Found commented-out steganography code and frontend IP/location harvesting.
- Tested the attacker's API on a VM and confirmed it serves a payload when the User-Agent matches axios.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A person pretended to be a recruiter and sent a coding test project. Hidden in the project was code that, when run, would download and run malicious software from the internet, letting the attacker control the victim's computer. The author spotted it before running the project.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.