├── requirements.txt ├── __pycache__ └── jokes.cpython-36.pyc ├── .github ├── dependabot.yml └── workflows │ └── codeql-analysis.yml ├── LICENSE ├── jokes.py ├── script.py └── README.md /requirements.txt: -------------------------------------------------------------------------------- 1 | selenium 2 | requests 3 | -------------------------------------------------------------------------------- /__pycache__/jokes.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/holps-7/Instagram-Spam-Bot/HEAD/__pycache__/jokes.cpython-36.pyc -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "pip3" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Ramesh Sachan 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 | -------------------------------------------------------------------------------- /jokes.py: -------------------------------------------------------------------------------- 1 | #------randome joke functions using different APIs 2 | import requests 3 | import random 4 | def geeks(): 5 | url = "https://geek-jokes.sameerkumar.website/api" 6 | resp = requests.get(url) 7 | resp.encoding = "utf-8" 8 | data = resp.json() 9 | return (data) 10 | 11 | def chuck_norris(): 12 | url = "https://api.icndb.com/jokes/random" 13 | resp = requests.get(url) 14 | resp.encoding = "utf-8" 15 | data = resp.json() 16 | return (data["value"]["joke"]) 17 | 18 | def stormconsultancy_quotes(): 19 | url = "http://quotes.stormconsultancy.co.uk/random.json" 20 | resp = requests.get(url) 21 | resp.encoding = "utf-8" 22 | data = resp.json() 23 | return (data["quote"]) 24 | 25 | def cat_fact_quotes(): 26 | url = "https://cat-fact.herokuapp.com/facts/random" 27 | resp = requests.get(url) 28 | resp.encoding = "utf-8" 29 | data = resp.json() 30 | return (data["text"]) 31 | 32 | def get_msg(): 33 | x = random.randint(0,3) 34 | if(x == 0): 35 | return (geeks()) 36 | elif(x == 1): 37 | return (chuck_norris()) 38 | elif(x == 2): 39 | return (stormconsultancy_quotes()) 40 | elif(x == 3): 41 | return (cat_fact_quotes()) 42 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ master ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ master ] 20 | schedule: 21 | - cron: '43 11 * * 0' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | 28 | strategy: 29 | fail-fast: false 30 | matrix: 31 | language: [ 'python' ] 32 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] 33 | # Learn more: 34 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed 35 | 36 | steps: 37 | - name: Checkout repository 38 | uses: actions/checkout@v2 39 | 40 | # Initializes the CodeQL tools for scanning. 41 | - name: Initialize CodeQL 42 | uses: github/codeql-action/init@v1 43 | with: 44 | languages: ${{ matrix.language }} 45 | # If you wish to specify custom queries, you can do so here or in a config file. 46 | # By default, queries listed here will override any specified in a config file. 47 | # Prefix the list here with "+" to use these queries and those in the config file. 48 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 49 | 50 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 51 | # If this step fails, then you should remove it and run the build manually (see below) 52 | - name: Autobuild 53 | uses: github/codeql-action/autobuild@v1 54 | 55 | # ℹ️ Command-line programs to run using the OS shell. 56 | # 📚 https://git.io/JvXDl 57 | 58 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 59 | # and modify them (or add more) to build your code if your project 60 | # uses a compiled language 61 | 62 | #- run: | 63 | # make bootstrap 64 | # make release 65 | 66 | - name: Perform CodeQL Analysis 67 | uses: github/codeql-action/analyze@v1 68 | -------------------------------------------------------------------------------- /script.py: -------------------------------------------------------------------------------- 1 | #script.py 2 | from selenium import webdriver 3 | from selenium.webdriver.common.keys import Keys 4 | from time import sleep 5 | 6 | import jokes 7 | 8 | class InstaScript: 9 | def __init__(self, username, password, victim_username, number): 10 | self.username = username 11 | self.password = password 12 | self.victim_username = victim_username 13 | self.number = number 14 | self.browser = webdriver.Firefox() 15 | 16 | def login(self): 17 | browser = self.browser 18 | browser.implicitly_wait(5) 19 | 20 | #opening instagram.com 21 | browser.get('https://www.instagram.com/') 22 | #-------login process starts 23 | #finding input boxes for username and password and pasing the appropriate values 24 | browser.find_element_by_xpath("//input[@name='username']").send_keys(self.username) 25 | browser.find_element_by_xpath("//input[@name='password']").send_keys(self.password) 26 | #findind login button and clicking it 27 | browser.find_element_by_xpath("//button[@type='submit']").click() 28 | #-------login process ends 29 | 30 | def victim_profile(self): 31 | browser = self.browser 32 | browser.implicitly_wait(5) 33 | 34 | #Clicking "Not Now" in pop up just after login 35 | sleep(2.5) 36 | not_now_button = browser.find_element_by_xpath("//button[text()='Not Now']") 37 | sleep(1) 38 | not_now_button.click() 39 | 40 | 41 | #-------search for victim's username starts 42 | #click search bar 43 | browser.find_element_by_xpath("//span[text()='Search']").click() 44 | #enter victim's username and clicking Search 45 | browser.find_element_by_xpath("//input[@placeholder='Search']").send_keys(self.victim_username) 46 | sleep(1) 47 | #open victim's profile 48 | browser.find_element_by_xpath("//span[text()='"+self.victim_username+"']").click() 49 | sleep(2) 50 | #-------search for username stops 51 | 52 | def spamming(self): 53 | browser = self.browser 54 | browser.implicitly_wait(5) 55 | 56 | #-------spamming begins 57 | #click message buttom 58 | browser.find_element_by_xpath("//button[@type='button']").click() 59 | #input random messages 100 times 60 | message_area = browser.find_element_by_xpath("//textarea[@placeholder='Message...']") 61 | message_area.click() 62 | message_area.send_keys("Revenge, the sweetest morsel to the mouth that ever was cooked in hell.", Keys.ENTER) 63 | for _ in range(0, self.number): 64 | message_area = browser.find_element_by_xpath("//textarea[@placeholder='Message...']") 65 | message_area.click() 66 | message_area.send_keys(jokes.get_msg(), Keys.ENTER) 67 | 68 | browser.close() 69 | 70 | 71 | 72 | if __name__ == '__main__': 73 | Instagram_Spam_Bot = InstaScript('', '', '', ) 74 | Instagram_Spam_Bot.login() 75 | Instagram_Spam_Bot.victim_profile() 76 | Instagram_Spam_Bot.spamming() 77 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | ![](https://img.shields.io/badge/author-Ramesh%20Sachan-brightgreen) ![](https://img.shields.io/badge/licence-MIT-green) 4 | 5 |
6 | 7 | # Instagram-Spam-Bot! 8 | ### Coded by: [@holps-7](https://github.com/holps-7/Instagram-Spam-Bot/) 9 | ### Give me the credits if you copy ANY part from this code. Don't be NOOB!! 10 | ## Star this repo if you liked the project! 11 | 12 | A simple script that can be used for spamming someones Instagram DM with random jokes and quotes 13 | 14 | 15 | ## Getting Started 16 | 17 | These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. 18 | 19 | 20 | 21 | ### Prerequisites 22 | 23 | You will need the following for running this script-
24 | >1)Python3 installed in your system
25 | >2)Firefox web browser with Firefox webdriver
26 | >3)pip3
27 | >4)selenium
28 | >5)requests
29 | 30 | 31 | 32 | ### Installation Instructions 33 | 34 | #### 1) Installing Python3 35 | >Visit the following url for details on how to install Python 3 for various Operating systems https://realpython.com/installing-python/#step-1-download-the-python-3-installer 36 | 37 | 38 | #### 2) Installing Firefox 39 | ```elm 40 | cd 41 | sudo apt-get -y install firefox 42 | cd 43 | wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz 44 | tar xzf geckodriver-v0.26.0-linux64.tar.gz 45 | sudo mv geckodriver /usr/bin/geckodriver 46 | ``` 47 | ##### For Windows: 48 | 49 | >1. Install [Firefox](https://www.mozilla.org/en-US/firefox/new/)
50 | >2. Download -> 32bit - [geckodriver](https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-win32.zip), 64bit - [geckodriver](https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-win64.zip) - Download the zip folder and extract it
51 | >3. Add the file present in the extracted folder to the path
52 | 53 | To add the file to path, paste it here (at this location) ->
54 | `C: -> Users -> -> AppData -> Local -> Programs -> Python -> Python` 55 | 56 | 57 | 58 | #### 3) Installing pip3 59 | ```elm 60 | cd 61 | apt install python3-pip 62 | ``` 63 | 64 | 65 | #### 4) Installing Selenium and Requests 66 | ```elm 67 | cd 68 | pip3 install selenium 69 | pip3 install requests 70 | ``` 71 | or 72 | ```elm 73 | pip3 install -r requirements.txt 74 | ``` 75 | 76 | 77 | 78 | ### Break down into end to end tests 79 | 80 | This project is not any kind of extention of any other project 81 | 82 | 83 | 84 | ## Deployment 85 | 86 | >1. Clone the project
87 | >2. Follow the installation instructions
88 | >3. Open script.py file in any text editor
89 | >4. Now, in line 73 replace the following with your credentials, victim's username and number of messages to be send
90 | ```elm 91 | ('', '', '', ) 92 | ``` 93 | >6. Save the script.py file
94 | >7. Open terminal and run the following command
95 | ```elm 96 | cd Downloads/Instagram-Spam-Bot-master 97 | python3 script.py 98 | ``` 99 | 100 | PS:- I used Atom editor, which is one of the greatest editors. 101 | Availabe for free on https://atom.io 102 | 103 | ## Contributing 104 | 105 | Feel free to create Pull Requests, for contributing. 106 | 107 | 108 | ## Authors 109 | 110 | * **Ramesh Sachan** - Vellore Institute of Technology 111 | 112 | ## License 113 | 114 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details 115 | 116 | 117 | 118 | ## Legal disclaimer: 119 | 120 | **Usage of Instagram-Spam-Bot for attacking targets without prior mutual consent is illegal. It's the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program. Only use for educational purposes.** 121 | --------------------------------------------------------------------------------