Closed cmlh closed 7 months ago
Some sensitive or irrelevant text has been redacted with [SNIP]
Contents of intelx_search_input.json
below:
{
"term": "apple.com",
"buckets": [],
"lookuplevel": 0,
"maxresults": 100,
"timeout": 5,
"datefrom": "",
"dateto": "",
"sort": 4,
"media": 0,
"terminate": []
}
httpie
command below:
$ http POST "https://2.intelx.io/intelligent/search" "x-key:[SNIP]" @intelx_search_input.json
HTTP/1.1 200 OK
Content-Length: 112
Content-Type: application/json
[SNIP]
{
"altterm": "",
"alttermh": "",
"id": "00000000-0000-0000-0000-000000000000",
"softselectorwarning": false,
"status": 1
}
Root casue is "status": 1
in JSON returned above
$ intelx.py -apikey [snip] -search apple.com
_____ _ ___ __
|_ _| | | | \ \ / /
| | _ __ | |_ ___| |\ V /
| || '_ \| __/ _ \ |/ \
_| || | | | || __/ / /^\ \
\___/_| |_|\__\___|_\/ \/
a command line client
for intelx.io
[05:50:41] Limit argument not supplied, setting default to 10 results.
[05:50:41] Starting search of "apple.com".
[!] intelx.INTEL_SEARCH() Received 200 | Success
The workaround displays[!] intelx.INTEL_SEARCH() Received 200 | Success
which is returned by get_error()
In the response to /intelligent/search
, the status code status
= 1 means "Invalid Term".
The API returns a JSON response so HTTP 200 is how it was designed and should be. The Python code/function should check for this status and return an error in the function and output an error message to the end user.
In the response to
/intelligent/search
, the status codestatus
= 1 means "Invalid Term".The API returns a JSON response so HTTP 200 is how it was designed and should be. The Python code/function should check for this status and return an error in the function and output an error message to the end user.
The fix was inserted into get_error()
i.e.
https://github.com/IntelligenceX/Python/commit/28803f80861421dc26baeff79d926336124585db#diff-4bee3ab27586d1a7a090e2047cdbb14fa88a7da9c5be80e4ff2fda72c4541b1aR46-R47
GitHub Issue https://github.com/zeropwn/intelx.py/issues/4 is not directly related but the latest
intelx
script causes this error.Pull Request https://github.com/IntelligenceX/SDK/pull/517 is unrelated.