![Malicious npm Package Typosquats react-login-page to Deploy Keylogger](https://cdn.sanity.io/images/cgdhsj6q/production/007b21d9cf9e03ae0bb3f577d1bd59b9d715645a-1024x1024.webp?w=400&fit=max&auto=format)
Research
Security News
Malicious npm Package Typosquats react-login-page to Deploy Keylogger
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
firefox-profile
Advanced tools
Changelog
1.1.0
Readme
Create or update Firefox Profile programmatically.
If you are using selenium-webdriver
package, you no longer need to use this package: selenium-webdriver
package now implements a class that allows to create firefox profiles. And this new class doesn't play well with this package. Check
this link
for an example on how to set your own profile with selenium-webdriver
.
This package is still useful if you use another webdriver library like wd.js
or any other webdriver json wire protocol implementation (webdriver.io
?).
This class allows you to:
More info on user preferences here.
It also contains a command line interface that allows to copy or create profiles.
"real" npm support is on its way... soon... maybe... Open an issue if you need it... Use npm:
npm install firefox-profile
or yarn
:
yarn add firefox-profile
Make sure you have selenium server running... or use 'selenium-webdriver/remote' class.
/******************************************************************
* with old version selenium webdriverJs
* WARNING: does not work with recent version of selenium-webdriver node bindings, which expect an instance of selenium-webdriver Firefox Profile page (`require('selenium-webdriver/firefox').Profile` or similar)
* @see: https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/firefox/profile_exports_Profile.html
* installs firebug
* and make http://saadtazi.com the url that is opened on new tabs
/******************************************************************/
var webdriver = require('selenium-webdriver');
// create profile
var FirefoxProfile = require('firefox-profile');
var myProfile = new FirefoxProfile();
// you can add an extension by specifying the path to the xpi file
// or to the unzipped extension directory
myProfile.addExtension('test/extensions/firebug-1.12.4-fx.xpi', function() {
var capabilities = webdriver.Capabilities.firefox();
// you can set firefox preferences BEFORE calling encoded()
myProfile.setPreference('browser.newtab.url', 'http://saadtazi.com');
// attach your newly created profile
myProfile.encoded(function(err, encodedProfile) {
capabilities.set('firefox_profile', encodedProfile);
// start the browser
var wd = new webdriver.Builder().
withCapabilities(capabilities).
build();
// woot!
wd.get('http://en.wikipedia.org');
});
});
/**************************************************
/* with admc/wd
/* installs firebug, and make it active by default
/**************************************************/
var FirefoxProfile = require('firefox-profile'),
wd = require('wd');
// set some userPrefs if needed
// Note: make sure you call encoded() after setting some userPrefs
var fp = new FirefoxProfile();
// activate and open firebug by default for all sites
fp.setPreference('extensions.firebug.allPagesActivation', 'on');
// activate the console panel
fp.setPreference('extensions.firebug.console.enableSites', true);
// show the console panel
fp.setPreference('extensions.firebug.defaultPanelName', 'console');
// done with prefs?
fp.updatePreferences();
// you can install multiple extensions at the same time
fp.addExtensions(['./test/extensions/firebug-1.12.4-fx.xpi'], function() {
fp.encoded(function(err, zippedProfile) {
if (err) {
console.error('oops, an error occured:', err);
return;
}
browser = wd.promiseChainRemote();
// firefox 46-
//browser.init({
// browserName:'firefox',
// // set firefox_profile capabilities HERE!!!!
// firefox_profile: zippedProfile
//}).
// firefox 47+
browser.init({
browserName:'firefox',
marionette: true,
'moz:firefoxOptions': {
profile: zippedProfile
}
})
// woOot!!
get('http://en.wikipedia.org');
});
});
You can also copy an existing profile... Check the doc FirefoxProfile.copy(...)
.
It allows to copy (from profile name or profile directory) or create firefox profiles with installed extensions. Note that it does not allow to load user preferences... yet.
Run node_modules/bin/firefox-profile -h
to get the help message:
usage: firefox-profile [-v] [-p profilename || -c profile_dir] [-e extension_path1 [-e extension_path2]] [-o destination_dir || --ouput destination_dir || -b [file_path] || --base64 [file_path]]
-v: verbose mode (same as --verbose)
-h: show this message (same as --help)
-p profilename: profile to copy (same as --profile)
-c profile_dir: profile folder path to copy (same as --copy)
-e extension_path: file path to extension to add to the profile. Can be present multiple times (same as --extension)
-o destination_dir (or --output destination_dir): folder where the profile will be created.
-b [file_path](or --base64): write the encoded firefox profile to stdout or to file_path if specified.
The API documentation can be found in doc/.
It can be regenerated using grunt docs
.
Requires apidox - listed in devDependencies.
mocha
# or
grunt mochacov:unit
grunt mochacov:coverage
Generates doc/coverage.html
This class is actually a port of the python class.
Open a github issue.
FAQs
Unknown package
The npm package firefox-profile receives a total of 80,159 weekly downloads. As such, firefox-profile popularity was classified as popular.
We found that firefox-profile demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
Security News
The JavaScript community has launched the e18e initiative to improve ecosystem performance by cleaning up dependency trees, speeding up critical parts of the ecosystem, and documenting lighter alternatives to established tools.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.