Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Script to reinstall and configure SSH for password authentication and root login
# Check if the script is run as root
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root. Please use sudo or log in as root."
exit 1
fi
@crawc
crawc / jbt-rules.cf
Created March 26, 2024 23:13 — forked from jult/jbt-rules.cf
SpamAssassin rules
# Put this file under /etc/spamassassin/ and run an sa-update or reload amavis etc.
#
#--------------------------------------------------
# The only RBL I trust, UCEPROTECT1 (single IP, not IP-ranges or entire ISPs) http://uceprotect.net
#--------------------------------------------------
header RCVD_IN_UCEPROTECT1 eval:check_rbl_txt('uceprotect1', 'dnsbl-1.uceprotect.net')
describe RCVD_IN_UCEPROTECT1 Listed in dnsbl-1.uceprotect.net
tflags RCVD_IN_UCEPROTECT1 net
score RCVD_IN_UCEPROTECT1 1.8
@crawc
crawc / README.md
Created April 22, 2023 20:03 — forked from taxilian/README.md
OPNSense: Scripts to run as a cron job to enable or disable wireguard based on the CARP status

Installation

  • Install checkWireguard as /usr/local/opnsense/scripts/OPNsense/Wireguard/checkWireguard
  • Install actions_wireguardCarp.conf as /usr/local/opnsense/service/conf/actions.d/actions_wireguardCarp.conf
  • run service configd restart
  • In the OPNSense UI - add a CRON job in System -> Settings -> Cron to call the script
@crawc
crawc / syslogger.py
Created February 23, 2023 19:04 — forked from haukurk/syslogger.py
Logger that sends to syslog servers.
#!/usr/bin/python
# -*- encoding: iso-8859-1 -*-
"""
Python syslog client.
This code is placed in the public domain by the author.
Written by Christian Stigen Larsen.
This is especially neat for Windows users, who (I think) don't
@crawc
crawc / pysyslog.py
Last active February 12, 2023 18:43 — forked from marcelom/pysyslog.py
Tiny Python Syslog Server
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'
$prtguser = "apiuser"
$prtghash = "123456"
$match = "Auto-Discovery *"
$actiontype = "close" # "close" or "resolve"
$message = "auto close"
$hostname = "prtg.yourdomain.com"
$URI = "https://" + $hostname + "/api/table.json?content=tickets&columns=datetime,priority,parentid,message,user,status,name&filter_drel=&username=" + $prtguser + "&passhash=" + $prtghash
$response = Invoke-WebRequest $URI
$jsonObj = $([String]::new($response.Content)) | ConvertFrom-Json | select -expand tickets | select parentid,status_raw,message_raw | Where-Object {($_.message_raw -like $match) -and ($_.status_raw -EQ '1')}
Example infrastructure outage incident report
Friday, May 13, 2077
By the Example Security Team
Earlier this week we experienced an outage in our API infrastructure. Today we’re providing an incident report that details the nature of the outage and our response.
The following is the incident report for the Example Security outage that occurred on April 30, 2077. We understand this service issue has impacted our valued developers and users, and we apologize to everyone who was affected.
@crawc
crawc / blacklist.txt
Created October 11, 2022 22:06 — forked from cephurs/blacklist.txt
2500+ IP malicious IP addresses
2500+ IP addresses dedicated to serving malware.
1.168.33.91
103.12.217.155
103.242.11.1
103.242.11.94
103.243.51.129
103.253.141.43
103.255.101.168
@crawc
crawc / blacklist.txt
Created October 11, 2022 22:06 — forked from cephurs/blacklist.txt
2500+ IP malicious IP addresses
2500+ IP addresses dedicated to serving malware.
1.168.33.91
103.12.217.155
103.242.11.1
103.242.11.94
103.243.51.129
103.253.141.43
103.255.101.168
@crawc
crawc / mpv-ipcam-monitor.sh
Created October 4, 2022 18:05 — forked from paius1/mpv-ipcam-monitor.sh
Script to view and Monitor rtsp:// stream from a security camera
#!/usr/bin/env bash
#
# Simple script to monitor a ipcam stream running on mpv
# using the ipc-server
# requires mpv, socat, and jq written for bash 4
# xwinwrap to run on the Desktop
# by gmail plgroves 2019
#
# script creates a kill script in same path as this script
# named This_script-kill