Open Meow-ops opened 6 years ago
Hi sarcarx,
it looks like that you are running a 64bit binary (according to virustotal) in a 32bit sandbox.
Hi itsacoderepo,
Ok I have tried using a Sandbox_Win_x86_64
instead of Sandbox_Win_x86_32
, the output seems to be the same.
Traceback (most recent call last):
File "sandboxed_powershell.py", line 31, in <module>
sb = Sandbox_Win_x86_64(options.filename, options, globals())
File "/usr/local/lib/python2.7/dist-packages/miasm2/analysis/sandbox.py", line 479, in __init__
Sandbox.__init__(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/miasm2/analysis/sandbox.py", line 55, in __init__
cls.__init__(self, custom_methods, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/miasm2/analysis/sandbox.py", line 246, in __init__
win_api_x86_32_seh.init_seh(self.jitter)
File "/usr/local/lib/python2.7/dist-packages/miasm2/os_dep/win_api_x86_32_seh.py", line 414, in init_seh
build_peb(jitter, peb_address)
File "/usr/local/lib/python2.7/dist-packages/miasm2/os_dep/win_api_x86_32_seh.py", line 132, in build_peb
Peb.ImageBaseAddress = main_pe.NThdr.ImageBase
File "/usr/local/lib/python2.7/dist-packages/miasm2/core/types.py", line 1472, in <lambda>
lambda self, val, name=name: self.set_field(name, val)
File "/usr/local/lib/python2.7/dist-packages/miasm2/core/types.py", line 1408, in set_field
return self._type.set_field(self._vm, self.get_addr(), name, val)
File "/usr/local/lib/python2.7/dist-packages/miasm2/core/types.py", line 643, in set_field
field.set(vm, addr + offset, val)
File "/usr/local/lib/python2.7/dist-packages/miasm2/core/types.py", line 283, in set
raw = self._pack(val)
File "/usr/local/lib/python2.7/dist-packages/miasm2/core/types.py", line 381, in _pack
return super(Num, self)._pack([number])
File "/usr/local/lib/python2.7/dist-packages/miasm2/core/types.py", line 354, in _pack
return struct.pack(self._fmt, *fields)
struct.error: 'I' format requires 0 <= number <= 4294967295
Also I tried using the same code with a 32bits executable with the Sandbox_Win_x86_32
and it does seem to work. Maybe the problem comes indeed from me using a 64bit executable
It seems that process envrionnement structures (PEB, TEB, etc) are only implemented for 32bits, so it cannot work with 64 bits binaries for now
Hi guys! @itsacoderepo : Nice catch for the 32/64 bit :) @themaks: You are right! for the moment only windows 32 bits structures are in the public repo. @sarcarx: We have a test branch internally for the 64bit we will release in a near future!
I have the following stack trace when using the "-y" option with the Sandbox_Win_x86_32 parser:
powershell.exe is the executable from windows (852d67a27e454bd389fa7f02a8cbe23f) The code I am using is very basic:
Any idea on how to fix that?