A
A
Alexander Petrov2021-08-24 23:50:19
API
Alexander Petrov, 2021-08-24 23:50:19

What are the easy options to turn off Mikrotik remotely?

Good evening.

There is a design: Beward video camera, connected to Mikrotik Hex Lite. All this is packed in an isolated box, from where the Ethernet cable is brought out. Outside there is some black box with a screen that can:

1. knock for a stream on rtsp://login : [email protected]:554/sub and display it on the screen
2. give two commands in this form:

  • Recording start (on built-in SD card): 192.168.0.99/cgi-bin/login/password.cgi?action=rec...
  • End of entry: 192.168.0.99/cgi-bin/login/password.cgi?action=rec...

3. Turn on and off the power of the camera and the router through the relay.

Question: how can a black box issue a shutdown command to the router (/system/shutdown) in such a situation? Those. Is it possible to generate a command over http similar to the camera API, passing everything directly in the line along with the login / password pair and the command to the Mikrotik terminal?
The black box is a specific and not very smart node of the system - there is no OS, and its tasks include, in general, only the above. Therefore, before considering the introduction of some other protocols into it (ssh, telnet), I would like to make sure that there is really a need for this and it cannot be made easier.

Thank you for your attention to the issue.

PS I found the potential of such a command in login:[email protected]/webfig/#System:Shutdown.. but the web pug does not accept the password in the line - it cuts into critical login failure for user <...> and forces it to be entered into the web -shape hands. You can make an account without a password, then you need to contact this address twice and it lets you enter the password for the form and even asks for confirmation to turn it off .. Potentially a working option, but somehow not very good without a password.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
d-stream, 2021-08-25
@Avis-HQ

As an idea - https://habr.com/ru/post/313794/
that is:
- in the scheduler we check for the presence of a specific address-list and, if it exists, execute /system/shutdown
- in the rules when accessing a specific port - we create (we write down address)
in order to avoid false positives from bot scanners, we make several rules for different ports (and sheets, respectively) with a short lifetime,
then the trigger will only occur when accessing these several ports in a short interval
(a sort of port-knocking)

M
MaxKozlov, 2021-08-25
@MaxKozlov

The simplest thing is that you can use netwatch to see if the camera is alive - 192.168.0.99, and if not, turn off after it. But I like the d-stream
option better :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question