New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-merlin-wrt-api

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-merlin-wrt-api

An npm package to retrieve data and send commands to an asus Router running Merlin WRT

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
12
1100%
Maintainers
1
Weekly downloads
 
Created
Source

NodeMerlinWrtApi

The purpose of this project is to provide a library that can be used to

  • connect to a router running the [Merlin] Firmware
  • fetching infos regarding router, clients, traffic, etc.
  • running arbitrary commands (untested)

Installation

$# npm i --save node-merlin-wrt-api

Usage

"use strict";

const node_merlin_wrt_api = require("node-merlin-wrt-api");
(async () => {
    const api = new node_merlin_wrt_api.NodeMerlinWrtApi('admin', 'changeMe', 'https://192.168.1.1:8443', true);
    console.log('Api created');

    const token = await api.getAuthToken();
    console.log(`New Auth Token: "${token}"`);

    const data = await api.getClientList();
    console.log(`Recieved clients macs: ${JSON.stringify(data.macList)}`);

    await api.logout();
})().then(() => {
    process.exit();
}).catch(err => {
    console.error(err);
    process.exit(1);
});

Development

Start the dev-Container described in docker-compose.yml-file:

$# docker-compose run --rm dev ash
/src $

Debugging

whilst in the dev-containers shell, run:

$# npm run tsx -- --inspect-wait=0.0.0.0:9229 Example/example.ts

then attach your node inspector of choice to port 9229, e.g. with vscode and the following configuration:

.vscode/launch.json:

"configurations": [
  {
    "type": "node",
    "request": "attach",
    "name": "Docker: Attach to Node",
    "port": 9229,
    "remoteRoot": "/src",
    "localRoot": "${workspaceFolder}"
  },
]

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

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.

Install

Related posts