Skip to content

Instantly share code, notes, and snippets.

View KINGSABRI's full-sized avatar
♠️

KING SABRI KINGSABRI

♠️
View GitHub Profile
#!/usr/bin/env ruby
class Pattern
def initialize
@pattern = []
@offset = String
@KINGSABRI
KINGSABRI / terminal_size.rb
Last active March 17, 2023 05:14
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]
@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 / 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 / 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"
#!/usr/bin/ruby
require 'rubygems'
require 'net/ssh'
host = "192.168.1.2"
user = "user"
pass = "password"
su_user = "boss"
@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 "";
@KINGSABRI
KINGSABRI / colorize.rb
Created August 4, 2013 18:15
colorizing
module Xss
module Ui
module Console
module Prints
module Color
#
# Colorize String class extension.
@KINGSABRI
KINGSABRI / readline.rb
Created September 4, 2013 17:27
Readline sub-command
require 'readline'
MAIN = ['help', 'show', 'set' , 'exit'].sort
SHOW = ['exploits', 'payloads', 'wiki'].sort
USE = ['exploit' , 'encoder'].sort
SET = ['payload', 'RHOST'].sort
comp = proc do |s|
if Readline.line_buffer =~ /help.* /
# How to convert IPv4 addresses between integer <=> dot-decimal notation
INTEGER = 1698212032
DOT_DECIMAL = '192.168.56.101'
# [ 192, 168, 56, 101 ]
DOT_DECIMAL_PARTS = DOT_DECIMAL.split('.').map(&:to_i)
####################################
# integer to dot-decimal