Metasploit mailing list archives

LocalJumpError problems


From: Robin Wood <dninja () gmail com>
Date: Fri, 12 Feb 2010 23:13:25 +0000

Hi
I've spent the last hour struggling to get the following code working
in ruby 1.9

def do_it
            each_packet do |pkt|
                if Time.now.to_i - start_time > datastore['TIMEOUT']
                    print_status "Timeout waiting for OFFER"

... Want to get out here..........

                    return false
                end
                print_status "here"

... Stuff
                next if not (udp.payload and udp.payload.length > 0
and udp.src_port == 67 and udp.dst_port == 68)
.. stuff

                break
            end
end

while (1)
  do_it
end

I want to break out when I get a timeout but I keep getting errors,
they are are all around this style

[-] Auxiliary failed: LocalJumpError unexpected return
[-] Auxiliary failed: LocalJumpError break from proc-closure

From loads of reading the problem is from trying to get out of the
inner loop and it getting confused. I've tried break in place of the
return and wrapping it all in a catch then using throw to get out of
it but wrapping the each_packet in a catch puts it out of scope.

There must be an easy way around this but I can't get it, can anyone help?

I'm trying to get my DHCP exhaustion attack to work with 1.9 so I can
release it properly and I think this is the last hurdle!

Robin
_______________________________________________
https://mail.metasploit.com/mailman/listinfo/framework


Current thread: