Exporting Stache Passwords

Exporting Stache Passwords

Below are directions on how to export your passwords from Stache. This is somewhat complicated and may not work 100% with all types of data so don’t use unless you have a lot and use at your own risk.

  1. Open chrome without devtool warnings:

    1. Windows:

      1. Open the run dialog ( 🪟-R )

      2. Paste in "C:\Program Files\Google\Chrome\Application\chrome.exe" --unsafely-disable-devtools-self-xss-warnings

    2. Mactinosh:

      1. Open the terminal

      2. Run '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' --unsafely-disable-devtools-self-xss-warnings

  2. Once chrome has opened navigate to stache and login:

  3. Open the developer console using F12 (Windows ) or Option + Command + J (Mac)

    1. Once in the tools click on the Console in the top menu

image-20260412-031530.png
  1. Scroll down to the bottom of the console window (there may already be data there).

  2. Copy and paste this script:

    function escapeCSV(value) { if (typeof value !== 'string') { return value; // Return non-string values as-is } // Escape internal double quotes by doubling them let escapedValue = value.replace(/"/g, '""'); // If the value contains a comma, double quote, or newline, // enclose the entire field in double quotes. if (escapedValue.includes(',') || escapedValue.includes('\n') || escapedValue.includes('\r') || escapedValue.includes('"') || escapedValue.includes('\t')) { return `"${escapedValue}"`; } return escapedValue; } let MYOUTPUT=''; let myresult=[]; var username="" //All uppercase let staff= {AH74:1,SPINDLER:1,TEB2388:1,LEHMAN:1}; function downloadCSV(data, filename = 'data.csv') { const blob = new Blob([data], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.setAttribute('href', url); a.setAttribute('download', filename); a.click(); } // Example usage with a CSV string: //downloadCSV(csvContent, 'my_export.csv'); function process_id(ids,loop,data){ if(data===null){ }else{ //console.log(data); var name=data.item.name; var note=data.item.core.note; var purpose=data.item.core.purpose; var value=data.item.core.value; var folder=""; var eids=""; if(data.folderCores.length>0){ folder=data.folderCores[0].name; }else if(data.item.members.length>0){ var staffmembers=0; for(var member of data.item.members){ var id=member.id.toUpperCase() //console.log(member); if(id === username){ //Skip this user it's me }else{ if(id in staff){staffmembers++;} eids+=id+","; } } if(staffmembers>=1){ eids=""; folder="itstaff"; }else{ eids=eids.slice(0,-1); } } myresult.push({name:name,note:note,purpose:purpose,value:value,folder:folder,eids:eids}); } if(loop<ids.length && loop<1000){ fetch("https://stache.utexas.edu/api/ui/v2/item/"+ids[loop]) .then(response=>response.json()) .then(data=>process_id(ids,loop+1,data)); }else { var output="name,note,purpose,secret,folder,eids\n"; myresult.forEach(function(result){ //console.log(result); output+=escapeCSV(result.name)+","+escapeCSV(result.note)+","+escapeCSV(result.purpose)+","+escapeCSV(result.value)+","+escapeCSV(result.folder)+","+escapeCSV(result.eids)+"\n"; }); //GM.setClipboard (output); downloadCSV(output,"Stache Passwords.csv") const overlay = document.createElement('div'); overlay.id = 'my-custom-overlay'; overlay.innerHTML = '<p> Saved '+myresult.length+' passwords into a file called stache_passwords.csv</p><p> Please store these securely and then delete this file</p>'; // Style the overlay overlay.style.position = 'fixed'; overlay.style.top = '50%'; overlay.style.left = '50%'; overlay.style.transform = 'translate(-50%, -50%)'; overlay.style.backgroundColor = 'rgba(0, 0, 0, 0.8)'; overlay.style.color = 'white'; overlay.style.padding = '20px'; overlay.style.border = '2px solid white'; overlay.style.borderRadius = '10px'; overlay.style.zIndex = '9999'; overlay.style.textAlign = 'center'; overlay.style.fontFamily = 'sans-serif'; // Add a close button const closeButton = document.createElement('button'); closeButton.textContent = 'Close'; closeButton.onclick = function() { overlay.remove(); }; overlay.appendChild(closeButton); // Append the overlay to the body of the page document.body.appendChild(overlay); } } function copy_passwords() { 'use strict'; // Get user input using window.prompt() username = window.prompt("Please enter your EID:", "UTEID"); username=username.toUpperCase(); fetch('https://stache.utexas.edu/api/ui/v2/items/all_ids') .then(response => response.json()) // Parse the response body as JSON .then(ids => process_id(ids,0,null)) .catch(error => alert('Error:', error)); } copy_passwords()
  3. It should ask you for your EID, go ahead and enter it

  4. WAIT A LONG TIME (5-10 minutes possibly)

  5. It should tell you it’s complete.

  6. Your passwords are saved unecrypted in your downloads. Secure them!!!