spender-sandbox / cuckoo-modified

Modified edition of cuckoo
395 stars 178 forks source link

Struggles with ssl and api submitting #495

Open DigiAngel opened 6 years ago

DigiAngel commented 6 years ago

Well I've never really got this to work right, and figured now was the time to try again. My goal is to pass multiple options. I have a valid ca cert and site cert setup...works fine in a web browser when I import the ca cert. Here's what I currently use:

#!/bin/bash
curl -k -u user:password -F options="tor = yes" -F file=@$1 "https://user:password@cuckoo/api/tasks/create/file/"

this works, but I can only pass one option...I've tried several different ways (such as "tor=yes,procmemdump=yes"), but in the end I get no options set, or just one after the analysis.

Next up is the submit.py in utils. If I try submit.py with just --ssl I get:

python submit.py -d --remote cuckoo:443 --priority 10 --user user --password 'password' --ssl --options "tor=yes,procmemdump=yes" /home/cuckoo/vmshared/pafish.exe

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): cuckoo
Error: unable to send file: HTTPSConnectionPool(host='cuckoo', port=443): Max retries exceeded with url: /tasks/create/file (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

If I add --noverifyssl I get:

python submit.py -d --remote cuckoo:443 --priority 10 --user user --password 'password' --ssl --sslnoverify --options "tor=yes,procmemdump=yes" /home/cuckoo/vmshared/pafish.exe

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): cuckoo
/home/user/.local/lib/python2.7/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
DEBUG:urllib3.connectionpool:https://cuckoo:443 "POST /tasks/create/file HTTP/1.1" 404 None
Error: unable to send file: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))

I've also tried adding the ca-cert to the ca-certficates.crt bundle, with no success. Thank you.

doomedraven commented 6 years ago

i think is related to the next libs: certifi, pyopenssl