Open LovishBathla opened 4 years ago
import requests
REST_URL = "http://localhost:8090/tasks/create/file" SAMPLE_FILE = "12.pdf" headers = {'Authorization': 'BEARER MDD567'}
with open(SAMPLE_FILE, "rb") as sample: files = {"file": ("temp_file_name", sample)} r = requests.post(REST_URL,headers=headers)
task_id = r.text print (task_id)
When I run this I am getting { "message": "Authentication in the form of an 'Authorization: Bearer ' header is required" }
But I already assigned headers in requests like this only and I also changed this in cuckoo.conf See this cuckoo.conf
api_token = MDD567
web_secret = {{ cuckoo.cuckoo.web_secret }}
. Thanks
import requests REST_URL = "http://your_IP/tasks/create/file" SAMPLE_FILE ='C:\Users\Vaio\Desktop\idmBroker.exe'
api_token value exist in file .cuckoo/config/cuckoo.config
plz close the issue.
import requests
REST_URL = "http://localhost:8090/tasks/create/file" SAMPLE_FILE = "12.pdf" headers = {'Authorization': 'BEARER MDD567'}
with open(SAMPLE_FILE, "rb") as sample: files = {"file": ("temp_file_name", sample)} r = requests.post(REST_URL,headers=headers)
task_id = r.text print (task_id)
When I run this I am getting { "message": "Authentication in the form of an 'Authorization: Bearer' header is required"
}
But I already assigned headers in requests like this only and I also changed this in cuckoo.conf See this cuckoo.conf
The authentication token that is required to access the Cuckoo API, using
HTTP Bearer authentication. This will protect the API instance against
unauthorized access and CSRF attacks. It is strongly recommended to set this
to a secure value.
api_token = MDD567
The Web secret is used as a very basic, but successful way to provide basic
authentication to the Cuckoo Web Interface. This is a shared secret amongst
all users of this Cuckoo instance and will "protect" usage from users outside
of this instance. Therefore, if you'd like to share this Cuckoo instance with
the outside world, then don't use the Web secret functionality.
web_secret = {{ cuckoo.cuckoo.web_secret }}
. Thanks