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
#!/usr/bin/env python3 | |
# Extract IP address and port from "ConnectBack" shellcode used in Gitlab intrusions | |
# https://bazaar.abuse.ch/browse/tag/ConnectBack/ | |
import sys | |
import struct | |
import socket | |
with open(sys.argv[1], "rb") as fp: |
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
#!/bin/bash | |
PIDS=$(pidof sshd) | |
PACKAGES="" | |
for pid in $PIDS; | |
do | |
for lib in $(cat /proc/$pid/maps |awk {'print $6'} |grep ^/ |sort |uniq); | |
do | |
PACKAGES="$PACKAGES $(rpm -q --whatprovides $lib)" |
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
#!/bin/bash | |
PIDS=$(pidof sshd) | |
for pid in $PIDS; | |
do | |
for lib in $(cat /proc/$pid/maps |awk {'print $6'} |grep ^/ |sort |uniq); | |
do | |
rpm -q --whatprovides $lib |grep " package" | |
done |
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
#!/usr/bin/env python3 | |
import json | |
import requests | |
from twisted.web import server | |
from twisted.web.resource import Resource | |
from twisted.internet import reactor | |
def http_log(request): |
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
#!/usr/bin/env python3 | |
import os | |
import fcntl | |
from array import array | |
# https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/fs.h | |
FS_IOC_GETFLAGS = 0x80086601 | |
f = os.open("/bin/ls", os.O_RDONLY) |
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
#!/usr/bin/env python3 | |
import os | |
import sys | |
import time | |
import fcntl | |
import errno | |
import socket | |
import hashlib | |
import requests |
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
#!/bin/sh | |
# This will generate a keypair for each command line argument: | |
# | |
# Create keys named "daniel", "jacob", and "whitley" | |
# % generate-lots-of-ssh-keypairs.sh daniel jacob whitley | |
# | |
# Create 100 numbered keys | |
# % generate-logs-of-ssh-keypairs.sh $(seq 100) |
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
#!/bin/sh | |
# This changes permissions on lolbins to only be executable by the lolbins | |
# group members. | |
# | |
# Beware; if you use an X11/Xorg display manager, this may cause your system | |
# not to boot properly. Add lightdm, xdm, etc to "lolbins" group if you are | |
# using a GUI. | |
# | |
# Beware again; this breaks apt. If you get gpg errors when doing apt updates, |
NewerOlder