Metasploit Module NoMethodError undefined method 'get_once' for nil:NilClass - plc

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.
The modules are not supplied with Metasploit but have been added to the auxiliary/admin/scada/ directory. This is a link to the Modules https://github.com/moki-ics/s7-metasploit-modules
The modules are showing up in Metasploit correctly and can be configured but when they are run there are a number of errors.
The module shown in the screen shot is simatic_s7_1200_command.rb
Errors are:
thread_manager.rb:100:in 'block in spawn'
rb:111:in 'block (2 levels) in run'
NoMethodError undefined method 'get_once' for nil:NilClass
I suspect the issue I am having is due to the version of Ruby being used with Metasploit is not compatible with the modules.
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.
The versions of Metasploit I tested this on:
Kali Raspberrypi Metasploit
Framework: 5.0.0-dev-0e3b8a2253
Console : 5.0.0-dev-0e3b8a2253
Mac OSx Metasploit
Framework: 4.17.3-dev-771462f765226974b2298e0fafd804f4523f75d7
Console : 4.17.3-dev-771462f765226974b2298e0fafd804f4523f75d7
Kali VM Metasploit
Framework: 4.16.17-dev
Console : 4.16.17-dev
Greatly appreciate any help any1 can give me on this 1!

I had the same problem and got it working by using a newer version of the exploit: https://www.exploit-db.com/exploits/38964

Related

Linking problems with nix package manager and termux

I tried to install the nix package manager on an Android device with termux.
When I try to execute the nix applicatives (for instance nix-store or nix-env) I get the following error
/nix/store/y9mfv3sx75mbfibf1zna1kq9v98fk2nb-nix-1.11.16/bin/nix-env:
error while loading shared libraries:
/nix/store/kfk65xrfzndyyz6if5fxk4wrwz76h2lh-glibc-2.25-49/lib/libc.so:
invalid ELF header
The file seems to be a script for the GNU linker, so I'm wondering what is the problem, could it be that termux's version of ld is unable to correctly interpret GNU Linker's scripts?
Thanks in advance for any help.
Edit: It seems that if unset the LD_PRELOADED and the LD_LIBRARY_PATH variables the nix-applications work fine. Problem is that in doing so termux cannot lunch any other non nix application, such as bash for instance.

Build a shared library on a Raspberry using Lazarus

I'm trying to build a shared library to use on a raspberry pi (model 3B) using lazarus. After some puzzling I found out that my original library didn't work properly so I switched to a very simple library using this example.
But even this simple library doesn't compile properly to be used. When I try to open the library in another lazarus project it gives me the error:
< libName >: cannot open shared object file: No such file or directory
After some research I found the following diagnostics I could run. The file and ldd command in the compile library:
$file ./libname.so gives:
./libname.so: ELF 32-bit LSB shared object, ARM, EABI5 verion 1 (SYSV), dynamically linked, not stripped
$ldd ./libname.so
not a dynamic executable
I have searched for similar cases and from found that others had this problem when they tried to use libraries compile for a different platform/architecture. I already set the project>project options>compiler options>target platform to OS:= linux and Target CPU family: arm.
The system I am using (using $uname -a):
Linux raspberrypi 4.4.13-V7+ #894 SMP Mon Jun 13 13:13:27 BST 2016 armv7l GNU/Linux
with distro: Raspbian GNU/linux 8.0 (jessie)
Lazarus version: 1.2.4+dfsg2-1
FPC version: 2.6.4 arm-linux-gtk2
At this point I am not sure what is wrong and why this library isn't working. I can find very little information on this problem (on the aspberry platform and using lazarus) Any suggestions what I could try to make it work, compile it different or do some more diagnostics?
Found the solution. As Marco proposed above: Add initc to the uses part. It seems that if you try to make a library it has to include initc, cmem or LCL to the uses section because the library has to do some memory management for which it needs one of these units.
However this resulted in another error when trying to load the library:
"Undefined symbol: TC_SYSTEM_ISLIBRARY"
This seems to be a raspberry specific problem, compilers on other systems do not give this error. More information can be found HERE.
Eventually solved this by install fpc 3.0.0 compiler on the raspberry pi, compiled it and the library can be loaded properly (but still needs one of the above units).

shared library issues while migrating from CodeSourcery armel to Linaro armhf compiler

I am migrating a Xilinx Zynq board from from the CodeSourcery armel (gnueabi) toolchain (from Vivado 2015.2) to a Linaro armhf, so we could instal Debian/Ubuntu armhf (gnueabihf).
While attempting to dlopen() and dlsym() a shared library, we get the next error from dlerror():
/.../controller.so: undefined symbol: _ZTVN10__cxxabiv119__pointer_type_infoE
The issue is present if the Linaro toolchain is used while software compiled with the CodeSourcery toolchain works properly.
I checked both libraries for the reported symbol and it is present in both:
$ grep -r cxxabiv119__pointer_type_info .
./controller.so.armel.simbols:U _ZTVN10__cxxabiv119__pointer_type_infoE
./controller.so.armhf.simbols:U _ZTVN10__cxxabiv119__pointer_type_infoE
It seems that if controller.so contains only C code (no C++ code) it works properry with Linaro. But the difference might be something else than the language used.
Regards,
Iztok Jeras
There was no simple answer to this problem, in the end I switched from cross compiling to a native compiler inside a QEMU emulated ARM environment. This was suggested by various Raspberry PI users. On the other hand every cross compiler solution just unearthed a new set of problems.

WebSphere Application Server 7.0.0.33 installation error - "failed to Install Update Installer"

I ran into errors when trying to install WebSphere Commerce Fix Pack 8 (on WCS FEP 1 and FP 7) and so started WebSphere Commerce installation from scratch. I was able to install RAD but am running into the below error when trying to install WebSphere Application Server 7.0.0.33 (I also tried installing other versions, but ended up having the same error).
Any help and ideas to overcome this problem would be much appreciated. Thanks in advance!
Please note this is: WebSphere Commerce Developer Environment and WebSphere Application Server Test Environment.
Operating System: Windows 7 Enterprise 64-bit
Antivirus: McAfee
IBM Installation Manager:
Version: 1.8.0
Internal version: 1.8.0.20140902_1503
Architecture: 32-bit
RAD:
Succeeded installing the below version:
IBM® Rational® Application Developer™ for WebSphere® Software
Version 7.5.5.5 iFix1 (7.5.5051.RADO7555iFix1-I20120913_1613)
WebSphere Application Server: Ran into the below error while attempting to install WAS 7.0.0.33
Error during "install" phase:
Error recorded in the log file:
actionStep : -INSTALL
version : 7.0.0.17
sourcePath : C:\IBM\SDP\image\UPDI70
installPath : C:\IBM\SDP\runtimes\updi_v70
calling performInstall
compare = 0
Deleting installPath : C:\IBM\SDP\runtimes\updi_v70
performInstall : Install Update Installer
OSCommand : Invoking at : C:\IBM\SDP\image\UPDI70\UpdateInstaller
OSCommand : Print out Command
C:\IBM\SDP\image\UPDI70\JDK\jre.pak\repository\package.java.jre\java\jre\bin\java.exe
-cp
setup.jar
run
-OPT
silentInstallLicenseAcceptance=true
-OPT
allowNonRootSilentInstall=true
-OPT
disableOSPrereqChecking=true
-OPT
disableEarlyPrereqChecking=true
-OPT
skipStartMenu=true
-OPT
installLocation=C:\IBM\SDP\runtimes\updi_v70
-silent
OSCommand : Done Print out Command
Unable to load JNI dll archive:C:\IBM\SDP\image\UPDI70\UpdateInstaller\setup.jar+/6d03fb4a8c94a5cdd9d0f5efa721f948/win32ppk/win32ppk.dll
java.lang.UnsatisfiedLinkError: C:\Users\SHEELA~1.DOS\AppData\Local\Temp\ismp001\win32ppk.dll (Access is denied. )
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1011)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1019)
at java.lang.Runtime.load0(Runtime.java:781)
at java.lang.Runtime.load(Runtime.java:769)
at com.installshield.util.LibraryLoader.loadLibrary(LibraryLoader.java:77)
at com.installshield.wizard.platform.win32.Win32Utils.loadDLL(Win32Utils.java:49)
at com.installshield.wizard.platform.win32.Win32SystemUtilServiceImpl.initialized(Win32SystemUtilServiceImpl.java:68)
at com.installshield.wizard.service.AbstractServiceImplementor.initialize(AbstractServiceImplementor.java:23)
at com.installshield.wizard.service.ServiceFactory.createImpl(ServiceFactory.java:129)
at com.installshield.wizard.service.ServiceFactory.createService(ServiceFactory.java:55)
at com.installshield.wizard.service.ServiceFactory.createService(ServiceFactory.java:24)
at com.installshield.wizard.service.LocalWizardServices.loadService(LocalWizardServices.java:107)
at com.installshield.wizard.service.LocalWizardServices.getService(LocalWizardServices.java:122)
at com.installshield.wizard.service.system.SystemUtilServiceInitialize.execute(SystemUtilServiceInitialize.java:17)
at com.installshield.wizard.Wizard.executeStartupBeans(Wizard.java:1451)
at com.installshield.wizard.Wizard$RunThread.run(Wizard.java:1534)
Thanks for looking into it!
FINALLY figured it out ... turned out McAfee (anti-virus) software was blocking the install.
I was able to successfully install WAS 7.0.0.33 after turning off the McAfee services - specifically the McAfee Host Intrusion Prevention Service.
The error stack seems to indicate a file permission issue:
Unable to load JNI dll
archive:C:\IBM\SDP\image\UPDI70\UpdateInstaller\setup.jar+/6d03fb4a8c94a5cdd9d0f5efa721f948/win32ppk/win32ppk.dll
java.lang.UnsatisfiedLinkError: C:\Users\SHEELA~1.DOS\AppData\Local\Temp\ismp001\win32ppk.dll ***(Access is denied. )***
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1011)
Maybe check privileges for the user installing the product/fix?

Nsight Eclipse Edition not finding nvcc

I just installed CUDA 5.0 Preview (Mac OS X Lion) and I'm having trouble with Nsight.
The toolkit seems to be installed correctly. (Driver loads, nvcc -V works in bash, samples work fine).
When I create a new project I get warnings:
Error launching external scanner info generator (nvcc -dryrun ...)
Program 'nvcc' is not found in $PATH
In Preferences -> CUDA Toolkit I get no CUDA-compatible devices detected. Which is strange because I have nVidia GT 650M on my machine. So why doesn't Nsight recognize it?
If I try to build a project I get 2 errors:
/bin/sh: nvcc: command not found
make: * [src/test.o] Error 127
How do you start Nsight? Do you use /usr/local/cuda/bin/nsight? Unfortunately, it is not currently possible to launch Nsight by double-clinking the application on Mac OS X.
In the CUDA 5.0 Preview build we had a bug when shell script did not properly setup paths. This is how this script looks like in latest internal toolkit builds (you may need to adjust paths depending on your toolkit install location - in the final release installer will handle it):
#!/bin/sh
PATH="$PATH:/Developer/NVIDIA/CUDA-5.0/bin" DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/Developer/NVIDIA/CUDA-5.0/lib" "/Developer/NVIDIA/CUDA-5.0/libnsight/nsight.app/Contents/MacOS/nsight" $#