Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joe Sandbox Analyzer returning error #156

Closed
Foneman38 opened this issue Dec 15, 2017 · 9 comments
Closed

Joe Sandbox Analyzer returning error #156

Foneman38 opened this issue Dec 15, 2017 · 9 comments
Labels
category:bug Issue is related to a bug scope:analyzer Issue is analyzer related

Comments

@Foneman38
Copy link

Joe Sandbox Analyzer not working

Request Type

Analyzer

Work Environment

N/A

Description

Joe Sandbox Analyzer not working on Joe Sandbox Complete (On Premise)

Complementary information

  1. I am using the analyzer that was rewritten to support api V2 found here: Joe Sandbox API version 2 support #141

  2. extracted from my conf file:
    JoeSandbox {
    url = "https://xxx.xxx.xxx.xxx/joesandbox/index.php/"
    apikey = "my-api-key"
    }

  3. Results =

{
"errorMessage": "Unexpected Error: Expecting value: line 1 column 1 (char 0)",
"input": {
"dataType": "url",
"config": {
"url": "https://xxx.xxx.xxx.xxx/joesandbox/index.php/",
"apikey": "REMOVED",
"check_tlp": false,
"service": "url_analysis"
},
"tlp": 1,
"data": "http://some-url-for-analysis.com/"
},
"success": false
}

@ant1
Copy link
Contributor

ant1 commented Dec 15, 2017

Does the analyzer with API v1 only work for you or not?
Is your Joe Sandbox using https not http?
If using https, do you have the CA Root certificate installed for it?

@Foneman38
Copy link
Author

The analyzer does not work with the v1 only code. The Joe Sandbox API uses https, but I have set requests to verify=false

@saadkadhi
Copy link
Contributor

@ant1 can you please check and let us know if we can go ahead and close this issue? Thanks mate.

@saadkadhi saadkadhi added category:bug Issue is related to a bug scope:analyzer Issue is analyzer related labels Jan 26, 2018
@ant1
Copy link
Contributor

ant1 commented Jan 26, 2018

I suggest doing a network capture with SSL disabled or using an SSL interception tool like burp/mitmproxy/sslsplit to debug the issue.

@ant1
Copy link
Contributor

ant1 commented Feb 21, 2018

Also, make sure you have automatic system selection in the php configuration file

$config['jbx']['autosystem'] = true;

@Foneman38
Copy link
Author

Foneman38 commented Mar 13, 2018

Packet capture shows the first post is checking to see if the Joe server is online. Joe responds with the answer and triggers an unexpected value error.

Here is the Cortex Data:
{ "errorMessage": "Unexpected Error: 'data'", "input": { "dataType": "url", "config": { "url": "http://sccfanjoe02.gacfanet.com/joesandbox/index.php/", "apikey": "REMOVED", "check_tlp": false, "service": "url_analysis" }, "tlp": 0, "data": "http://198.100.119.11/d1.jpg?rnd=53171" }, "success": false }
Here is the transcript of the packet capture:
`POST /joesandbox/index.php/api/v2/server/online HTTP/1.1
Host: JOESANDBOX-HOSTNAME
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: /
User-Agent: python-requests/2.18.4
Content-Length: 71
Content-Type: application/x-www-form-urlencoded
apikey=KEY REMOVED
HTTP/1.1 200 OK
Date: Tue, 13 Mar 2018 15:26:14 GMT
Server: Apache/2.4.7 (Ubuntu)
X-Powered-By: PHP/5.5.9-1ubuntu4.23
Set-Cookie: PHPSESSID=n15k7t5rdpbluv1m7eamb6hlf0; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 24
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json

{"data":{"online":true}}`

@Foneman38
Copy link
Author

So after further investigation, it appears that response.status_code returns a string, so the analyzer code should be modified as follows:
` if response.status_code == 200:
self.runv2()
else:
self.runv1()

if response.status_code == '200':
self.runv2()
else:
self.runv1()
`

@ant1
Copy link
Contributor

ant1 commented Mar 13, 2018

According to requests documentation and to my tests, status_code is an int.

@Foneman38
Copy link
Author

Thank you for your assistance. Your original suggestion for automatic system selection was the solution.
$config['jbx']['autosystem'] = true;

I'm a dumba$$ for not trying it earlier. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bug Issue is related to a bug scope:analyzer Issue is analyzer related
Projects
None yet
Development

No branches or pull requests

3 participants