Community discussions

Search found 15 matches

by rendezz
Thu Oct 18, 2018 4:16 pm
Forum: General
Topic: libssh exploit, is Mikrotik affected?
Replies: 5
Views: 991

Re: libssh exploit, is Mikrotik affected?

Great, thank you
by rendezz
Thu Oct 18, 2018 10:01 am
Forum: General
Topic: libssh exploit, is Mikrotik affected?
Replies: 5
Views: 991

libssh exploit, is Mikrotik affected?

Is Mikrotik affected by the libssh bug described here?

https://arstechnica.com/information-tec ... ot-access/

I am not sure if libssh is used under the hood, it would be great to know one way or the other.

Thanks
by rendezz
Wed Sep 26, 2018 2:51 pm
Forum: Scripting
Topic: Variable Inconsistencies
Replies: 2
Views: 360

Re: Variable Inconsistencies

perhaps a race condition?

Also, I believe dhcp-script will run on both activation of a lease and release.

I would add some logging to the script, then you can manually look at the logs to see DHCP being allocated the the log item in the script being called.
by rendezz
Wed Sep 26, 2018 2:41 pm
Forum: Scripting
Topic: script to detect RDP user connected
Replies: 8
Views: 856

Re: script to detect RDP user connected

If I correct your code like this #Define variables global vCurrentStatus; global vCurrentRDPIPs global vNewStatus #find number of connected RDP Users :set vNewStatus [:len [/ip firewall address-list find list="RDPUserConnected"]]; #If change in RDP user count - send email :if ($vNewStatus != $vCurre...
by rendezz
Wed Sep 26, 2018 2:31 pm
Forum: Scripting
Topic: script to detect RDP user connected
Replies: 8
Views: 856

Re: script to detect RDP user connected

Your code doesn't seem to compile on my side

Colon end of second line
Colon end of third line
no :local on fourth line

Does that code compile on your side?

Can you send me your running code so I can take a look at it.
by rendezz
Fri Sep 21, 2018 2:48 pm
Forum: Scripting
Topic: get packet-loss value from ping
Replies: 1
Views: 537

Re: get packet-loss value from ping

Below is an extract from the Badjr's failover detection code Take it for a spin :local totalpingsreceived 0; :local avgrtt 0; :local pinglimit 4 /tool flood-ping address=8.8.8.8 count=$pinglimit interval=00:00:01 timeout=00:00:01 do={ :if ($sent = $pinglimit) do={ :set totalpingsreceived $"received"...
by rendezz
Fri Sep 21, 2018 9:51 am
Forum: Scripting
Topic: Parse issue
Replies: 1
Views: 321

Re: Parse issue

Try this :local test "ether1:cc|ether2:xx|ether9:zz|" :local found 0 :while ([:len ($test)] > 0) do={ :set found [:find $test "|" -1] :if ($found = "") do={ :put $test :set test "" } else={ :put [:pick $test 0 $found] :set test [:pick $test ($found+1) [:len ($test)]] } }
by rendezz
Fri Sep 21, 2018 9:38 am
Forum: Scripting
Topic: script to detect RDP user connected
Replies: 8
Views: 856

Re: script to detect RDP user connected

Actually just ignore my post above

Try this
global vCurrentStatus;
:local vNewStatus [:len [/ip firewall address-list find list="RDPUserConnected"]];
:if ($vNewStatus != $vCurrentStatus) do={
    :put "ip address $vCurrentStatus changed to $vNewStatus";
    :set vCurrentStatus $vNewStatus;
}
by rendezz
Fri Sep 21, 2018 9:31 am
Forum: Scripting
Topic: script to detect RDP user connected
Replies: 8
Views: 856

Re: script to detect RDP user connected

:global vCurrentStatus; :local vNewStatus [/ip firewall address-list> :put [:len [/ip firewall address-list find list="RDPUserConnected"] ]]; :if ($vNewStatus != $vCurrentStatus) do={ :put "ip address $vCurrentStatus changed to $vNewStatus"; :set vCurrentStatus $vNewStatus; } Thats just a guess fro...
by rendezz
Fri Sep 21, 2018 9:26 am
Forum: Scripting
Topic: Locate script that was generated in CLI
Replies: 1
Views: 308

Re: Locate script that was generated in CLI

does "/system script export" return anything?

Are you sure it wasn't loaded into scheduler and run on start?
by rendezz
Wed Sep 19, 2018 12:53 pm
Forum: Scripting
Topic: Remove address from address-list
Replies: 5
Views: 1609

Re: Remove address from address-list

Broke my own code when I added the logging component. Seems pre storing the address in $address causes the behaviour you saw. Put is straight in find and it works :foreach i in=[/ip firewall address-list find list="ssh_stage2"] do={ :local address [/ip firewall address-list get $i address] :log info...
by rendezz
Wed Sep 19, 2018 11:50 am
Forum: Scripting
Topic: Wait for command to complete?
Replies: 2
Views: 541

Re: Wait for command to complete?

You could try { :execute { ping 10.0.0.1 interface="bridge / LAN" interval="1000ms" count=30; /file print file=pingdone.txt; } file=ping.txt } Then in your later code, or other code where you are waiting, just look for the existence of pingdone.txt which will only be created after the ping is comple...
by rendezz
Wed Sep 19, 2018 11:33 am
Forum: Scripting
Topic: Remove address from address-list
Replies: 5
Views: 1609

Re: Remove address from address-list

:foreach i in=[/ip firewall address-list find name="ssh_stage2"] do=( /ip firewall address-list find name="ssh_stage1" remove $i ) The above is very broken in terms of syntax and just about everything. Try :foreach i in=[/ip firewall address-list find list="ssh_stage2"] do={ :local address [/ip fir...
by rendezz
Tue Sep 18, 2018 3:46 pm
Forum: Scripting
Topic: Remove address from address-list
Replies: 5
Views: 1609

Re: Remove address from address-list

Can you send us the relevant code/config snippet on how you are doing that, and lets see what can be done with that.
by rendezz
Mon Sep 17, 2018 11:09 am
Forum: Scripting
Topic: Built in function library
Replies: 55
Views: 15048

Re: Built in function library

url_encode();
+1 to this, my implementation is limited and awful