Run POST Modules On All Sessions
Jcran recently blogged about an easy way to run a post module on all sessions:
http://blog.pentestify.com/simple-framework-domain-token-scanner
|
|
You use the POST module, drop to IRB and run those 4 lines, and bam, you win. With resource files we can automate this a bit more and have it so that we do this effortlessly with any post module.
Thinking back to http://blog.metasploit.com/2010/03/automating-metasploit-console.html and my rapid file PSEXEC resource file, we know we can run ruby inside of resource files with the tag.
Save the following as runall.rc somewhere where you’ll remember:
|
|
Then when you want to run a POST module against every session you have you simply do:
|
|
Update on 2011-11-06 20:05 by Rob Fuller
A commenter noticed an error in the coding for cross compatibility. The following should work better across versions:
|
|