Help Mnscript Random Firewall Code

Ping_Wing

Civil Gamers Expert
Feb 24, 2021
11
0
91
Trying to get it to generate an automatic firewall code. Anyone know?

using Console;
using System;
using String;
using Math;

string input = Math.RandomRange (12350,1024551();

Console.WriteLine("Firewall now being enabled...");
System.RunCommand("router settings admin_password "..input"());

}

}
 

lybbx

CG Super VIP
Donator
Dec 25, 2020
70
35
91
aha x
iirc there's no built in function to get the ASCII values of characters, but you can do something similar instead.

ways i can think of are:

1) Creating a string array of characters and getting a random index for a random range, here's a function which returns the result of this:

-----------------------------------------------------------

using Console;
using System;
using Array;
using Math;
using String;

string[] chars = new Array[65]; // i cba to write out all values, this represents the length of all lowercase, uppercase, numbers, space, dash and underscore

function<string> getRandomString(number len, string[] charList)
{
string pass; // creates a variable to store the password
while(String.Length(pass) <= len)
{
pass = pass .. charList[Math.RandomRange(1, Array.Length(charList)]; // Concatenates a new character onto the string while it's less than the desired length
}
return pass; // Returns the variable 'pass'
}

string randomPass = getRandomString(Math.RandomRange(10,15), chars);

-----------------------------------------------------------

2) Creating a single string with each character and using String.CharAt() instead

-----------------------------------------------------------

using Console;
using System;
using Math;
using String;

string chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 -_";

function<string> getRandomString(number len, string charList)
{
string pass;
while(String.Length(pass) <= len)
{
pass = pass .. String.CharAt(charList, Math.RandomRange(1, String.Length(charList)));
}
return pass;
}

string randomPass = getRandomString(Math.RandomRange(10,15), chars);
-----------------------------------------------------------

Then just do something like

System.RunCommand("router settings admin_password " .. getRandomString(Math.RandomRange(10,15), chars));


tbh there's probably a far easier way, but this is all off the top of my head. Hope these helped
 
  • Like
Reactions: CamZin

JFK

CG Platinum VIP
Donator
Jan 1, 2021
50
19
91
@Ping_Wing

You need to use the "randomPass" variable instead on the last line.

Code:
string chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 -_";

function<string> getRandomString(number len, string charList)
{
string pass;
while(String.Length(pass) <= len)
{
pass = pass .. String.CharAt(charList, Math.RandomRange(1, String.Length(charList)));
}
return pass;
}

string randomPass = getRandomString(Math.RandomRange(10,15), chars);

System.RunCommand("router settings admin_password "..randomPass);

Hope this helps.
 

'a' TS Kenny

CG Super VIP
Donator
Dec 20, 2020
420
153
41
Chicaco town
iirc there's no built in function to get the ASCII values of characters, but you can do something similar instead.

ways i can think of are:

1) Creating a string array of characters and getting a random index for a random range, here's a function which returns the result of this:

-----------------------------------------------------------

using Console;
using System;
using Array;
using Math;
using String;

string[] chars = new Array[65]; // i cba to write out all values, this represents the length of all lowercase, uppercase, numbers, space, dash and underscore

function<string> getRandomString(number len, string[] charList)
{
string pass; // creates a variable to store the password
while(String.Length(pass) <= len)
{
pass = pass .. charList[Math.RandomRange(1, Array.Length(charList)]; // Concatenates a new character onto the string while it's less than the desired length
}
return pass; // Returns the variable 'pass'
}

string randomPass = getRandomString(Math.RandomRange(10,15), chars);

-----------------------------------------------------------

2) Creating a single string with each character and using String.CharAt() instead

-----------------------------------------------------------

using Console;
using System;
using Math;
using String;

string chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 -_";

function<string> getRandomString(number len, string charList)
{
string pass;
while(String.Length(pass) <= len)
{
pass = pass .. String.CharAt(charList, Math.RandomRange(1, String.Length(charList)));
}
return pass;
}

string randomPass = getRandomString(Math.RandomRange(10,15), chars);
-----------------------------------------------------------

Then just do something like

System.RunCommand("router settings admin_password " .. getRandomString(Math.RandomRange(10,15), chars));


tbh there's probably a far easier way, but this is all off the top of my head. Hope these helped
Nice malware retard :mad: