Size
11.0 KB
Version
1.1.1
Created
Nov 5, 2025
Updated
about 1 month ago
1// ==UserScript==
2// @name Extension for privatekeyfinder.io
3// @description A new extension
4// @version 1.1.1
5// @match https://*.privatekeyfinder.io/*
6// @icon https://privatekeyfinder.io/favicon.png
7// ==/UserScript==
8(function() {
9 'use strict';
10
11 // Configuration
12 let isRunning = false;
13 let pageDelay = 3000; // 3 seconds between pages
14 let pagesScanned = 0;
15 let keysWithBalance = [];
16
17 // Initialize the extension
18 async function init() {
19 console.log('Litecoin Private Key Balance Finder initialized');
20
21 // Load saved state
22 isRunning = await GM.getValue('isRunning', false);
23 pagesScanned = await GM.getValue('pagesScanned', 0);
24 keysWithBalance = await GM.getValue('keysWithBalance', []);
25
26 // Create UI controls
27 createControlPanel();
28
29 // If was running, resume
30 if (isRunning) {
31 startScanning();
32 }
33 }
34
35 // Create control panel UI
36 function createControlPanel() {
37 const panel = document.createElement('div');
38 panel.id = 'balance-finder-panel';
39 panel.style.cssText = `
40 position: fixed;
41 top: 80px;
42 right: 20px;
43 background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
44 color: white;
45 padding: 20px;
46 border-radius: 12px;
47 box-shadow: 0 8px 32px rgba(0,0,0,0.3);
48 z-index: 10000;
49 min-width: 300px;
50 font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
51 `;
52
53 panel.innerHTML = `
54 <div style="margin-bottom: 15px;">
55 <h3 style="margin: 0 0 10px 0; font-size: 18px; font-weight: 600;">🔍 Balance Finder</h3>
56 <div style="font-size: 13px; opacity: 0.9;">
57 <div>Pages scanned: <strong id="pages-count">${pagesScanned}</strong></div>
58 <div>Keys with balance: <strong id="balance-count">${keysWithBalance.length}</strong></div>
59 </div>
60 </div>
61
62 <div style="margin-bottom: 15px;">
63 <label style="display: block; margin-bottom: 5px; font-size: 13px;">Delay (seconds):</label>
64 <input type="number" id="delay-input" value="${pageDelay / 1000}" min="1" max="60"
65 style="width: 100%; padding: 8px; border: none; border-radius: 6px; font-size: 14px;">
66 </div>
67
68 <div style="display: flex; gap: 10px; margin-bottom: 10px;">
69 <button id="start-btn" style="flex: 1; padding: 10px; border: none; border-radius: 6px;
70 background: #10b981; color: white; font-weight: 600; cursor: pointer; font-size: 14px;">
71 ▶ Start
72 </button>
73 <button id="stop-btn" style="flex: 1; padding: 10px; border: none; border-radius: 6px;
74 background: #ef4444; color: white; font-weight: 600; cursor: pointer; font-size: 14px;" disabled>
75 ⏸ Stop
76 </button>
77 </div>
78
79 <button id="reset-btn" style="width: 100%; padding: 8px; border: none; border-radius: 6px;
80 background: rgba(255,255,255,0.2); color: white; font-weight: 500; cursor: pointer; font-size: 13px;">
81 🔄 Reset Stats
82 </button>
83
84 <div id="found-keys" style="margin-top: 15px; max-height: 200px; overflow-y: auto;
85 background: rgba(0,0,0,0.2); padding: 10px; border-radius: 6px; font-size: 12px;">
86 </div>
87 `;
88
89 document.body.appendChild(panel);
90
91 // Event listeners
92 document.getElementById('start-btn').addEventListener('click', startScanning);
93 document.getElementById('stop-btn').addEventListener('click', stopScanning);
94 document.getElementById('reset-btn').addEventListener('click', resetStats);
95 document.getElementById('delay-input').addEventListener('change', (e) => {
96 pageDelay = parseInt(e.target.value) * 1000;
97 });
98
99 updateFoundKeysDisplay();
100 }
101
102 // Start scanning
103 async function startScanning() {
104 isRunning = true;
105 await GM.setValue('isRunning', true);
106
107 document.getElementById('start-btn').disabled = true;
108 document.getElementById('stop-btn').disabled = false;
109
110 console.log('Starting balance scan...');
111 scanCurrentPage();
112 }
113
114 // Stop scanning
115 async function stopScanning() {
116 isRunning = false;
117 await GM.setValue('isRunning', false);
118
119 document.getElementById('start-btn').disabled = false;
120 document.getElementById('stop-btn').disabled = true;
121
122 console.log('Scanning stopped');
123 }
124
125 // Reset statistics
126 async function resetStats() {
127 if (confirm('Reset all statistics and found keys?')) {
128 pagesScanned = 0;
129 keysWithBalance = [];
130 await GM.setValue('pagesScanned', 0);
131 await GM.setValue('keysWithBalance', []);
132
133 document.getElementById('pages-count').textContent = '0';
134 document.getElementById('balance-count').textContent = '0';
135 updateFoundKeysDisplay();
136
137 console.log('Statistics reset');
138 }
139 }
140
141 // Scan current page for keys with balance
142 async function scanCurrentPage() {
143 if (!isRunning) return;
144
145 console.log('Scanning page for balances...');
146
147 try {
148 // Get total balance on page
149 const totalBalanceElement = document.querySelector('#total-balance');
150 const balanceSatoshi = totalBalanceElement ? parseInt(totalBalanceElement.getAttribute('data-satoshi')) : 0;
151 const totalTx = totalBalanceElement ? parseInt(totalBalanceElement.getAttribute('data-tx')) : 0;
152
153 console.log(`Page balance: ${balanceSatoshi} satoshi, TX: ${totalTx}`);
154
155 // If page has balance, check individual addresses
156 if (balanceSatoshi > 0 || totalTx > 0) {
157 await checkIndividualAddresses();
158 }
159
160 // Update stats
161 pagesScanned++;
162 await GM.setValue('pagesScanned', pagesScanned);
163 document.getElementById('pages-count').textContent = pagesScanned;
164
165 // Navigate to next page after delay
166 setTimeout(() => {
167 if (isRunning) {
168 goToNextPage();
169 }
170 }, pageDelay);
171
172 } catch (error) {
173 console.error('Error scanning page:', error);
174 setTimeout(() => {
175 if (isRunning) {
176 goToNextPage();
177 }
178 }, pageDelay);
179 }
180 }
181
182 // Check individual addresses for balance
183 async function checkIndividualAddresses() {
184 const addressElements = document.querySelectorAll('[id^="addr-"]');
185
186 for (const addrElement of addressElements) {
187 const addressId = addrElement.id;
188 const address = addrElement.textContent.trim();
189
190 // Get balance badge for this address
191 const balanceBadge = addrElement.querySelector('.badge-success, .badge-warning');
192
193 if (balanceBadge) {
194 // Found an address with balance!
195 const balanceText = balanceBadge.textContent.trim();
196
197 // Get the private key
198 const row = addrElement.closest('tr');
199 const privateKeyElement = row ? row.querySelector('[data-key]') : null;
200 const privateKey = privateKeyElement ? privateKeyElement.getAttribute('data-key') : 'Unknown';
201
202 const foundKey = {
203 address: address,
204 balance: balanceText,
205 privateKey: privateKey,
206 page: window.location.href,
207 timestamp: new Date().toISOString()
208 };
209
210 keysWithBalance.push(foundKey);
211 await GM.setValue('keysWithBalance', keysWithBalance);
212
213 document.getElementById('balance-count').textContent = keysWithBalance.length;
214 updateFoundKeysDisplay();
215
216 // Alert user
217 console.log('🎉 FOUND KEY WITH BALANCE!', foundKey);
218 alert(`🎉 Found key with balance!\n\nAddress: ${address}\nBalance: ${balanceText}\nPrivate Key: ${privateKey}`);
219
220 // Copy to clipboard
221 await GM.setClipboard(`Address: ${address}\nBalance: ${balanceText}\nPrivate Key: ${privateKey}\nPage: ${window.location.href}`);
222 }
223 }
224 }
225
226 // Update found keys display
227 function updateFoundKeysDisplay() {
228 const container = document.getElementById('found-keys');
229
230 if (keysWithBalance.length === 0) {
231 container.innerHTML = '<div style="opacity: 0.6; text-align: center;">No keys with balance found yet</div>';
232 } else {
233 container.innerHTML = keysWithBalance.map((key, index) => `
234 <div style="margin-bottom: 10px; padding: 8px; background: rgba(255,255,255,0.1); border-radius: 4px;">
235 <div style="font-weight: 600; color: #10b981;">#${index + 1} ${key.balance}</div>
236 <div style="font-size: 11px; word-break: break-all; margin-top: 4px; opacity: 0.9;">
237 ${key.address}
238 </div>
239 <div style="font-size: 10px; margin-top: 4px; opacity: 0.7;">
240 ${new Date(key.timestamp).toLocaleString()}
241 </div>
242 </div>
243 `).join('');
244 }
245 }
246
247 // Navigate to next page
248 function goToNextPage() {
249 const nextButton = document.querySelector('a[href*="/litecoin/"][href*="/2"], a[href*="/bitcoin/"][href*="/2"], a[href*="/ethereum/"][href*="/2"], a.btn-outline-secondary:not(.disabled)');
250
251 // Try to find the "Next" button more specifically
252 const nextLink = Array.from(document.querySelectorAll('a.btn-outline-secondary')).find(link => {
253 return link.textContent.includes('Next') && !link.classList.contains('disabled');
254 });
255
256 if (nextLink) {
257 console.log('Navigating to next page:', nextLink.href);
258 window.location.href = nextLink.href;
259 } else {
260 console.log('No next page found, trying random page...');
261 const randomLink = document.querySelector('a[href*="random"]');
262 if (randomLink) {
263 window.location.href = randomLink.href;
264 } else {
265 console.log('Cannot find next or random page, stopping...');
266 stopScanning();
267 }
268 }
269 }
270
271 // Start when page loads
272 if (document.readyState === 'loading') {
273 document.addEventListener('DOMContentLoaded', init);
274 } else {
275 init();
276 }
277
278})();