Skip to content

Update linkedin2username.py to fix a few index out of bounds issues#75

Closed
pwnf wants to merge 1 commit into
initstring:masterfrom
pwnf:master
Closed

Update linkedin2username.py to fix a few index out of bounds issues#75
pwnf wants to merge 1 commit into
initstring:masterfrom
pwnf:master

Conversation

@pwnf
Copy link
Copy Markdown

@pwnf pwnf commented Nov 28, 2023

It appears linkedin2username.py wasn't handling a few cases where a first or last name didn't exist causing index out of bounds. This includes generating lists for 'f_last', 'f_dot_last', 'first_l', 'last_f'. I've hacked pull request together that gets the script to run again but the logic may be borked in some of my changes as I just wanted to get it running for some enumeration asap.

It appears linkedin2username.py wasn't handling a few cases where a first or last name didn't exist causing index out of bounds. This includes generating lists for 'f_last', 'f_dot_last', 'first_l', 'last_f'. I've hacked pull request together that gets the script to run again but the logic may be borked in some of my changes as I just wanted to get it running for some enumeration asap.
@initstring
Copy link
Copy Markdown
Owner

Thanks for bringing this to my attention, @pwnf!

I need to look deeper, but I think we don't want to progress any usernames that don't have a first and last name. So we'd want to catch it earlier than those specific functions.

Or do the names still mutate into a probable username?

@initstring
Copy link
Copy Markdown
Owner

Heads up, you might want to check the logic in your functions, too. The tests are failing, indicating it is no longer parsing names correctly: https://github.com/initstring/linkedin2username/actions/runs/7014144213/job/19081459027?pr=75

@initstring initstring self-assigned this Nov 28, 2023
@pwnf
Copy link
Copy Markdown
Author

pwnf commented Nov 28, 2023

Right ok, I just needed to get something with reasonable accuracy running to do some enumeration at work :D. It probably makes sense to catch earlier.. as I said, hacky changes. Thanks for maintaining the tool though! its been very handy over the years. If I get some free time and you don't beat me to it ill look at opening a better pull request. Happy for you to decline this one but as it stands the main branch is borked.. I tried a few different companies and always had at least one offending employee name.

@initstring
Copy link
Copy Markdown
Owner

I understand. Thanks again! Maintaining this tool is a moving target, and without reports like yours I would not know it's broken.

Much appreciated. :)

@initstring
Copy link
Copy Markdown
Owner

initstring commented Nov 28, 2023

Hi @pwnf - I think I fixed the problem here. Would you mind letting me know if that branch works for you?

Thanks!!!

@pwnf
Copy link
Copy Markdown
Author

pwnf commented Nov 28, 2023

image
Unfortunately it looks like that branch doesn't work.

@initstring
Copy link
Copy Markdown
Owner

Unfortunately it looks like that branch doesn't work.

That's strange. The changes shouldn't have any effect on the HTTP response codes. The branch is working ok here... could you try again, to make sure it isn't some connection issue?

@initstring
Copy link
Copy Markdown
Owner

Just to make sure you're on the right branch, it should be:

git fetch
git pull
git checkout name-keyerrors

@pwnf
Copy link
Copy Markdown
Author

pwnf commented Nov 28, 2023

I did the following assuming it would achieve the same:
git fetch --all
git checkout 2f13902

ill try yours and try again.

@pwnf
Copy link
Copy Markdown
Author

pwnf commented Nov 28, 2023

It stated 'Already up to date' when copying your git instructions and re-running linkedin2username.py had the same outcome.

@initstring
Copy link
Copy Markdown
Owner

OK, thanks for checking. That is bizarre, as yours is now failing inside a function that is unchanged in that branch. The changes are in a function that aren't even reached yet when your error surfaces.

Is your other branch still working ok?

@pwnf
Copy link
Copy Markdown
Author

pwnf commented Nov 28, 2023

No.. and oddly I don't know why.. I flicked over to python 3.11 with update alternatives earlier but ive tried 3.10 & 3.11 for both this branch and my own and neither are working.. But my LinkedIn account also seems fine..

@initstring
Copy link
Copy Markdown
Owner

Because I'm using an un-official API from LinkedIn, it's a bit of a black box. You can try proxying the requests and see if the error on the 400 has any more info.

It could be anything - maybe even LinkedIn blocking your account.

I'm going to close this PR and merge the other - feel free to open another issue specific to the 400 you're getting.

Thanks again for your help.

@initstring initstring closed this Nov 28, 2023
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.

2 participants