Jika anda membutuhkan sebuah script membuat password secara acak, anda dapat menggunakan script buatan LOGAM.ID di bawah ini. Script ini merupakan hasil dari frustasi karena tidak menemukan script password generator setelah mencari-cari di Google. 😀 Script ini dapat membuat password secara acak dengan panjang password yang diinginkan dengan kombinasi karakter huruf kecil, huruf kapital dan angka. Anda dapat mengubah script ini sesuai dengan kebutuhan anda. Berikut script password generator untuk MikroTik oleh LOGAM.ID.
#########################################
#-----PASSWORD-GENERATOR-BY-LOGAM.ID----#
#########################################
#-----PASSWORD-LENGTH-----#;
:local pwdLength (16);
#----------GET-DATE----------#
:local date [/system clock get date];
:local months ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");
:local month ([:find $months [:pick $date 0 3 ]] + 1);
:if ($month < 10) do={:set month ("0" . $month);};
:local getDate ("$[:pick $date 7 11]" + "$month" + "$[:pick $date 4 6]" );
:set getDate ($getDate % 365);
#-----GET-TIME------#;
:local ts [/system clock get time];
:local getTime ("$[:pick $ts 0 2].$[:pick $ts 3 5].$[:pick $ts 6 8]");
:local getHour ("$[:pick $ts 0 2]");
:local getMinute ("$[:pick $ts 3 5]");
:local getSecond ("$[:pick $ts 6 8]");
#-----GENERATE-PASSWORD----#;
:local char ({ {"a";"b";"c";"d";"e";"f";"g";"h";"i";"j";"k";"l";"m";"n";"o";"p";"q";"r";"s";"t";"u";"v";"w";"x";"y";"z";};{"A";"B";"C";"D";"E";"F";"G";"H";"I";"J";"K";"L";"M";"N";"O";"P";"Q";"R";"S";"T";"U";"V";"W";"X";"Y";"Z";};{0;1;2;3;4;5;6;7;8;9;};});
:local password ("");
for i from=1 to $pwdLength do {
:local modnum (($getSecond) % 3);
:set getSecond ((($getSecond + $getDate) + (($getMinute * $getHour) + $i)) % 26);
:local varnum1 ($getSecond);
:local varnum2 ((($getSecond * $getHour) + ($getMinute + $getDate + $i)) % 10);
:if ($modnum < 2) do {
:local pickchar [:put ($char->modnum)];
:set pickchar [:put ($pickchar->$varnum1)];
#:log warning ("[ $i ]" . " ---> ". $pickchar);
:set password ($password . $pickchar);
} else {
:local pickchar [:put ($char->modnum)];
:set pickchar [:put ($pickchar->$varnum2)];
#:log warning ("[ $i ]" . " --- > ". $pickchar);
:set password ($password . $pickchar);
};
};
:return $password;
Semoga bermanfaat. 😉
thanks alot of information