metasploit-framework/lib
Jonathan Cran 78e507fe9b erb processing for RC files. Allows you to do more generic things w/ rc files:
<rc_file>
<%
rhost = "192.168.1.1"
smbuser = "test"
smbpass = "pass"
payload = "windows/meterpreter/reverse_http"
puts "This will happen while i preprocess an erb-enabled rc file" 
%>

use windows/smb/psexec
set RHOST <%= rhost %>
set SMBUser <%= smbuser %>
set SMBPass <%= smbpass %>
set PAYLOAD <%= payload %>
save

<ruby>
 puts "Now, i should print the system path while running the actual resource file! "
 puts ENV["PATH"]
 puts "end"
</ruby>

<%= puts "This will also happen when i preprocess too" %>

</rc_file>

which will give you output like this: 
<output>
[*] Processing /home/jcran/Desktop/test_erb_rc for ERB directives.
This will happen while i preprocess an erb-enabled rc file
This will also happen when i preprocess too
resource (/home/jcran/Desktop/test_erb_rc)> use windows/smb/psexec
resource (/home/jcran/Desktop/test_erb_rc)> set RHOST 192.168.1.1
RHOST => 192.168.1.1
resource (/home/jcran/Desktop/test_erb_rc)> set SMBUser test
SMBUser => test
resource (/home/jcran/Desktop/test_erb_rc)> set SMBPass pass
SMBPass => pass
resource (/home/jcran/Desktop/test_erb_rc)> set PAYLOAD windows/meterpreter/reverse_http
PAYLOAD => windows/meterpreter/reverse_http
resource (/home/jcran/Desktop/test_erb_rc)> save
Saved configuration to: /home/jcran/.msf4/config
[*] resource (/home/jcran/Desktop/test_erb_rc)> Ruby Code (115 bytes)
Now, i should print the system path while running the actual resource file! 
/home/jcran/.rvm/gems/ruby-1.9.4-p1/bin:/home/jcran/.rvm/gems/ruby-1.9.4-p1@global/bin:/home/jcran/.rvm/rubies/ruby-1.9.4-p1/bin:/home/jcran/.rvm/bin
end
msf  exploit(psexec) >
</output>




git-svn-id: file:///home/svn/framework3/trunk@14013 4d416f70-5f16-0410-b530-b9f4589650da
2011-10-20 06:41:07 +00:00
..
active_record Fixes #2979. The bug is triggered when the en locale is used in activerecord -- this fix appears to have no ill effects when both the /vendor version or a local (current) version of i18n is installed, since the percent notation appears to be okay for both versions. In any event, db_nmap 127.0.0.1 fails correctly for both. 2010-10-18 19:58:56 +00:00
active_support Revert previous patch and handle via override instead 2011-05-11 22:18:16 +00:00
anemone Adds the ability to set the cookies, authentication, and arbitrary headers 2011-07-16 13:29:28 +00:00
lab oops, don't require this if it's not available 2011-09-24 21:28:18 +00:00
metasm Change import names to work properly on windows 2000 2011-07-26 22:48:46 +00:00
msf erb processing for RC files. Allows you to do more generic things w/ rc files: 2011-10-20 06:41:07 +00:00
nessus add latest nessus plugin patches from Zate, fixes #2704 2010-10-14 18:54:35 +00:00
net check for framework before removing the socket. make the spacing consistent 2011-08-11 23:31:19 +00:00
openvas Fixes #5436. Thanks averagesecurityguy! 2011-10-10 16:10:20 +00:00
packetfu Just a version change to reflect that it's current. I really need to automate this. 2011-10-05 18:32:50 +00:00
postgres See #808. Converts the metasploit fork of postgres-pr to use Rex::Socket instead of 2010-02-16 17:42:38 +00:00
rabal Code cleanups 2008-10-19 21:03:39 +00:00
rapid7 Consistent spelling 2011-10-03 19:22:30 +00:00
rbmysql Fixes #3915. This comments out two more raiseable conditions -- neither seem particularly useful to raise on in the first place anyway, though. 2011-03-08 21:28:20 +00:00
rex Treat all input as strings, avoids some sloppy caller code that wasn't as strict before 2011-10-18 19:16:48 +00:00
rkelly allow setting the property name. note that properties must be a bareword or string literal, not an expression 2011-06-03 00:16:50 +00:00
snmp Clean up an SNMP rescue clause that makes Windows Ruby builds sad. 2011-05-03 07:51:09 +00:00
telephony Wardialer 2009-01-28 06:13:47 +00:00
zip fix silly test bug 2010-10-12 00:27:35 +00:00
active_record.rb Remove unsupported msfweb interface. (fixes #503) 2010-10-14 18:45:16 +00:00
active_support.rb Remove unsupported msfweb interface. (fixes #503) 2010-10-14 18:45:16 +00:00
anemone.rb Add the crawler mixin and a sample form extractor crawler 2010-11-13 06:40:56 +00:00
enumerable.rb Add the enumerable module as a standalone file 2009-03-28 18:56:31 +00:00
metasm.rb Fix mips encoders 2009-06-03 03:14:29 +00:00
packetfu.rb Updating PacketFu to 1.0.2 2011-05-23 14:04:38 +00:00
postgres_msf.rb See #730. Forking and adding Postgres-PR, with the following changes: 2010-02-01 19:49:36 +00:00
postgres_msf.rb.ut.rb See #808. Converts the metasploit fork of postgres-pr to use Rex::Socket instead of 2010-02-16 17:42:38 +00:00
rbmysql.rb Fix warning on 1.8 2009-12-26 09:01:08 +00:00
rbreadline.rb Fixes #5204. Adding Windows Console2 color support from mihi. Thanks! 2011-10-13 17:35:31 +00:00
readline_compatible.rb Fixes #5204. Adding Windows Console2 color support from mihi. Thanks! 2011-10-13 17:35:31 +00:00
rex.rb Reverting the autoload changes until we can upgrade to a new ActiveSupport library or find a workaround 2011-05-12 20:03:55 +00:00
rex.rb.ts.rb License corrections 2010-04-02 21:34:15 +00:00
rkelly.rb missed a file, see r12815 2011-06-03 00:15:08 +00:00
snmp.rb Import the ruby snmp library into the tree. Making a few adjustments to make it msf-friendly 2009-05-08 03:35:59 +00:00
telephony.rb Added missing telephony.rb 2009-01-11 07:17:57 +00:00
windows_console_color_support.rb Fixes #5204. Adding Windows Console2 color support from mihi. Thanks! 2011-10-13 17:35:31 +00:00
zip.rb Adding a 3rd party zip library (rubyzip by Thomas Sondergaard and Technorama Ltd, released under the Ruby license), and a method to import ZIP reports generated by Metasploit Express (still needs work, but is mildly functional right now). 2010-06-10 21:06:06 +00:00