zoomeye-search icon indicating copy to clipboard operation
zoomeye-search copied to clipboard

Error when trying to compile the results into output file 'results.txt'

Open syriusbughunt opened this issue 5 years ago • 21 comments

Hi,

Since only today, I'm getting the following error msg when performing a search:

Traceback (most recent call last): File "zoomeye.py", line 120, in <module> getResult() File "zoomeye.py", line 80, in getResult response = json.loads(SEARCH.text) File "/usr/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I've used the same tools the last few days without issue, can you confirm if this is an issue with ZoomEye API and which one exactly would it be? I can contact them with the technical details to fix it.

Thank you for your time !

syriusbughunt avatar Mar 06 '19 22:03 syriusbughunt

I couldn't reproduce this and everything appears to be working for me so I doubt it's an issue on ZoomEye's end. Could you put the full command you entered that gave you this error?

Of course redact your email and password. And the search query shouldn't matter either. I'm just curious exactly what options you put in to get this error.

adcar avatar Mar 06 '19 23:03 adcar

Here's the syntax I've used:

python3 zoomeye.py -p 1000 --email [email protected] --password 123456 -s --domain --platform web "'jenkins'"

syriusbughunt avatar Mar 07 '19 01:03 syriusbughunt

-s needs an input. So you'll have to do something like this: python3 zoomeye.py -p 1000 --email [email protected] --password 123456 -s my_output_file.txt --domain --platform web -q "jenkins"

I also just added a commit (2a31d9b ) that won't require the -s argument and will automatically save to results.txt by default.

EDIT: Also you need -q in front of your query. (I added it to the command above)

adcar avatar Mar 07 '19 02:03 adcar

Make sure you're on the latest version of the script. Because it seems like you must've been using an older version for that syntax to even work. This was probably the problem as ZoomEye changed their API slightly since the old version.

adcar avatar Mar 07 '19 02:03 adcar

This is the output I am getting with the latest version:

`[] All IPs will be saved to results_jenkins80.txt [] Logging in as [email protected] access token: {"access_token": "**************"} [+] Successfuly logged in Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 562, in urlopen body=body, headers=headers) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 387, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.6/http/client.py", line 1239, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.6/http/client.py", line 1285, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.6/http/client.py", line 1234, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.6/http/client.py", line 1026, in _send_output self.send(msg) File "/usr/lib/python3.6/http/client.py", line 964, in send self.connect() File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 138, in connect ssl_version=resolved_ssl_version) File "/usr/lib/python3/dist-packages/urllib3/util.py", line 619, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket _context=self, _session=session) File "/usr/lib/python3.6/ssl.py", line 817, in init self.do_handshake() File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake self._sslobj.do_handshake() File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:847)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/adapters.py", line 330, in send timeout=timeout File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 595, in urlopen raise SSLError(e) urllib3.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:847)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "zoomeye.py", line 235, in main() File "zoomeye.py", line 225, in main getResult() File "zoomeye.py", line 186, in getResult getPage(currentPage) File "zoomeye.py", line 132, in getPage headers=HEADERS, params={"query": args.query, "page": page}) File "/usr/lib/python3/dist-packages/requests/api.py", line 55, in get return request('get', url, **kwargs) File "/usr/lib/python3/dist-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 467, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 570, in send r = adapter.send(request, **kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 385, in send raise SSLError(e) requests.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:847) `

Please note that I see the page parsing (1...2...3....4... etc then when trying to compile results in output, it display the error msg above)

Syntax used:

python3 zoomeye.py -p 1000 --email [email protected] --password 123456 -s results_jenkins.txt --domain --platform web -q "jenkins"

syriusbughunt avatar Mar 07 '19 15:03 syriusbughunt

Does this fix it?

adcar avatar Mar 07 '19 16:03 adcar

Now with the fix I tried from you above, I am getting the following output:

[] All IPs will be saved to results_jenkins.txt [] Logging in as [email protected] access token: {"access_token": "**********"} [+] Successfuly logged in [-] No hosts found501

the output file 'results_jenkins.txt' exists but it's empty :(

I have a feeling since the beginning that it actually gets the data but when it's time to save it into the output file, there is an issue

syriusbughunt avatar Mar 07 '19 22:03 syriusbughunt

That happened to me before. Not sure why, I'm assuming it was a problem with the API. Try running the script again

adcar avatar Mar 07 '19 22:03 adcar

Still getting the same error msg, I will try on one other machine in my LAN

syriusbughunt avatar Mar 07 '19 22:03 syriusbughunt

Wow... same issue with the latest version of Ubuntu (the other machine I just tried on) this is weird since you are telling me on your side everything is OK ;/

syriusbughunt avatar Mar 08 '19 03:03 syriusbughunt

[+] Successfuly logged in [*] Parsing page: 1 Traceback (most recent call last): File "zoomeye.py", line 237, in main() File "zoomeye.py", line 227, in main getResult() File "zoomeye.py", line 188, in getResult getPage(currentPage) File "zoomeye.py", line 135, in getPage response = json.loads(SEARCH.text) File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

slowmistio avatar Mar 20 '20 11:03 slowmistio

Wow... same issue with the latest version of Ubuntu (the other machine I just tried on) this is weird since you are telling me on your side everything is OK ;/

Just tested the script today on a new machine and it still works. Not sure what's going on with your machines.

[+] Successfuly logged in [*] Parsing page: 1 Traceback (most recent call last): File "zoomeye.py", line 237, in main() File "zoomeye.py", line 227, in main getResult() File "zoomeye.py", line 188, in getResult getPage(currentPage) File "zoomeye.py", line 135, in getPage response = json.loads(SEARCH.text) File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

To me this looks like an issue with ZoomEye's API. Does it work if you try it now?

adcar avatar Aug 30 '21 19:08 adcar

I have a similar problem, thinks for a very long time and gives an error. zoomeye.py -p 1 -q title:WordPress -s file.txt ←[94m[] All IPs will be saved to file.txt ←[94m[] Logging in as mail.com@******** access token: {"access_token": "eyJhbGciOiJIUzI1NiInR5cCI6IkpXVCJ9.eyJpZGVudGl0eSI6InJtYW5zeXMuY2 jY2MjM3NTAyLCJleHAiOjE2NjYyODA3MDJ9.yZg7O7Ib0IQ1rRhlRbJM0i5vE59-j47YtpDuWHvQM"} ←[32m[+] Successfuly logged in Traceback (most recent call last): File "zoomeye.py", line 235, in main() File "zoomeye.py", line 225, in main getResult() File "zoomeye.py", line 186, in getResult getPage(currentPage) File "zoomeye.py", line 133, in getPage response = json.loads(SEARCH.text) File "C:\Python38\lib\json_init_.py", line 357, in loads return _default_decoder.decode(s) File "C:\Python38\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Python38\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Tried both on Windows and on Linux, the problem is the same!

romanioui avatar Oct 20 '22 04:10 romanioui

maybe you need to add some check

FIX ?

romanioui avatar Oct 20 '22 04:10 romanioui

Hi @romanioui, this is an old script and the ZoomEye API likey changed. I'd recommend looking for an alternative to this script if you can find one, but I'll look into this within the next 24hrs or so. If you're able to fix the issue with a code change in the meantime please submit a PR. Also, if you find an alternative please let me know so I can link to it on the Readme

adcar avatar Oct 20 '22 04:10 adcar

there is no alternative I don't know. before entering the site, the confirmation window did not pop up, I think this is the problem, that the script cannot jump over it.

romanioui avatar Oct 20 '22 05:10 romanioui

Hi @romanioui, sorry about the delay. I just re-downloaded this script on my Manjaro Linux machine with Python 3.10.7 installed and ran your command with no issues.

python zoomeye.py -p 1 -q title:WordPress -s file.txt

[*] All IPs will be saved to file.txt
[*] Logging in as ********@gmail.com
access token: {"access_token": "*****"}
[+] Successfuly logged in
...
[+] 20 IPs saved to file.txt

Both my script and Zoomeye's API can be buggy. Do you mind trying again? It's possible their API was just having some issues.

adcar avatar Oct 27 '22 22:10 adcar

Ohhhh. Thanks. This version also works for me. tell me how to correctly compose a request to parse the country and port

romanioui avatar Nov 02 '22 02:11 romanioui

I'm not sure what you mean. --port will give you port numbers in results if that's what you're looking for.

adcar avatar Nov 02 '22 03:11 adcar

No, I'm interested in how to add. title:"WordPress" +country:"US" +port:"8080" nothing comes out.

romanioui avatar Nov 02 '22 04:11 romanioui

You might need to put the -q command in single quotes. So for example

python zoomeye.py -p 1 -q 'country:"US" port:8080'

Or do the inverse and use single quotes. I haven't tested that command. Also, it looks like the port number shouldn't be in quotes: ZoomEye Search Docs

adcar avatar Nov 03 '22 01:11 adcar