Skip to content

Instantly share code, notes, and snippets.

@revolunet
Last active November 12, 2024 10:51
Show Gist options
  • Save revolunet/80ca6cb0b09c7855872f8df062c53708 to your computer and use it in GitHub Desktop.
Save revolunet/80ca6cb0b09c7855872f8df062c53708 to your computer and use it in GitHub Desktop.
extract vaultwarden non-2FA users

extract vaultwarden non-2FA users

in the /users/overview browser console:

const table = document.querySelector("table#users-table");
const unsecureUsers = Array.from(table.querySelectorAll("tbody tr")).filter(r=>!r.innerHTML.includes("2FA is enabled")).map(r => r.querySelector("td.sorting_1:first-of-type span.d-block").textContent);
copy(unsecureUsers.join("\n")); // clipboard copy

the in the /organizations/overview browser console

unsercureUsers=[/* paste from previous step */]
table = document.querySelector("table#orgs-table");
unsecureOrgsTrs = Array.from(table.querySelectorAll("tbody tr td:first-of-type")).filter(td =>
   unsecureOrgs.includes(td.querySelector("strong:first-of-type").textContent)
).map(td => td.querySelector("span.me-2").textContent.replace(/[()]/g,""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment