Skip to content

Instantly share code, notes, and snippets.

local msg_types = {
[0] = "None",
[1] = "Version",
[2] = "Serial",
[3] = "Close",
[4] = "Close all",
[5] = "Error",
[6] = "Connect to",
[7] = "Connected",
[8] = "Request events",
##! Analysis of ARP Traffic.
##! This script logs ARP traffic while doing so builds an internal ARP cache
##! that can be used to determine when MAC/IP associations change.
##!
##! Written by Peter Erickson <[email protected]>
##! Reference: http://mailman.icsi.berkeley.edu/pipermail/bro/2011-November/004415.html
#
# Abbreviations are taken from RFC 826:
#
# SHA: source hardware address (i.e., MAC address)
#!/bin/bash
#
# Found on: http://hackforums.net/showthread.php?tid=914128
#
#Autorooter and backdoor bash-script
#Hopefully this script will come to good use
#Run n tell dat home, home, homeboy!!
#by: ludwig @ SSTeam.info
clear
@grigorescu
grigorescu / README.md
Last active November 6, 2020 02:34
breakpoint_to_pcap

breakpoint_to_pcap

Overview

Given an input PCAP and a location in a Bro script, this script will filter the PCAP into a new file, which contains only the connections that visited that script location. This script can help filter a large PCAP to narrow down problematic connections, such as protocol violations, weirds, etc.

Example

#!/usr/bin/python
import sys
import pygeoip
import dns.resolver
from IPy import IP
import pytz
import smtplib
import datetime
#!/usr/bin/python
import argparse, sys
def hexdump(text, space=False):
result = ""
for t in text:
s = str(hex(ord(t))).replace('0x', '')
if len(s) == 1:
s = '0' + s
##! A detection script for UDP DoS Flows
@load base/protocols/conn
module UDPDoS;
export {
redef enum Notice::Type += {
Detected,
@load base/frameworks/sumstats
@load base/protocols/smtp
module SMTP;
export {
redef enum Notice::Type += {
## Generated if a user is sending mail to too many recipients
ExcessiveRecipients
};
module Exposed;
export {
redef enum Notice::Type += {
Service
};
const exposed_services: table[port] of string ={} &redef;
}
redef exposed_services+= [[11211/tcp] = "memcached"];
@grigorescu
grigorescu / bro_find_all_events.sh
Created March 5, 2018 15:35
This is a one-liner to find all events defined in Bro
for i in $(git grep -l event); do cat $i | perl -e '$input=join("", <>); for ($input=~/^\s*(event [^(]+\([^)]*?\))/mg) { s/\n\s*/ /g; s/%//g; print "$_ { }\n"; }' ; done