Skip to content

Instantly share code, notes, and snippets.

Avatar

David Wittman DavidWittman

View GitHub Profile
@DavidWittman
DavidWittman / ms120-020.py
Created Apr 5, 2012
MS12-020/CVE-2012-0002 Vulnerability Tester
View ms120-020.py
#!/usr/bin/env python
"""
MS12-020/CVE-2012-0002 Vulnerability Tester
based on sleepya's version @ http://pastebin.com/Ks2PhKb4
"""
import socket
import struct
import sys
@DavidWittman
DavidWittman / audit_iam_accounts.py
Created Apr 14, 2016
Parses the output from AWS credential reports and displays users which have been inactive for 60+ days.
View audit_iam_accounts.py
#!/usr/bin/env python
# Parses the output from AWS credential reports and displays
# users which have been inactive for 60+ days.
#
# Usage:
# audit_iam_accounts.py credential_report.csv <days>
#
import csv
View windows-vm-openstack.md

Create a Windows OpenStack VM with VirtualBox

0. Obtain Windows ISO

  • Use an existing ISO or copy from a CD with dd if=/dev/cdrom of=image.iso

1. Boot VirtualBox VM from Windows ISO

  • Qcow disk type
  • 40GB Root Disk
  • Load your Windows ISO to the Primary CD drive
  • Add a secondary CD drive and attach the VirtIO ISO to it
@DavidWittman
DavidWittman / supermicro-java-console.sh
Last active Dec 5, 2019
Retrieves the plaintext JNLP for the iKVM console from a SuperMicro IPMI webserver
View supermicro-java-console.sh
#!/usr/bin/env bash
# Retrieves the plaintext JNLP from a SuperMicro IPMI webserver
# Usage: supermicro-java-console.sh <hostname>
# supermicro-java-console.sh 10.1.2.34 > login.jnlp
set -x
HOST="$1"
IPMI_USER=${IPMI_USER:-ADMIN}
@DavidWittman
DavidWittman / supermicro-bmc-reset.sh
Created Sep 11, 2014
Issues a reset of the SuperMicro BMC via the web interface
View supermicro-bmc-reset.sh
#!/usr/bin/env bash
# Issues a reset of the SuperMicro BMC via the web interface
#
# usage: supermicro-bmc-reset.sh <ipmi-host>
# e.g.: supermicro-bmc-reset.sh 10.0.0.1
#
set -x
@DavidWittman
DavidWittman / clouddns-export.py
Last active Dec 12, 2018
Exports all domains for a Rackspace Cloud account in BIND9 format
View clouddns-export.py
#!/usr/bin/env python
import json
import os
import time
import clouddns
USERNAME = ''
APIKEY = ''
@DavidWittman
DavidWittman / supermicro-psblock-fix.expect
Last active Oct 25, 2018
This expect script secures SuperMicro IPMI implementations which are vulnerable to viewing the IPMI password in plaintext on port 49152.
View supermicro-psblock-fix.expect
#!/usr/bin/expect -f
# This script secures SuperMicro IPMI implementations which are vulnerable
# to viewing the IPMI password in plaintext on port 49152. It does this by
# using the shell available in some SuperMicro BMCs to drop traffic to port
# 49152 in iptables.
#
# See http://blog.cari.net/carisirt-yet-another-bmc-vulnerability-and-some-added-extras/
# for more details on the vulnerability.
#
@DavidWittman
DavidWittman / wireshark-analysis.md
Last active Jul 21, 2018
Outline for Packet Analysis with Wireshark
View wireshark-analysis.md

Packet Analysis with Wireshark

Links

Common filters

Source IP is 192.168.1.1

ip.src == 192.168.1.1

@DavidWittman
DavidWittman / python-nested_list_comprehensions.md
Created Jul 26, 2012
Nested list comprehensions in Python
View python-nested_list_comprehensions.md

Nested list comprehensions in Python

For some reason or another, I'm always second guessing myself when writing nested list comprehensions. Here's a quick example to clarify what's going behind the scenes:

>>> words = ["foo", "bar", "baz"]
>>> [letter for word in words for letter in word]
['f', 'o', 'o', 'b', 'a', 'r', 'b', 'a', 'z']
@DavidWittman
DavidWittman / saltstack-devstack.md
Last active Mar 29, 2018
Automated DevStack deployments on Rackspace with salt-cloud
View saltstack-devstack.md

Automated DevStack deployments on Rackspace with salt-cloud

Preparation

Install salt-master and salt-cloud

These instructions will install salt-master and salt-cloud on recent Ubuntu releases. Consult the SaltStack Installation Documentation should you require instructions for other distributions.

echo deb http://ppa.launchpad.net/saltstack/salt/ubuntu `lsb_release -sc` main | sudo tee /etc/apt/sources.list.d/saltstack.list