Skip to content

Instantly share code, notes, and snippets.

View jjarmoc's full-sized avatar

Jeff Jarmoc jjarmoc

View GitHub Profile
@jjarmoc
jjarmoc / itoa.sh
Created October 19, 2011 22:42
IP to Integer and Integer to IP conversions in bash.
#Handy functions for .bashrc loading.
#
# $ atoi 192.168.1.1
# 3232235777
# $ itoa 3232235777
# 192.168.1.1
function atoi
{
I asked ChatGPT to write lyrics to a KMFDM song.
(Verse 1)
In the neon city, where shadows collide,
A pulse of distortion, in the chaos we hide.
Machinery heartbeat, relentless and cold,
Kaleidoscope chaos, the story unfolds.
(Pre-Chorus)
Metallic echoes in the streets we roam,
@jjarmoc
jjarmoc / gist:1571540
Created January 6, 2012 17:21
Quoted Printable encode/decode bash aliases - suitable for pipelining
# To decode:
# qp -d string
# To encode:
# qp string
alias qpd='perl -MMIME::QuotedPrint -pe '\''$_=MIME::QuotedPrint::decode($_);'\'''
alias qpe='perl -MMIME::QuotedPrint -pe '\''$_=MIME::QuotedPrint::encode($_);'\'''
function qp {
if [[ "$1" = "-d" ]]
then
@jjarmoc
jjarmoc / gist:7938988
Created December 13, 2013 02:26
Microsoft $100,000 bug bounty check easter egg..
# See https://twitter.com/k8em0/status/411247236610134016 for the check I found this on.
1.9.3p484 :001 > nums = [0b01001101, 0b01101001, 0b01100011, 0b01110010, 0b01101111, 0b01110011, 0b01101111, 0b01100110, 0b01110100]
=> [77, 105, 99, 114, 111, 115, 111, 102, 116]
1.9.3p484 :001 > nums.map{|x| x.chr }.join
=> "Microsoft"
@jjarmoc
jjarmoc / whatinzeus_solve.rb
Created May 23, 2013 13:18
BSJTF CTF 'What in the name of Zeus?' solve
require 'packetfu'
require 'ipaddr'
puts "-- Reading packets"
packets = PacketFu::PcapFile.read_packets('./whatinzeus')
output = packets.inject([]){|ret, pkt|
ret.push(PacketFu::EthHeader.str2mac(pkt.eth_dst) =~ "01:00:5e" ? 1 : 0)
}
@jjarmoc
jjarmoc / gist:5367196
Last active December 16, 2015 03:08
Start of ruby HTTP automation...
require 'httpclient'
cmds = [
{ :method => "POST", :uri => "http://www.example.com/posthere", :body=>{ 'userid' => 'user', 'pw'=>'password'}, :response=>nil},
{ :method => "GET", :uri =>"http://www.example.com/gethere", :body=>{}, :response=>nil}
]
client = HTTPClient.new
client.set_cookie_store('cookie.dat')
cmds.each do |cmd|

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@jjarmoc
jjarmoc / gist:5008251
Created February 21, 2013 21:06
Overview of how ssltest.offenseindepth.com operated when it was alive.
- Apache configured to accept SSL on a number of ports, each with their own cert demonstrating an individual test case.
- ELBs performing PAT so I had :443 on a number of IPs ending up hitting apache on it's various ports.
- PHP on the webserver would parse the Host Header, and return a response setting a corresponding div to vulnerable
- When the main domain name was accessed, it would instead return a bunch of DIV's each named to correspond to a given vuln, and including the CSS file (generated by PHP above) to test for cert validation.
The end result of all this was a table that looked like the ones shown near the end of;
http://www.secureworks.com/cyber-threat-intelligence/threats/transitive-trust/
Tested included;
- Mismatched CN
@jjarmoc
jjarmoc / gist:4661586
Last active December 11, 2015 21:19
rails_json_yaml_code_exec Confirmed working on rails 3.0.19 and 2.3.15, both on ruby 1.9.3-p125
MSF Module;
https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/rails_json_yaml_code_exec.rb
See also;
https://gist.github.com/4660248
https://github.com/ronin-ruby/ronin-ruby.github.com/blob/master/blog/_posts/2013-01-28-new-rails-poc.md
@jjarmoc
jjarmoc / xorfile.rb
Created May 31, 2012 23:04
XOR a file with a single byte key, save as file.xor
# XOR an input file with a single byte, save as input.xor
# xorfile(0xff, input)
def xorfile(key, file)
File.open("#{file}.xor", 'w') {|f| f.write(File.open("#{file}","rb") {|io| io.read}.unpack('C*').map{|x| x ^ key}.pack('C*')) }
end
# string pack/unpack w/ XOR
"ABCD".unpack('C*').collect{|x| (x ^ 0xa2).chr}.join
=> "\xE3\xE0\xE1\xE6"
"E3E0E1E6".scan(/../).collect{|x| (x.to_i(16) ^ 0xa2).chr}.join