Update linkedin2username.py to fix a few index out of bounds issues#75
Update linkedin2username.py to fix a few index out of bounds issues#75pwnf wants to merge 1 commit into
Conversation
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.
|
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? |
|
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 |
|
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. |
|
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. :) |
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? |
|
Just to make sure you're on the right branch, it should be: |
|
I did the following assuming it would achieve the same: ill try yours and try again. |
|
It stated 'Already up to date' when copying your git instructions and re-running linkedin2username.py had the same outcome. |
|
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? |
|
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.. |
|
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. |

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.