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

twitterdetails: account for private accounts #236

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KhasMek
Copy link

@KhasMek KhasMek commented Jan 19, 2018

The twitterdetails module will now check if the account is set to protected (aka private tweets) and skips trying to parse any tweet statistics. After some consideration, in this case I have decided to leave the error message in the json output. This will allow the (datasploit) user to easily determine that twitter account is actually protected, and not that the account hasn't posted any tweets to date.

Examples

Without Patch

Invoked Through DataSploit

...

[+] Getting information from Twitter

Traceback (most recent call last):
File "datasploit.py", line 112, in <module>
  main(sys.argv[1:])
File "datasploit.py", line 68, in main
  auto_select_target(single_input, output)
File "datasploit.py", line 107, in auto_select_target
  usernameOsint.run(target, output)
File "/opt/datasploit/usernameOsint.py", line 9, in run
  osint_runner.run("username", "username", username, output)
File "/opt/datasploit/osint_runner.py", line 28, in run
  data = x.main(m_input)
File "/opt/datasploit/username/username_twitterdetails.py", line 106, in main
  activitydetails, userdetails = twitterdetails(username)
File "/opt/datasploit/username/username_twitterdetails.py", line 65, in twitterdetails
  for tweet in tweepy.Cursor(api.user_timeline, id=username).items(1000):
File "/usr/local/lib/python2.7/dist-packages/tweepy/cursor.py", line 197, in next
  self.current_page = self.page_iterator.next()
File "/usr/local/lib/python2.7/dist-packages/tweepy/cursor.py", line 108, in next
  data = self.method(max_id=self.max_id, parser=RawParser(), *self.args, **self.kargs)
File "/usr/local/lib/python2.7/dist-packages/tweepy/binder.py", line 245, in _call
  return method.execute()
File "/usr/local/lib/python2.7/dist-packages/tweepy/binder.py", line 229, in execute
  raise TweepError(error_msg, resp, api_code=api_error_code)
tweepy.error.TweepError: Twitter error response: status code = 401

Invoked directly

➜  datasploit git:(twitterdetails) ✗ python username/username_twitterdetails.py XXXXX

[+] Getting information from Twitter

Twitter error response: status code = 401
Please provide a username as argument
➜  datasploit git:(twitterdetails) ✗ 

With Patch

Invoked Through DataSploit

...

[+] Getting information from Twitter

Verified Account: XXXXX
Time Zone: XXXXX
Language: XXXXX
Number of Tweets: XXXXX
Geolocation Enabled: XXXXX
Profile Description: 
User ID: XXXXX
Followers: XXXXX
Following: XXXXX
Profile Set Location: 
UTC Offset: XXXXX

[!] Account Set to Private

...

Invoked Directly

➜  datasploit git:(twitterdetails) ✗ python username/username_twitterdetails.py XXXXX

[+] Getting information from Twitter

Verified Account: XXXXX
Time Zone: XXXXX
Language: XXXXX
Number of Tweets: XXXXX
Geolocation Enabled: XXXXX
Profile Description: 
User ID: XXXXX
Followers: XXXXX
Following: XXXXX
Profile Set Location: 
UTC Offset: XXXXX

[!] Account Set to Private
➜  datasploit git:(twitterdetails) ✗ 

  twitterdetails will now check if the account is set to
  protected (aka private tweets) and skips trying to
  parse any tweet statistics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant