Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Commit 142afad

Browse files
author
mattifestation
committed
Added parameters back to the original Invoke-Shellcode
1 parent 59b35d1 commit 142afad

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

CodeExecution/Invoke-Shellcode.ps1

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,50 @@
55
# many scripts that have this path hardcoded. If you don't like it,
66
# fork PowerSploit and host it yourself.
77

8-
throw 'Something terrible may have just happened and you have no idea what because you just arbitrarily download crap from the Internet and execute it.'
8+
function Invoke-Shellcode
9+
{
10+
11+
[CmdletBinding( DefaultParameterSetName = 'RunLocal', SupportsShouldProcess = $True , ConfirmImpact = 'High')] Param (
12+
[ValidateNotNullOrEmpty()]
13+
[UInt16]
14+
$ProcessID,
15+
16+
[Parameter( ParameterSetName = 'RunLocal' )]
17+
[ValidateNotNullOrEmpty()]
18+
[Byte[]]
19+
$Shellcode,
20+
21+
[Parameter( ParameterSetName = 'Metasploit' )]
22+
[ValidateSet( 'windows/meterpreter/reverse_http',
23+
'windows/meterpreter/reverse_https',
24+
IgnoreCase = $True )]
25+
[String]
26+
$Payload = 'windows/meterpreter/reverse_http',
27+
28+
[Parameter( ParameterSetName = 'ListPayloads' )]
29+
[Switch]
30+
$ListMetasploitPayloads,
31+
32+
[Parameter( Mandatory = $True,
33+
ParameterSetName = 'Metasploit' )]
34+
[ValidateNotNullOrEmpty()]
35+
[String]
36+
$Lhost = '127.0.0.1',
37+
38+
[Parameter( Mandatory = $True,
39+
ParameterSetName = 'Metasploit' )]
40+
[ValidateRange( 1,65535 )]
41+
[Int]
42+
$Lport = 8443,
43+
44+
[Parameter( ParameterSetName = 'Metasploit' )]
45+
[ValidateNotNull()]
46+
[String]
47+
$UserAgent = 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
48+
49+
[Switch]
50+
$Force = $False
51+
)
52+
53+
throw 'Something terrible may have just happened and you have no idea what because you just arbitrarily download crap from the Internet and execute it.'
54+
}

0 commit comments

Comments
 (0)