Minor tweaks to the wardialer module
git-svn-id: file:///home/svn/framework3/trunk@6200 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
a46fa68bac
commit
bd8293360a
|
@ -40,7 +40,6 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
|
|
||||||
include Msf::Auxiliary::Report
|
include Msf::Auxiliary::Report
|
||||||
include Msf::Auxiliary::Scanner
|
include Msf::Auxiliary::Scanner
|
||||||
include Msf::Auxiliary::Scanner
|
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
super(
|
super(
|
||||||
|
@ -67,14 +66,14 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
OptInt.new( 'DialDelay', [true, 'Time to wait between dials in seconds (rec. min. 1)', 1]),
|
OptInt.new( 'DialDelay', [true, 'Time to wait between dials in seconds (rec. min. 1)', 1]),
|
||||||
OptString.new('DialSuffix', [false, 'Dial Suffix', nil]),
|
OptString.new('DialSuffix', [false, 'Dial Suffix', nil]),
|
||||||
OptInt.new( 'DialTimeout', [true, 'Timeout per dialed number in seconds', 40]),
|
OptInt.new( 'DialTimeout', [true, 'Timeout per dialed number in seconds', 40]),
|
||||||
OptBool.new( 'DisplayModem', [true, 'Displays modem commands and responses on the console', false]),
|
OptBool.new( 'DisplayModem', [false, 'Displays modem commands and responses on the console', false]),
|
||||||
OptEnum.new( 'FlowControl', [true, 'Flow Control', 'None', ['None', 'Hardware', 'Software', 'Both'], 'None']),
|
OptEnum.new( 'FlowControl', [true, 'Flow Control', 'None', ['None', 'Hardware', 'Software', 'Both'], 'None']),
|
||||||
OptInt.new( 'InitInterval', [true, 'Number of dials before reinitializing modem', 30]),
|
OptInt.new( 'InitInterval', [true, 'Number of dials before reinitializing modem', 30]),
|
||||||
#OptEnum.new( 'LogMethod', [true, 'Log Method', 'File', ['File', 'DataBase', 'TIDBITS'], 'File']),
|
#OptEnum.new( 'LogMethod', [true, 'Log Method', 'File', ['File', 'DataBase', 'TIDBITS'], 'File']),
|
||||||
OptEnum.new( 'LogMethod', [true, 'Log Method', 'File', ['File'], 'File']),
|
OptEnum.new( 'LogMethod', [true, 'Log Method', 'File', ['File'], 'File']),
|
||||||
OptString.new('NudgeString', [false, 'Nudge String', '\x1b\x1b\r\n\r\n']),
|
OptString.new('NudgeString', [false, 'Nudge String', '\x1b\x1b\r\n\r\n']),
|
||||||
OptEnum.new( 'Parity', [true, 'Parity (Mark & Space are Windows Only)', 'None', ['None', 'Even', 'Odd', 'Mark', 'Space'], 'None']),
|
OptEnum.new( 'Parity', [false, 'Parity (Mark & Space are Windows Only)', 'None', ['None', 'Even', 'Odd', 'Mark', 'Space'], 'None']),
|
||||||
OptBool.new( 'RedialBusy', [true, 'Redails numbers found to be busy', false]),
|
OptBool.new( 'RedialBusy', [false, 'Redials numbers found to be busy', false]),
|
||||||
OptEnum.new( 'StopBits', [true, 'Stop Bits', '1', ['1', '2'], '1']),
|
OptEnum.new( 'StopBits', [true, 'Stop Bits', '1', ['1', '2'], '1']),
|
||||||
], self.class)
|
], self.class)
|
||||||
|
|
||||||
|
@ -103,9 +102,10 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
|
|
||||||
@confdir = File.join(Msf::Config.get_config_root, 'wardial')
|
@confdir = File.join(Msf::Config.get_config_root, 'wardial')
|
||||||
@datadir = File.join(Msf::Config.get_config_root, 'logs', 'wardial')
|
@datadir = File.join(Msf::Config.get_config_root, 'logs', 'wardial')
|
||||||
|
|
||||||
# make sure working dirs exist
|
# make sure working dirs exist
|
||||||
Dir.mkdir(@confdir) if ! Dir.new(@confdir)
|
FileUtils.mkdir_p(@confdir)
|
||||||
Dir.mkdir(@datadir) if ! Dir.new(@datadir)
|
FileUtils.mkdir_p(@datadir)
|
||||||
|
|
||||||
@logmethod = case datastore['LogMethod']
|
@logmethod = case datastore['LogMethod']
|
||||||
when 'DataBase' : :database
|
when 'DataBase' : :database
|
||||||
|
@ -395,7 +395,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
def log_result(dialnum)
|
def log_result(dialnum)
|
||||||
case @logmethod
|
case @logmethod
|
||||||
when :file :
|
when :file :
|
||||||
logfile = @datadir + '/found.log'
|
logfile = File.join(@datadir, 'found.log')
|
||||||
file = File.new(logfile, 'a')
|
file = File.new(logfile, 'a')
|
||||||
file.puts( "#####( NEW LOG ENTRY )#####\n")
|
file.puts( "#####( NEW LOG ENTRY )#####\n")
|
||||||
file.puts( "#{Time.now}\n")
|
file.puts( "#{Time.now}\n")
|
||||||
|
@ -427,7 +427,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
next if ! c
|
next if ! c
|
||||||
|
|
||||||
gotchar = Time.now
|
gotchar = Time.now
|
||||||
printf( "%c", c) if @displaymodem
|
print( c.chr ) if @displaymodem
|
||||||
|
|
||||||
# stop if carrier dropped
|
# stop if carrier dropped
|
||||||
break if modem.dcd == 0
|
break if modem.dcd == 0
|
||||||
|
@ -435,7 +435,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
banner += c.chr
|
banner += c.chr
|
||||||
end
|
end
|
||||||
|
|
||||||
print "\n" if @displaymodem
|
print("\n") if @displaymodem
|
||||||
return banner
|
return banner
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue