├── Capture.JPG ├── Capture1.JPG ├── LICENSE ├── README.md ├── SECURITY.md ├── _config.yml ├── mail.py ├── run.bat ├── run.py └── run.sh /Capture.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitikeshd/LinkedInAutoConnectBot/24bd268f6f4f48b249101f7bb6d372f20f535bd0/Capture.JPG -------------------------------------------------------------------------------- /Capture1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitikeshd/LinkedInAutoConnectBot/24bd268f6f4f48b249101f7bb6d372f20f535bd0/Capture1.JPG -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 nitikeshd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Script Name: LinkedIn Auto Connect Bot With OTP Bypass
2 | OS Platform: Windows/Linux/Mac
3 | Coding Language: Python
4 | License: Free
5 | 6 | How to get Started? 7 | ``` 8 | Step 1: 9 | clone the repository: git clone https://github.com/nitikeshd/LinkedInAutoConnectBot.git 10 | 11 | Step 2: 12 | get inside the Folder: cd LinkedInAutoConnectBot 13 | 14 | Step 3: 15 | Open run.py file and change your LinkedIn Email Id and Password. (replace all *) 16 | 17 | Step 4: 18 | In run.py file, You need to put app username and password from browserstack.com. Once Done, Save it. (Replace all *) 19 | 20 | Step 5: 21 | In mail.py file, replace your emailid and password. Password should not be your general password. It should be the APP password. go to this link to generate App password: https://myaccount.google.com/security 22 | 23 | Step 6: 24 | Once all changes are done, you can schedule it to run for everyday at a specified time. In Windows, you can use task Scheduler. Or in Linux, you can use cron jobs. 25 | ``` 26 | If you still have any issues, create one issue in https://github.com/nitikeshd/LinkedInAutoConnectBot 27 | I will reply back as soon as possible. 28 | 29 | Thank you ✌ 30 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | We are currently using v1.1.1 for LinkedInAutoConnectBot. 6 | 7 | | Version | Supported | 8 | | ------- | ------------------ | 9 | | 1.0.0 | :white_check_mark: | 10 | | 1.0.1 | :x: | 11 | | 1.1.1 | :white_check_mark: | 12 | | < 1.0 | :x: | 13 | 14 | ## Reporting a Vulnerability 15 | 16 | Any Vulnerabilities or issues reported by the Candidates will be highly appreciated and greatly awarded. 17 | 18 | 19 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /mail.py: -------------------------------------------------------------------------------- 1 | # Importing libraries 2 | import imaplib, email 3 | 4 | #Put your Gmail Email here. (Replace YOUR_GMAIL_EMAILID with youremailid@gmail.com) 5 | user = 'YOUR_GMAIL_EMAILID' 6 | password = 'YOUR_APP_PASSWORD' #Get this app password from https://myaccount.google.com/security 7 | imap_url = 'imap.gmail.com' 8 | class mail: 9 | def __init__(self): 10 | pass 11 | # Function to get email content part i.e its body part 12 | def get_body(self,msg): 13 | if msg.is_multipart(): 14 | return self.get_body(msg.get_payload(0)) 15 | else: 16 | return msg.get_payload(None, True) 17 | 18 | # Function to search for a key value pair 19 | def search(self,key, value, con): 20 | result, data = con.search(None, key, '"{}"'.format(value)) 21 | return data 22 | 23 | # Function to get the list of emails under this label 24 | def get_emails(self,result_bytes,con): 25 | msgs = [] # all the email data are pushed inside an array 26 | for num in result_bytes[0].split(): 27 | typ, data = con.fetch(num, '(RFC822)') 28 | msgs.append(data) 29 | 30 | return msgs 31 | def getCode(self): 32 | con = imaplib.IMAP4_SSL(imap_url) 33 | con.login(user, password) 34 | con.select('Inbox') 35 | msgs = self.get_emails(self.search('FROM', 'security-noreply@linkedin.com', con),con) 36 | 37 | for sent in msgs[-1]: 38 | if type(sent) is tuple: 39 | content = str(sent[1], 'utf-8') 40 | content=content.split('Please use this verification code to complete your sign in: ')[1] 41 | code=content[0]+content[1]+content[2]+content[3]+content[4]+content[5] 42 | return code 43 | return 0 44 | 45 | #mail().getCode() 46 | #No need to run this code from here as it is being used in run.py 47 | 48 | -------------------------------------------------------------------------------- /run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | python run.py 3 | -------------------------------------------------------------------------------- /run.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | from selenium.webdriver.common.desired_capabilities import DesiredCapabilities 3 | import time 4 | from mail import mail 5 | 6 | #get it from browserstack.com 7 | def getDriver(): 8 | desired_cap = {'os': 'Windows', 'os_version': '10', 'browser': 'Chrome', 'browser_version': '57.0' } 9 | return webdriver.Remote(command_executor='http://*************:**************@hub.browserstack.com:80/wd/hub', desired_capabilities=desired_cap) 10 | def linkedinLogin(driver): 11 | driver.get('https://www.linkedin.com/login') 12 | username = driver.find_element_by_id("username") 13 | password = driver.find_element_by_id("password") 14 | username.send_keys("****YOUR_USERNAME*****") 15 | password.send_keys("****YOUR_PASSWORD*****") 16 | driver.find_element_by_tag_name("button").click() 17 | time.sleep(5) 18 | def checkOTP(driver): 19 | code=mail().getCode() 20 | try: 21 | pin=driver.find_element_by_name("pin") 22 | pin.send_keys(code) 23 | driver.find_element_by_id("email-pin-submit-button").click() 24 | except: 25 | pass 26 | finally: 27 | executeBot(driver) 28 | def executeBot(driver): 29 | driver.get('https://www.linkedin.com/mynetwork/') 30 | driver.execute_script('async function moreConnectionsPlease(){const n=600,o=15,e=300,t=10;var c,l=0,s=0;function i(){return[...document.querySelectorAll("button span")].filter(n=>n.textContent.includes("Connect"))}async function r(){return new Promise(o=>{setTimeout(()=>{window.scrollTo(0,document.body.scrollHeight),console.log("scroll!"),o()},n)})}async function a(n){return new Promise(o=>{setTimeout(()=>{n.click(),o()},e)})}async function u(){for(let n=0;n=c?(console.log("There are plenty of connections, time to click..."),await f()):(console.log("Out of connections, need to scroll..."),await u()),console.log(`New Connections:${l} Failed clicks:${s}`)}while(l<500)}moreConnectionsPlease();') 31 | 32 | driver = getDriver() 33 | #Step - 1 : Login 34 | linkedinLogin(driver) 35 | #Step 2 : Check OTP 36 | #checkOTP(driver) 37 | #Now Linked in has removed OTP Auth for some caseds. So use it at your own convinient. 38 | executeBot(driver) 39 | #Step 3 : Run BOT 40 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | python3 run.py --------------------------------------------------------------------------------