initstring / linkedin2username

OSINT Tool: Generate username lists for companies on LinkedIn
MIT License
1.25k stars 185 forks source link

Can't log in #17

Closed OSINT007 closed 4 years ago

OSINT007 commented 4 years ago

Hello,

I've been getting this anytime I'm trying to log in. The manual is not at all very clear how to run the commands. I assume when I run python3 linkedin2username.py --username xxxxxxx -c xxxxx I put my own username and then when asked for the password I put my password. Well, I've been getting the following:

Password:

[*] Using version 0.16, which is the latest on GitHub.

[!] Some unknown error logging in. If this persists,please open an issue on github.

Any clues?

All help is appreciated!

initstring commented 4 years ago

Hello, and thank you very much for taking the time to open an issue!

LinkedIn is changing their site often, and this can sometimes break my tool. So I depend on folks opening issues when that happens.

I just tried the tool myself, though, and it is working perfectly.

We'll need more info to figure this out. Are you familiar with using an intercepting proxy like Burp or ZAP? If so, you can run the tool again with the --proxy argument to view the response returned by LinkedIn to the logon attempt. Any details you can provide on that would be helpful to troubleshoot.

KusuLeung commented 4 years ago

Hello, and thank you very much for taking the time to open an issue!

LinkedIn is changing their site often, and this can sometimes break my tool. So I depend on folks opening issues when that happens.

I just tried the tool myself, though, and it is working perfectly.

We'll need more info to figure this out. Are you familiar with using an intercepting proxy like Burp or ZAP? If so, you can run the tool again with the --proxy argument to view the response returned by LinkedIn to the logon attempt. Any details you can provide on that would be helpful to troubleshoot.

Login redirects a url reponse, the Location is
'/checkpoint/challenge/AgF4pNvujBS_tQAAAW7LgRTBk4sLJO1rYprPhiC9PM80q6ndbdXtASNwvsvtc0ziYA1iL2_xF0iRfYIUFh1YGEYdvOu8nA?ut=2Yz_e3YVJcEV01'

Is it a Man-machine calibration page?If so , how to avoid these situation? Thanks.

initstring commented 4 years ago

Great, thanks for this. Good info. In the past, I've seen the challenge come up with you're logging in from a dodgy location (like a VPN provider). Are you able to log in to LinkedIn via the web from the same IP address the linkedin2username tool is running from? I'll need to update the code to correctly parse this error. I'm just our on holidays for a bit and will try to get to it when I get back.

initstring commented 4 years ago

@KusuLeung Sorry, I just noticed your username is not the one that opened the issue. :) Are both accounts yours, or are these separate issues?

KusuLeung commented 4 years ago

@KusuLeung Sorry, I just noticed your username is not the one that opened the issue. :) Are both accounts yours, or are these separate issues?

Because I have the same notice. I guess we have faced a similar situation. Maybe it is not a separate issue.

KusuLeung commented 4 years ago

Great, thanks for this. Good info. In the past, I've seen the challenge come up with you're logging in from a dodgy location (like a VPN provider). Are you able to log in to LinkedIn via the web from the same IP address the linkedin2username tool is running from? I'll need to update the code to correctly parse this error. I'm just our on holidays for a bit and will try to get to it when I get back.

I can login Linkedin though browser from the same IP address without Man-machine calibration.

OSINT007 commented 4 years ago

I opened up the ticket. Yes, I can login from the same environment as the tool. Nothing pops out. Maybe I entered the credentials incorrectly in the py doc? I followed the instructions to the dot but nothing happened.

On Tue, Dec 3, 2019 at 8:12 PM KusuLeung notifications@github.com wrote:

@KusuLeung https://github.com/KusuLeung Sorry, I just noticed your username is not the one that opened the issue. :) Are both accounts yours, or are these separate issues?

Because I have the same notice. I guess we have faced a similar situation. Maybe it is not a separate issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/initstring/linkedin2username/issues/17?email_source=notifications&email_token=AMYDFEPVKENFLEZWHVQKH6LQW37WLA5CNFSM4JL5O4J2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF3LYUI#issuecomment-561429585, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMYDFEOEE5UDDBQ36TXHFRTQW37WLANCNFSM4JL5O4JQ .

hookabidoo commented 4 years ago

Hi, I got the same problems too. After awhile keep login, i got those errors: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 159, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw) File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 57, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/usr/lib/python3.7/socket.py", line 748, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 343, in _make_request self._validate_conn(conn) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 841, in _validate_conn conn.connect() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 301, in connect conn = self._new_conn() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 168, in _new_conn self, "Failed to establish a new connection: %s" % e) urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fb4e069d0d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 638, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 398, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.linkedin.com', port=443): Max retries exceeded with url: /uas/login (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fb4e069d0d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "./linkedin2username.py", line 693, in main() File "./linkedin2username.py", line 669, in main session = login(args) File "./linkedin2username.py", line 233, in login anon_response = session.get('https://www.linkedin.com/uas/login') File "/usr/lib/python3/dist-packages/requests/sessions.py", line 546, in get return self.request('GET', url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, **kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.linkedin.com', port=443): Max retries exceeded with url: /uas/login (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fb4e069d0d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

initstring commented 4 years ago

Thanks everyone. I can now replicate the issue. Looks like LinkedIn made some changes, and for some reason it took a while to catch up to everyone. I will try to find time this week to fix, but it may stay broken until next week. I'm just on holiday with family right now. :)

initstring commented 4 years ago

Turns out the master version was actually still working for me.

But I did notice a few changes on LinkedIn. Can you please try out the version here: https://github.com/initstring/linkedin2username/tree/dev and let me know if it solves your issue?

hookabidoo commented 4 years ago

Hi @initstring , thank you so much, the later version works like a charm for me! Just curious, what did u do to make it work =)?

initstring commented 4 years ago

Hi @hookabidoo

A few things. Basically, I used ZAP to proxy a legit login (using mobile browser user agent) and noticed that a new login URL is being used. So I updated both where the login data is POSTed to and where the CSRF token is pulled from.

Also I noticed that a few error checks (challenge and bad username/password) would no longer provide a specific error due to LinkedIn changing some stuff, so I fixed those as well.

initstring commented 4 years ago

Pushed fixes to master.

KusuLeung commented 4 years ago

Pushed fixes to master.

Thanks for bug fixes. It has already been run without Man-machine calibration .

initstring commented 4 years ago

Thanks everyone! Closing this now.