├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE ├── bastion.yml ├── issue_label_bot.yaml └── stale.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── main ├── banner.txt ├── body.txt ├── emailspam.py ├── gmail.txt ├── gmailpass.txt ├── recipientLists.txt └── subject.txt └── requirements.txt /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | Issue tracker is used for reporting bugs. 11 | 12 | 13 | 14 | ## Expected Behavior 15 | 16 | 17 | ## Current Behavior 18 | 19 | 20 | ## Possible Solution 21 | 22 | 23 | ## Steps to Reproduce 24 | 25 | 26 | 1. 27 | 2. 28 | 3. 29 | 4. 30 | 31 | ## Context (Environment) 32 | 33 | 34 | 35 | 36 | 37 | ## Detailed Description 38 | 39 | 40 | ## Possible Implementation 41 | 42 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE: -------------------------------------------------------------------------------- 1 | THIS PROJECT IS IN MAINTENANCE MODE. We accept pull-requests for Bug Fixes **ONLY**. NO NEW FEATURES ACCEPTED! 2 | 3 | 4 | 5 | ## Description 6 | 7 | 8 | ## Related Issue 9 | 10 | 11 | 12 | 13 | 14 | ## Motivation and Context 15 | 16 | 17 | 18 | ## How Has This Been Tested? 19 | 20 | 21 | 22 | 23 | ## Screenshots (if appropriate): 24 | -------------------------------------------------------------------------------- /.github/bastion.yml: -------------------------------------------------------------------------------- 1 | ## Invite Contributors to Organization ## 2 | 3 | inviteContributors: true 4 | 5 | 6 | ## Issue Welcome Comments ## 7 | 8 | # Comment to send on a user's first issue in the repository. 9 | firstIssueWelcomeComment: | 10 | Thank you for opening this issue. A maintainer will get by as soon as possible to address this issue. 11 | Since this is your first issue in this repository, please make sure follow the issue template and provide as much detail as possible. 12 | 13 | # Comment to send on the user's forthcoming issues in the repository. 14 | issueWelcomeComment: | 15 | Thank you for opening this issue. A maintainer will get by as soon as possible to address this issue. 16 | In the mean time, please check out our contributing guidelines to explore other ways you can get involved. 17 | 18 | 19 | ## Pull Request Welcome Comments ## 20 | 21 | # Comment to send on a user's first pull request in the repository. 22 | firstPullRequestWelcomeComment: | 23 | Thank you for opening this issue. A maintainer will get by as soon as possible to address this issue. 24 | Since this is your first issue in this repository, please make sure follow the issue template and provide as much detail as possible. 25 | 26 | # Comment to send on the user's forthcoming pull requests in the repository. 27 | pullRequestWelcomeComment: | 28 | Thank you for opening this issue. A maintainer will get by as soon as possible to address this issue. 29 | In the mean time, please check out our contributing guidelines to explore other ways you can get involved. 30 | -------------------------------------------------------------------------------- /.github/issue_label_bot.yaml: -------------------------------------------------------------------------------- 1 | label-alias: 2 | bug: 'bug' 3 | feature_request: 'enhancement' 4 | question: 'question' 5 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 60 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - security 9 | - documentation 10 | # Label to use when marking an issue as stale 11 | staleLabel: stale 12 | # Comment to post when marking an issue as stale. Set to `false` to disable 13 | markComment: > 14 | This issue has been automatically marked as stale because it has not had 15 | recent activity. It will be closed if no further activity occurs. Thank you 16 | for your contributions. 17 | # Comment to post when closing a stale issue. Set to `false` to disable 18 | closeComment: True 19 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Covenant Code of Conduct 3 | 4 | ## Our Pledge 5 | 6 | We as members, contributors, and leaders pledge to make participation in our 7 | community a harassment-free experience for everyone, regardless of age, body 8 | size, visible or invisible disability, ethnicity, sex characteristics, gender 9 | identity and expression, level of experience, education, socio-economic status, 10 | nationality, personal appearance, race, caste, color, religion, or sexual 11 | identity and orientation. 12 | 13 | We pledge to act and interact in ways that contribute to an open, welcoming, 14 | diverse, inclusive, and healthy community. 15 | 16 | ## Our Standards 17 | 18 | Examples of behavior that contributes to a positive environment for our 19 | community include: 20 | 21 | * Demonstrating empathy and kindness toward other people 22 | * Being respectful of differing opinions, viewpoints, and experiences 23 | * Giving and gracefully accepting constructive feedback 24 | * Accepting responsibility and apologizing to those affected by our mistakes, 25 | and learning from the experience 26 | * Focusing on what is best not just for us as individuals, but for the overall 27 | community 28 | 29 | Examples of unacceptable behavior include: 30 | 31 | * The use of sexualized language or imagery, and sexual attention or advances of 32 | any kind 33 | * Trolling, insulting or derogatory comments, and personal or political attacks 34 | * Public or private harassment 35 | * Publishing others' private information, such as a physical or email address, 36 | without their explicit permission 37 | * Other conduct which could reasonably be considered inappropriate in a 38 | professional setting 39 | 40 | ## Enforcement Responsibilities 41 | 42 | Community leaders are responsible for clarifying and enforcing our standards of 43 | acceptable behavior and will take appropriate and fair corrective action in 44 | response to any behavior that they deem inappropriate, threatening, offensive, 45 | or harmful. 46 | 47 | Community leaders have the right and responsibility to remove, edit, or reject 48 | comments, commits, code, wiki edits, issues, and other contributions that are 49 | not aligned to this Code of Conduct, and will communicate reasons for moderation 50 | decisions when appropriate. 51 | 52 | ## Scope 53 | 54 | This Code of Conduct applies within all community spaces, and also applies when 55 | an individual is officially representing the community in public spaces. 56 | Examples of representing our community include using an official e-mail address, 57 | posting via an official social media account, or acting as an appointed 58 | representative at an online or offline event. 59 | 60 | ## Enforcement 61 | 62 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 63 | reported to the community leaders responsible for enforcement at 64 | [INSERT CONTACT METHOD]. 65 | All complaints will be reviewed and investigated promptly and fairly. 66 | 67 | All community leaders are obligated to respect the privacy and security of the 68 | reporter of any incident. 69 | 70 | ## Enforcement Guidelines 71 | 72 | Community leaders will follow these Community Impact Guidelines in determining 73 | the consequences for any action they deem in violation of this Code of Conduct: 74 | 75 | ### 1. Correction 76 | 77 | **Community Impact**: Use of inappropriate language or other behavior deemed 78 | unprofessional or unwelcome in the community. 79 | 80 | **Consequence**: A private, written warning from community leaders, providing 81 | clarity around the nature of the violation and an explanation of why the 82 | behavior was inappropriate. A public apology may be requested. 83 | 84 | ### 2. Warning 85 | 86 | **Community Impact**: A violation through a single incident or series of 87 | actions. 88 | 89 | **Consequence**: A warning with consequences for continued behavior. No 90 | interaction with the people involved, including unsolicited interaction with 91 | those enforcing the Code of Conduct, for a specified period of time. This 92 | includes avoiding interactions in community spaces as well as external channels 93 | like social media. Violating these terms may lead to a temporary or permanent 94 | ban. 95 | 96 | ### 3. Temporary Ban 97 | 98 | **Community Impact**: A serious violation of community standards, including 99 | sustained inappropriate behavior. 100 | 101 | **Consequence**: A temporary ban from any sort of interaction or public 102 | communication with the community for a specified period of time. No public or 103 | private interaction with the people involved, including unsolicited interaction 104 | with those enforcing the Code of Conduct, is allowed during this period. 105 | Violating these terms may lead to a permanent ban. 106 | 107 | ### 4. Permanent Ban 108 | 109 | **Community Impact**: Demonstrating a pattern of violation of community 110 | standards, including sustained inappropriate behavior, harassment of an 111 | individual, or aggression toward or disparagement of classes of individuals. 112 | 113 | **Consequence**: A permanent ban from any sort of public interaction within the 114 | community. 115 | 116 | ## Attribution 117 | 118 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 119 | version 2.1, available at 120 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. 121 | 122 | Community Impact Guidelines were inspired by 123 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. 124 | 125 | For answers to common questions about this code of conduct, see the FAQ at 126 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at 127 | [https://www.contributor-covenant.org/translations][translations]. 128 | 129 | [homepage]: https://www.contributor-covenant.org 130 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html 131 | [Mozilla CoC]: https://github.com/mozilla/diversity 132 | [FAQ]: https://www.contributor-covenant.org/faq 133 | [translations]: https://www.contributor-covenant.org/translations 134 | 135 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | When contributing to this repository, please first discuss the change you wish to make via issue, 4 | email, or any other method with the owners of this repository before making a change. 5 | 6 | Please note we have a code of conduct, please follow it in all your interactions with the project. 7 | 8 | ## Pull Request Process 9 | 10 | 1. Ensure any install or build dependencies are removed before the end of the layer when doing a 11 | build. 12 | 2. Update the README.md with details of changes to the interface, this includes new environment 13 | variables, exposed ports, useful file locations and container parameters. 14 | 3. Increase the version numbers in any examples files and the README.md to the new version that this 15 | Pull Request would represent. 16 | 4. You may merge the Pull Request in once you have the sign-off of another developer, or if you 17 | do not have permission to do that, you may request the second reviewer to merge it for you. 18 | 19 | ## Code of Conduct 20 | 21 | ### Our Pledge 22 | 23 | In the interest of fostering an open and welcoming environment, we as 24 | contributors and maintainers pledge to making participation in our project and 25 | our community a harassment-free experience for everyone, regardless of age, body 26 | size, disability, ethnicity, gender identity and expression, level of experience, 27 | nationality, personal appearance, race, religion, or sexual identity and 28 | orientation. 29 | 30 | ### Our Standards 31 | 32 | Examples of behavior that contributes to creating a positive environment 33 | include: 34 | 35 | * Using welcoming and inclusive language 36 | * Being respectful of differing viewpoints and experiences 37 | * Gracefully accepting constructive criticism 38 | * Focusing on what is best for the community 39 | * Showing empathy towards other community members 40 | 41 | Examples of unacceptable behavior by participants include: 42 | 43 | * The use of sexualized language or imagery and unwelcome sexual attention or 44 | advances 45 | * Trolling, insulting/derogatory comments, and personal or political attacks 46 | * Public or private harassment 47 | * Publishing others' private information, such as a physical or electronic 48 | address, without explicit permission 49 | * Other conduct which could reasonably be considered inappropriate in a 50 | professional setting 51 | 52 | ### Our Responsibilities 53 | 54 | Project maintainers are responsible for clarifying the standards of acceptable 55 | behavior and are expected to take appropriate and fair corrective action in 56 | response to any instances of unacceptable behavior. 57 | 58 | Project maintainers have the right and responsibility to remove, edit, or 59 | reject comments, commits, code, wiki edits, issues, and other contributions 60 | that are not aligned to this Code of Conduct, or to ban temporarily or 61 | permanently any contributor for other behaviors that they deem inappropriate, 62 | threatening, offensive, or harmful. 63 | 64 | ### Scope 65 | 66 | This Code of Conduct applies both within project spaces and in public spaces 67 | when an individual is representing the project or its community. Examples of 68 | representing a project or community include using an official project e-mail 69 | address, posting via an official social media account, or acting as an appointed 70 | representative at an online or offline event. Representation of a project may be 71 | further defined and clarified by project maintainers. 72 | 73 | ### Enforcement 74 | 75 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 76 | reported by contacting the project team in an issue. All 77 | complaints will be reviewed and investigated and will result in a response that 78 | is deemed necessary and appropriate to the circumstances. The project team is 79 | obligated to maintain confidentiality with regard to the reporter of an incident. 80 | Further details of specific enforcement policies may be posted separately. 81 | 82 | Project maintainers who do not follow or enforce the Code of Conduct in good 83 | faith may face temporary or permanent repercussions as determined by other 84 | members of the project's leadership. 85 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Curioo 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 | ![GitHub](https://img.shields.io/github/license/curioo/emailpyspam) 2 | ![Build Status](https://img.shields.io/badge/Build-Passing-green) 3 | ![GitHub top language](https://img.shields.io/github/languages/top/curioo/emailpyspam) 4 | 5 | # EmailPySpam 6 | 7 | Python 3+ program to send emails to a list of users repetitively. 8 | 9 | **WARNING**: This project will be rewritten soon. Fork the repository if you wish to keep our current iteration of the program. Thanks! 10 | 11 | ## Getting Started 12 | 13 | These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. 14 | 15 | ### Prerequisites 16 | 17 | [Python 3+](https://www.python.org/downloads/) (made on python 3.8) 18 | 19 | ### Installing 20 | 21 | A step by step series of examples that tell you how to get a development env running 22 | #### Linux (Bash) 23 | Clone the repository 24 | 25 | ``` 26 | git clone https://github.com/Curioo/emailpyspam.git 27 | ``` 28 | 29 | Install required libraries 30 | 31 | ``` 32 | pip3 install -r requirements.txt 33 | ``` 34 | 35 | Navigate into main directory 36 | 37 | ``` 38 | cd emailspam/ 39 | ``` 40 | 41 | Navigate into sub-directory 42 | 43 | ``` 44 | cd main/ 45 | ``` 46 | 47 | Start the program 48 | 49 | ``` 50 | python3 emailspam.py 51 | ``` 52 | There is also a non interactive mode, you can see the options for running it in non interactive mode with 53 | ``` 54 | python3 emailspam.py -h 55 | ``` 56 | 57 | Which creates the following output 58 | 59 | ``` 60 | Usage: emailspam.py [options] 61 | 62 | Options: 63 | -h, --help show this help message and exit 64 | -i, --interactive this choice negates interactive mode 65 | -t TO_ADDRESS, --to=TO_ADDRESS 66 | the email address you are spamming e.x.: email@gmail 67 | (cannot contain .com) 68 | -f FROM_ADDRESS, --from=FROM_ADDRESS 69 | the email you are spamming from 70 | -d SENDSPEED, --interval=SENDSPEED 71 | the interval in seconds in which you want to send the 72 | emails 73 | -p PASSWORD, --password=PASSWORD 74 | the password for the email account you are spamming 75 | from 76 | -s SUBJECT, --subject=SUBJECT 77 | the subject of the email you want to spam 78 | -b BODY, --body=BODY the actual message inside the email you wish to spam 79 | -e RECIPIENTNUM, --num-of-emails=RECIPIENTNUM 80 | the number of email addresses you want to send from 81 | -n SEND, --num=SEND the number of emails you wish to send 82 | 83 | ``` 84 | ======= 85 | 86 | #### Windows (Command Prompt) 87 | Clone the repository 88 | 89 | ``` 90 | git clone https://github.com/Curioo/emailpyspam.git 91 | ``` 92 | 93 | Install required libraries 94 | 95 | ``` 96 | pip install -r requirements.txt 97 | ``` 98 | 99 | Navigate into main directory 100 | 101 | ``` 102 | cd emailspam/ 103 | ``` 104 | 105 | Navigate into sub-directory 106 | 107 | ``` 108 | cd main/ 109 | ``` 110 | 111 | Start the program 112 | 113 | ``` 114 | python emailspam 115 | ``` 116 | 117 | ## Usage 118 | 119 | You have the ability to use the program in two ways. 120 | * Simple 121 | * Type an email and password in at the beginning 122 | * Extended 123 | * Have the program access a list of emails and passwords to access once an email has been locked 124 | 125 | ## Screenshots 126 | 127 | Welcome message: 128 | 129 | 130 | ![Image of welcome message](https://i.imgur.com/G1X8r49.png) 131 | 132 | ## Built With 133 | 134 | * [Python](https://www.python.org) - The language used 135 | * [Atom](https://Atom.io) - Code editing 136 | 137 | ## Contributing 138 | 139 | Please read [CONTRIBUTING.md](https://github.com/Curioo/emailpyspam/blob/master/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us. 140 | 141 | ## Authors 142 | 143 | * **Max Spitzer** - *Initial work* - [Curioo](https://github.com/Curioo) 144 | * **Franco Aparicio** - *Main Contributor* - [NONAME1103](https://github.com/NONAME1103) 145 | * **Ethan Moore** - *Web Design and additional features* - [quarksrcool](https://github.com/quarksrcool) 146 | 147 | See also the list of [contributors](https://github.com/Curioo/emailpyspam/contributors) who participated in this project. 148 | 149 | ## License 150 | 151 | This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/Curioo/emailpyspam/blob/master/LICENSE) file for details 152 | -------------------------------------------------------------------------------- /main/banner.txt: -------------------------------------------------------------------------------- 1 | 2 | ______ _ _ _____ 3 | | ____| (_) | | / ____| 4 | | |__ _ __ ___ __ _ _ | | | (___ _ __ __ _ _ __ ___ 5 | | __| | '_ ` _ \ / _` | | | | | \___ \ | '_ \ / _` | | '_ ` _ \ 6 | | |____ | | | | | | | (_| | | | | | ____) | | |_) | | (_| | | | | | | | 7 | |______| |_| |_| |_| \__,_| |_| |_| |_____/ | .__/ \__,_| |_| |_| |_| 8 | Author: Max Spitzer | | Co-Author: Franco Aparicio 9 | |_| 10 | -------------------------------------------------------------------------------- /main/body.txt: -------------------------------------------------------------------------------- 1 | insert_your_body_here 2 | -------------------------------------------------------------------------------- /main/emailspam.py: -------------------------------------------------------------------------------- 1 | # Import statements 2 | import smtplib 3 | from email.message import EmailMessage 4 | import random 5 | import time 6 | import getpass 7 | import sys 8 | import os 9 | import optparse 10 | 11 | try: 12 | from tabulate import tabulate 13 | except ModuleNotFoundError: 14 | table = False 15 | else: 16 | table = True 17 | try: 18 | from tqdm import tqdm 19 | except ModuleNotFoundError: 20 | loadingBar = False 21 | else: 22 | loadingBar = True 23 | 24 | # Colour Scheme 25 | 26 | class bcolors: 27 | HEADER = '\033[95m' 28 | OKBLUE = '\033[94m' 29 | OKGREEN = '\033[92m' 30 | WARNING = '\033[93m' 31 | FAIL = '\033[91m' 32 | ENDC = '\033[0m' 33 | BOLD = '\033[1m' 34 | UNDERLINE = '\033[4m' 35 | #----- 36 | ITALIC = '\33[3m' 37 | URL = '\33[4m' 38 | BLINK = '\33[5m' 39 | BLINK2 = '\33[6m' 40 | SELECTED = '\33[7m' 41 | 42 | BLACK = '\33[30m' 43 | RED = '\33[31m' 44 | GREEN = '\33[32m' 45 | YELLOW = '\33[33m' 46 | BLUE = '\33[34m' 47 | VIOLET = '\33[35m' 48 | BEIGE = '\33[36m' 49 | WHITE = '\33[37m' 50 | 51 | BLACKBG = '\33[40m' 52 | REDBG = '\33[41m' 53 | GREENBG = '\33[42m' 54 | YELLOWBG = '\33[43m' 55 | BLUEBG = '\33[44m' 56 | VIOLETBG = '\33[45m' 57 | BEIGEBG = '\33[46m' 58 | WHITEBG = '\33[47m' 59 | 60 | GREY = '\33[90m' 61 | BEIGE2 = '\33[96m' 62 | WHITE2 = '\33[97m' 63 | 64 | GREYBG = '\33[100m' 65 | REDBG2 = '\33[101m' 66 | 67 | # Functions 68 | def resize(): 69 | cmdsize = os.get_terminal_size() 70 | num = 0 71 | col = "" 72 | lin = "" 73 | for c in range (len (cmdsize)): 74 | try: 75 | if cmdsize[c] == "=": 76 | num += 1 77 | int (cmdsize[c]) 78 | except ValueError: 79 | "Placeholder" 80 | else: 81 | if num == 1: 82 | col += str (cmdsize[c]) 83 | else: 84 | lin += str (cmdsize[c]) 85 | if sys.platform.startswith('win32'): 86 | if col < "123" or lin < "35": 87 | os.system('mode con:cols=123 lines=35') 88 | else: 89 | """if col < "123" or lin < "49": 90 | os.system("printf '\e[8;49;123t'")""" 91 | 92 | def banner(): 93 | if sys.platform.startswith('win32'): 94 | os.system('cls') 95 | else: 96 | os.system('clear') 97 | try: 98 | file1 = open('banner.txt', 'r') 99 | print(' ') 100 | print(bcolors.OKGREEN + file1.read() + bcolors.ENDC) 101 | file1.close() 102 | except IOError: 103 | print( bcolors.FAIL + 'Banner File not found!' + bcolors.ENDC) 104 | 105 | def validChoice(ch): 106 | valid = False 107 | while not valid: 108 | if ch == "1" or ch == "2" or ch == "3" or ch == "#": 109 | valid = True 110 | else: 111 | print (bcolors.FAIL + "Invalid choice!" + bcolors.ENDC) 112 | time.sleep(0.5) 113 | ch = input(bcolors.FAIL + "Enter a valid choice: " + bcolors.ENDC) 114 | return ch 115 | 116 | def validMultiple(mult): 117 | valid = False 118 | while not valid: 119 | if mult == "1" or mult.upper() == "YES" or mult == "2" or mult.upper() == "NO": 120 | valid = True 121 | else: 122 | print (bcolors.FAIL + "Invalid choice!" + bcolors.ENDC) 123 | time.sleep(0.5) 124 | mult = input(bcolors.FAIL + "Enter a valid choice: " + bcolors.ENDC) 125 | return mult 126 | 127 | def validRecipientNum(to_addr,recipientNum): 128 | valid = False 129 | while not valid: 130 | message = False 131 | if 0 < recipientNum <= 500: 132 | valid = True 133 | else: 134 | message = True 135 | if message: 136 | print (bcolors.FAIL + "Invalid number of recipients! You must start over.\n" + bcolors.ENDC) 137 | time.sleep(0.5) 138 | to_addr = [] 139 | addr = "" 140 | number = random.randint(0, 10000) 141 | while True: 142 | addr = input(bcolors.OKGREEN + "Type in the recipient(s), hit enter to finish (or \"#\" to use a predefined recipient list): " + bcolors.ENDC) 143 | if addr == "#": 144 | recipients = listSelector(recipientLists) 145 | if recipients != "normal": 146 | to_addr = recipients 147 | break 148 | elif not addr: 149 | save = input (bcolors.OKGREEN + "\nDo you want to save these recipients to a new recipient list? (Y/N): " + bcolors.ENDC) 150 | if save.upper() == "Y": 151 | nameList = input (bcolors.OKGREEN + "\nName of new list: " + bcolors.ENDC) 152 | if nameList in recipientLists: 153 | print (bcolors.FAIL + "\nList already exists!\n" + bcolors.ENDC) 154 | else: 155 | print ("\n" + bcolors.OKGREEN + nameList + ":",end = " ") 156 | print (to_addr) 157 | print ("" + bcolors.ENDC,end = "") 158 | sure = input(bcolors.REDBG + "\nAre you sure? (Y/N): " + bcolors.ENDC) 159 | if sure.upper() == "Y": 160 | recipientLists[nameList] = to_addr 161 | saveRescipientLists() 162 | break 163 | else: 164 | to_addr.append(addr) 165 | return to_addr,recipientNum 166 | 167 | def validSend(send,multiple,recipientNum): 168 | valid = False 169 | while not valid: 170 | message = False 171 | try: 172 | int (send) 173 | except ValueError: 174 | message = True 175 | else: 176 | send = int (send) 177 | if send > 0: 178 | if send < 500: 179 | valid = True 180 | else: 181 | message = True 182 | else: 183 | message = True 184 | if message: 185 | print (bcolors.FAIL + "Invalid amount!" + bcolors.ENDC) 186 | time.sleep(0.5) 187 | send = input(bcolors.FAIL + "Enter the number of emails you want to send: " + bcolors.ENDC) 188 | valid = False 189 | return send 190 | 191 | def validSpeed(s): 192 | valid = False 193 | while not valid: 194 | try: 195 | float (s) 196 | except ValueError: 197 | print (bcolors.FAIL + "Invalid number for speed!" + bcolors.ENDC) 198 | time.sleep(0.5) 199 | s = input(bcolors.FAIL + "At what interval should the emails get sent out? (seconds): " + bcolors.ENDC) 200 | else: 201 | s = float (s) 202 | valid = True 203 | return s 204 | 205 | def validGmail(from_addr,cipher): 206 | server = smtplib.SMTP('smtp.gmail.com', 587) 207 | # Start TLS for security 208 | server.starttls() 209 | try: 210 | server.login(from_addr, cipher) 211 | server.quit() 212 | except smtplib.SMTPAuthenticationError: 213 | print(bcolors.FAIL + "\nThe email / password you have entered is incorrect\nor access to less secure apps is disabled! Try again" + bcolors.ENDC) 214 | valid = False 215 | else: 216 | valid = True 217 | return valid 218 | 219 | def resetAllLists(): 220 | global recipientLists 221 | try: 222 | while ("recipientLists.txt"): 223 | os.remove ("recipientLists.txt") 224 | except FileNotFoundError: 225 | print (bcolors.WARNING + "\nLists successfully deleted" + bcolors.ENDC) 226 | recipientLists = {} 227 | saveRescipientLists() 228 | 229 | def saveRescipientLists(): 230 | f = open ("recipientLists.txt", "w") 231 | for thing in range (len (sorted (recipientLists))): 232 | f.write (sorted (recipientLists)[thing] + ":") 233 | for things in range (len (recipientLists[sorted (recipientLists)[thing]])): 234 | f.write (recipientLists[sorted (recipientLists)[thing]][things] + ":") 235 | f.write ("\n") 236 | f.close() 237 | 238 | def recipientEditor(recipientLists): 239 | print(bcolors.WARNING + ''' 240 | Choose an Option: 241 | 1) Add a list of recipients 242 | 2) Edit list of recipients 243 | 3) Delete a list of recipients 244 | 4) View all lists 245 | 5) Quit recipient editor 246 | #) Delete all saved lists 247 | ''' + bcolors.ENDC + '--------------------------------------------------------------') 248 | option = input(bcolors.OKGREEN + '\nNumber: ' + bcolors.ENDC) 249 | 250 | while option != "5": 251 | if option == "1": 252 | nameList = input(bcolors.OKGREEN + "\nName of new list: " + bcolors.ENDC) 253 | if nameList in recipientLists: 254 | print (bcolors.FAIL + "\nList already exists!\n" + bcolors.ENDC) 255 | else: 256 | rList = [] 257 | while True: 258 | entry = input(bcolors.OKGREEN + "Type in the recipient(s), hit enter to finish: " + bcolors.ENDC) 259 | if not entry: 260 | break 261 | else: 262 | rList.append(entry) 263 | print ("\n" + bcolors.OKGREEN + nameList + ":",end = " ") 264 | print (rList) 265 | print ("" + bcolors.ENDC,end = "") 266 | sure = input(bcolors.REDBG + "\nAre you sure? (Y/N): " + bcolors.ENDC) 267 | if sure.upper() == "Y": 268 | recipientLists[nameList] = rList 269 | saveRescipientLists() 270 | else: 271 | break 272 | elif option == "2": 273 | if len (recipientLists) == 0: 274 | print (bcolors.FAIL + "\nYou don't have any saved lists yet!\n" + bcolors.ENDC) 275 | else: 276 | wantEdit = input(bcolors.OKGREEN + '\nEnter the name of the list you would like to edit: ' + bcolors.ENDC) 277 | if wantEdit not in recipientLists: 278 | print (bcolors.FAIL + "\nList not found!\n" + bcolors.ENDC) 279 | else: 280 | print ("\n" + bcolors.OKGREEN + wantEdit + ":",end = " ") 281 | print (recipientLists[wantEdit]) 282 | print ("" + bcolors.ENDC,end = "") 283 | print(bcolors.WARNING + ''' 284 | Choose an Option: 285 | 1) Add a recipient 286 | 2) Delete a recipient 287 | 3) Exit 288 | ''' + bcolors.ENDC + '--------------------------------------------------------------') 289 | opt = input (bcolors.OKGREEN + "\nNumber: " + bcolors.ENDC) 290 | while opt != "3": 291 | if opt == "1": 292 | edit = input (bcolors.OKGREEN + "\nEnter new recipient: " + bcolors.ENDC) 293 | rlist = recipientLists[wantEdit] 294 | if edit in rlist: 295 | print (bcolors.FAIL + "\nRecipient already in list!\n" + bcolors.ENDC) 296 | else: 297 | rlist.append (edit) 298 | recipientLists[wantEdit] = rlist 299 | print (bcolors.OKGREEN + '\nCurrent list:\n') 300 | print (recipientLists[wantEdit]) 301 | print ("" + bcolors.ENDC,end = "") 302 | saveRescipientLists() 303 | elif opt == "2": 304 | if len (recipientLists[wantEdit]) == 0: 305 | print (bcolors.FAIL + "\nYou don't have any recipients in this list yet!\n" + bcolors.ENDC) 306 | else: 307 | edit = input (bcolors.OKGREEN + "\nEnter recipient you wish to delete: " + bcolors.ENDC) 308 | rlist = recipientLists[wantEdit] 309 | if edit not in rlist: 310 | print (bcolors.FAIL + "\nRecipient not found!\n" + bcolors.ENDC) 311 | else: 312 | rlist.remove (edit) 313 | recipientLists[wantEdit] = rlist 314 | print (bcolors.OKGREEN + '\nCurrent list:\n') 315 | print (recipientLists[wantEdit]) 316 | print ("" + bcolors.ENDC,end = "") 317 | saveRescipientLists() 318 | else: 319 | print (bcolors.FAIL + "\nInvaid choice!\n" + bcolors.ENDC) 320 | print(bcolors.WARNING + ''' 321 | Choose an Option: 322 | 1) Add a recipient 323 | 2) Delete a recipient 324 | 3) Exit 325 | ''' + bcolors.ENDC + '--------------------------------------------------------------') 326 | opt = input (bcolors.OKGREEN + "\nNumber: " + bcolors.ENDC) 327 | elif option == "3": 328 | if len (recipientLists) == 0: 329 | print (bcolors.FAIL + "\nYou don't have any saved lists yet!\n" + bcolors.ENDC) 330 | else: 331 | wantDel = input (bcolors.OKGREEN + "\nEnter the name of the list you would like to delete: " + bcolors.ENDC) 332 | if wantDel not in recipientLists: 333 | print (bcolors.FAIL + "\nList not found" + bcolors.ENDC) 334 | else: 335 | print ("\n" + bcolors.OKGREEN + wantDel + ":",end = " ") 336 | print (recipientLists[wantDel]) 337 | print ("" + bcolors.ENDC,end = "") 338 | print (bcolors.REDBG + "\nAre you sure? (Y/N):" + bcolors.ENDC, end = " ") 339 | sure = input () 340 | if sure.upper() == "Y": 341 | del recipientLists[wantDel] 342 | saveRescipientLists() 343 | else: 344 | break 345 | elif option == "4": 346 | if len (recipientLists) == 0: 347 | print (bcolors.FAIL + "\nYou don't have any saved lists yet!\n" + bcolors.ENDC) 348 | else: 349 | keys = sorted (recipientLists) 350 | for list in range (len (keys)): 351 | print ("") 352 | k = keys[list] 353 | print (bcolors.OKGREEN + k,"\n-",end = "" ) 354 | print (("-")*len (k),end = "") 355 | print ("-" + bcolors.ENDC) 356 | for entry in range (len (recipientLists[k])): 357 | print (bcolors.OKGREEN + recipientLists[k][entry] + bcolors.ENDC) 358 | time.sleep(1.5) 359 | elif option == "#": 360 | print (bcolors.REDBG + "\nAre you sure? (Y/N):" + bcolors.ENDC, end = " ") 361 | sure = input () 362 | if sure.upper() == "Y": 363 | resetAllLists() 364 | recipientLists = {} 365 | else: 366 | print (bcolors.FAIL + "\nInvaid choice!\n" + bcolors.ENDC) 367 | time.sleep(0.5) 368 | print(bcolors.WARNING + ''' 369 | Choose an Option: 370 | 1) Add a list of recipients 371 | 2) Edit list of recipients 372 | 3) Delete a list of recipients 373 | 4) View all lists 374 | 5) Quit recipient editor 375 | #) Delete all saved lists 376 | ''' + bcolors.ENDC + '--------------------------------------------------------------') 377 | option = input(bcolors.OKGREEN + '\nNumber: ' + bcolors.ENDC) 378 | if sys.platform.startswith('win32'): 379 | os.system('cls') 380 | else: 381 | os.system('clear') 382 | banner() 383 | return recipientLists 384 | 385 | def listSelector(recipientLists): 386 | if len (recipientLists) == 0: 387 | print (bcolors.FAIL + "\nYou don't have any saved lists yet.\n" + bcolors.ENDC) 388 | openEditor = input (bcolors.GREEN + "Would you like to enter the recipient list editor? (Y/N): " + bcolors.ENDC) 389 | if openEditor.upper() == "Y": 390 | recipientLists = recipientEditor(recipientLists) 391 | Continue = True 392 | else: 393 | Continue = False 394 | else: 395 | Continue = True 396 | if Continue: 397 | wantUse = input (bcolors.OKGREEN + "\nEnter the name of the list you would like to use (or \"#\" to show all existing lists): " + bcolors.ENDC) 398 | while wantUse == "#": 399 | keys = sorted (recipientLists) 400 | for list in range (len (keys)): 401 | print ("") 402 | k = keys[list] 403 | print (bcolors.OKGREEN + k,"\n-",end = "" ) 404 | print (("-")*len (k),end = "") 405 | print ("-" + bcolors.ENDC) 406 | for entry in range (len (recipientLists[k])): 407 | print (bcolors.OKGREEN + recipientLists[k][entry] + bcolors.ENDC) 408 | wantUse = input (bcolors.OKGREEN + "\nEnter the name of the list you would like to use (or \"#\" to show all existing lists): " + bcolors.ENDC) 409 | if wantUse not in recipientLists: 410 | print (bcolors.FAIL + "\nList not found" + bcolors.ENDC) 411 | recipients = "normal" 412 | else: 413 | print ("\n" + bcolors.OKGREEN + wantUse + ":",end = " ") 414 | print (recipientLists[wantUse]) 415 | print ("" + bcolors.ENDC,end = "") 416 | print (bcolors.REDBG + "\nAre you sure? (Y/N):" + bcolors.ENDC, end = " ") 417 | sure = input () 418 | if sure.upper() == "Y": 419 | recipients = recipientLists[wantUse] 420 | else: 421 | recipients = "normal" 422 | else: 423 | recipients = "normal" 424 | return recipients 425 | 426 | # Choose Mail Service 427 | def mailChoice(): 428 | print(bcolors.WARNING + ''' 429 | Choose an Option: 430 | 1) Gmail Spammer 431 | 2) Yahoo Spammer 432 | 3) Outlook/Hotmail Spammer 433 | #) Recipients Editor 434 | ''' + bcolors.ENDC + '--------------------------------------------------------------') 435 | choice = input(bcolors.OKGREEN + '\nNumber: ' + bcolors.ENDC) 436 | return choice 437 | 438 | def legacy(): 439 | print(bcolors.FAIL + bcolors.BOLD + 'The development team has decided to depreciate this feature as we have run into too many errors with this mail service.' + bcolors.ENDC) 440 | print(bcolors.FAIL + bcolors.BOLD + "If you would like to try and fix the errors or test these mail services, do the following:"\ 441 | '\n • Refer to our "legacy" branch' + bcolors.ENDC, end = " (") 442 | print(bcolors.URL + "https://github.com/Curioo/emailpyspam/tree/legacy" + bcolors.ENDC, end = ")\n") 443 | print(bcolors.FAIL + bcolors.BOLD + ' • Access the original code for this service'\ 444 | '\n(• Submit a pull request)'+ bcolors.ENDC) 445 | time.sleep(1) 446 | sys.exit() 447 | 448 | # Gmail DISCLAIMER 449 | 450 | def gmailInstruct(): 451 | print(bcolors.FAIL + "\nNOTE: To send emails with Gmail, you need to enable less secure apps:\n" + bcolors.ENDC) 452 | print(bcolors.URL + "https://myaccount.google.com/lesssecureapps" + bcolors.ENDC) 453 | print(bcolors.FAIL + "\nDISCLAIMER: Gmail has a limit of 500 emails per day per account" + bcolors.ENDC) 454 | print(bcolors.WARNING + "The email limit can be surpassed by using multiple emails."\ 455 | "\nDo you wish to surpass the limit using multiple emails?"\ 456 | "\n(If so, emails and passwords must be predefined in gmail.txt and gmailpass.txt)"\ 457 | "\n1) Yes"\ 458 | "\n2) No"\ 459 | + bcolors.ENDC) 460 | multiple = input(bcolors.OKGREEN + '\nNumber: ' + bcolors.ENDC) 461 | return multiple 462 | 463 | # Surpass Limit with multiple emails (Gmail) 464 | 465 | def gMultiple(): 466 | global emailnum 467 | global passnum 468 | try: 469 | file = open("gmail.txt", "r") 470 | fileStuff = file.readline() 471 | gmail = fileStuff.split(",") 472 | emailnum += 1 473 | from_addr = gmail[emailnum] 474 | numOfSenders = len (gmail) 475 | if gmail[-1] == "\n" or gmail[-1] == "": 476 | numOfSenders -= 1 477 | file.close() 478 | except IOError: 479 | print (bcolors.FAIL + "gmail.txt not found! Exiting..." + bcolors.ENDC) 480 | sys.exit() 481 | try: 482 | passFile = open("gmailpass.txt", "r") 483 | passFileStuff = passFile.readline() 484 | passThing = passFileStuff.split(",") 485 | passnum += 1 486 | cipher = passThing[passnum] 487 | file.close() 488 | except IOError: 489 | print (bcolors.FAIL + "gmailpass.txt not found! Exiting..." + bcolors.ENDC) 490 | sys.exit() 491 | return from_addr,cipher,numOfSenders 492 | 493 | # Send with limits (Gmail) 494 | 495 | def gSingle(): 496 | valid = False 497 | while not valid: 498 | from_addr = input(bcolors.OKGREEN + 'Your Google Email: ' + bcolors.ENDC) 499 | cipher = getpass.getpass(bcolors.OKGREEN + 'Password (Note: Input is hidden):' + bcolors.ENDC) 500 | valid = validGmail(from_addr,cipher) 501 | numOfSenders = 1 502 | return from_addr,cipher,numOfSenders 503 | 504 | # Main structure (subject, body, etc.) 505 | 506 | def structure(recipientLists): 507 | to_addr = [] 508 | addr = "" 509 | number = random.randint(0, 10000) 510 | cnt = 0 511 | while True: 512 | if cnt == 0: 513 | addr = input(bcolors.OKGREEN + "Type in the recipient(s), hit enter to finish (or \"#\" to use a predefined recipient list): " + bcolors.ENDC) 514 | cnt += 1 515 | else: 516 | addr = input(bcolors.OKGREEN + "Type in the recipient(s), hit enter to finish: " + bcolors.ENDC) 517 | cnt += 1 518 | if addr == "#" and cnt == 1: 519 | recipients = listSelector(recipientLists) 520 | if recipients != "normal": 521 | to_addr = recipients 522 | break 523 | elif not addr: 524 | save = input (bcolors.OKGREEN + "\nDo you want to save these recipients to a new recipient list? (Y/N): " + bcolors.ENDC) 525 | if save.upper() == "Y": 526 | nameList = input (bcolors.OKGREEN + "\nName of new list: " + bcolors.ENDC) 527 | if nameList in recipientLists: 528 | print (bcolors.FAIL + "\nList already exists!\n" + bcolors.ENDC) 529 | else: 530 | print ("\n" + bcolors.OKGREEN + nameList + ":",end = " ") 531 | print (to_addr) 532 | print ("" + bcolors.ENDC,end = "") 533 | sure = input(bcolors.REDBG + "\nAre you sure? (Y/N): " + bcolors.ENDC) 534 | if sure.upper() == "Y": 535 | recipientLists[nameList] = to_addr 536 | saveRescipientLists() 537 | break 538 | else: 539 | to_addr.append(addr) 540 | recipientNum = len (to_addr) 541 | to_addr,recipientNum = validRecipientNum(to_addr,recipientNum) 542 | bcc = input(bcolors.OKGREEN + "Would you like recipients to not see other recipients (use BCC header)? (Y/N): " + bcolors.ENDC) 543 | if bcc.lower() == "y": 544 | bcc = "BCC" 545 | else: 546 | bcc = "To" 547 | limit = input(bcolors.OKGREEN + "Would you like to send a specific number of emails? (Y/N): " + bcolors.ENDC) 548 | if limit.lower() == "y": 549 | send = input(bcolors.FAIL + "Enter the number of emails you want to send: " + bcolors.ENDC) 550 | send = validSend(send,multiple,recipientNum) 551 | else: 552 | send = float ("inf") 553 | predef = input(bcolors.OKGREEN + 'Would you like to use the subject saved in subject.txt? (Y/N): ' + bcolors.ENDC) 554 | if predef.lower() == 'y': 555 | try: 556 | p_reader = open("subject.txt", 'r') 557 | subject = p_reader.readline() 558 | index = len(subject) - 1 559 | subject = subject[0:index] 560 | p_reader.close() 561 | length = len (subject) 562 | subject += ' (' + str(number) + ')' 563 | except IOError: 564 | print (bcolors.FAIL + "subject.txt not found! Exiting..." + bcolors.ENDC) 565 | sys.exit() 566 | else: 567 | subject = input(bcolors.OKGREEN + 'Subject: ' + bcolors.ENDC) 568 | length = len (subject) 569 | subject += ' (' + str(number) + ')' 570 | 571 | predef1 = input(bcolors.OKGREEN + 'Would you like to use the body saved in body.txt? (Y/N): ' + bcolors.ENDC) 572 | 573 | if predef1.lower() == 'y': 574 | try: 575 | f = open("body.txt", "r") 576 | body = f.read() 577 | f.close() 578 | except IOError: 579 | print (bcolors.FAIL + "body.txt not found! Exiting..." + bcolors.ENDC) 580 | sys.exit() 581 | else: 582 | body = input(bcolors.OKGREEN + 'Body: ' + bcolors.ENDC) 583 | speed = input(bcolors.FAIL + "At what interval should the emails get sent out? (seconds): " + bcolors.ENDC) 584 | speed = validSpeed(speed) 585 | 586 | print(bcolors.WARNING + "Emails will be sent continuously, until this window is closed." + bcolors.ENDC) 587 | time.sleep(1) 588 | return speed,to_addr,body,subject,length,recipientNum,send,bcc 589 | 590 | # Main Spammer (Gmail) 591 | 592 | def gmailSpam(speed,from_addr,to_addr,body,subject,length,cipher,bcc): 593 | global sent 594 | global Sent 595 | number = random.randint(0, 10000) 596 | subject = subject[0:length] + " (" + str(number) + ")" 597 | msg = EmailMessage() 598 | msg.add_header('From', from_addr) 599 | if bcc != "BCC": msg.add_header('To', ', '.join(to_addr)) 600 | msg.add_header('Subject', subject) 601 | msg.set_payload(body) 602 | # Connect 603 | server = smtplib.SMTP('smtp.gmail.com', 587) 604 | # Start TLS for security 605 | server.starttls() 606 | try: 607 | server.login(from_addr, cipher) 608 | server.send_message(msg, from_addr = from_addr, to_addrs = to_addr) 609 | server.quit() 610 | sent += (1) 611 | Sent += (1) 612 | time.sleep(speed) 613 | except smtplib.SMTPAuthenticationError: 614 | print(bcolors.FAIL + "\nThe email / password you have entered is incorrect\nor access to less secure apps is disabled!\nExiting..." + bcolors.ENDC) 615 | sys.exit() 616 | except smtplib.SMTPRecipientsRefused: 617 | print(bcolors.FAIL + "\nThe recipient's email adress is invalid! Exiting..." + bcolors.ENDC) 618 | sys.exit() 619 | 620 | def getops(): #Get options and turn off interactive mode 621 | parser = optparse.OptionParser() 622 | parser.add_option('-i', '--interactive', default=False, action='store_true', dest='interactive', help='this choice negates interactive mode') 623 | parser.add_option('-t', '--to', action='append', dest='to_address', help='the email address you are spamming e.x.: email@gmail (cannot contain .com)') 624 | parser.add_option('-f', '--from', type='string', dest='from_address', help='the email you are spamming from') 625 | parser.add_option('-d', '--interval', type='int', dest='sendSpeed', help='the interval in seconds in which you want to send the emails')#this cant be set to i cause interactive mode is set to i as well 626 | parser.add_option('-p', '--password', type='string', dest='password', help='the password for the email account you are spamming from') 627 | parser.add_option('-s', '--subject', type='string', dest='subject', help='the subject of the email you want to spam') 628 | parser.add_option('-b', '--body', type='string', dest='body', help='the actual message inside the email you wish to spam') 629 | parser.add_option('-e', '--num-of-emails', dest='recipientNum', help='the number of email addresses you want to send from') 630 | parser.add_option('-n', '--num', type='int', dest='send', help='the number of emails you wish to send') 631 | (options, arguments) = parser.parse_args() 632 | return options 633 | 634 | # Main Program 635 | try: 636 | sent = 0 637 | Sent = 0 638 | ops = getops() 639 | emailnum = -1 640 | passnum = -1 641 | if (ops.interactive == False): 642 | resize() 643 | banner() 644 | choice = mailChoice() 645 | choice = validChoice(choice) 646 | try: 647 | recipientLists = {} 648 | f = open("recipientLists.txt", "r") 649 | for l in f: 650 | line = l.split(":") 651 | line.remove ("\n") 652 | values = [] 653 | key = line[0] 654 | line.remove (key) 655 | for v in range (len (line)): 656 | val = line[v] 657 | values.append (val) 658 | recipientLists[key] = values 659 | f.close() 660 | except IOError: 661 | recipientLists = {} 662 | saveRescipientLists() 663 | while choice == "#": 664 | recipientLists = recipientEditor(recipientLists) 665 | choice = mailChoice() 666 | choice = validChoice(choice) 667 | if choice == "2" or choice == "3": 668 | legacy() 669 | # Gmail 670 | if choice == "1": 671 | multiple = gmailInstruct() 672 | multiple = validMultiple(multiple) 673 | if multiple == "1" or multiple.upper() == "YES": 674 | from_address,password,numOfSenders = gMultiple() 675 | sendSpeed,to_address,body,subject,length,recipientNum,send,bcc = structure(recipientLists) 676 | if loadingBar and send != float ("inf"): 677 | pbar = tqdm(total=(send)) 678 | elif table and recipientNum <= 2: 679 | print (tabulate([[from_address,to_address,Sent]], headers=["From:", "To:","Sent:"], tablefmt="github")) 680 | else: 681 | print (bcolors.OKGREEN + "\nFrom:",from_address,"\tTo:",to_address,"\tSent:",str (Sent) + bcolors.ENDC) 682 | spam = True 683 | while spam is True and Sent < send: 684 | if from_address == "" or from_address == "\n": 685 | spam = False 686 | else: 687 | try: 688 | gmailSpam(sendSpeed,from_address,to_address,body,subject,length,password,bcc) 689 | if loadingBar and send != float ("inf"): 690 | pbar.update(1) 691 | elif table and recipientNum <= 2: 692 | print (tabulate([[from_address,to_address,Sent]], headers=[" "," "," "], tablefmt="github")) 693 | else: 694 | print ( bcolors.OKGREEN + "\nFrom:",from_address,"\tTo:",to_address,"\tSent:",str (Sent) + bcolors.ENDC) 695 | except smtplib.SMTPSenderRefused: 696 | print ("Limit reached. Switching emails...") 697 | from_address,password,numOfSenders = gMultiple() 698 | spam = True 699 | sent = 0 700 | except smtplib.SMTPDataError: 701 | print ("Limit reached. Switching emails...") 702 | from_address,password,numOfSenders = gMultiple() 703 | spam = True 704 | sent = 0 705 | if sent == 500: 706 | from_address,password,numOfSenders = gMultiple() 707 | spam = True 708 | sent = 0 709 | if loadingBar and send != float ("inf"): 710 | pbar.close() 711 | elif multiple == "2" or multiple.upper() == "NO": 712 | from_address,password,numOfSenders = gSingle() 713 | sendSpeed,to_address,body,subject,length,recipientNum,send,bcc = structure(recipientLists) 714 | if loadingBar and send != float ("inf"): 715 | pbar = tqdm(total=(send)) 716 | elif table and recipientNum <= 2: 717 | print (tabulate([[from_address,to_address,Sent]], headers=["From:", "To:","Sent:"], tablefmt="github")) 718 | else: 719 | print ( bcolors.OKGREEN + "\nFrom:",from_address,"\tTo:",to_address,"\tSent:",str (Sent) + bcolors.ENDC) 720 | while sent != 500 and Sent < send: 721 | try: 722 | gmailSpam(sendSpeed,from_address,to_address,body,subject,length,password,bcc) 723 | if loadingBar and send != float ("inf"): 724 | pbar.update(1) 725 | elif table and recipientNum <= 2: 726 | print (tabulate([[from_address,to_address,Sent]], headers=[" "," "," "], tablefmt="github")) 727 | else: 728 | print ( bcolors.OKGREEN + "\nFrom:",from_address,"\tTo:",to_address,"\tSent:",str (Sent) + bcolors.ENDC) 729 | except smtplib.SMTPSenderRefused: 730 | print ("Limit reached. Exiting...") 731 | sys.exit() 732 | except smtplib.SMTPDataError: 733 | print ("Limit reached. Exiting...") 734 | sys.exit() 735 | if loadingBar and send != float ("inf"): 736 | pbar.close() 737 | else: 738 | print (bcolors.FAIL + "Invaid choice!" + bcolors.ENDC) 739 | sys.exit() 740 | elif (ops.interactive == True): # this code is called when the user disables interactive mode 741 | numsent = -1 742 | length = len(ops.subject) # find the length of the subject, in order to provide a seed for the random number generator in gmailSpam() 743 | recipientNum = int(ops.recipientNum) # set this variable to an integer 744 | if recipientNum <= 500: 745 | ops.send = ops.send - 2 746 | while numsent <= ops.send: 747 | gmailSpam(ops.sendSpeed, ops.from_address, ops.to_address, ops.body, ops.subject, length, ops.password, bcc) # run the spam script with the given options 748 | numsent = numsent + 1 749 | number = str(numsent + 1) 750 | print("[+] EMAILS SENT " + number) 751 | 752 | except KeyboardInterrupt: 753 | print(bcolors.FAIL + "\nCancelled!" + bcolors.ENDC) 754 | sys.exit() 755 | -------------------------------------------------------------------------------- /main/gmail.txt: -------------------------------------------------------------------------------- 1 | email1@gmail.com,email2@gmail.com, 2 | -------------------------------------------------------------------------------- /main/gmailpass.txt: -------------------------------------------------------------------------------- 1 | password1,password2, 2 | -------------------------------------------------------------------------------- /main/recipientLists.txt: -------------------------------------------------------------------------------- 1 | exampleList1:email1@domain1.com:email2@domain1.com: 2 | exampleList2:email2@domain1.com:email2@domain1.com: 3 | -------------------------------------------------------------------------------- /main/subject.txt: -------------------------------------------------------------------------------- 1 | insert_your_subject_here 2 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | tabulate==0.8.6 2 | tqdm==2.2.3 3 | --------------------------------------------------------------------------------