Skip to content

Instantly share code, notes, and snippets.

View claudijd's full-sized avatar
🦬

Jonathan Claudius claudijd

🦬
View GitHub Profile
@claudijd
claudijd / bmo_query_example.py
Created March 13, 2018 14:46
Example of using BMO to query fixed bugs in a product
#!/usr/bin/env python
from __future__ import print_function
import time
import bugzilla
import sys
if sys.version_info[0] >= 3:
api_key = input("Enter Bugzilla API Key: ")
@claudijd
claudijd / protocol.rb
Created March 2, 2018 05:29
A quick example of Nagios NRPE v2 protocol object reading/writing using bindata
require 'bindata'
require 'zlib'
# Extend string class to make it easier to work with hexified binary strings
class String
def unhexify
[self].pack("H*")
end
def hexify
@claudijd
claudijd / shim.py
Last active February 13, 2018 19:45
A work in progress shim to play around with credential generation and auth bits
# A testing harness/shim for playing around with taskcluster authentication
import yaml
import taskcluster
import requests
import json
import datetime
#Example config.yaml
# clientId: INSERT_CLIENT_ID
@claudijd
claudijd / dup_keys.rb
Last active October 25, 2017 03:19
A quick bit of code to enumerate duplicate hostkey usage within the SSH Observatory for offline reporting of dups
require 'mongo'
require 'set'
Mongo::Logger.logger.level = ::Logger::FATAL
client = Mongo::Client.new([ '127.0.0.1:27018' ], :database => 'ssh_scan')
collection = client['ssh_scan']
collection.distinct("scan.fingerprints.rsa.sha256").each do |sha256_fingerprint|
targets = Set.new
@claudijd
claudijd / release_notes_4.14.4_4.14.11.html
Last active April 15, 2017 04:26
Draft of Metasploit release notes from 4.14.4 to 4.14.11
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><table border="0px">
<tr>
<td valign="top" nowrap>
<li>PR <a href="https://github.com/rapid7/metasploit-framework/pull/8236">#8236</a>
</td>
<td valign="top">-</td>
<td>This fixes #8235 by adding xmlrpc as an explicit dependency.<br></td>
</tr>
<tr>
# Collapses odd/even lines into single lines
#
# Example:
# Thing1
# description for thing1
# Thing2
# description for thing2
#
# Is translated to...
# Thing1 description for thing1
@claudijd
claudijd / ssh_scan_database.rb
Created January 5, 2017 15:41
Proposal for SSHScan::Database abstraction layer
module SSHScan
class Database
def initialize(opts = {})
@db = opts[:database] # SSHScan::Database::MongoDb -or- # SSHScan::Database::SQLite
@username = opts[:username]
@password = opts[:password]
@password = opts[:password]
@server = opts[:server]
@port = opts[:port]
end
@claudijd
claudijd / example.yml
Created December 22, 2016 16:16
Simple example
policies:
name: Mozilla Modern
:logic ssh_version_eq 2.0 AND ( ssh_lib_eq openssh OR ssh_lib_eq openssh )...
@claudijd
claudijd / example.rb
Last active December 22, 2016 16:03
Idea for complex rule making policy logic
items:
item1:
description: SSH version 2.0 only
ssh_version_eq: 2.0
item2:
description: OpenSSH ssh library
ssh_lib_eq: openssh
item3:
description: libssh ssh library
ssh_lib_eq: libssh
@claudijd
claudijd / test.txt
Created December 15, 2016 18:12
test
2.2.3 :003 > YAML.load_file('test.yml')
=> {"rules"=>{"openssh_2"=>{"and"=>{"ssh_lib"=>"openssh", "ssh_lib_version_gte"=>2.0, "ssh_lib_version_lt"=>3.0}}, "openssh_3"=>{"and"=>{"ssh_lib"=>"openssh", "ssh_lib_version_gte"=>3.0}}}, "defaults"=>{"auth_methods"=>["publickey"], "kex"=>["algo1", "algo2"]}, "openssh_2"=>{"auth_methods"=>["publickey"], "kex"=>["algo1", "algo2"], "encryption"=>["algo3"]}, "openssh_3"=>{"auth_methods"=>["publickey"], "kex"=>["algo1", "algo2"], "encryption"=>["algo4"]}}