1. Welcome to PHCorner Forums. Take a moment to Sign up and gain unlimited access and extra privileges that guests are not entitled to, such as:

    All that and more! Registration is quick, simple and absolutely free. Join our community today!

Smart Mac Changer/Factory Reset Auto ...credits to the coder

Discussion in 'WiMAX, DSL Modems' started by mike0924, Oct 16, 2015.

  1. mike0924

    mike0924 Grasshopper Established

    copy and paste sa notepad save as DV235t-Smart-MyBro-Mac-Changer.vbs




    <job>
    <script language="jscript">
    var add=[];
    var subst={};

    function generatePassword(input){
    var inputMac=input.replace(/:/g,"").toUpperCase();
    var macPassword="";
    if((inputMac.search(/^[A-F0-9]{12}$/)==-1) || (inputMac =="000000000000")){
    return macPassword="invalid"}
    else{
    var b;
    var a;
    var c="";
    for(b=0;b<12;b++){
    a=inputMac.charCodeAt(b)+add;
    if(subst[a]){
    a=subst[a]
    }
    c+=String.fromCharCode(a)
    }
    return macPassword="smart1_lancelot";
    }
    };
    function doMath(hexValue1,hexValue2) {
    var outHex;
    var stringHex1 = parseInt(hexValue1,16);
    var stringHex2 = parseInt(hexValue2,16);
    var number = stringHex1;
    var number2 = stringHex2;
    var hexaddansv = eval(number) + eval(number2);
    outHex = (hexaddansv);
    return outHex = Number(hexaddansv).toString(16);
    }
    </script>

    <script language="vbscript">
    'Dim out


    Dim telnetUserName, telnetPassword, telnetHost,sMac,genPassOut,sM
    Set cloner = CreateObject("WScript.Shell")


    '===Server settings===

    telnetUserName = "mt7109"
    telnetPassword = "wimax"
    telnetHost = "10.1.1.254"

    '===End server settings===

    'connectToHost(telnetHost)

    If Ping(telnetHost) Then
    connectToHost(telnetHost)
    Else
    MsgBox vbCr & vbLf & "Failed to connect! Please check your WIMAX IP!!! and TRY AGAIN...",16,"Status Window [Recode by: Dr.Yell] "
    WScript.Quit
    End If

    'Function check Host if reachable
    Function Ping(Target)
    Dim results

    On Error Resume Next

    Set shell = CreateObject("WScript.Shell")

    ' Send 1 echo request, waiting 2 seconds for result
    Set exec = shell.Exec("ping -n 1 -w 2000 " & Target)
    results = LCase(exec.StdOut.ReadAll)

    Ping = (InStr(results, "reply from") > 0)
    End Function

    Function getBaseMacFourtOctetSixTTm(macFull)
    Dim mac,baseMac
    mac = macFull
    baseMacValue = Mid(mac,1,12)
    getBaseMacFourtOctetSixTTm =baseMacValue
    'inputMacBase.value = baseMac
    Set mac = Nothing
    Set baseMac = Nothing
    End Function 'end getbaseMac

    ''Begin IncrementMAC by One
    Function IncrementMacbyOne (lanMAc)
    Dim mac, lastHex, lastHexRange,inc,incTest,newMac,genMethodString
    mac = lanMAc
    fullNewMAc = "30:87:30:C6:83:18"
    ''LogContents.value = "Generating MAC started..."
    intNumberofMAc = CLng(Trim(1))
    inc = 1
    genMethodString = "Increment"
    howManyMac = 0
    getNewBaseMac = UCase(getBaseMacFourtOctetSixTTm(mac))
    Do
    myCurrenMacFifthHex = Mid(mac,13,2)
    myCurrenMacSixthHex = Mid(mac,16,2)
    fifthAndSixthMac = myCurrenMacFifthHex & myCurrenMacSixthHex
    howManyMac = howManyMac + 1
    incTest = doMath(fifthAndSixthMac,inc)
    newMac = incTest
    If incTest < "0000" Then
    ''DisplayLogMacGenScan genMethodString & " is out of range... Try use INCREMENT method."
    Exit do
    End If
    If Len(incTest) = 3 Then
    newMac = "0" & newMac
    ElseIf Len(incTest) = 2 Then
    newMac = "00" & newMac
    ElseIf Len(incTest) = 1 Then
    newMac = "000" & newMac
    ElseIf Len(incTest) >4 Then
    ''DisplayLogMacGenScan genMethodString & " is out of range... Try use DECREMENT method."
    Exit Do
    End If
    newMacFifth = Mid(newMac,1,2)
    newMacSixth = Mid(newMac,3,2)
    newMac = newMacFifth &":"& newMacSixth
    fullNewMAc = getNewBaseMac & UCase(newMac)
    mac = fullNewMAc
    Loop While howManyMac <> intNumberofMAc
    IncrementMacbyOne = fullNewMAc
    End Function
    ''End IncrementMAC by one

    'Ask MAc and Connect to telnet
    Sub connectToHost(hostAddress)
    Do
    sMac = InputBox( vbCr & vbLf & "Supported device:" & vbCr & vbLf & " DV-235t with orig Firmware and Green Packet Firmware," & vbCr & vbLf & "" & vbCr & vbLf & "NOTE: Paglagay mo ng Smart Mac sipol kana, kasi kasama na ang frequency at lan mac na papalitan!!!" & vbCr & vbLf & "Sinama ko na na palitan ang Lan Mac!!! Ayos ba ka-tinapay!!! " & vbCr & vbLf & "" & vbCr & vbLf & "Please enter a VALID Smart MAC Address! EX. 00:1F:FB:UT:UT:MO" , "WIMAX MAC Changer [Recode by: Dr.Yell]")


    If TypeName(sMac) = "Empty" Then
    MsgBox vbCr & vbLf & " Operation Canceled! ",16,"Goodbye... [Recode by: Dr.Yell] "
    WScript.Quit
    End If

    If Len(Trim(sMac)) = 0 Then
    MsgBox "Please Enter valid MAC Address!",16,"Status Window [Recode by: Dr.Yell] "
    End If
    passWord =generatePassword(sMac)
    Loop While (passWord="invalid")
    wanMacEntry = Replace(sMac ,":","")
    currentMacAddOne = IncrementMacbyOne(sMac)

    cloner.run "Telnet " & hostAddress
    WScript.Sleep 2000

    cloner.SendKeys telnetUserName
    cloner.SendKeys("{Enter}")
    WScript.Sleep 2000

    cloner.SendKeys telnetPassword
    cloner.SendKeys("{Enter}")
    WScript.Sleep 2000

    cloner.SendKeys"sncfg dset ADMIN_NAME admin"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset ADMIN_PASSWD '$1$k2I9hJe4$OkHKF43oTmjvv3zJtrEZ4.'"
    cloner.SendKeys("{Enter}")
    WScript.sleep 400

    cloner.SendKeys"sncfg dset WAN_MAC_ENCRY " & wanMacEntry
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset WAN_MAC " & sMac
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset LAN_MAC " & currentMacAddOne
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset WMX_USER_NAME " & wanMacEntry
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset WMX_PASSW " & passWord
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset WMX_ANONYMOUS_ID " & wanMacEntry & "@smartbro.net"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset WMX_FREQ_LIST 2337500,2347500,2357500,2345000,2355000,2365000"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset WMX_GEMTEK_FREQUENCY_RANGE_LH_BOUND 2300000KHz-2400000KHz"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset WMX_IGNORE_CERT 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset MGMT_WEB_WAN 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset MGMT_TELNET_WAN 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset MGMT_SSH_WAN 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset HTTPD_ENABLE 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset HTTPD_PORT 80"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset HTTPSD_ENABLE 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset HTTPSD_PORT 443"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset TELNETD_ENABLE 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset TELNETD_PORT 23"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset MGMT_TELNET_LAN 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset SSHD_Enable 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset SSHD_PORT 22"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset MGMT_SSH_LAN 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset TR_ENABLE 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset TR_BOOTSTRAP 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset TR_INFORM_ENABLE 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_DDOS_SYNFLOOD 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_DDOS_UDPFLOOD 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_DDOS_ICMPFLOOD 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_DDOS_PORTSCAN 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_DDOS_LANDATTACK 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_DDOS_IPSPOOF 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_DDOS_ICMPREDIRECT 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_DDOS_PINGOFDEATH 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_DDOS_PINGFROMWAN 1"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_ALG_FTP 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_ALG_H323 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_ALG_IPSEC 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_ALG_L2TP 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_ALG_PPTP 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_ALG_RTSP 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg dset NETFILTER_ALG_SIP 0"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"sncfg commit"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"clear"
    cloner.SendKeys("{Enter}")
    WScript.Sleep 400

    cloner.SendKeys"/factoryreset.sh"
    cloner.SendKeys("{Enter}")
    WScript.quit


    end sub
    Sub tymsg(hostadd)
    MsgBox "Recode by: Dr.Yell" & vbCr & vbLf & out,48,"Status Window"
    end sub
    </script>

    </job>
     
Tags / Keywords: