Skip to content

Instantly share code, notes, and snippets.

View ccammilleri's full-sized avatar

ccammilleri

View GitHub Profile
@ccammilleri
ccammilleri / hashview.service
Last active April 16, 2020 00:26
A systemd script to run hashview as a service.
[Unit]
Description=hashview
[Service]
User=ubuntu
Group=ubuntu
WorkingDirectory=/home/ubuntu/hashview
ExecStart=/bin/bash -lc 'RACK_ENV=development foreman start'
ExecStop=/bin/bash -lc 'RACK_ENV=development foreman stop'
Restart=always
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- This inline task executes shellcode. -->
<!-- C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe SimpleTasks.csproj -->
<!-- Save This File And Execute The Above Command -->
<!-- Author: Casey Smith, Twitter: @subTee -->
<!-- License: BSD 3-Clause -->
<Target Name="Hello">
<ClassExample />
</Target>
<UsingTask
@ccammilleri
ccammilleri / group_snapshot.bash
Created January 25, 2018 01:23
Take group snapshots for multiple xenserver VMs at once. Helpful for lab environments.
#! /bin/bash
#
# add vm uuid of machines you want to be added to the group snapshot
labvms=(
57f9803c-e350-d4fd-2091-215702341df9 #LAB-caldera
8165e1ee-ec65-36c8-c87a-ae94019df08b #LAB-exchange
58138ed5-feb9-46f6-33a7-11102c9a1a7f #LAB-dc01
)
#! /bin/bash
PUSHOVER=true
ORG='9dcd0694b58847fba102f7158aa7d47c741baf54'
CURRENT=`wget -q -O - https://www.derbycon.com/ticket-purchases/ | sha1sum | awk '{print $1}'`
while true; do
echo "checking site..."
require 'json'
require 'smbhash'
require 'open-uri'
require 'digest/md5'
# get data from here
# wget https://api.randomuser.me/?results=1000&password=4,15&nat=us
open('seed.json', 'wb') do |file|
file << open('https://api.randomuser.me/?results=1000&password=4,15&nat=us').read
#! /bin/bash
while read line;do
echo "===="
echo "Source IP: $line"
whois $line | egrep "(contact\:Company|descr)"
done < <(awk '{print $1}' /var/log/apache2/access.log | sort -u)
@ccammilleri
ccammilleri / purge-unused-kernels.sh
Created November 3, 2016 00:57
purge unused kernels in ubuntu to avoid boot partition form filling up
#! /bin/sh
dpkg --get-selections | grep 'linux-image-*' | awk '{print $1}' | egrep -v "linux-image-$(uname -r)|linux-image-generic" | head -n -2 | sed 's/^linux-image-\(.*\)$/\1/' | \
while read n; do
echo 'Purging unneeded kernel images and headers for: '$n
sudo apt-get --yes purge linux-image-$n #purge images
sudo apt-get --yes purge linux-headers-$n #purge headers
done
# this script requires burp extension carbonator to be active
<ruby>
framework.db.workspace.services.each do |serv|
next if (serv.state != ServiceState::Open)
if (serv.port == 80 || serv.name == "http")
print_line("http server found: #{serv.host.address} port: #{serv.port}")
run_single("java -jar -Xmx2g /opt/burp/burpsuite_pro_v1.6.36.jar http #{serv.host.address} #{serv.port}")
elsif (serv.port == 443 || serv.name == "https")
print_line("https server found: #{serv.host.address} port: #{serv.port}")
run_single("java -jar -Xmx2g /opt/burp/burpsuite_pro_v1.6.36.jar https #{serv.host.address} #{serv.port}")
set PROMPT %red%L %yel%J %grn%S %blu%W
load nessus
load pentest
load sounds
load alias
alias j "jobs -v"
alias s "sessions -v"
alias -f w "workspace"
alias so "show options"
alias sa "show advanced"
@ccammilleri
ccammilleri / duo_openvpn.patch
Created February 3, 2012 22:33
Patch for Duo Security's OpenVPN plugin to support password concatenation delimiting on rightmost comma (meant to be used with a modified OpenVPN auth-pam plugin)
--- duo_openvpn.py.bak 2011-11-01 12:16:36.000000000 -0500
+++ duo_openvpn.py 2012-01-19 10:15:30.728361702 -0600
@@ -162,6 +162,13 @@
username = os.environ.get('username')
password = os.environ.get('password')
ipaddr = os.environ.get('ipaddr', '0.0.0.0')
+
+ if "," in password:
+ passarray = password.split(',')
+ password = passarray[-1]