title: Metasploit Module NoMethodError undefined method 'get_once' for nil:NilClass
body: <p>I am running a number of Metasploit modules for exploiting Siemens S7-300/400 and S7-1200 PLCs that were created from a Blackhat talk by Dillion Beresford in 2011.</p>
  
  <p>The modules are not supplied with Metasploit but have been added to the auxiliary/admin/scada/ directory. This is a link to the Modules <a href="https://github.com/moki-ics/s7-metasploit-modules" rel="nofollow noreferrer">https://github.com/moki-ics/s7-metasploit-modules</a></p>
  
  <p>The modules are showing up in Metasploit correctly and can be configured but when they are run there are a number of errors.   </p>
  
  <p><a href="https://i.stack.imgur.com/EB3Cp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EB3Cp.png" alt=""></a></p>
  
  <p>The module shown in the screen shot is simatic_s7_1200_command.rb</p>
  
  <p>Errors are:</p>
  
  <p>thread_manager.rb:100:in 'block in spawn'</p>
  
  <p>rb:111:in 'block (2 levels) in run'</p>
  
  <p>NoMethodError undefined method 'get_once' for nil:NilClass</p>
  
  <p>I suspect the issue I am having is due to the version of Ruby being used with Metasploit is not compatible with the modules.</p>
  
  <p>I have run the modules in Metasploit running on Mac OSx, Metasploit on Kali running on a VM and Metasploit running on Kali on Raspberry Pi, all with 
  same results.</p>
  
  <p>The versions of Metasploit I tested this on:</p>
  
  <p>Kali Raspberrypi Metasploit
  Framework: 5.0.0-dev-0e3b8a2253
  Console  : 5.0.0-dev-0e3b8a2253</p>
  
  <p>Mac OSx Metasploit
  Framework: 4.17.3-dev-771462f765226974b2298e0fafd804f4523f75d7
  Console  : 4.17.3-dev-771462f765226974b2298e0fafd804f4523f75d7</p>
  
  <p>Kali VM Metasploit
  Framework: 4.16.17-dev
  Console  : 4.16.17-dev</p>
  
  <p>Greatly appreciate any help any1 can give me on this 1! </p>