Skip to content

Instantly share code, notes, and snippets.

View KINGSABRI's full-sized avatar
♠️

KING SABRI KINGSABRI

♠️
View GitHub Profile
@KINGSABRI
KINGSABRI / LinuxHWScanner.rb
Created June 2, 2012 15:18
LinuxHWScanner
#~~~~~~~~~~~~~~~~~~~~~~~
# Linux HW Scanner is a simple script to catch all Hardware Specifications from list of servers
# Coded by : Sabry Saleh
# License : GPL2
#~~~~~~~~~~~~~~~~~~~~~~~
#=-Notes-=
# You have to install ruby + net-ssh gems
# sudo gem install net-ssh
#~~~~~~~~~~~~~~~~~~~~~~~
@KINGSABRI
KINGSABRI / check-my-root-v1.0.1.rb
Created June 3, 2012 02:13
Checker for correct/incorrect user/pass
#~~~~~~~~~~~~~~~~~~~~~~~
# Checker for correct/incorrect user/pass
# xx.xx.xx.xx:user:pass
# Coded by : KING SABRI
# License : JUST FOR DR.Hacker
#~~~~~~~~~~~~~~~~~~~~~~~
#=-Notes-=
# sudo gem install net-ssh colorize
#~~~~~~~~~~~~~~~~~~~~~~~
require 'rubygems'
@KINGSABRI
KINGSABRI / syn-poc.rb
Created June 8, 2012 20:31
Build TCP/IP packet from scratch by ruby , and send syn(or whatever you want) packet
#!/usr/bin/env ruby
# Full Contol on Ethnet, IP & TCP headers. Play with it ;)
# to test it: nc -lvp 4444
# as root: tcpdump -nvvvv 'tcp port 4444' -i wlan0 # change wlan0 to your interface
# or use packetfu to monitor as tcpdump
## cap = PacketFu::Capture.new(:iface => 'wlan0' , :promisc=> true)
## cap.show_live(:filter => 'tcp and port 4444')
# libpcap should be installed
# gem install pcaprub packetfu
@KINGSABRI
KINGSABRI / get_SYN-ACK.rb
Created June 18, 2012 15:59
PoC for parsing input/output packets' headers
=begin
PoC for parsing input/output packets' headers
This PoC will print "Yes, Got SYN/ACK guys!!" if it capture a AYN/ACK packet to/from 10.20.50.45
Note that you can change IP and flags and many mangy things
=end
require 'packetfu'
config = PacketFu::Config.new(PacketFu::Utils.whoami?(:iface=> "wlan0")).config
@KINGSABRI
KINGSABRI / http(s)-Post.rb
Created August 8, 2012 23:45
post to Virustotal
# http://posttestserver.com/post.php?
@url = "http://www.virustotal.com"
@url_scanner = "http://www.virustotal.com/vtapi/v2/url/scan" # https://www.virustotal.com/vtapi/v2/url/scan
#@url_scanner = "https://www.posttestserver.com/post.php?"
@report_url = "http://www.virustotal.com/vtapi/v2/url/report"
@api_key = "a2068ef6c93dba5fad9a0e374db3b359dcf62as4eef3f22c491a98824fc0cc6d"
url_scanner = URI.parse(@url_scanner)
url2scan = {"url" => "http://download.utorrent.com/3.2/uTorrent.exe", "apikey" => @api_key}.to_json
@KINGSABRI
KINGSABRI / lua-v0.0.1.rb
Created August 11, 2012 10:32
Linux User Auditor
#!/bin/ruby
=begin
#- Description:
We need to have a script to perform a periodically review of the user account that have a login permission to all Linux server.
our objective is to insure that the users exist on the system is authorized and only a valid user.
#-> Keys
- Check users , find valid & invalid users
- check UID more than 500 or 1000(fedora)
#!/usr/bin/env ruby
# http://patorjk.com/software/taag/
# http://www.kammerl.de/ascii/AsciiSignature.php
banner1 = <<-ENDTEXT
oooo oooo ooooo ooooo ooo .oooooo.
@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) }
@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 / 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