The backend consist of an expressjs webserver which serves the administrator interface using Basic HTTP Authentication customizable from the options and a socket.io server wait and handle the receiving of key logs from various sources, stores them and forward them to the administrator interface for be seen and analyzed.
The administrator interface for visualize the key logs archive and the live key logs feed from various clients is built with Angular using Angular CLI version 1.6.6. The administrator interface comes with a basic HTTP authorization which defaults to:
The client script is a socketio.io client with key logger functions that try to hide himself by pausing when the dev-tools (inspector) is open. It catches only relevant keys and send them back to the server as a buffer with additional information, take a look at the code if you want to see more.
The best way to use it is installing it globally so you have access at the keylog-io command anytime you want to spin up quickly your keylog server.
npm install -g keylog.io
yarn global add keylog.io
--help anytime to get informations about the program or the commands, for example:
$ keylog-io --help Commands: start [options] Start the keylogger server build [options] <hostname> [port] Build the client flle for the given endpoint
or sub commands for example:
$ keylog-io start --help Usage: start [options] Options: -h, --hostname <host> The address where start the server -p, --port <port> The port where start the server (default: 9000) -c, --client Serve the client keylogger file -d, --demo Serve the demo client page -h, --help output usage information
You can also optionally setup a database to use for storing persistently the keylog entries you grab with the client payload.
You can also use it in your applications or scripts like a normal nodejs module. First of all install it using npm or yarn:
npm install keylog.io yarn add keylog.io
Than require it in your code and use it like in the example below, it takes only few options:
const keyloggerServer = ;// Start the server connected with database;
By default the administrator interface will have Basic HTTP Authentication with values:
For a full list of options see the default options on source code.
If you want to use the MySQL database to persist the keylog entries across time when used multiple times or for using the
archive page to analyze your findings later using the filters, you must setup a table called keylogs, the suggested
table structure is the following but you can adapt the sized to your needs or suggest a more optimized structure. You can customize the database name using the
database options property which is an object that let you configure the details of the connection to your MySQL instance.
(`id` int(11) NOT NULL,`hostname` varchar(50) NOT NULL,`element` varchar(50) NOT NULL,`key` varchar(50) NOT NULL,`path` varchar(255) NOT NULL,`timestamp` timestamp NULL DEFAULT current_timestamp()) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;`keylogs`ADD PRIMARY KEY (`id`),ADD KEY `HOSTNAME_INDEX` (`hostname`);`keylogs`MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;COMMIT;
- Basic HTTP Authentication for administrator interface with options for username and password
- Optionally save key logs results on a MySQL database
- Change behavior, pausing and trying to hide when devtools is open
- Create different routes for live feeds and archive
- Handle mobile input events (mobile browsers support)
- Test key logger performances with multiple different hosts
- Complete the administrator interface with filters, groups, labels and stuff..
- Write a good documentation with examples and video use during simulated MITM attacks
- Write tests for backend and frontend code
- Get drunk at the end of all this
npm run start this will concurrently spin up the express/socketio development server and start angular-cli. It should open a browser page with the administrator interface, if not, vavigate to
http://localhost:4200/. The app will automatically reload if you change any of the source files.
Also it will serve a keylogger client demo page at the address:
ng generate component component-name to generate a new component. You can also use
ng generate directive|pipe|service|class|guard|interface|enum|module.
npm run build to build the project. The build artifacts will be stored in the
dist/ directory. Use the
-prod flag for a production build.
npm run build-client to build the key logger-client file which is a socket.io-client module with a payload for capturing key presses and send them to a remote server.
Running unit tests
npm run test to execute the unit tests via Karma.
Running end-to-end tests
npm run e2e to execute the end-to-end tests via Protractor.
- Fork it ( https://github.com/b4dnewz/keylog.io/fork )
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Write and run the tests (
npm run test)
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request
The keylog.io is released under the MIT License by b4dnewz.