ℹ️ This was duplicated to this blog for readability and reference
The most difficult challenge with RMM detection is contextual awareness around usage to determine if it is valid or malicious.
#!/usr/bin/python3 | |
# From DOS commandline, run this as follows:- | |
# python3 ejectusb.py | |
# -or- create C:\windows\ejectusb.bat to do the above in fewer characters. | |
# | |
# From WSL bash, run it as follows:- | |
# cmd.exe /c start python3 C:\\windows\\ejectusb.py | |
# -or- create /usr/local/bin/ejectusb to do the above in fewer characters. |
function Get-InjectedThread | |
{ | |
<# | |
.SYNOPSIS | |
Looks for threads that were created as a result of code injection. | |
.DESCRIPTION | |
ℹ️ This was duplicated to this blog for readability and reference
The most difficult challenge with RMM detection is contextual awareness around usage to determine if it is valid or malicious.
/* | |
TaskManagerSecret | |
Author: @splinter_code | |
This is a very ugly POC for a very unreliable UAC bypass through some UI hacks. | |
The core of this hack is stealing and using a token containing the UIAccess flag set. | |
A trick described by James Forshaw, so all credits to him --> https://www.tiraniddo.dev/2019/02/accessing-access-tokens-for-uiaccess.html | |
From there it uses a task manager "feature" to run a new High IL cmd.exe. | |
This has been developed only for fun and shouldn't be used due to its high unreliability. |
#!/bin/sh | |
# | |
# This script is used on a QNAP TS-269 PRO. https://www.en0ch.se/qnap-and-rsync/ | |
# | |
# You have to change: | |
# 1. $SHAREUSR | |
# 2. $EXCLUDES (if you want o change the name of the file servername.excludes) | |
# 3. $SOURCE & $DESTINATION | |
# 4. user@yourserver.se for the mysqldump | |
# 5. --password=SUPERSECRET |
#!/usr/bin/python | |
import dbus | |
import dbus.glib | |
import gobject | |
import subprocess | |
def lock(): | |
print "Screen saver turned on" |
I hereby claim:
To claim this, I am signing this object:
$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |