Skip to content

Instantly share code, notes, and snippets.

View mzpqnxow's full-sized avatar

AG mzpqnxow

View GitHub Profile
@mzpqnxow
mzpqnxow / import_od_xxd.py
Created May 29, 2017 20:45
Ingesting ASCII hex dumps into Python strings
from re import (
sub as regex_sub,
match as regex_match)
from binascii import a2b_hex as ascii_hex_to_binary
def asciiHexToBuffer(inbuf,
skip_bin_encode=False,
is_xxd=False,
is_od=False,
is_tcpdump=False,
@mzpqnxow
mzpqnxow / autolog.py
Last active September 12, 2021 00:34 — forked from brendano/autolog.py
python decorators to log all method calls, show call graphs in realtime too
"""
Written by Brendan O'Connor, brenocon@gmail.com, www.anyall.org
* Originally written Aug. 2005
* Posted to gist.github.com/16173 on Oct. 2008
Copyright (c) 2003-2006 Open Source Applications Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
#!/bin/bash
# Print a list of all USB devices in Linux along with their
# manufacturer, product name and USB version (i.e. USBv2, USBv3)
# Set DEBUG to any value to enable printing of each command
# in case you get weird output
DEBUG=""
lsusb | while read line
do
#
# Useful function for outputting to structured files without any work - AG
#
def to_file(dest, obj, csv_fields=None, uniq=True, filter_blanks=True, silent=False):
"""
Dump to a file based on extension
If .json, do a standard dump() to the file
If .csv, do a CSV with column headers
If .lst, do one str/unicode per-line
"""
#!/usr/bin/env python
"""
Copyright 2018 copyright@mzpqnxow.com
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
<QueryList>
<Query Id="0" Path="Security">
<Select Path="Security">
*[EventData[Data[@Name='ObjectName'] and (Data='C:\Users\Public\Documents\new-login-information.txt')]]
and
*[System[(EventID='4663')]]
</Select>
</Query>
</QueryList>
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
LogFile %ROOT%\data\nxlog.log
<Extension _json>
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
LogFile %ROOT%\data\nxlog.log
<Extension _json>
@mzpqnxow
mzpqnxow / 200-event_id_desc.conf
Created February 3, 2018 06:26
logstash translate event_id to human readable form
filter {
if "winlog" in [tags] and [SourceName] == "wineventlog" {
# Begin translate block - this adds a new field to enrich the event with a description based on the event_id value
translate {
field => "EventID"
destination => "EventDesc"
override => true
fallback => "no match"
# https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/Default.aspx
# Whip it into shape with sed/awk or use Python (4-5 lines cleans it up)
@mzpqnxow
mzpqnxow / dns-servers_updated-2017.md
Created February 22, 2018 03:16 — forked from jcanfield/dns-servers_updated-2017.md
DNS Server List for 2015/2017 (courtesy of http://sos.smerwick.com.tw)

List of DNS Servers

'The following is a list of DNS Servers: both, Private and Public.'

DNS Servers

Why does DNS matter?

The Domain Name System (DNS) protocol is an important part of the web's infrastructure, serving as the Internet's phone book: every time you visit a website, your computer performs a DNS lookup. Complex pages often require multiple DNS lookups before they start loading, so your computer may be performing hundreds of lookups a day.

List of Public DNS Servers