hatching / vmcloak

Automated Virtual Machine Generation and Cloaking for Cuckoo Sandbox.
479 stars 118 forks source link

ValueError: need more than 1 value to unpack #200

Open LegendXI1 opened 1 year ago

LegendXI1 commented 1 year ago

┌──(cuckoo-test)(cuckoo7k㉿kali)-[~] └─$ vmcloak init --verbose --win7x64 win7x64base1 --cpus 2 --ramsize 2048
/home/cuckoo7k/.virtualenvs/cuckoo-test/lib/python2.7/site-packages/OpenSSL/crypto.py:14: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release. from cryptography import utils, x509 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% INFO:vmcloak:Starting the Virtual Machine u'win7x64base1' to install Windows. Traceback (most recent call last): File "/home/cuckoo7k/.virtualenvs/cuckoo-test/bin/vmcloak", line 8, in sys.exit(main()) File "/home/cuckoo7k/.virtualenvs/cuckoo-test/lib/python2.7/site-packages/click/core.py", line 716, in call return self.main(args, kwargs) File "/home/cuckoo7k/.virtualenvs/cuckoo-test/lib/python2.7/site-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/home/cuckoo7k/.virtualenvs/cuckoo-test/lib/python2.7/site-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/cuckoo7k/.virtualenvs/cuckoo-test/lib/python2.7/site-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/cuckoo7k/.virtualenvs/cuckoo-test/lib/python2.7/site-packages/click/core.py", line 534, in invoke return callback(args, **kwargs) File "/home/cuckoo7k/.virtualenvs/cuckoo-test/lib/python2.7/site-packages/vmcloak/main.py", line 275, in init m.wait_for_state(shutdown=True) File "/home/cuckoo7k/.virtualenvs/cuckoo-test/lib/python2.7/site-packages/vmcloak/vm.py", line 65, in wait_for_state status = self.vminfo("VMState") File "/home/cuckoo7k/.virtualenvs/cuckoo-test/lib/python2.7/site-packages/vmcloak/vm.py", line 49, in vminfo key, value = line.split("=", 1) ValueError: need more than 1 value to unpack

Hi, im trying to innit win7 but I came across this issue which doesn't seem to have happend before to anyone else before. Thank you

Glacons commented 1 year ago

I successfully implemented Cuckoo few months ago with vmcloak and now i try to reinstall it from scratch and got the same error. Currently using Virtualbox, i was using VMware workstation when it worked.

TiborGalko commented 1 year ago

Looks like bug in vm.py file. Because output from VBoxManage showvminfo can contain lines with no = character. Split will then fail. I tried to add if condition before key, value = line.split("=", 1) in home/cuckoo/lib/python2.7/site-packages/vmcloak/vm.py vminfo function: if("=" not in line): continue and it seems to work.

j3nn13 commented 1 year ago

Looks like bug in vm.py file. Because output from VBoxManage showvminfo can contain lines with no = character. Split will then fail. I tried to add if condition before key, value = line.split("=", 1) in home/cuckoo/lib/python2.7/site-packages/vmcloak/vm.py vminfo function: if("=" not in line): continue and it seems to work.

Hi can you do a video demo :(( i struggle with this bugs for days..

j3nn13 commented 1 year ago

I fixed like u said but it still give an error :(

image image

TiborGalko commented 1 year ago

@j3nn13 Like this. Add continue after if. If there is no "=" in line, then skip it.

...
for line in lines.split("\n"):
    if ("=" not in line):
        continue
    key, value = line.split("=", 1)
...
GVATech commented 1 year ago

Had the same issue, Tried the additional IF statement and vmcloak worked correctly. Thanks @TiborGalko