Skip to content

Instantly share code, notes, and snippets.

@warewolf
warewolf / tcpdump.txt
Created December 8, 2014 01:31
Nifty. Update notifications packes for PS4 are plaintext.
ETag: "da4bb8afaac733892077087143a7af2c:1417600099"
Last-Modified: Wed, 03 Dec 2014 09:48:19 GMT
Accept-Ranges: bytes
Content-Length: 769
Content-Type: application/xml
Date: Mon, 08 Dec 2014 01:28:49 GMT
Connection: keep-alive
<?xml version="1.0" ?>
<update_data_list>
@warewolf
warewolf / log.txt
Created December 20, 2014 23:56
Captchas don't work so well when it's a predictable number: SIP attack from 62.210.143.154
[Dec 20 18:52:04] NOTICE[23145][C-0000001b] chan_sip.c: Call from '' (62.210.143.154:7930) to extension '3371316412' rejected because extension not found in context 'from-sip'.
[Dec 20 18:52:04] NOTICE[23145][C-0000001c] chan_sip.c: Call from '' (62.210.143.154:7915) to extension '3151494933' rejected because extension not found in context 'from-sip'.
[Dec 20 18:52:04] NOTICE[23145][C-0000001d] chan_sip.c: Call from '' (62.210.143.154:7930) to extension '111111' rejected because extension not found in context 'from-sip'.
[Dec 20 18:52:04] NOTICE[23145][C-0000001e] chan_sip.c: Call from '' (62.210.143.154:7915) to extension '000' rejected because extension not found in context 'from-sip'.
[Dec 20 18:52:04] NOTICE[23145][C-0000001f] chan_sip.c: Call from '' (62.210.143.154:7915) to extension '001' rejected because extension not found in context 'from-sip'.
[Dec 20 18:52:04] NOTICE[23145][C-00000020] chan_sip.c: Call from '' (62.210.143.154:7915) to extension '002' rejected because extension not found in context
@warewolf
warewolf / iptables.txt
Last active February 8, 2022 16:52
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
#
@warewolf
warewolf / contact.xml
Last active August 29, 2015 14:12
Signs somebody doesn't know how to XML
<?xml version="1.0" encoding="utf-8"?>
<groups>
<group display_name="All Contacts" ring="" />
<group display_name="Blacklist" ring="" />
</groups>
<contacts>
<contact display_name="Richard" office_number="richard" mobile_number="" other_number="" line="0" ring="Auto" group_id_name="All Contacts" />
</contacts>
@warewolf
warewolf / gist:c185d17008dd1639138f
Created January 1, 2015 02:21
SMI USB flash drive controller identification page
# sg_raw -r 525 /dev/sg2 f0 04 00 00 00 00 00 00 00 00 00 01
>>> transport error: Host_status=0x03 [DID_TIME_OUT]
Driver_status=0x00 [DRIVER_OK, SUGGEST_OK]
SCSI Status: Good
Received 525 bytes of data:
00 02 00 43 30 4b 40 02 c0 17 22 22 30 4b 38 02 c0 ..C0K@...""0K8..
10 1a 22 22 30 4b 30 02 c0 1d 22 22 30 4b 29 02 c0 .""0K0...""0K)..
@warewolf
warewolf / gist:cc7f6e7a062421387d4c
Created January 1, 2015 02:27
SMI flash part identification (98 3a a8 92 76 == TH58TEG8T2JBA4C)
# sg_raw -r 530 /dev/sg2 f0 06 00 00 00 00 00 00 00 00 00 01
>>> transport error: Host_status=0x03 [DID_TIME_OUT]
Driver_status=0x00 [DRIVER_OK, SUGGEST_OK]
SCSI Status: Good
Received 525 bytes of data:
00 20 02 00 0d 00 00 47 e5 0f 01 00 00 00 00 00 00 .....G.........
10 00 00 00 00 00 00 00 00 00 00 00 00 03 be ef 00 ................
20 03 be ef 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
@warewolf
warewolf / clubdubstep
Last active January 5, 2018 18:22
di.fm tracklist scraping perl script (so you can "tag" your likes)
#!/bin/bash
# softlink me to a channel name, e.g. clubdubstep chillout, trance.
CHANNEL=`basename $0`
difmwant $CHANNEL
@warewolf
warewolf / dst.gdb
Created February 19, 2015 23:37
Don't Starve Together GDB script for running on a different display
file /usr/lib/libSDL2-2.0.so.0
file "/home/warewolf/.local/share/Steam/steamapps/common/Don't Starve Together Beta/bin/dontstarve_steam"
set breakpoint pending on
define MTFNPY
step 6
finish
step 4
set variable displaydata.screen=3
disable
detach
# gdb `which python`
GNU gdb (GDB) Fedora 7.7.1-21.fc20
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
@warewolf
warewolf / hash.pl
Created April 3, 2015 22:00
Today I learned about Scalar::Util::dualvar, and used it to my advantage.
#!/usr/bin/perl
use strict;
use warnings;
use Scalar::Util qw(dualvar);
use List::Util qw(first);
use constant {
md5 => dualvar(length('62e2b06482fc7c4f4312797c81bf102a'),"md5"),
sha1 => dualvar(length('59ad3fe46fa061bfd690e0bce261a4cb37a83e51'),"sha1"),