Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Metasploit Remote API: module.execute fails after 2nd exploit
  2. modules = rpc.call("module.exploits")
  3.  
  4. modules["modules"].each do | exploit |
  5.      # filter the exploits I want
  6.      # set the payload and other required options
  7.  
  8.      running = rpc.call("module.execute", "exploit", exploit, args)
  9.  
  10.      if (running["job_id"].nil?)
  11.             puts "#{exploit} is NOT running"
  12.      else
  13.           puts "#{exploit} is running"
  14.           # ....
  15.  
  16.           rpc.call("job.stop", running["job_id"])
  17.  
  18.           puts rpc.call("job.list")
  19.           sleep 1
  20.      end
  21. end