ImpostorKeanu / peasant

LinkedIn reconnaissance tool
48 stars 8 forks source link

Failed to get company identifier #3

Open st1ckyb1t opened 4 years ago

st1ckyb1t commented 4 years ago

Hello,

I am receiving the below error when attempting to harvest contacts.

Command: python3 peasant.py h -c path\to\cookiebro-cookies.json --disable-logout -cns REDACTED -of REDACTED.csv

Result: [+] Starting new CSV file: REDACTED.csv [+] Authenticating session [+] Failed to get company identifier for REDACTED Continuing to next company [+] Getting initial profiles Traceback (most recent call last): File "peasant.py", line 85, in harvest_contacts(args,session,main_profiles) File "C:\Users\relax\Tools\peasant\Peasant\harvest.py", line 34, in harvest_contacts resp = session.getContactSearchResults(cid,0,10) UnboundLocalError: local variable 'cid' referenced before assignment

ImpostorKeanu commented 4 years ago

Are we certain that the company identifier is correct and that the cookies are currently valid? The following image illustrates which part of the URL represents the company ID, "microsoft" in this case.

image

Also, I saw your question about how to pass cookies at the command line. You can use a JSON file, as you've done here, or you can point the -c flag to a Firefox database containing valid cookies. Note

Example (Linux):

cp /home/archangel/.mozilla/firefox/zzzzzz.default/cookies.sqlite cookies.sqlite
python3 peasant.py h -c cookies.sqlite <additional arguments>

Edit: The sqlite file must be copied because Firefox will have it locked if a browser associated with the zzzzzz.default profile is running in memory.

st1ckyb1t commented 4 years ago

I just tested with microsoft as a baseline with the cookies argument and it worked fine. The company I am attempting to harvest is valid (pulled it from that /company/company-name path) however there is a dash in it, not sure if that is impacting the result?

ImpostorKeanu commented 4 years ago

I don't think so. Have you tried wrapping the company id in quotes? Perhaps argparse is clobbering the dash.

st1ckyb1t commented 4 years ago

Yeah I tried that as well, still no dice.

ImpostorKeanu commented 4 years ago

Interesting, I'll see if I can't dig up a company with dashes and see if I get get same behavior.

st1ckyb1t commented 4 years ago

I think I may have discovered something that may be causing the issue. I leveraged subaru-of-america as another example that you had previously used and it worked without any issues as well. Now the difference between that one and the organization I am currently testing is that the https://www.linkedin.com/company/subaru-of-america/ URI is valid. However, the organization I am testing redirects to https://www.linkedin.com/company/test-company/about/.

st1ckyb1t commented 4 years ago

Seems that is the case, if they redirect to the /about/ page it simply means there are no posts in their "Home" tab. I tested with another organization and received the same error.

ImpostorKeanu commented 4 years ago

Interesting. I've not observed that behavior. Can you share the identifier unrelated to your engagement with me so that I can work out the issue with a solid example?

st1ckyb1t commented 4 years ago

Here you go: bank-leumi https://www.linkedin.com/company/bank-leumi/about/

syrinxtech commented 1 year ago

I get the same exact error message when testing on my own company profile: syrinx-technologies-llc

I tried single and double quotes with no luck. Logged out and back into make sure cookies were good.