Skip to content

Instantly share code, notes, and snippets.

View tomaszklim's full-sized avatar

Tomasz Klim tomaszklim

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

Kerberos cheatsheet



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

With Rubeus version with brute module:

tomaszklim /
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 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 \
tomaszklim /
Created September 4, 2019 09:31
Edit existing Heartbeat-based check in using API (update url and name)
if [ "$3" = "" ]; then
echo "usage: $0 <check-id> <search-for> <replace-with> [--execute]"
exit 0
tomaszklim /
Last active August 8, 2019 12:06
Configure swap file - eg. on Amazon ECS
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
tomaszklim /
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 /opt/heartbeat
echo "" >/etc/heartbeat/server.url
tomaszklim /
Last active October 26, 2023 09:43
Espeo Software initial server analysis script, for future customers
# Espeo Software server analysis script
# Written by Tomasz Klim
# Version 1.2
# Run this script as root and send us the created TGZ package.
mkdir -p $path/etc $path/log $path/ls $path/proc
tomaszklim /
Created July 5, 2019 10:58
Send stdout logs from running Docker containers by email.
# 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/
tomaszklim /
Created June 7, 2019 15:10
Install Docker stack on Ubuntu 18.04 LTS
apt install apt-transport-https ca-certificates curl software-properties-common
echo "deb [arch=amd64] bionic stable" >/etc/apt/sources.list.d/docker.list
curl -fsSL |apt-key add -
apt update
apt install docker-ce python-pip
git clone /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)"