ilektrojohn / creepy

A geolocation OSINT tool. Offers geolocation information gathering through social networking platforms.
http://www.geocreepy.com
GNU General Public License v3.0
1.25k stars 303 forks source link

problem in authorization process #12

Closed ilektrojohn closed 13 years ago

ilektrojohn commented 13 years ago

Sent to me via email :

I'm having trouble with Creepy. The Windows installer finishes without error and the application opens in Win7 64-bit and WinXP 32. The problem is the application will not open the web page to authorize Twitter in both versions of Windows. The error from the log can be found below. Could you help out with this?

creepymap.exe.log

Traceback (most recent call last): File "creepymap.py", line 477, in button_authorize_twitter File "tweepy\auth.pyo", line 103, in get_authorization_url tweepy.error.TweepError: 'oauth_token'

Thank you for the assistance

dlynes commented 13 years ago

I'll second this as a problem in Ubuntu 10.04 as well:

dlynes@pronto:/usr/share/pyshared/creepy$ creepymap /usr/lib/pymodules/python2.6/flickrapi/init.py:45: DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5 Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/creepy/creepymap.py", line 514, in button_authorize_twitter url = self.oauth.get_authorization_url(True) File "/usr/local/lib/python2.6/dist-packages/tweepy-1.7.1-py2.6.egg/tweepy/auth.py", line 103, in get_authorization_url raise TweepError(e) tweepy.error.TweepError: HTTP Error 401: Unauthorized ^CTraceback (most recent call last): File "/usr/bin/creepymap", line 5, in c.main() File "/usr/lib/pymodules/python2.6/creepy/creepymap.py", line 1005, in main gtk.main()

dlynes commented 13 years ago

Fwiw, if launched from the applications menu (no console), it just acts like the 'Authorize Creepy' button doesn't do anything.

dlynes commented 13 years ago

I dove into the tweepy code for this (and wiresharked it), and it seems as though Twitter is not recognizing tweepy's credentials.

Here's the request to 199.59.149.230 (resolves locally to www4.twitter.com): GET /oauth/request_token HTTP/1.1 Accept-Encoding: identity Host: twitter.com Connection: close Authorization: OAuth realm="", oauth_nonce="50841128", oauth_timestamp="1308576680", oauth_consumer_key="nW9dRFaHXMXWucxeTWiC8Q", oauth_signature_method="HMAC-SHA1", oauth_version="1.0", oauth_signature="I88%2BhPuI44pVnMzKbzPavUURoMY%3D" User-Agent: Python-urllib/2.6

And here's the response from 199.59.149.230 (resolves locally to www4.twitter.com): HTTP/1.1 401 Unauthorized Date: Mon, 20 Jun 2011 17:30:44 GMT Server: hi Status: 401 Unauthorized X-Transaction: 1308591044-28205-30002 X-Frame-Options: SAMEORIGIN Last-Modified: Mon, 20 Jun 2011 17:30:44 GMT X-Runtime: 0.01166 Content-Type: text/html; charset=utf-8 Content-Length: 44 Pragma: no-cache X-Revision: DEV Expires: Tue, 31 Mar 1981 05:00:00 GMT Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0 X-MID: 1aee9adea5e0b7c88b355964ca5eb506c8105355 Set-Cookie: k=216.185.79.50.1308591044524011; path=/; expires=Mon, 27-Jun-11 17:30:44 GMT; domain=.twitter.com Set-Cookie: guest_id=130859104453461339; path=/; expires=Wed, 20 Jul 2011 17:30:44 GMT Set-Cookie: _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCLi3Gq4wAToHaWQiJTRkMzYwNDQ5YmNjYWU0%250AMWNiNDAyYTJlMGRjZjg0OTJlIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--94021f21a0c04a5e473ac26e45f265489c2be655; domain=.twitter.com; path=/; HttpOnly X-XSS-Protection: 1; mode=block Vary: Accept-Encoding Connection: close

ilektrojohn commented 13 years ago

Thank you very much for your feedback and the digging in . I won't have time to look into it until later tonight , but I'm pretty sure it has to do with your systems time. In the above example the request has an oauth timestap with value 1308576680 which is Mon, 20 Jun 2011 17:45:17 GMT and the response has Mon, 20 Jun 2011 17:30:44 GMT . I've had users with the same exact error before and it was due to wrong time on their machine, hence the oauth failure. Check this , and if it fails to resolve the problem , I'll look into it more later.

For the "button" issue , you mean that when clicking it, no browser is invoked ?

dlynes commented 13 years ago

Good catch on the date/time thing. I'll see what I can do to fix that.

Yes, no browser is invoked. However, I don't believe the browser gets invoked until after the oauth authentication has completed, anyways (based on my reading of the code).

ilektrojohn commented 13 years ago

Yeap, I had spent quite a few hours/days of early debugging before I realized the time issues with oAuth , and since then it is the first thing to come in mind.

Yes, it fails to get the authorization URL and the exception is thrown there , right before the call to invoke the web browser. Somebody called "insufficient error handling" ? :) I'll get down to it .

Let me know if fixing the time issue helps you overcome the authorization process issue after all

Cheers

dlynes commented 13 years ago

I figured out what it was. Time might be part of it, but it's not the only problem. My system time zone was set to UTC, but my desktop was set to UTC -4. That being said, it was probably using my system time zone, not the desktop time zone.

However, what I also found was that the twitter authorization process for this is a bit buggy. Sometimes it gets denied, sometimes it works. It's not a bug in creepymap, I don't think...I'm pretty sure it's a bug in twitter, itself.

Excalibur025 commented 12 years ago

So, I'm experiencing this same bug in Ubuntu 10.10 but I'm less savy with the code. How do I fix this?

luigimaldini commented 6 years ago

Good evening! Can you help me please? The plugin configuration file is working with twitter but when I search for a perso it gives me the error below:

DEBUG:2018-04-07 22:43:28,510 In twitter.py:56: Searching for Targets from Twitter Plugin. Search term is : cients390 DEBUG:2018-04-07 22:43:30,088 In twitter.py:62: Twitter returned 1 results ERROR:2018-04-07 22:43:30,088 In twitter.py:86: 'ascii' codec can't decode byte 0xe7 in position 10: ordinal not in range(128) ERROR:2018-04-07 22:43:30,088 In twitter.py:87: Error searching for targets in Twitter plugin.