Skip to content

Instantly share code, notes, and snippets.

@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'
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
@crawc
crawc / udptextd.php
Created August 25, 2022 01:26 — forked from tiebingzhang/udptextd.php
An one-off PHP UDP server to listen on a UDP port and print the text received. Can be used as a very basic UDP log listener.
#!/usr/bin/php -f
<?php
error_reporting(~E_WARNING);
//Create a UDP socket
if(!($sock = socket_create(AF_INET, SOCK_DGRAM, 0))) {
$errorcode = socket_last_error();
$errormsg = socket_strerror($errorcode);
die("Couldn't create socket: [$errorcode] $errormsg \n");
}
echo "Socket created \n";
@crawc
crawc / iptables.txt
Created February 8, 2022 16:52 — forked from warewolf/iptables.txt
iptables based rate limiting
-A INPUT -i eth0 -p udp -m udp --dport 5060 -j SIP
#
-A SIP -i eth0 -p udp -m udp --dport 5060 -m string --string "INVITE" --algo bm --from 23 --to 28 -m comment --comment "Catch SIP INVITEs" -j SIPINVITE
-A SIP -i eth0 -p udp -m udp --dport 5060 -m string --string "REGISTER" --algo bm --from 23 --to 30 -m comment --comment "Catch SIP REGISTERs" -j SIPREGISTER
-A SIP -m comment --comment "Catch and accept everything else" -j ACCEPT
#
-A SIPINVITE -m hashlimit --hashlimit-upto 4/min --hashlimit-burst 4 --hashlimit-mode srcip,dstip,dstport --hashlimit-name anon-sip-rateinv --hashlimit-srcmask 24 -m comment --comment "Rate limit SIP invites" -j ACCEPT
-A SIPINVITE -m limit --limit 10/min -j LOG --log-prefix "SIPINV DROP: "
-A SIPINVITE -m comment --comment "Rate limit exceeded, reject" -j REJECT
#