Skip to content

Instantly share code, notes, and snippets.

View KINGSABRI's full-sized avatar
♠️

KING SABRI KINGSABRI

♠️
View GitHub Profile
@KINGSABRI
KINGSABRI / bash-code-colors.sh
Created July 28, 2013 19:45
Print all bash colors with its codes
#!/usr/bin/bash
for x in 0 1 4 5 7 8; do for i in `seq 30 37`; do for a in `seq 40 47`; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; done; echo; done; done; echo "";
#!/usr/bin/ruby
require 'rubygems'
require 'net/ssh'
host = "192.168.1.2"
user = "user"
pass = "password"
su_user = "boss"
@KINGSABRI
KINGSABRI / url-extract.rb
Last active December 15, 2015 07:59
url-extract, just a simple script to check if url is redirecting to another or not! it supports proxy authentication too. You can use it to extracting shorten urls.
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
def fetch(uri_str, limit = 10)
#==[ Proxy settings ]==#
proxy_host = "127.0.0.1"
@KINGSABRI
KINGSABRI / keePassX-brute-force.rb
Last active March 13, 2020 21:28
KeePassX Brute-force
#!/usr/bin/env ruby
#################################################
# simple Keepassx database brute force #
# Coded by: KING SABRI #
# Requirements : #
# gem install keepassx #
#-----------------------------------------------#
# Note about gem installation: #
# if you got error during keepassx installation #
# make sure ruby-devel or ruby-dev is installed #
@KINGSABRI
KINGSABRI / phone-generator.rb
Last active December 13, 2015 21:28
Simple script to generate all possible mobile numbers for particular GSM provider. You can use it for Wireless Password/Wireless cracking. (Word list generator)
#!/usr/bin/env ruby
# Simple script to generate all possible mobile numbers for particular GSM provider (Word list generator)
# You can use it for Wireless Password/Wireless cracking.
# All what you need is to mention the GSM key
# assume your are using Mobily provider from KSA so you'll mention 056
# ex. ruby phone-generator.rb 056
#
# KING SABRI | @KINGSABRI
begin
@KINGSABRI
KINGSABRI / terminal_size.rb
Last active December 28, 2024 06:08
Getting Terminal size by ruby
# Here are many ways to get terminal size from ruby
# By Readline
require 'readline'
Readline.get_screen_size #=> [31, 268]
# Get terminal size in Environemtn like IRB
[ENV['COLUMNS'].to_i, ENV['LINES'].to_i]
#!/usr/bin/env ruby
class Pattern
def initialize
@pattern = []
@offset = String
@KINGSABRI
KINGSABRI / hex2lendian.rb
Created January 26, 2013 14:28
Small script to convert opcode to little endian format, like ex. from \x41\x42\x43\x44 or 0x41424344 to \x44\x43\x42\x41
#!/usr/bin/env ruby
#
# Small script to convert opcode to little endian format, like ex. from \x41\x42\x43\x44 or 0x41424344 to \x44\x43\x42\x41
# usage:
# ruby hex2lendian.rb \x41\x42\x43\x44
# Coded by: KING SABRI
#
begin
@KINGSABRI
KINGSABRI / port_scanner.rb
Created August 30, 2012 22:24 — forked from jstorimer/port_scanner.rb
Simple, parallel port scanner in Ruby built with connect_nonblock and IO.select.
require 'socket'
# Set up the parameters.
PORT_RANGE = 1..512
HOST = 'archive.org'
TIME_TO_WAIT = 5 # seconds
# Create a socket for each port and initiate the nonblocking
# connect.
sockets = PORT_RANGE.map do |port|
@KINGSABRI
KINGSABRI / ex-ssh-pty.rb
Created August 28, 2012 16:04
ex. SSH with real PTY
require 'net/ssh'
host = "the.host"
user = "joe"
su_user = "bob"
password = "password"
commands = ["cd /", "pwd", "ls -l", "exit"]
finished = ("%08x" * 8) % Array.new(8) { rand(0xFFFFFFFF) }