Skip to content

Instantly share code, notes, and snippets.

View blackknight36's full-sized avatar
💭
I may be slow to respond.

Michael blackknight36

💭
I may be slow to respond.
View GitHub Profile
@blackknight36
blackknight36 / beer.py
Created April 8, 2016 21:22
How many beers can you drink?
#!/usr/bin/python
def drink_beer():
global caps
global empties
global full
caps += 1
empties += 1
full -= 1
print "Drank full bottle.\n"
@blackknight36
blackknight36 / count_words.py
Created April 8, 2016 21:23
count words with $n letters
#!/usr/bin/python
f = open("input.txt", "ro")
words = f.readline().split(" ")
f.close()
limit = len(max(words, key=len)) + 1
for i in range(1, limit):
count = 0
@blackknight36
blackknight36 / revslider-exploit.pl
Created April 9, 2016 23:03
pwn a vulnerable wordpress site
#!/usr/bin/perl
#
# Title: Slider Revolution/Showbiz Pro shell upload exploit
# Author: Simo Ben youssef
# Contact: Simo_at_Morxploit_com
# Discovered: 15 October 2014
# Coded: 15 October 2014
# Updated: 25 November 2014
# Published: 25 November 2014
# MorXploit Research
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.collectd.collectd</string>
<key>ProgramArguments</key>
<array>
<string>/opt/local/sbin/collectd</string>
<string>-f</string>
@blackknight36
blackknight36 / mysql_to_pg.py
Last active February 26, 2017 15:55
copy a mysql table to a postgresql table
#!/usr/bin/env python
# This script copies all records from a mysql database table into the
# corresponding table in the postgresql database. Tables must be created
# with the proper structure before running this script.
import psycopg2 as pgdb
import MySQLdb
host = 'localhost'
user = 'user'
pass = 'password'
@blackknight36
blackknight36 / list-images.py
Created April 22, 2016 12:48
List DO images
#!/usr/bin/env python
import requests
import json
apikey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
headers = { "Authorization": "Bearer "+ apikey , "Content-Type" : "application/json" }
r = requests.get('https://api.digitalocean.com/v2/images/?type=snapshot&per_page=100', headers=headers)
parsed = json.loads(r.text)
@blackknight36
blackknight36 / list-keys.py
Created April 22, 2016 13:48
List ssh keys on a DO account
#!/usr/bin/env python
import requests
import json
apikey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
headers = { "Authorization": "Bearer "+ apikey , "Content-Type" : "application/json" }
r = requests.get('https://api.digitalocean.com/v2/account/keys', headers=headers)
parsed = json.loads(r.text)
@blackknight36
blackknight36 / check-moebius.pl
Created April 23, 2016 02:02
Nagios check for the moebius file system
#!/usr/bin/perl
use strict;
my $moebius = "/home/jsipek/Copy/linrel_x86_64-superlowmem/moebius.admin";
my $output = `$moebius -s /var/run/moebius/moebius.sock df -c | tail -1`;
if ( ($? >> 8) == 0 ) {
print "CRITICAL: moebius.admin failed to run.\n";
exit(2);
@blackknight36
blackknight36 / ips.pl
Created April 23, 2016 02:04
IPS patcher written in perl
#!/usr/bin/perl
# ips.pl
# version 0.01
#
# This is a quick hack to apply IPS patches. It is distributed under
# the terms of the GNU General Public License.
if (@ARGV != 2)
{
@blackknight36
blackknight36 / list-mailman-lists.py
Created April 23, 2016 02:06
List Mailman lists set up by a user. Uses cPanel json api.
!/usr/bin/python
import json
import requests
host = "1.2.3.4"
hash = """xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"""
hash = hash.replace('\n', '')