Accept Proxmark dump uploads, mfc v2 JSON, and key.bin

Parse object-shaped mfc v2 dumps (the format Proxmark writes today) and
let the new-tag form upload dump.json/dump.bin plus an optional binary
hf-mf-*-key.bin instead of only pasting text.
This commit is contained in:
Cursor Agent
2026-08-24 07:12:44 +00:00
parent 21e2592f92
commit 5fcc106a3a
8 changed files with 1184 additions and 91 deletions
+34
View File
@@ -270,4 +270,38 @@ FFFFFFFFFFFFFF078069FFFFFFFFFFFF
);
expect(restore.status).toBe(200);
});
it("imports Proxmark mfc v2 JSON dumps", async () => {
const auth = { Authorization: `Bearer ${bearer}` };
const siteRes = await postSite(
req("http://localhost/api/v1/sites", {
method: "POST",
headers: { ...auth, "Content-Type": "application/json" },
body: JSON.stringify({ code: "PM3", name: "Proxmark" }),
})
);
const site = await siteRes.json();
const dump = fs.readFileSync(
path.join(import.meta.dirname, "../fixtures/hf-mf-91A2F020-dump.json"),
"utf8"
);
const imported = await importTag(
req("http://localhost/api/v1/tags/import", {
method: "POST",
headers: { ...auth, "Content-Type": "application/json" },
body: JSON.stringify({
siteId: site.id,
label: "Proxmark v2",
content: dump,
filename: "hf-mf-91A2F020-dump.json",
}),
})
);
expect(imported.status).toBe(201);
const tag = await imported.json();
expect(tag.uid).toBe("91A2F020");
expect(tag.protocol).toBe("MIFARE_CLASSIC_1K");
expect(tag.keys.A[0]).toBe("A1D4FAFD4CAF");
});
});