cuckoosandbox / cuckoo

Cuckoo Sandbox is an automated dynamic malware analysis system
http://www.cuckoosandbox.org
Other
5.57k stars 1.71k forks source link

[2.0.1] Unable to start Cuckoo Webserver #1424

Closed Cuckoo0000 closed 6 years ago

Cuckoo0000 commented 7 years ago

Hi,

I can successful start Cuckoo, as below:

C:\Windows\system32>cuckoo

   ______   __  __   ______   ___   ___   ______   ______
  /_____/\ /_/\/_/\ /_____/\ /___/\/__/\ /_____/\ /_____/\
  \:::__\/ \:\ \:\ \\:::__\/ \::.\ \\ \ \\:::_ \ \\:::_ \ \
   \:\ \  __\:\ \:\ \\:\ \  __\:: \/_) \ \\:\ \ \ \\:\ \ \ \
    \:\ \/_/\\:\ \:\ \\:\ \/_/\\:. __  ( ( \:\ \ \ \\:\ \ \ \
     \:\_\ \ \\:\_\:\ \\:\_\ \ \\: \ )  \ \ \:\_\ \ \\:\_\ \ \
      \_____\/ \_____\/ \_____\/ \__\/\__\/  \_____\/ \_____\/

 Cuckoo Sandbox 2.0.1
 www.cuckoosandbox.org
 Copyright (c) 2010-2017

 Checking for updates...
 You're good to go!
2017-04-18 14:15:22,269 [cuckoo.core.startup] WARNING: Unable to import yara (please compile from sources)
2017-04-18 14:15:22,275 [cuckoo.core.scheduler] INFO: Using "virtualbox" as machine manager
2017-04-18 14:15:33,089 [cuckoo.core.scheduler] INFO: Loaded 1 machine/s
2017-04-18 14:15:33,125 [cuckoo.core.scheduler] INFO: Waiting for analysis tasks.

However attempting to run cuckoo web results in the following error:

C:\Users\User>cuckoo web
c:\python27\python.exe: can't open file 'C:\Python27\Scripts\cuckoo': [Errno 2] No such file or directory

For reference, my .cuckoo folder is located at C:\Users\User\.cuckoo.

Thanks.

jbremer commented 7 years ago

Just double checking: what happens if you run cuckoo web from the same directory (i.e., C:\Windows\System32)? That shouldn't really matter, but if cuckoo works, cuckoo web should too - it's the same executable / script.

Cuckoo0000 commented 7 years ago

Hi, same error:

C:\Windows\system32>cuckoo web
c:\python27\python.exe: can't open file 'C:\Python27\Scripts\cuckoo': [Errno 2] No such file or directory
jbremer commented 7 years ago

And if you try that in the same terminal where cuckoo ran successfully? I.e., by killing cuckoo and starting cuckoo web?

Cuckoo0000 commented 7 years ago
C:\Users\User>cuckoo

                                 _|
     _|_|_|  _|    _|    _|_|_|  _|  _|      _|_|      _|_|
   _|        _|    _|  _|        _|_|      _|    _|  _|    _|
   _|        _|    _|  _|        _|  _|    _|    _|  _|    _|
     _|_|_|    _|_|_|    _|_|_|  _|    _|    _|_|      _|_|

 Cuckoo Sandbox 2.0.1
 www.cuckoosandbox.org
 Copyright (c) 2010-2017

 Checking for updates...
 You're good to go!
2017-04-20 09:53:17,772 [cuckoo.core.startup] WARNING: Unable to import yara (please compile from sources)
2017-04-20 09:53:17,780 [cuckoo.core.scheduler] INFO: Using "virtualbox" as machine manager
2017-04-20 09:53:18,186 [cuckoo.core.scheduler] INFO: Loaded 1 machine/s
2017-04-20 09:53:18,223 [cuckoo.core.scheduler] INFO: Waiting for analysis tasks.
(CTRL-C here)
C:\Users\User>cuckoo web
c:\python27\python.exe: can't open file 'C:\Python27\Scripts\cuckoo': [Errno 2] No such file or directory

C:\Users\User>

Thanks.

jbremer commented 7 years ago

I just installed 2.0.1 in a 64-bit Windows 7 VM & Python 2.7.6 and both cuckoo.exe and cuckoo.exe web work just fine. Do you have any more information for me to work with?

Cuckoo0000 commented 7 years ago

Hi, I'm running Windows 10 64bit, with 32bit Python 2.7.13.

I've just had a play around, and I managed to get the web interface to run by renaming cuckoo.exe to cuckoo and running the following:

C:\Users\User>python C:\Python27\Scripts\cuckoo web
Performing system checks...

System check identified no issues (0 silenced).
April 21, 2017 - 09:20:36
Django version 1.8.4, using settings 'cuckoo.web.web.settings'
Starting development server at http://localhost:8000/

Hope this helps.

jbremer commented 7 years ago

That's even stranger, hehe. What kind of file is C:\Python27\Scripts\cuckoo? Is it even an exe file or is it in fact a Python file? I guess I'll have to setup a Windows VM with Python 2.7.13..

Cuckoo0000 commented 7 years ago

It really is. It's an exe file.

Thanks.

jbremer commented 7 years ago

@Cuckoo0000 did you have any progress with this issue?

Waffles-2 commented 7 years ago

Can confirm, I am also having this same issue.

Running cuckoo works fine but cuckoo web fails with c:\python27\python.exe: can't open file 'C:\Python27\Scripts\cuckoo': [Errno 2] No such file or directory

jbremer commented 7 years ago

This is what I'm getting in my 64-bit Windows 7 VM with Python 2.7.6 and Cuckoo 2.0.2, so, seems to work here. I'll check out Python 2.7.13 later..

C:\Users\Administrator>C:\Python27\Scripts\cuckoo

    sSSs   .S       S.     sSSs   .S    S.     sSSs_sSSs      sSSs_sSSs
   d%%SP  .SS       SS.   d%%SP  .SS    SS.   d%%SP~YS%%b    d%%SP~YS%%b
  d%S'    S%S       S%S  d%S'    S%S    S&S  d%S'     `S%b  d%S'     `S%b
  S%S     S%S       S%S  S%S     S%S    d*S  S%S       S%S  S%S       S%S
  S&S     S&S       S&S  S&S     S&S   .S*S  S&S       S&S  S&S       S&S
  S&S     S&S       S&S  S&S     S&S_sdSSS   S&S       S&S  S&S       S&S
  S&S     S&S       S&S  S&S     S&S~YSSY%b  S&S       S&S  S&S       S&S
  S&S     S&S       S&S  S&S     S&S    `S%  S&S       S&S  S&S       S&S
  S*b     S*b       d*S  S*b     S*S     S%  S*b       d*S  S*b       d*S
  S*S.    S*S.     .S*S  S*S.    S*S     S&  S*S.     .S*S  S*S.     .S*S
   SSSbs   SSSbs_sdSSS    SSSbs  S*S     S&   SSSbs_sdSSS    SSSbs_sdSSS
    YSSP    YSSP~YSSY      YSSP  S*S     SS    YSSP~YSSY      YSSP~YSSY
                                 SP
                                 Y

 Cuckoo Sandbox 2.0.2
 www.cuckoosandbox.org
 Copyright (c) 2010-2017

=======================================================================
    Welcome to Cuckoo Sandbox, this appears to be your first run!
    We will now set you up with our default configuration.
    You will be able to see and modify the Cuckoo configuration,
    Yara rules, Cuckoo Signatures, and much more to your likings
    by exploring the C:\Users\Administrator\.cuckoo directory.

    Among other configurable items of most interest is the
    new location for your Cuckoo configuration:
              C:\Users\Administrator\.cuckoo\conf
=======================================================================

Cuckoo has finished setting up the default configuration.
Please modify the default settings where required and
start Cuckoo again (by running `cuckoo` or `cuckoo -d`).

C:\Users\Administrator>C:\Python27\Scripts\cuckoo web
In order to use the Cuckoo Web Interface it is required to have MongoDB up-and-r
unning and enabled in Cuckoo. Please refer to our official documentation as well
 as the $CWD/conf/reporting.conf file.

C:\Users\Administrator>C:\Python27\Scripts\cuckoo.exe web
In order to use the Cuckoo Web Interface it is required to have MongoDB up-and-r
unning and enabled in Cuckoo. Please refer to our official documentation as well
 as the $CWD/conf/reporting.conf file.
Waffles-2 commented 7 years ago

Ok awesome, I will just downgrade python and test it out.

Thanks.

Cuckoo0000 commented 7 years ago

Hi, I've downgraded to Python 2.7.6 (32 bit) and I'm still getting the same issue.

C:\Users\User\Desktop>python
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
^C
C:\Users\User\Desktop>cuckoo web
c:\python27\python.exe: can't open file 'C:\Python27\Scripts\cuckoo': [Errno 2] No such file or directory

C:\Users\User\Desktop>
jbremer commented 7 years ago

Hmm, based on information provided in #1520 I think this issue might be related to Cuckoo doing os.chdir() for cuckoo web. I can get rid of that (hopefully smoothly) and debug with @Waffles-2 to see if that does the job. Give me a bit of time though ;-)

Cuckoo0000 commented 7 years ago

Okay awesome, thanks! If you need any further information from me let me know.

jbremer commented 7 years ago

Didn't have much luck debugging this issue with @Waffles-2 yet, sorry :-(

jbremer commented 7 years ago

Thanks to @botherder and those involved here this issue has now been resolved properly! To be pushed in a future alpha & stable release of Cuckoo.

Waffles-2 commented 7 years ago

Great work @botherder and @jbremer! I will be sure to test it out on my Windows machine once it is released, but for now Linux is king!

bicyclemicycle commented 7 years ago

Has this been resolved yet? I am still having this issue as well. Here's my setup: Windows 7 x64 SP1 Python 2.7.13 x86 cuckoo 2.0.3

jbremer commented 7 years ago

Yes, but you'll have to install the latest alpha/development version; pip install cuckoo==2.0.4a2. Please let me know if that does the trick (it should).

avihay1 commented 7 years ago

I found a fix with little help from procmon take "cuckoo-script.py" and rename it to "cuckoo" then place it in C:\Python27\Lib\site-packages\Cuckoo-2.0.3-py2.7.egg\cuckoo\web

jbremer commented 7 years ago

What cuckoo-script.py file would that be?

Cuckoo0000 commented 7 years ago

Just wanted to say thanks for fixing this!

jbremer commented 7 years ago

You're welcome, @Cuckoo0000 :)

avihay1 commented 7 years ago

script created at C:\Python27\Scripts when installing cuckoo the content:

!C:\Python27\python.exe

EASY-INSTALL-ENTRY-SCRIPT: 'Cuckoo==2.0.3','console_scripts','cuckoo'

requires = 'Cuckoo==2.0.3' import re import sys from pkg_resources import load_entry_point

if name == 'main': sys.argv[0] = re.sub(r'(-script.pyw?|.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('Cuckoo==2.0.3', 'console_scripts', 'cuckoo')() )

installing pip install cuckoo==2.0.4a2 didn't do the trick for me

jbremer commented 7 years ago

@avihay1 can you provide us with full logs? thanks.

Mato-Z commented 7 years ago

Hello, I have the same problem. When I run web: ./cuckoo web runserver 0.0.0.0:PORT I get error: /root/.cuckoo/venv/bin/python2: can't open file './cuckoo': [Errno 2] No such file or directory I use Debian 8.9 x64, Cuckoo version 2.0.3 and Python 2.7.9. Can you help me please?

doomedraven commented 7 years ago

it's not ./ just cuckoo

jbremer commented 7 years ago

If you upgrade to one of our latest alpha releases (i.e., >=2.0.4a2 - and soon to be 2.0.4), then this issue has been resolved. It was fixed in 898b49ce6e59484800b5d6806aa161eb5a17bb04.

Mato-Z commented 7 years ago

Ok, thanks for info, so I hope that new release which will solved several issues will be released soon...

jthe13 commented 7 years ago

hello I have the same problem too.. Every time I running cuckoo web then I always have an error c:\python27\python.exe: can't open file 'C:\Python27\Scripts\cuckoo': [Errno 2] No such file or directory 2 I install python 2.7.13 and cuckoo 2.0.4.4 where host is Windows 10 64 bit and guest is Windows 7 32bit in virtualbox by the way.. really need your help.. thanks

cuckoobot commented 7 years ago

@jthe13 and you're sure you're running the 2.0.4.4 version? Because as mentioned above it was resolved in there.

jthe13 commented 7 years ago

yes, I'am.. I will send a screenshot about my cuckoo version and when I getting error when running cuckoo web in Windows.. cant you help me?

On Wed, Oct 18, 2017 at 2:46 PM, Cuckoo Sandbox notifications@github.com wrote:

@jthe13 https://github.com/jthe13 and you're sure you're running the 2.0.4.4 version? Because as mentioned above it was resolved in there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cuckoosandbox/cuckoo/issues/1424#issuecomment-337476104, or mute the thread https://github.com/notifications/unsubscribe-auth/AedsIEsOLcsIQrECWWfuK7bqDf72LpCDks5stZ62gaJpZM4NAXBT .

jthe13 commented 7 years ago

Hy, good morning from Indonesia.. By the way, can I ask you question? Can I run cuckoo sandbox as service in Ubuntu? Really need your help.. thank you so much and I hope you can reply my message..

On Fri, Oct 20, 2017 at 10:35 AM, Jelita Thehumury jejethe13@gmail.com wrote:

yes, I'am.. I will send a screenshot about my cuckoo version and when I getting error when running cuckoo web in Windows.. cant you help me?

On Wed, Oct 18, 2017 at 2:46 PM, Cuckoo Sandbox notifications@github.com wrote:

@jthe13 https://github.com/jthe13 and you're sure you're running the 2.0.4.4 version? Because as mentioned above it was resolved in there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cuckoosandbox/cuckoo/issues/1424#issuecomment-337476104, or mute the thread https://github.com/notifications/unsubscribe-auth/AedsIEsOLcsIQrECWWfuK7bqDf72LpCDks5stZ62gaJpZM4NAXBT .

doria90 commented 7 years ago

Hi all, I'm having this same issue. made sure I have the latest update of Cuckoo installed. When running cuckoo web --help, I'm able to get the help screen for cuckoo web and when applying cuckoo web help i'm able to get Django's help screen.. however, when applying cuckoo web runserver -H .. -p .. i get the same error as others have stated.

any help please?

doria90 commented 7 years ago

OK I was able to get around it: I copied the "cuckoo-script.py" from C:\Python27\Scripts to C:\Python27\Scripts and called it "cuckoo". that's it..

jaapjaa commented 7 years ago

@doria90 Where did you find cuckoo-script.py? I have no file on my machine with that name:(

doria90 commented 7 years ago

@jaapjaa It's in C:\Python27\Scripts. If your'e having issues, try to copy cuckoo.exe from C:\Python27\Scripts to that same location with the name "cuckoo".. I've read just now that this might work as well

jaapjaa commented 7 years ago

@doria90 thanks for your response! Its not working unfortunately:P When I rename the file cuckoo.exe to cuckoo, Cuckoo is not even working more:P When I have both files I stil remain with the same issue

doria90 commented 7 years ago

@jaapjaa and are you sure you have the latest ver of Cuckoo?

jaapjaa commented 7 years ago

@doria90 Cuckoo Sandbox 2.0.4 But I`ve made a post on the forum so I hope someone will help me! Thanks a lot for your time!

doria90 commented 7 years ago

@jaapjaa sure np! I've had to debug it manually to figure out what's the issue, all I can say is that the commit that was supposed to fix this issue, 898b49c, didn't work for me.

maynardflies commented 6 years ago

I am having the same problem on 2.0.5, copying cuckoo.exe to cuckoo doesn't work, since it says "Error: No such command "runserver"." I can't find any file called cuckoo-script.py in my virtualenv or host environment. Any traction on this? It seems like cuckoo.exe is supposed to know what "runserver" means, but it doesn't

maynardflies commented 6 years ago

OK I managed to work around this with 2 operations

  1. copy cuckoo.exe to cuckoo in your venv's scripts folder (or root env)
  2. runserver doesn't seem to do anything, instead run "cuckoo -d web ...args..."
jbremer commented 6 years ago

Yep, exactly. Closing issue.

NewSystemGames commented 5 years ago

Still having this issue in cuckoo 2.0.7 .... :/

doomedraven commented 5 years ago

issue without log isn't an issue :P

NewSystemGames commented 5 years ago

-I installed Mongodb, Mysql, Apache2 on WSL -Updated conf files on .cuckoo -Installed cuckoo on Windows 10

cuckoo would work, but not cuckoo web.

`Microsoft Windows [Version 10.0.17763.615] (c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\Ali>cuckoo init

eeee e e eeee e e eeeee eeeee 8 8 8 8 8 8 8 8 8 88 8 88 8e 8e 8 8e 8eee8e 8 8 8 8 88 88 8 88 88 8 8 8 8 8 88e8 88ee8 88e8 88 8 8eee8 8eee8

Cuckoo Sandbox 2.0.7 www.cuckoosandbox.org Copyright (c) 2010-2018

Checking for updates... Vulnerable dependencies found

--> Potentially vulnerable virtualbox version installed. Failed to retrieve its version. Update if version is: 5.2.27

--> Potentially vulnerable virtualbox version installed. Failed to retrieve its version. Update if version is: 6.0.5

This check can be disabled by enabling 'ignore_vulnerabilities' in cuckoo.conf under the [cuckoo] section

C:\Users\Ali>cuckoo web c:\python27\python.exe: can't open file 'C:\Python27\Scripts\cuckoo': [Errno 2] No such file or directory

C:\Users\Ali>`

NewSystemGames commented 5 years ago

I tried one method i found here: https://sec.xiaomi.com/article/45

"On Python27 Scripts folder, create a copy of cuckoo-script.py in same path and rename it to cuckoo"

After doing so i get another error:

`C:\Users\Ali>cuckoo init Traceback (most recent call last): File "C:\Python27\Scripts\cuckoo-script.py", line 11, in load_entry_point('Cuckoo==2.0.7', 'console_scripts', 'cuckoo')() File "c:\python27\lib\site-packages\pkg_resources__init.py", line 487, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "c:\python27\lib\site-packages\pkg_resources__init.py", line 2728, in load_entry_point return ep.load() File "c:\python27\lib\site-packages\pkg_resources__init__.py", line 2346, in load return self.resolve() File "c:\python27\lib\site-packages\pkg_resources\init.py", line 2352, in resolve module = import__(self.module_name, fromlist=['name__'], level=0) ImportError: No module named main

C:\Users\Ali>`

Installing this thing is huge puzzle for me

NewSystemGames commented 5 years ago

tried making cuckoo.exe to cuckoo only on python27/Scripts and i get following error:

File "C:\Python27\Scripts\cuckoo", line 1 SyntaxError: Non-ASCII character '\x90' in file C:\Python27\Scripts\cuckoo on line 1, but no encoding declared;