Not so random 11 digits? H112-370
#5
This was pulled from the firmware from one of the routers. I'm sure SoxRok2212 doesn't mind me sharing, but the algo you're looking for is likely similar

#!/bin/sh

# Generate a unique video SSID from the box's serial number

charset="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\"#\$%&'()*+,-./:;<=>?@[]_\`{|}~\\"

cat /sys/module/board/parameters/serialnumber | openssl sha1 | awk '
{
hash = $2;

sizeof_charset=split( chars, charset, "" );

hex[0] = "0";
hex[1] = "1";
hex[2] = "2";
hex[3] = "3";
hex[4] = "4";
hex[5] = "5";
hex[6] = "6";
hex[7] = "7";
hex[8] = "8";
hex[9] = "9";
hex[10] = "a";
hex[11] = "b";
hex[12] = "c";
hex[13] = "d";
hex[14] = "e";
hex[15] = "f";

for(a=0; a<16; a++)
{
for(b=0; b<16; b++)
{
idx = 16*a + b;
str = sprintf( "%s%s", hex[a], hex[b] );
bighex[ str ] = idx;
}
}

resultstr = "";

for(i=1; i<= length(hash) && i <= 14; i += 2)
{
str = substr(hash, i, 2);
idx = bighex[ str ];
idx = idx % sizeof_charset;
resultstr = resultstr charset[idx];
}

print "vATT" resultstr;
}' chars=$charset
Reply


Messages In This Thread
Not so random 11 digits? H112-370 - by doraimon0 - 07-27-2021, 06:43 AM
RE: Not so random 11 digits? H112-370 - by drsnooker - 08-01-2021, 01:26 AM