Skip to content

Instantly share code, notes, and snippets.

View tomaszklim's full-sized avatar

Tomasz Klim tomaszklim

View GitHub Profile
@tomaszklim
tomaszklim / Clear-Event-Log.bat
Last active June 18, 2021 17:23
Source code for articles on Payload.pl
REM Code from https://payload.pl/jak-prosto-wirusy-rozbrajaja-zabezpieczenia-windows-10/
for /f “delims=” %%I in (‘wevtutil el’) do (wevtutil cl “%%I”)
wevtutil sl Security /e:false
@tomaszklim
tomaszklim / kerberos_attacks_cheatsheet.md
Created February 27, 2021 12:34 — forked from TarlogicSecurity/kerberos_attacks_cheatsheet.md
A cheatsheet with commands that can be used to perform kerberos attacks

Kerberos cheatsheet

Bruteforcing

With kerbrute.py:

python kerbrute.py -domain <domain_name> -users <users_file> -passwords <passwords_file> -outputfile <output_file>

With Rubeus version with brute module:

@tomaszklim
tomaszklim / build-opencv3-with-python-on-ubuntu20lts.sh
Last active August 10, 2021 14:23
How to build OpenCV 3.x with Python 3.x bindings on Ubuntu 20.04 LTS
# Download and unpack your chosen OpenCV version., eg. as `/usr/local/src/opencv-3.4.1`
# You can use https://github.com/pisecurity/opencv-manager repository as well.
# This is important. On Ubuntu 20.04 LTS, it is not enough to install just python-dev.
apt-get install python-dev python-numpy python-is-python2 python2.7 python2.7-dev python2.7-minimal
# All unrelated build settings were cut off.
cd /usr/local/src/opencv-3.4.1/build
cmake \
-DENABLE_PRECOMPILED_HEADERS=OFF \
@tomaszklim
tomaszklim / uptimerobot-edit-check.sh
Created September 4, 2019 09:31
Edit existing Heartbeat-based check in Uptimerobot.com using API (update url and name)
#!/bin/bash
api_key="u123456-qa9oic80zsll1xi0fhbwso1"
if [ "$3" = "" ]; then
echo "usage: $0 <check-id> <search-for> <replace-with> [--execute]"
exit 0
fi
tmp=/tmp/uptimerobot-$1-$$.tmp
@tomaszklim
tomaszklim / configure-swap-file.sh
Last active August 8, 2019 12:06
Configure swap file - eg. on Amazon ECS
#!/bin/sh
if [ ! -f /swapfile ]; then
dd if=/dev/zero of=/swapfile bs=1M count=16384
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile
if ! grep -q swapfile /etc/fstab; then
echo "/swapfile none swap sw 0 0" >>/etc/fstab
fi
@tomaszklim
tomaszklim / espeo-custom-aws-ecs-user-data.sh
Created August 2, 2019 15:19
Install Espeo Heartbeat on newly created ECS instance in AWS
echo "Installing Espeo custom monitoring client"
yum install -y git
git clone https://github.com/serverfarmer/heartbeat-linux /opt/heartbeat
/opt/heartbeat/setup.sh
echo "http://monitoring.espeo.pl/cgi-bin/heartbeat-local.cgi" >/etc/heartbeat/server.url
@tomaszklim
tomaszklim / espeo-initial-server-analysis.sh
Last active October 26, 2023 09:43
Espeo Software initial server analysis script, for future customers
#!/bin/sh
# Espeo Software server analysis script
# Written by Tomasz Klim
# Version 1.2
#
# Run this script as root and send us the created TGZ package.
WD=`pwd`
path=$WD/analysis
mkdir -p $path/etc $path/log $path/ls $path/proc
@tomaszklim
tomaszklim / docker-logtail.sh
Created July 5, 2019 10:58
Send stdout logs from running Docker containers by email.
#!/bin/sh
# Written by Tomasz Klim, 2019-07-05
#
# This is a simplified, open source version. It relies on $MAILTO variable
# defined in /etc/crontab file for all cron tasks. A better approach would
# be to send emails in dedicated format, to dedicated list of recipients.
#
# Add this to /etc/crontab:
# * * * * * root /etc/local/docker-logtail.sh
@tomaszklim
tomaszklim / install-docker-ubuntu18.sh
Created June 7, 2019 15:10
Install Docker stack on Ubuntu 18.04 LTS
#!/bin/sh
apt install apt-transport-https ca-certificates curl software-properties-common
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" >/etc/apt/sources.list.d/docker.list
curl -fsSL https://download.docker.com/linux/ubuntu/gpg |apt-key add -
apt update
apt install docker-ce python-pip
#!/bin/sh
git clone https://github.com/CISOfy/lynis /opt/lynis
cd /opt/lynis && /opt/lynis/lynis audit system --cronjob --quiet |grep -v custom.prf
grep warning /var/log/lynis-report.dat |egrep -v "(CONT-8104|KRNL-5830|NETW-2705)"