Skip to content

Instantly share code, notes, and snippets.

@pyperanger
pyperanger / ransonpoc.go
Created January 8, 2021 20:26
EDR Ransonware PoC
package main
import (
"fmt"
"os"
"io/ioutil"
"path/filepath"
"strings"
"math/rand"
"time"
@pyperanger
pyperanger / HSTS.pl
Created November 23, 2020 16:44
Check HSTS Compliance
#!/usr/bin/perl
use LWP::UserAgent;
sub usage {print "HSTS Validate\n# perl hsts.pl https://domain.com\n";exit(254);}
my $url = shift || usage();
my $status = 0;
my $res = (LWP::UserAgent->new(timeout=>3,agent =>'Mozilla/5.0'))->get($url);
print "Failed connection\n" and exit(255) unless ($res->code < 302);
if($res->header("strict-transport-security") eq ""){print "no hsts flag" and exit(4);}
print "max-age lower then 31536000\n" and $status++ if ($res->header("strict-transport-security") =~ /max-age=(\d+)/g)[0] < 31536000;
@pyperanger
pyperanger / Makefile.pl
Last active September 20, 2020 07:20
suck makefile
#!/usr/bin/perl
# FLAGS
$NASM = "nasm -f elf64";
$GCC = "gcc -no-pie";
# COMPILATION
map { print "$NASM $_\n"; `$NASM $_`} glob("*.asm");
map { $elf = substr($_, 0, -2); print "$GCC $elf\n"; `$GCC $_ -o $elf`} glob("*.o");
@pyperanger
pyperanger / sukofus.go
Created September 11, 2020 13:14
F4ck ofuscation shells
package main
import (
"fmt"
"io/ioutil"
"regexp"
"strconv"
"strings"
"flag"
)
var (
@pyperanger
pyperanger / meet.go
Created September 3, 2020 22:38
Creating Google Meet via Golang
/*
Google Meet communication
*/
package main
import (
// Google SDK Libraries
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
@pyperanger
pyperanger / otx-dump.go
Last active December 10, 2020 18:05
AlienVault OTX Dump via API (unauth)
package main
import (
"encoding/json"
"fmt"
"net/http"
"strconv"
"io/ioutil"
"os"
"flag"
@pyperanger
pyperanger / open.go
Last active May 28, 2020 19:27
"Hooking" Open call (rootkit ring3 wanna be)
/*
go build -o opengo.so -buildmode=c-shared open.go
*/
package main
// #cgo LDFLAGS: -fpic -shared
// #include <sys/types.h>
import "C"
import (
"strings"
@pyperanger
pyperanger / sampe.go
Last active April 6, 2020 17:44
Golang Expr Obfuscation Gval Example
package main
import (
"fmt"
"strings"
"github.com/PaesslerAG/gval"
)
var (
dic = strings.NewReplacer(
const fs = require('fs');
const NodeRSA = require('node-rsa');
const cryptokey = ""; // private key
const keyoptions = {
encryptionScheme: 'pkcs1'
};
const privateKey = fs.readFileSync(cryptokey, 'utf8');
const key = new NodeRSA(privateKey);
key.setOptions(keyoptions);
@pyperanger
pyperanger / colors.go
Created February 3, 2020 17:59
Golang colors without external library in Linux
package main
import (
"fmt"
)
var (
RED = "\x1b[31m"
GREEN = "\x1b[32m"
YELLOW = "\x1b[33m"