what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Pivot Scan Written In Ruby

Pivot Scan Written In Ruby
Posted Mar 25, 2009
Authored by Augusto Pereyra | Site code.google.com

Pivot Scan is a scanner written in Ruby for the meterpreter tool.

tags | tool, scanner, ruby
systems | unix
SHA-256 | 45ecdf791525de7234a5d539bbcfc9801fc8ecc45b4c462216830f1b0c819b69

Pivot Scan Written In Ruby

Change Mirror Download
#!/usr/bin/env ruby
require 'ftools'
############################################################
# This is an Meterpreter script to do a portscanning of#
#the same network where the controled computer is #
#using a portscanner called sl.exe #
# #
############################################################
# If netmask isn't 255.255.255.0 it must work any way#
############################################################
# Tested in Win2003 and WinXP #
############################################################
# Created by Augusto Pereyra aepereyra(at)gmail.com #
############################################################


################## Variable Declarations ##################
@@exec_opts = Rex::Parser::Arguments.new(
"-h" => [ false, "Help menu."],
"-r" => [ true, "To set the range manualy"],
"-a" => [ false, "For automatic lan detection and port scan"]
)


#####################################################################################
#Function for upload the port scanner################################################
#####################################################################################
def uploadtool ()
print_status("Uploading Portscanner")
#Here you can set the path where sl.exe is in owr system and Where will be wher run this tool
#sl.exe was created by foundstone
client.fs.file.upload_file("%windir%\\system32\\sl.exe", "/pentest/windows-binaries/scanners/sl.exe")
end


#####################################################################################
#Function for network autodetection##################################################
#####################################################################################
def auto ()
session1 = client
cuenta = 0
l1 = Array.new
rangoar = Array.new
res = session1.sys.process.execute("route print", nil, {'Hidden' => true, 'Channelized' => true})
while(d1 = res.channel.read)
d1.each do |line|

if line =~ /( 0.0.0.0)/
l1= line.split
res.channel.close
end
end
xx= l1[3]
sxx1 = xx.split(".")
sxx2 = xx.split(".")
sxx1[3]='1'
sxx2[3]='254'
rango1= sxx1.join(".")
rango2= sxx2.join(".")
rangoar[0]=rango1
rangoar[1]=rango2
rango= rangoar.join("-")
return rango
end
end


############################################################################
#Function for Port Scanning#################################################
############################################################################

def portscan(iprange)
print_status("Performing portscanning for IP range #{iprange}")

session = client
cuentah = 0
a1 = Array.new
session.response_timeout= 100
res = session.sys.process.execute("sl -q 1000 -s -c 3 #{iprange}", nil, {'Hidden' => true, 'Channelized' => true})
while(d = res.channel.read)
d.each do |line|
if line =~ /(Yes)/
a1.insert(cuentah, line)
cuentah = cuentah + 1
res.channel.close
end
end
end
a1.each { |v| puts v}

end
##############################################################################
#This is me###################################################################
##############################################################################
def mysign ()

print ("Created by Augusto Pereyra aepereyra at gmail.com")

end

###############################################################################
#################################### MAIN ###################################
###############################################################################
# Parsing of Options

range = nil
porsc = nil
@@exec_opts.parse(args) { |opt, idx, val|
case opt

when "-a"
porsc = 2
when "-r"
range = val
# when "-h"
# print(@@exec_opts.usage)
# break

end

}

if range != nil && porsc != 2
mysign()
uploadtool()
portscan(range)
elsif porsc == 2
mysign()
uploadtool()
range= auto()
portscan(range)
else
mysign()
print( @@exec_opts.usage)
end
Login or Register to add favorites

File Archive:

September 2023

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    2 Files
  • 2
    Sep 2nd
    21 Files
  • 3
    Sep 3rd
    0 Files
  • 4
    Sep 4th
    17 Files
  • 5
    Sep 5th
    34 Files
  • 6
    Sep 6th
    29 Files
  • 7
    Sep 7th
    11 Files
  • 8
    Sep 8th
    25 Files
  • 9
    Sep 9th
    0 Files
  • 10
    Sep 10th
    0 Files
  • 11
    Sep 11th
    26 Files
  • 12
    Sep 12th
    23 Files
  • 13
    Sep 13th
    17 Files
  • 14
    Sep 14th
    22 Files
  • 15
    Sep 15th
    16 Files
  • 16
    Sep 16th
    0 Files
  • 17
    Sep 17th
    0 Files
  • 18
    Sep 18th
    19 Files
  • 19
    Sep 19th
    60 Files
  • 20
    Sep 20th
    23 Files
  • 21
    Sep 21st
    15 Files
  • 22
    Sep 22nd
    8 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    17 Files
  • 26
    Sep 26th
    3 Files
  • 27
    Sep 27th
    13 Files
  • 28
    Sep 28th
    5 Files
  • 29
    Sep 29th
    12 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close