(kind of?) hacking the UG56 LoraWAN Gateway

Hey folks :vulcan_salute: ,

i have this lorawan gateway. Industrial LoRaWAN® Gateway | Milesight for controlling some thermostats.

I use a Raspberry with moquitto and node-red for controlling the devices. Setting the target temperatur, getting the current temperaturs etc. via mqtt. ... Done :check_mark:


In the gateway, you can install node-red with the Version 3.0.2.
There are some Lora-specific nodes:

And i want to see how they work :face_with_monocle:
Especially the "LoRa Output" node, because you can only hardcode the parameters. Passing the variables with msg doesn't work.


In the Gateway, you can avtivate ssh, but you can't login with the user root.

But the node RED process runs as the user root :zany_face:
grafik

so i try to find the lora node via node-red

I (ChatGPT :see_no_evil_monkey: ) build a simple htmlpage with a websocket connection to look for node red folder and found it here:

The name of the lora package is this: node-red-contrib-node-library

But in the node_modules folder, there is no module node-red-contrib-node-library

I don't want to brick the device ( :money_with_wings:).
So i only want to read the filesystem, i don't want to invoke some risky commands.

search results:


du

I search the output from du for the name, no luck.


node

node -p "require.resolve.paths('node-red-contrib-node-library')"

[
  '/node_modules',
  '/.node_modules',
  '/.node_libraries',
  '/usr/lib/node'
]

1-3 dont exists, in /usr/lib/node i could not find it


/etc/node_red/data/

cat /etc/node_red/data/package.json

{
    "name": "node-red-project",
    "description": "A Node-RED Project",
    "version": "0.0.1",
    "private": true,
    "dependencies": {
        "node-red-contrib-aedes": "~0.13.0",
        "node-red-contrib-buffer-parser": "~3.2.2"
    }
}

These are the nodes which i have manually installed


/usr/lib/node_modules/node_red

cat /usr/lib/node_modules/node_red/package.json

{
    "name": "node-red",
    "version": "3.0.2",
    "description": "Low-code programming for event-driven applications",
    "homepage": "http://nodered.org",
    "license": "Apache-2.0",
    "repository": {
        "type": "git",
        "url": "https://github.com/node-red/node-red.git"
    },
    "main": "lib/red.js",
    "scripts": {
        "start": "node red.js"
    },
    "bin": {
        "node-red": "./red.js",
        "node-red-pi": "bin/node-red-pi"
    },
    "contributors": [
        {
            "name": "Nick O'Leary"
        },
        {
            "name": "Dave Conway-Jones"
        }
    ],
    "keywords": [
        "editor",
        "messaging",
        "iot",
        "flow"
    ],
    "dependencies": {
        "@node-red/editor-api": "3.0.2",
        "@node-red/nodes": "3.0.2",
        "@node-red/runtime": "3.0.2",
        "@node-red/util": "3.0.2",
        "basic-auth": "2.0.1",
        "bcryptjs": "2.4.3",
        "express": "4.18.1",
        "fs-extra": "10.1.0",
        "node-red-admin": "^3.0.0",
        "node-red-contrib-modbus": "^5.25.0",
        "node-red-node-tail": "^0.4.0",
        "nopt": "5.0.0",
        "semver": "7.3.7"
    },
    "optionalDependencies": {
        "bcrypt": "5.0.1"
    },
    "engines": {
        "node": ">=14"
    }
}

/usr/lib/node_modules/node_red/node_modules



ls -lah   /usr/lib/node_modules/node_red/node_modules

--> No luck


Has someone an idea how or where to find the node module?