WithSecureLabs / snake

snake - a malware storage zoo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uploading errors

3nk0d3r opened this issue · comments

I'have some problems during the upload step of samples.

I have installed Snake on Ubuntu Server 18.04.

snake and snake-pit services are working correctly.
pit
snake

When i try to upload a sample:
Cattura

On NGINX error log:
2019/12/18 13:48:42 [error] 1394#1394: *4 open() "/var/www/snake-skin/api/store" failed (2: No such file or directory), client: XXX.XXX.XXX.XXX, server: _, request: "GET /api/store?file_type=file&limit=10&sort=timestamp HTTP/1.1", host: "XXX.XXX.XXX.XXX:8000", referrer: "http://XXX.XXX.XXX.XXX:8000/" 2019/12/18 13:48:42 [error] 1393#1393: *1 open() "/var/www/snake-skin/api/store" failed (2: No such file or directory), client: XXX.XXX.XXX.XXX, server: _, request: "GET /api/store?file_type=memory&limit=10&sort=timestamp HTTP/1.1", host: "XXX.XXX.XXX.XXX:8000", referrer: "http://XXX.XXX.XXX.XXX:8000/" 2019/12/18 13:48:44 [error] 1393#1393: *6 open() "/var/www/snake-skin/api/scales" failed (2: No such file or directory), client: XXX.XXX.XXX.XXX, server: _, request: "GET /api/scales?file_type=file HTTP/1.1", host: "XXX.XXX.XXX.XXX:8000", referrer: "http://XXX.XXX.XXX.XXXm:8000/" 2019/12/18 13:48:58 [error] 1393#1393: *6 client intended to send too large body: 2409045 bytes, client: XXX.XXX.XXX.XXX, server: _, request: "POST /api/upload/file HTTP/1.1", host: "XXX.XXX.XXX.XXX:8000", referrer: "http://XXX.XXX.XXX.XXX:8000/"

Ignoring the odd 2: No such file or directory error is looks like it may just be the file size as your upload is failing due to nginx limiting the upload size: client intended to send too large body: 2409045 bytes. I believe this can be fixed with the following: client_max_body_size 500M;

These sorts of issues should be addressed when we get the new UI live (but its still in the dev branch) which removes the need for nginx, it is also much nicer to use.

Thanks Alex.
I've insert client_max_body_size but don't fix the problem.

The samples that i try to upload are not so large. I have the same issue with .exe or .xls files.

On NGINX:

2019/12/18 14:24:26 [error] 2512#2512: *5 open() "/var/www/snake-skin/api/store" failed (2: No such file or directory), client: XXX.XXX.XXX.XXX, server: _, request: "GET /api/store?file_type=file&limit=10&sort=timestamp HTTP/1.1", host: "YY.Y.Y.Y.compute.amazonaws.com:8000", referrer: "http://YY.Y.Y.Y.compute.amazonaws.com:8000/" 2019/12/18 14:24:26 [error] 2512#2512: *4 open() "/var/www/snake-skin/api/store" failed (2: No such file or directory), client: XXX.XXX.XXX.XXX, server: _, request: "GET /api/store?file_type=memory&limit=10&sort=timestamp HTTP/1.1", host: "YY.Y.Y.Y.compute.amazonaws.com:8000", referrer: "http://YY.Y.Y.Y.compute.amazonaws.com:8000/" 2019/12/18 14:24:28 [error] 2512#2512: *4 open() "/var/www/snake-skin/api/scales" failed (2: No such file or directory), client: XXX.XXX.XXX.XXX, server: _, request: "GET /api/scales?file_type=file HTTP/1.1", host: "YY.Y.Y.Y.compute.amazonaws.com:8000", referrer: "http://YY.Y.Y.Y.compute.amazonaws.com:8000/" 2019/12/18 14:24:42 [error] 2512#2512: *4 open() "/var/www/snake-skin/api/upload/file" failed (2: No such file or directory), client: XXX.XXX.XXX.XXX, server: _, request: "POST /api/upload/file HTTP/1.1", host: "YY.Y.Y.Y.compute.amazonaws.com:8000", referrer: "http://YY.Y.Y.Y.compute.amazonaws.com:8000/" 2019/12/18 14:25:52 [error] 2512#2512: *7 open() "/var/www/snake-skin/api/scales" failed (2: No such file or directory), client: XXX.XXX.XXX.XXX, server: _, request: "GET /api/scales?file_type=file HTTP/1.1", host: "YY.Y.Y.Y.compute.amazonaws.com:8000", referrer: "http://YY.Y.Y.Y.compute.amazonaws.com:8000/" 2019/12/18 14:26:03 [error] 2512#2512: *7 open() "/var/www/snake-skin/api/upload/file" failed (2: No such file or directory), client: XXX.XXX.XXX.XXX, server: _, request: "POST /api/upload/file HTTP/1.1", host: "YY.Y.Y.Y.compute.amazonaws.com:8000", referrer: "http://YY.Y.Y.Y.compute.amazonaws.com:8000/"

Awesome so now we are back to the error I was confused about before, which is nginx trying to open a file path rather than doing proxy pass through: /var/www/snake-skin/api/upload/file That should be something like http://localhost:5000/api/upload/file. So it looks like the proxy pass settings in your nginx conf may be incorrect, are you able to share them without giving any sensitive information away?

I don't modify NGINX conf.

The NGINX conf, from install.sh process:
`/etc/nginx/sites-available# cat /etc/nginx/sites-available/snake-skin
server {
listen 8000 default_server;

root /var/www/snake-skin;
client_max_body_size 500M;
server_name _;
}`

Ah yeah, I would hazard a guess you are hitting this issue: #8? Again, this solution is resolved in the new Snake Skin, it is just not ready to go live yet. So either of these should work: #8 (comment)

This is due to lack of foresight in the install scripts on my behalf, apologies for the inconvenience. This is fixed in the docker images but not the system based install.

When do you release the new Snake Skin?

I don't find "snake-skin/src/config/config.js"
asd

However, i try with Snake on docker.

Thank you

Literally working on it now, so should not be too long :p