├── LICENSE ├── README.md ├── SupportingFiles ├── Emails │ ├── __init__.py │ ├── fedEx.py │ ├── googleSupport.py │ ├── itControlsDoc.py │ ├── microsoftUpdateBody.py │ ├── microsoftUpdateForward.py │ ├── onsiteTech.py │ ├── secureUpdateBody.py │ ├── tempTest.py │ ├── xcel.py │ └── zixmailSecureEmail.py ├── __init__.py ├── buildMenu.py ├── deliverEmails.py ├── images │ ├── google.png │ └── microsoft.png └── menuText.py ├── config-files └── base-config.txt └── pyPhishing.py /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Phishing-Application 2 | 3 | - Please use this tool ethically and within legal means. The developer and anyone who contributes takes no liability for user's actions while using the tool. Be good. 4 | 5 | This application is used to send phishing emails to any number of users. The data is pulled from a user-supplied 6 | text document. The menu is fairly self explanatory. Be sure to test before delivering to a lot of users! 7 | 8 | # Usage: 9 | > python pyPhishing.py 10 | > python pyPhishing.py -h 11 | > python pyPhishing.py -c [config file] 12 | 13 | [Follow menu and be sure to add data to advanced settings] 14 | 15 | # Description/Purpose of files: 16 | > pyPhishing.py 17 | - Used to drive the application, contains most of the menu logic and data manipulation. 18 | 19 | > SupportingFiles/ 20 | -> deliverEmails.py 21 | - The second most important file for this application. Contains the logic for sending emails and building 22 | message bodies. 23 | -> buildMenu.py 24 | - Creates an instance of the menu class each time the menu is called. A separate menu for advanced options 25 | was created to fix some formatting. 26 | 27 | > SupportingFiles/Emails/ 28 | -> zixmailSecureEmail.py, microsoftUpdateBody.py, secureUpdateBody.py, etc. 29 | - These files contain all of the text for email messages, including headers. If it is desired to change the 30 | wording in an email message, these files are where you want to look. 31 | -------------------------------------------------------------------------------- /SupportingFiles/Emails/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redteamsecurity/PyPhishing/7e9b0a836704e31cf065b8331cc35b41110ad93b/SupportingFiles/Emails/__init__.py -------------------------------------------------------------------------------- /SupportingFiles/Emails/fedEx.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from email.mime.multipart import MIMEMultipart 4 | from email.mime.text import MIMEText 5 | from email import utils 6 | import email, random, os, time, datetime, socket, email.mime.application, string 7 | 8 | ''' This file is meant to build the appropriate parts of the phishing message 9 | and will be called by phishing.py. Much more will be added to this to simplify the 10 | idea of building the messages and whatnot.''' 11 | 12 | URL_Placemarker = 'URL_Placemarker' 13 | 14 | def make_msgid(idstring=None): 15 | """Returns a string suitable for RFC 2822 compliant Message-ID 16 | Optional idstring if given is a string used to strengthen the 17 | uniqueness of the message id. 18 | """ 19 | timeval = int(time.time()*100) 20 | pid = os.getpid() 21 | randint = random.getrandbits(64) 22 | if idstring is None: 23 | idstring = '' 24 | else: 25 | idstring = '.' + idstring 26 | idhost = socket.getfqdn() 27 | msgid = '<%d.%d.%d%s@%s>' % (timeval, pid, randint, idstring, idhost) 28 | return msgid 29 | 30 | def build_body(variable_dict): 31 | d = str(datetime.datetime.today().strftime("%A, %B %d %Y")) 32 | delta = datetime.timedelta(days=-1) 33 | oldDate = (datetime.datetime.strptime(d, "%A, %B %d %Y") + delta).strftime("%A, %B %d %Y") 34 | currentDate = utils.formatdate(timeval=None, localtime=True, usegmt=False) 35 | 36 | 37 | MaskedURL = variable_dict['link'] 38 | if MaskedURL == '': 39 | MaskedURL = 'URL_Placemarker' 40 | 41 | sender_in_header = variable_dict['headerfrom'] 42 | if sender_in_header == '': 43 | sender_in_header = 'Support@rt-sec.net' 44 | 45 | rand_id = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(15)]) 46 | msgid = make_msgid(rand_id) 47 | 48 | # Create message container - the correct MIME type is multipart/alternative. 49 | msg = MIMEMultipart('alternative') 50 | msg['From'] = 'Delivery Support <{0}>'.format(sender_in_header) 51 | msg['To'] = 'EMPADDR' 52 | msg['Subject'] = 'Undeliverable Package' 53 | msg['Date'] = currentDate 54 | msg['message-id'] = msgid 55 | 56 | 57 | # Create the body of the message (a plain-text and an HTML version). 58 | text ='''*Fed**Ex*\n\n 59 | Not possible to make delivery.\n\nOur company's courier couldn't make the delivery.\n\nTracking Updates\n\n 60 | FedEx 1995-2016 | Global Home | Terms of Use | Security and Privacy 61 | '''.format(oldDate) 62 | 63 | html = """\ 64 | 65 | 66 | 67 |

68 |

69 | Fed 70 | Ex
71 |
{0}
72 | Not possible to make delivery. 73 |
74 |
75 | Our company's courier couldn't make the delivery.
76 | Tracking Updates


77 |
© FedEx 1995-2016 | 78 | Global Home | 79 | Terms of Use | 80 | Security and Privacy 81 |
82 |
83 |

84 | 85 | 86 | """.format(oldDate, URL_Placemarker) 87 | 88 | # File attachment 89 | if variable_dict['attachment'] != '': 90 | filename = variable_dict['attachment'] 91 | fp = open(filename,'rb') 92 | extension = filename.rsplit('.', 1)[-1] 93 | att = email.mime.application.MIMEApplication(fp.read(),_subtype=extension) 94 | fp.close() 95 | att.add_header('Content-Disposition','attachment',filename=filename) 96 | msg.attach(att) 97 | 98 | 99 | # Record the MIME types of both parts - text/plain and text/html. 100 | part1 = MIMEText(text, 'plain') 101 | part2 = MIMEText(html, 'html') 102 | 103 | 104 | # Attach parts into message container. 105 | # According to RFC 2046, the last part of a multipart message, in this case 106 | # the HTML message, is best and preferred. 107 | msg.attach(part1) 108 | msg.attach(part2) 109 | return msg.as_string() 110 | -------------------------------------------------------------------------------- /SupportingFiles/Emails/googleSupport.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from email.mime.multipart import MIMEMultipart 4 | from email.mime.text import MIMEText 5 | from email.mime.image import MIMEImage 6 | from email import utils 7 | import email, random, os, time, datetime, socket, email.mime.application, string 8 | 9 | ''' This file is meant to build the appropriate parts of the Google phishing message 10 | and will be called by phishing.py. Much more will be added to this to simplify the 11 | idea of building the messages and whatnot.''' 12 | 13 | 14 | URL_Placemarker = 'URL_Placemarker' 15 | 16 | def make_msgid(idstring=None): 17 | """Returns a string suitable for RFC 2822 compliant Message-ID 18 | Optional idstring if given is a string used to strengthen the 19 | uniqueness of the message id. 20 | """ 21 | timeval = int(time.time()*100) 22 | pid = os.getpid() 23 | randint = random.getrandbits(64) 24 | if idstring is None: 25 | idstring = '' 26 | else: 27 | idstring = '.' + idstring 28 | idhost = socket.getfqdn() 29 | msgid = '<%d.%d.%d%s@%s>' % (timeval, pid, randint, idstring, idhost) 30 | return msgid 31 | 32 | 33 | def build_body(variable_dict): 34 | d = str(datetime.datetime.today().strftime("%A, %B %d %Y")) 35 | delta = datetime.timedelta(days=-4) 36 | oldDate = (datetime.datetime.strptime(d, "%A, %B %d %Y") + delta).strftime("%A, %B %d %Y") 37 | currentDate = utils.formatdate(timeval=None, localtime=True, usegmt=False) 38 | 39 | MaskedURL = variable_dict['link'] 40 | if MaskedURL == '': 41 | MaskedURL = 'URL_Placemarker' 42 | sender_in_header = variable_dict['headerfrom'] 43 | if sender_in_header == '': 44 | sender_in_header = 'Support@goo.com' 45 | 46 | rand_id = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(15)]) 47 | msgid = make_msgid(rand_id) 48 | 49 | # Create message container - the correct MIME type is multipart/alternative. 50 | msg = MIMEMultipart('alternative') 51 | msg['From'] = sender_in_header 52 | msg['To'] = 'EMPADDR' 53 | msg['Subject'] = 'Returned email message' 54 | msg['Date'] = currentDate 55 | msg['message-id'] = msgid 56 | 57 | 58 | plaintextBody = '''Google Support\nEMPADDR\nLynn Bisson (Google Support) has sent you a message:\n 59 | {0}\nUndeliverable messages.\nMore information\n_____________________________\n 60 | This e-mail was sent to EMPADDR.\nDon't want occasional updates about Google activity? Change what email 61 | Google Team sends you. 62 | '''.format(oldDate) 63 | 64 | htmlBody = '''
65 |
66 | 67 | 68 | 79 | 80 | 81 | 93 | 94 | 95 | 99 | 100 | 101 | 107 | 108 |
69 | 70 | 71 | 75 | 76 | 77 |
72 | 73 | Support 74 |
78 |
82 | EMPADDR
83 |
84 |
85 | Lynn Bisson 86 | (Google Support) has sent you a message:

87 | {0} 88 |
89 | Undeliverable messages.
90 | More information 91 | 92 |
96 | View Messages 97 | 98 |
102 |
This e-mail was sent to 103 | EMPADDR 104 | . 105 |
Don't want occasional updates about Google activity? 106 |
109 |
110 |
111 | 112 | '''.format(oldDate, URL_Placemarker, URL_Placemarker) 113 | 114 | 115 | if variable_dict['attachment'] != '': 116 | filename = variable_dict['attachment'] 117 | fp=open(filename,'rb') 118 | extension = filename.rsplit('.', 1)[-1] 119 | att = email.mime.application.MIMEApplication(fp.read(),_subtype=extension) 120 | fp.close() 121 | att.add_header('Content-Disposition','attachment',filename=filename) 122 | msg.attach(att) 123 | 124 | img_location = os.getcwd() + '/SupportingFiles/images/google.png' 125 | img_data = open(img_location, 'rb').read() 126 | 127 | # Record the MIME types of both parts - text/plain and text/html. 128 | part1 = MIMEText(plaintextBody, 'plain') 129 | part2 = MIMEText(htmlBody, 'html') 130 | 131 | 132 | image = MIMEImage(img_data) 133 | image.add_header('Content-Transfer-Encoding','base64') 134 | image.add_header('Content-ID', '') 135 | image.add_header('Content-disposition', 'inline') 136 | 137 | # Attach parts into message container. 138 | # According to RFC 2046, the last part of a multipart message, in this case 139 | # the HTML message, is best and preferred. 140 | msg.attach(part1) 141 | msg.attach(part2) 142 | msg.attach(image) 143 | 144 | return msg.as_string() 145 | -------------------------------------------------------------------------------- /SupportingFiles/Emails/itControlsDoc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from email.mime.multipart import MIMEMultipart 4 | from email.mime.text import MIMEText 5 | from email import utils 6 | import email, random, os, time, socket, email.mime.application, string 7 | 8 | ''' This file is meant to build the appropriate parts of the phishing message 9 | and will be called by phishing.py. Much more will be added to this to simplify the 10 | idea of building the messages and whatnot.''' 11 | 12 | 13 | URL_Placemarker = 'URL_Placemarker' 14 | 15 | def make_msgid(idstring=None): 16 | """Returns a string suitable for RFC 2822 compliant Message-ID 17 | Optional idstring if given is a string used to strengthen the 18 | uniqueness of the message id. 19 | """ 20 | timeval = int(time.time()*100) 21 | pid = os.getpid() 22 | randint = random.getrandbits(64) 23 | if idstring is None: 24 | idstring = '' 25 | else: 26 | idstring = '.' + idstring 27 | idhost = socket.getfqdn() 28 | msgid = '<%d.%d.%d%s@%s>' % (timeval, pid, randint, idstring, idhost) 29 | return msgid 30 | 31 | def build_body(variable_dict): 32 | currentDate = utils.formatdate(timeval=None, localtime=True, usegmt=False) 33 | MaskedURL = variable_dict['link'] 34 | if MaskedURL == '': 35 | MaskedURL = 'URL_Placemarker' 36 | 37 | sender_in_header = variable_dict['headerfrom'] 38 | if sender_in_header == '': 39 | sender_in_header = 'Support@contoso.com' 40 | 41 | rand_id = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(15)]) 42 | msgid = make_msgid(rand_id) 43 | # Create message container - the correct MIME type is multipart/alternative. 44 | msg = MIMEMultipart('alternative') 45 | msg['From'] = sender_in_header 46 | msg['To'] = 'EMPADDR' 47 | msg['Subject'] = 'Can you look at this?' 48 | msg['Date'] = currentDate 49 | msg['message-id'] = msgid 50 | 51 | 52 | plaintextBody ='''Hey,\n\nCan you look over some of the new IT controls I'm writing up and respond with any changes?\n\nThanks''' 53 | 54 | htmlBody ='''Hey,

55 | Can you look over some of the new IT controls I'm writing up and respond with any changes?

56 | Thanks
''' 57 | 58 | if variable_dict['attachment'] != '': 59 | # If a document is to be attached 60 | filename = variable_dict['attachment'] 61 | fp=open(filename,'rb') 62 | extension = filename.rsplit('.', 1)[-1] 63 | att = email.mime.application.MIMEApplication(fp.read(),_subtype=extension) 64 | fp.close() 65 | att.add_header('Content-Disposition','attachment',filename=filename) 66 | msg.attach(att) 67 | 68 | # Record the MIME types of both parts - text/plain and text/html. 69 | part1 = MIMEText(plaintextBody, 'plain') 70 | part2 = MIMEText(htmlBody, 'html') 71 | 72 | # Attach parts into message container. 73 | # According to RFC 2046, the last part of a multipart message, in this case 74 | # the HTML message, is best and preferred. 75 | msg.attach(part1) 76 | msg.attach(part2) 77 | return msg.as_string() 78 | -------------------------------------------------------------------------------- /SupportingFiles/Emails/microsoftUpdateBody.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from email.mime.multipart import MIMEMultipart 4 | from email.mime.text import MIMEText 5 | from email.mime.image import MIMEImage 6 | from email import utils 7 | import email, random, os, time, socket, email.mime.application, string 8 | 9 | ''' This file is meant to build the appropriate parts of the phishing message 10 | and will be called by phishing.py. Much more will be added to this to simplify the 11 | idea of building the messages and whatnot.''' 12 | 13 | URL_Placemarker = 'URL_Placemarker' 14 | 15 | def make_msgid(idstring=None): 16 | """Returns a string suitable for RFC 2822 compliant Message-ID 17 | Optional idstring if given is a string used to strengthen the 18 | uniqueness of the message id. 19 | """ 20 | timeval = int(time.time()*100) 21 | pid = os.getpid() 22 | randint = random.getrandbits(64) 23 | if idstring is None: 24 | idstring = '' 25 | else: 26 | idstring = '.' + idstring 27 | idhost = socket.getfqdn() 28 | msgid = '<%d.%d.%d%s@%s>' % (timeval, pid, randint, idstring, idhost) 29 | return msgid 30 | 31 | def build_body(variable_dict): 32 | currentDate = utils.formatdate(timeval=None, localtime=True, usegmt=False) 33 | MaskedURL = variable_dict['link'] 34 | if MaskedURL == '': 35 | MaskedURL = 'URL_Placemarker' 36 | 37 | sender_in_header = variable_dict['headerfrom'] 38 | if sender_in_header == '': 39 | sender_in_header = 'Support@goo.com' 40 | 41 | rand_id = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(15)]) 42 | msgid = make_msgid(rand_id) 43 | 44 | # Create message container - the correct MIME type is multipart/alternative. 45 | msg = MIMEMultipart('alternative') 46 | msg['From'] = sender_in_header 47 | msg['To'] = 'EMPADDR' 48 | msg['Subject'] = 'Message from the Microsoft Security Team' 49 | msg['Date'] = currentDate 50 | msg['message-id'] = msgid 51 | 52 | 53 | plaintextBody ='''Hello,\n\nThere has been a recent virus outbreak in corporate environments that target out of date systems.\n 54 | The virus corrupts and deletes all data on the affected machine and therefore can be very dangerous.\n 55 | Please download and install the updates manually at the link below, as we do not want to wait to push it out in our normal patch cycle.\n 56 | {0}\n 57 | Thank you, 58 | Microsoft Security Team\n\n 59 | Note: Please DO NOT reply to this email, this is an unmanaged email address. Replies will not be received. 60 | 61 | '''.format(URL_Placemarker) 62 | 63 | 64 | # Images need to be hosted on the internet to properly work 65 | htmlBody =''' 66 | 67 |


68 | 69 | Hello,
70 |
71 | 72 | There has been a recent virus outbreak in corporate environments that target out of date systems.
73 | The virus corrupts and deletes all data on the affected machine and therefore can be very dangerous.
74 |
75 | 76 | Please download and install the updates manually at the link below, as we do not want to wait to push it out in our normal patch cycle.
77 |
78 | 79 | {1}
80 |
81 | 82 | Thank you,
83 | Microsoft Security Team 84 |
85 |
86 | Note: Please DO NOT reply to this email, this is an unmanaged email address. Replies will not be received. 87 | '''.format(URL_Placemarker, MaskedURL) 88 | 89 | 90 | if variable_dict['attachment'] != '': 91 | filename = variable_dict['attachment'] 92 | fp=open(filename,'rb') 93 | extension = filename.rsplit('.', 1)[-1] 94 | att = email.mime.application.MIMEApplication(fp.read(),_subtype=extension) 95 | fp.close() 96 | att.add_header('Content-Disposition','attachment',filename=filename) 97 | msg.attach(att) 98 | 99 | img_location = os.getcwd() + '/SupportingFiles/images/microsoft.png' 100 | img_data = open(img_location, 'rb').read() 101 | 102 | # Record the MIME types of both parts - text/plain and text/html. 103 | part1 = MIMEText(plaintextBody, 'plain') 104 | part2 = MIMEText(htmlBody, 'html') 105 | 106 | 107 | image = MIMEImage(img_data) 108 | image.add_header('Content-Transfer-Encoding','base64') 109 | image.add_header('Content-ID', '') 110 | image.add_header('Content-disposition', 'inline') 111 | 112 | # Attach parts into message container. 113 | # According to RFC 2046, the last part of a multipart message, in this case 114 | # the HTML message, is best and preferred. 115 | msg.attach(part1) 116 | msg.attach(part2) 117 | msg.attach(image) 118 | 119 | return msg.as_string() 120 | 121 | -------------------------------------------------------------------------------- /SupportingFiles/Emails/microsoftUpdateForward.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from email.mime.multipart import MIMEMultipart 4 | from email.mime.text import MIMEText 5 | from email.mime.image import MIMEImage 6 | from email import utils 7 | import email, random, os, time, datetime, socket, email.mime.application, string 8 | 9 | ''' This file is meant to build the appropriate parts of the phishing message 10 | and will be called by phishing.py. Much more will be added to this to simplify the 11 | idea of building the messages and whatnot.''' 12 | 13 | 14 | URL_Placemarker = 'URL_Placemarker' 15 | 16 | def make_msgid(idstring=None): 17 | """Returns a string suitable for RFC 2822 compliant Message-ID 18 | Optional idstring if given is a string used to strengthen the 19 | uniqueness of the message id. 20 | """ 21 | timeval = int(time.time()*100) 22 | pid = os.getpid() 23 | randint = random.getrandbits(64) 24 | if idstring is None: 25 | idstring = '' 26 | else: 27 | idstring = '.' + idstring 28 | idhost = socket.getfqdn() 29 | msgid = '<%d.%d.%d%s@%s>' % (timeval, pid, randint, idstring, idhost) 30 | return msgid 31 | 32 | def build_body(variable_dict): 33 | d = str(datetime.datetime.today().strftime("%A, %B %d, %Y %I:%M%p")) 34 | delta = datetime.timedelta(hours=-2) 35 | sentDate = (datetime.datetime.strptime(d, "%A, %B %d, %Y %I:%M%p") + delta).strftime("%A, %B %d, %Y %I:%M%p") 36 | currentDate = utils.formatdate(timeval=None, localtime=True, usegmt=False) 37 | 38 | MaskedURL = variable_dict['link'] 39 | if MaskedURL == '': 40 | MaskedURL = 'URL_Placemarker' 41 | 42 | sender_in_header = variable_dict['headerfrom'] 43 | if sender_in_header == '': 44 | sender_in_header = 'Support@goo.com' 45 | 46 | rand_id = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(15)]) 47 | msgid = make_msgid(rand_id) 48 | 49 | # Create message container - the correct MIME type is multipart/alternative. 50 | msg = MIMEMultipart('alternative') 51 | msg['From'] = sender_in_header 52 | msg['To'] = 'EMPADDR' 53 | msg['Subject'] = 'FW: Message from the Microsoft Security Team' 54 | msg['Date'] = currentDate 55 | msg['message-id'] = msgid 56 | 57 | 58 | plaintextBody ="""All, 59 | 60 | Please see below about an urgent message sent from Microsoft this morning. Follow the instructions and 61 | install the update to your systems ASAP. 62 | 63 | 1. Run the update 64 | 2. When SmartScreen pops up, click "more info" and then the "Run" button. 65 | 3. A screen may pop up, but that's normal. Everything should be updated after running. 66 | 67 | Thanks, 68 | CLIENT NAME 69 | 70 | ---------- Forwarded message ---------- 71 | From: Microsoft Security Team 72 | Date: {0} 73 | Subject: Message from the Microsoft Security Team 74 | To: CLIENT NAME 75 | 76 | Hello, 77 | 78 | There has been a recent virus outbreak in corporate environments that target out of date systems. 79 | The virus corrupts and deletes all data on the affected machine and therefore can be very dangerous. 80 | 81 | Please download and install the updates manually at the link below, as we do not want to wait to push it out in our normal patch cycle. 82 | 83 | {1} 84 | 85 | Thank you, 86 | Microsoft Security Team 87 | 88 | 89 | Note: Please DO NOT reply to this email, this is an un-managed email address. Replies will not be received. 90 | 91 | -- 92 | """.format(sentDate, URL_Placemarker) 93 | 94 | htmlBody =''' 95 | All,

96 | 97 | Please see below about an urgent message sent from Microsoft this morning. Follow the instructions and 98 | install the update to your systems ASAP.

99 | 100 | 1. Run the update
101 | 2. When SmartScreen pops up, click "more info" and then the "Run" button.
102 | 3. A screen may pop up, but that's normal. Everything should be updated after running.

103 | 104 | Thanks,
105 | CLIENT NAME

106 | 107 | ---------- Forwarded message ----------
108 | From: Microsoft Security Team <Security@microsoft.com>
109 | Date: {0}
110 | Subject: Message from the Microsoft Security Team
111 | To: CLIENT NAME <CLIENTEMAIL> 112 |

113 | 114 | Hello,
115 |
116 | 117 | There has been a recent virus outbreak in corporate environments that target out of date systems.
118 | The virus corrupts and deletes all data on the affected machine and therefore can be very dangerous.
119 |
120 | 121 | Please download and install the updates manually at the link below, as we do not want to wait to push it out in our normal patch cycle.
122 |
123 | 124 | {2}
125 |
126 | 127 | Thank you,
128 | Microsoft Security Team 129 |
130 |
131 | Note: Please DO NOT reply to this email, this is an un-managed email address. Replies will not be received. 132 | '''.format(sentDate, URL_Placemarker, MaskedURL) 133 | 134 | if variable_dict['attachment'] != '': 135 | filename = variable_dict['attachment'] 136 | fp=open(filename,'rb') 137 | extension = filename.rsplit('.', 1)[-1] 138 | att = email.mime.application.MIMEApplication(fp.read(),_subtype=extension) 139 | fp.close() 140 | att.add_header('Content-Disposition','attachment',filename=filename) 141 | msg.attach(att) 142 | 143 | img_location = os.getcwd() + '/SupportingFiles/images/microsoft.png' 144 | img_data = open(img_location, 'rb').read() 145 | 146 | # Record the MIME types of both parts - text/plain and text/html. 147 | part1 = MIMEText(plaintextBody, 'plain') 148 | part2 = MIMEText(htmlBody, 'html') 149 | 150 | 151 | image = MIMEImage(img_data) 152 | image.add_header('Content-Transfer-Encoding','base64') 153 | image.add_header('Content-ID', '') 154 | image.add_header('Content-disposition', 'inline') 155 | 156 | # Attach parts into message container. 157 | # According to RFC 2046, the last part of a multipart message, in this case 158 | # the HTML message, is best and preferred. 159 | msg.attach(part1) 160 | msg.attach(part2) 161 | msg.attach(image) 162 | 163 | return msg.as_string() 164 | -------------------------------------------------------------------------------- /SupportingFiles/Emails/onsiteTech.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from email.mime.multipart import MIMEMultipart 4 | from email.mime.text import MIMEText 5 | from email import utils 6 | import email, random, os, time, datetime, socket, email.mime.application, string 7 | 8 | ''' This file is meant to build the appropriate parts of the phishing message 9 | and will be called by phishing.py. Much more will be added to this to simplify the 10 | idea of building the messages and whatnot. TEST''' 11 | 12 | 13 | URL_Placemarker = 'URL_Placemarker' 14 | 15 | def make_msgid(idstring=None): 16 | """Returns a string suitable for RFC 2822 compliant Message-ID 17 | Optional idstring if given is a string used to strengthen the 18 | uniqueness of the message id. 19 | """ 20 | timeval = int(time.time()*100) 21 | pid = os.getpid() 22 | randint = random.getrandbits(64) 23 | if idstring is None: 24 | idstring = '' 25 | else: 26 | idstring = '.' + idstring 27 | msgid = '<%d.%d.%d%s>' % (timeval, pid, randint, idstring) 28 | return msgid 29 | 30 | def build_body(variable_dict): 31 | MaskedURL = variable_dict['link'] 32 | if MaskedURL == '': 33 | MaskedURL = 'URL_Placemarker' 34 | 35 | sender_in_header = variable_dict['headerfrom'] 36 | if sender_in_header == '': 37 | sender_in_header = 'MicrosoftSupport@contoso.com' 38 | 39 | rand_id = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(15)]) 40 | msgid = make_msgid(rand_id) 41 | 42 | client = variable_dict['client'] 43 | if client == '': 44 | client = 'NO CLIENT' 45 | d = str(datetime.datetime.today().strftime("%A, %B %Y")) 46 | delta = datetime.timedelta(days=-1) 47 | currentDate = utils.formatdate(timeval=None, localtime=True, usegmt=False) 48 | 49 | msg = MIMEMultipart('alternative') 50 | msg['From'] = sender_in_header 51 | msg['To'] = 'EMPADDR' 52 | msg['Subject'] = 'Technician On-site' 53 | msg['Date'] = currentDate 54 | msg['message-id'] = msgid 55 | 56 | 57 | plaintextBody ='''We are having a technician from {0} arriving at LOCATION today at TIME, so please ensure they have access to the network room.\n\n 58 | Thanks, 59 | NAME 60 | ''' 61 | 62 | htmlBody = '''We are having a technician from {0} arriving at LOCATION today at TIME, so please ensure they have access to the network room.
63 |
64 | Thanks,
65 | NAME

66 | '''.format(client) 67 | 68 | # File attachment 69 | if variable_dict['attachment'] != '': 70 | filename = variable_dict['attachment'] 71 | fp = open(filename,'rb') 72 | extension = filename.rsplit('.', 1)[-1] 73 | att = email.mime.application.MIMEApplication(fp.read(),_subtype=extension) 74 | fp.close() 75 | att.add_header('Content-Disposition','attachment',filename=filename) 76 | msg.attach(att) 77 | 78 | part1 = MIMEText(plaintextBody, 'plain') 79 | part2 = MIMEText(htmlBody, 'html') 80 | 81 | 82 | # Attach parts into message container. 83 | # According to RFC 2046, the last part of a multipart message, in this case 84 | # the HTML message, is best and preferred. 85 | msg.attach(part1) 86 | msg.attach(part2) 87 | return msg.as_string() 88 | -------------------------------------------------------------------------------- /SupportingFiles/Emails/secureUpdateBody.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from email.mime.multipart import MIMEMultipart 4 | from email.mime.text import MIMEText 5 | from email import utils 6 | import email, random, os, time, socket, email.mime.application, string 7 | 8 | URL_Placemarker = 'URL_Placemarker' 9 | 10 | def make_msgid(idstring=None): 11 | """Returns a string suitable for RFC 2822 compliant Message-ID 12 | Optional idstring if given is a string used to strengthen the 13 | uniqueness of the message id. 14 | """ 15 | timeval = int(time.time()*100) 16 | pid = os.getpid() 17 | randint = random.getrandbits(64) 18 | if idstring is None: 19 | idstring = '' 20 | else: 21 | idstring = '.' + idstring 22 | idhost = socket.getfqdn() 23 | msgid = '<%d.%d.%d%s@%s>' % (timeval, pid, randint, idstring, idhost) 24 | return msgid 25 | 26 | def build_body(variable_dict): 27 | ''' This file is meant to build the appropriate parts of the phishing message 28 | and will be called by phishing.py. Much more will be added to this to simplify the 29 | idea of building the messages and whatnot.''' 30 | MaskedURL = variable_dict['link'] 31 | currentDate = utils.formatdate(timeval=None, localtime=True, usegmt=False) 32 | if MaskedURL == '': 33 | MaskedURL = URL_Placemarker 34 | 35 | # Split variable list to access specific vars. Assign if not already assigned. 36 | client = variable_dict['client'] 37 | sender_in_body = variable_dict['bodysender'] 38 | sender_in_header = variable_dict['headerfrom'] 39 | if sender_in_header == '': 40 | sender_in_header = 'IT Support ' 41 | if sender_in_body == '': 42 | sender_in_body = 'ITSupport@contoso.com' 43 | if client == '': 44 | client = 'client' 45 | 46 | rand_id = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(15)]) 47 | msgid = make_msgid(rand_id) 48 | 49 | msg = MIMEMultipart('alternative') 50 | msg['From'] = sender_in_header 51 | msg['To'] = 'EMPADDR' 52 | msg['Subject'] = 'Security Updates' 53 | msg['Date'] = currentDate 54 | msg['message-id'] = msgid 55 | 56 | #MaskedURL = URL_Placemarker # change 'Secure Link' to desired mask or change line to "MaskedURL = URL_Placemarker" if no masked link desired. 57 | # Uncomment the following if you wish to send the message with the importance flag set. 58 | #important = '''X-Priority: 1 (Highest) 59 | #X-MSMail-Priority: High 60 | #''' 61 | currentDate = utils.formatdate(timeval=None, localtime=True, usegmt=False) 62 | 63 | plaintextBody ="""All,For security reasons, the IT department is registering each of the workstations 64 | with security software to make sure they receive security updates promptly. 65 | Therefore, we are asking each employee to register their workstation. 66 | To register your workstation, please visit the website below and enter your 67 | Corporate username and password. 68 | 69 | Visit this website: 70 | {0} 71 | 72 | Thanks, 73 | {1} IT Department 74 | Email: {2} 75 | 76 | """.format(URL_Placemarker, client, sender_in_body) 77 | 78 | htmlBody ='''All,

For security reasons, the IT department is registering each of the workstations 79 | with security software to make sure they receive security updates promptly. Therefore, we are 80 | asking each employee to register their workstation.

81 | 82 | To register your workstation, please visit the website below and enter your Corporate username and password.

83 | Visit this website:
84 | {1} 85 | 86 |
87 |
Thanks,
{2} IT Department
Email: {3} 88 | 89 | '''.format(URL_Placemarker, MaskedURL, client, sender_in_body) 90 | 91 | # File attachment 92 | if variable_dict['attachment'] != '': 93 | filename = variable_dict['attachment'] 94 | fp = open(filename,'rb') 95 | extension = filename.rsplit('.', 1)[-1] 96 | att = email.mime.application.MIMEApplication(fp.read(),_subtype=extension) 97 | fp.close() 98 | att.add_header('Content-Disposition','attachment',filename=filename) 99 | msg.attach(att) 100 | 101 | part1 = MIMEText(plaintextBody, 'plain') 102 | part2 = MIMEText(htmlBody, 'html') 103 | 104 | 105 | # Attach parts into message container. 106 | # According to RFC 2046, the last part of a multipart message, in this case 107 | # the HTML message, is best and preferred. 108 | msg.attach(part1) 109 | msg.attach(part2) 110 | return msg.as_string() 111 | -------------------------------------------------------------------------------- /SupportingFiles/Emails/tempTest.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from email.mime.multipart import MIMEMultipart 4 | from email.mime.text import MIMEText 5 | from email import utils 6 | import email, random, os, time, datetime, socket, email.mime.application, string 7 | 8 | date = str(datetime.datetime.today().strftime("%A, %B %d, %Y")) 9 | currentDate = utils.formatdate(timeval=None, localtime=True, usegmt=False) 10 | 11 | def make_msgid(idstring=None): 12 | """Returns a string suitable for RFC 2822 compliant Message-ID 13 | Optional idstring if given is a string used to strengthen the 14 | uniqueness of the message id. 15 | """ 16 | timeval = int(time.time()*100) 17 | pid = os.getpid() 18 | randint = random.getrandbits(64) 19 | if idstring is None: 20 | idstring = '' 21 | else: 22 | idstring = '.' + idstring 23 | idhost = socket.getfqdn() 24 | msgid = '<%d.%d.%d%s@%s>' % (timeval, pid, randint, idstring, idhost) 25 | return msgid 26 | 27 | def build_body(variable_dict): 28 | 29 | sender_in_header = variable_dict['headerfrom'] 30 | if sender_in_header == '': 31 | sender_in_header = 'Support@contoso.com' 32 | 33 | rand_id = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(15)]) 34 | msgid = make_msgid(rand_id) 35 | # Create message container - the correct MIME type is multipart/alternative. 36 | msg = MIMEMultipart('alternative') 37 | msg['From'] = sender_in_header 38 | msg['To'] = 'EMPADDR' 39 | msg['Subject'] = 'Check this out' 40 | msg['Date'] = currentDate 41 | msg['message-id'] = msgid 42 | 43 | 44 | # Create the body of the message (a plain-text and an HTML version). 45 | text = 'Hey,\n\nCan you look over the new IT breakdown document that\'s attached? Let me know if there are any errors or anything that needs to be changed.\n\nThanks' 46 | html = """\ 47 | 48 | 49 | 50 |

Hey,

51 | Can you look over the new IT breakdown document that's attached? Let me know if there are any errors or anything that needs to be changed.

52 | Thanks 53 |

54 | 55 | 56 | """ 57 | 58 | if variable_dict['attachment'] != '': 59 | filename = variable_dict['attachment'] 60 | fp=open(filename,'rb') 61 | extension = filename.rsplit('.', 1)[-1] 62 | att = email.mime.application.MIMEApplication(fp.read(),_subtype=extension) 63 | fp.close() 64 | att.add_header('Content-Disposition','attachment',filename=filename) 65 | msg.attach(att) 66 | 67 | # Record the MIME types of both parts - text/plain and text/html. 68 | part1 = MIMEText(text, 'plain') 69 | part2 = MIMEText(html, 'html') 70 | 71 | 72 | # Attach parts into message container. 73 | # According to RFC 2046, the last part of a multipart message, in this case 74 | # the HTML message, is best and preferred. 75 | msg.attach(part1) 76 | msg.attach(part2) 77 | return msg.as_string() 78 | -------------------------------------------------------------------------------- /SupportingFiles/Emails/xcel.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from email.mime.multipart import MIMEMultipart 4 | from email.mime.text import MIMEText 5 | from email.mime.image import MIMEImage 6 | from email import utils 7 | import email, random, os, time, datetime, socket, email.mime.application, string 8 | 9 | ''' This file is meant to build the appropriate parts of the phishing message 10 | and will be called by phishing.py. Much more will be added to this to simplify the 11 | idea of building the messages and whatnot.''' 12 | 13 | 14 | URL_Placemarker = 'URL_Placemarker' 15 | 16 | def make_msgid(idstring=None): 17 | """Returns a string suitable for RFC 2822 compliant Message-ID 18 | Optional idstring if given is a string used to strengthen the 19 | uniqueness of the message id. 20 | """ 21 | timeval = int(time.time()*100) 22 | pid = os.getpid() 23 | randint = random.getrandbits(64) 24 | if idstring is None: 25 | idstring = '' 26 | else: 27 | idstring = '.' + idstring 28 | idhost = socket.getfqdn() 29 | msgid = '<%d.%d.%d%s@%s>' % (timeval, pid, randint, idstring, idhost) 30 | return msgid 31 | 32 | def build_body(variable_dict): 33 | d = str(datetime.datetime.today().strftime("%A, %B %d %Y")) 34 | delta = datetime.timedelta(days=-1) 35 | oldDate = (datetime.datetime.strptime(d, "%A, %B %d %Y") + delta).strftime("%A, %B %d %Y") 36 | currentDate = utils.formatdate(timeval=None, localtime=True, usegmt=False) 37 | 38 | MaskedURL = variable_dict['link'] 39 | if MaskedURL == '': 40 | MaskedURL = 'URL_Placemarker' 41 | 42 | sender_in_header = variable_dict['headerfrom'] 43 | if sender_in_header == '': 44 | sender_in_header = 'team@connectsurvey.com' 45 | 46 | rand_id = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(15)]) 47 | msgid = make_msgid(rand_id) 48 | 49 | # Create message container - the correct MIME type is multipart/alternative. 50 | msg = MIMEMultipart('alternative') 51 | msg['From'] = sender_in_header 52 | msg['To'] = 'EMPADDR' 53 | msg['Subject'] = 'Please Help Xcel Energy Serve You Better' 54 | msg['Date'] = currentDate 55 | msg['message-id'] = msgid 56 | 57 | 58 | # Would be good to find a way to use first name here. 59 | plaintextBody =''' 60 | Dear EMPADDR, 61 | 62 | [image: $50 Visa Gift Card] Thank you for speaking with ConnectSmart after 63 | setting up your utility services. We are committed to providing the best 64 | quality service. To better serve you, please take a moment to answer a 65 | short survey 66 | 67 | {0} 68 | 69 | regarding your recent customer service experience. Your responses are very important 70 | to us and will be kept strictly confidential. 71 | 72 | How to get your $50 73 | 74 | *Step 1:* Take our short survey 75 | *Step 2:* Be automatically entered to win a $50 Visa Gift Card! 76 | 77 | 78 | [image: Click Here to Take this Survey] 79 | {1} 80 | 81 | 82 | 83 | If you have any questions please contact us at customercare@allconnectsurvey.com 84 | or call 1-800-255-2666. Thank you for your participation in this survey. We 85 | look forward to your response. 86 | 87 | 88 | Best regards, 89 | Your friends at ConnectSmart 90 | Note: This offer is presented by Allconnect Inc. and is not affiliated with 91 | your utility provider. 92 | 93 | Copyright 2008 Allconnect, Inc 94 | 4 Concourse PKWY, Suite 410 Atlanta, GA 30328 95 | Allconnect respects your privacy. As an Allconnect customer, you agreed 96 | that we may contact you via email at EMPADDR. 97 | 98 | '''.format(URL_Placemarker, URL_Placemarker) 99 | 100 | 101 | htmlBody = ''' 102 | 103 | 104 | 106 | 107 | 108 | 160 | 161 | 162 | 164 | 165 | 166 | 178 | 179 | 180 |
105 |
109 |

110 | 111 | Dear EMPADDR,

112 |
113 |

114 |

115 | $50 Visa Gift Card Thank you for speaking with 117 | ConnectSmart after setting up your utility services. We are committed to providing 118 | the best quality service. To better serve you, please take a moment to 119 | 120 | 121 | 122 | answer a short survey 123 | 124 | 125 | regarding your recent customer service experience. 126 | Your responses are very important to us and will be kept strictly confidential. 127 |

128 |
129 |

130 |

131 | How to get your $50
132 |
133 |

134 |

135 | Step 1: Take our short survey 136 |
Step 2: Be automatically entered to win a $50 Visa Gift Card! 137 |
138 |

139 |

140 |
141 |
142 | 143 | Click Here to Take this Survey

145 | 146 |

If you have any questions please contact us at 147 | customercare@allconnect.com 148 | or call 149 | 1-800-245-4666 150 | . Thank you for your participation in this survey. We look forward to your response. 151 |
152 |

153 |

154 |
Best regards,
Your friends at ConnectSmart
155 |
156 | Note: This offer is presented by Allconnect Inc and is not affiliated with your utility provider. 157 | 158 |

159 |

163 |
167 | Copyright 2008 Allconnect, Inc 168 |
4 Concourse PKWY, Suite 410 Atlanta, GA 30328
169 | Allconnect respects your 170 | privacy 171 | . As an Allconnect customer, you agreed that we may contact you via email at 172 | EMPADDR 173 | .If you no longer wish to receive emails,please select the link below:
174 | https://www.allconnect.com/account/emailPreferences.html 175 |
176 |
177 |
181 | 182 |

183 | '''.format(oldDate, URL_Placemarker, URL_Placemarker) 184 | 185 | if variable_dict['attachment'] != '': 186 | # If a document is to be attached 187 | filename = variable_dict['attachment'] 188 | fp=open(filename,'rb') 189 | extension = filename.rsplit('.', 1)[-1] 190 | att = email.mime.application.MIMEApplication(fp.read(),_subtype=extension) 191 | fp.close() 192 | att.add_header('Content-Disposition','attachment',filename=filename) 193 | msg.attach(att) 194 | 195 | # Record the MIME types of both parts - text/plain and text/html. 196 | part1 = MIMEText(plaintextBody, 'plain') 197 | part2 = MIMEText(htmlBody, 'html') 198 | 199 | # Attach parts into message container. 200 | # According to RFC 2046, the last part of a multipart message, in this case 201 | # the HTML message, is best and preferred. 202 | msg.attach(part1) 203 | msg.attach(part2) 204 | return msg.as_string() 205 | -------------------------------------------------------------------------------- /SupportingFiles/Emails/zixmailSecureEmail.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from email.mime.multipart import MIMEMultipart 4 | from email.mime.text import MIMEText 5 | from email import utils 6 | import email, random, os, time, datetime, socket, email.mime.application, string 7 | ''' This file is meant to build the appropriate parts of the phishing message 8 | and will be called by phishing.py. Much more will be added to this to simplify the 9 | idea of building the messages and whatnot.''' 10 | 11 | 12 | URL_Placemarker = 'URL_Placemarker' 13 | 14 | def make_msgid(idstring=None): 15 | """Returns a string suitable for RFC 2822 compliant Message-ID 16 | Optional idstring if given is a string used to strengthen the 17 | uniqueness of the message id. 18 | """ 19 | timeval = int(time.time()*100) 20 | pid = os.getpid() 21 | randint = random.getrandbits(64) 22 | if idstring is None: 23 | idstring = '' 24 | else: 25 | idstring = '.' + idstring 26 | idhost = socket.getfqdn() 27 | msgid = '<%d.%d.%d%s@%s>' % (timeval, pid, randint, idstring, idhost) 28 | return msgid 29 | 30 | def build_body(variable_dict): 31 | 32 | MaskedURL = variable_dict['link'] 33 | if MaskedURL == '': 34 | MaskedURL = URL_Placemarker 35 | 36 | client = variable_dict['client'] 37 | if client == '': 38 | client = 'NO CLIENT' 39 | sender_in_header = variable_dict['headerfrom'] 40 | if sender_in_header == '': 41 | sender_in_header = 'IT Support ' 42 | 43 | rand_id = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(15)]) 44 | msgid = make_msgid(rand_id) 45 | 46 | currentDate = utils.formatdate(timeval=None, localtime=True, usegmt=False) 47 | d = str(datetime.datetime.today().strftime("%A, %B %d %Y @ %I:%M%p")) 48 | delta = datetime.timedelta(days=7) 49 | expireDate = (datetime.datetime.strptime(d, "%A, %B %d %Y @ %I:%M%p") + delta).strftime("%A, %B %d %Y @ %I:%M%p") 50 | 51 | msg = MIMEMultipart('alternative') 52 | msg['From'] = sender_in_header 53 | msg['To'] = 'EMPADDR' 54 | msg['Subject'] = 'Secure Message from {0}'.format(client) 55 | msg['Date'] = currentDate 56 | msg['message-id'] = msgid 57 | 58 | plaintextBody ="""New ZixCorp secure email message from {0}\n 59 | To view the secure message, click on the link below or copy and paste the 60 | link into your Internet browser address bar.\n 61 | {1}\n 62 | You are reading the plaintext version of this message. For a better user 63 | experience, change your email settings to enable the viewing of HTML.\n 64 | Do not reply to this notification message; this message was auto-generated 65 | by the sender's security system. To reply to the sender, click on the link 66 | above. 67 | 68 | The secure message expires on {2}. 69 | """.format(client, URL_Placemarker, expireDate) 70 | 71 | htmlBody =''' 72 |
New ZixCorp secure = 78 | email message from %s
Open Message

To view the s= 88 | ecure message, click Open Message.

The secure message expires on %s.

Do not reply to this notification message;= 89 | this message was auto-generated by the sender\'s security system. To reply = 90 | to the sender, click Open Message.

If clicking Open Message does not = 91 | work, copy and paste the link below into your Internet browser address bar.
= 92 |
%s

93 | ''' %(client, URL_Placemarker,expireDate,URL_Placemarker,MaskedURL) 94 | 95 | # File attachment 96 | if variable_dict['attachment'] != '': 97 | filename = variable_dict['attachment'] 98 | fp = open(filename,'rb') 99 | extension = filename.rsplit('.', 1)[-1] 100 | att = email.mime.application.MIMEApplication(fp.read(),_subtype=extension) 101 | fp.close() 102 | att.add_header('Content-Disposition','attachment',filename=filename) 103 | msg.attach(att) 104 | 105 | part1 = MIMEText(plaintextBody, 'plain') 106 | part2 = MIMEText(htmlBody, 'html') 107 | part2.replace_header('Content-Transfer-Encoding', 'quoted-printable') 108 | 109 | # Attach parts into message container. 110 | # According to RFC 2046, the last part of a multipart message, in this case 111 | # the HTML message, is best and preferred. 112 | msg.attach(part1) 113 | msg.attach(part2) 114 | return msg.as_string() 115 | -------------------------------------------------------------------------------- /SupportingFiles/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redteamsecurity/PyPhishing/7e9b0a836704e31cf065b8331cc35b41110ad93b/SupportingFiles/__init__.py -------------------------------------------------------------------------------- /SupportingFiles/buildMenu.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ######################################## 4 | # # 5 | # # 6 | # Used to create the build # 7 | # menues for each instance obj # 8 | # # 9 | # # 10 | ######################################## 11 | 12 | import readline 13 | readline.parse_and_bind('tab: complete') 14 | 15 | 16 | def dict_to_list(temporaryDict): 17 | # Takes in a dictionary and creates a list (crappy shortcut but will work for now) 18 | tempList = [] 19 | tempList.insert(0, temporaryDict['scenario']) 20 | tempList.insert(1, temporaryDict['link']) 21 | tempList.insert(2, temporaryDict['encoding']) 22 | tempList.insert(3, temporaryDict['addressfile']) 23 | a = [] # had to create a list to put in tempList (backwards as hell, i know) 24 | a.insert(0, temporaryDict['headerfrom']) 25 | a.insert(1, temporaryDict['smtpfrom']) 26 | a.insert(2, temporaryDict['client']) 27 | a.insert(3, temporaryDict['bodysender']) 28 | a.insert(4, temporaryDict['url']) 29 | a.insert(5, temporaryDict['verbose']) 30 | a.insert(6, temporaryDict['attachment']) 31 | tempList.insert(4, a) 32 | b = [] 33 | b.insert(0, temporaryDict['smtpserver']) 34 | b.insert(1, temporaryDict['smtpusername']) 35 | b.insert(2, temporaryDict['smtppass']) 36 | b.insert(3, temporaryDict['smtpport']) 37 | tempList.insert(5, b) 38 | 39 | return tempList 40 | 41 | class create_menu: 42 | '''This is used to build an instance of the menu object 43 | and can be called from the main program to instantiate the menu 44 | with passed variables.''' 45 | def __init__(self, menu, text, variable_dict): 46 | if type(variable_dict) == dict: 47 | # Sometimes a blank string is passed and that needs to be accounted for 48 | variable_list = dict_to_list(variable_dict) # Shortcut so I didn't have to build the menu shit again 49 | else: 50 | variable_list = variable_dict 51 | self.text = text 52 | self.menu = menu 53 | self.variable = variable_list 54 | var_list_length = len(variable_list) 55 | o = 0 56 | 57 | # Build the menu 58 | for i, option in enumerate(menu): 59 | option_length = len(option) 60 | menunum = i + 1 61 | if menunum < 10: 62 | 63 | # If there are variables passed, it prints them 64 | if o < var_list_length: 65 | if type(variable_list[o]) is type(list()): 66 | # Print the variables differently if a list 67 | variable_string = '' 68 | 69 | for item in variable_list[o]: 70 | variable_string = variable_string + ', ' + item 71 | variable_string = variable_string[2:] 72 | print(' %s) %s' %(menunum, option)) + ((30-option_length)*' ') + '| ' + variable_string 73 | 74 | else: 75 | print(' %s) %s' %(menunum, option)) + ((30-option_length)*' ') + '| ' + variable_list[o] 76 | o += 1 77 | 78 | else: 79 | print(' %s) %s' %(menunum, option)) + ((28-option_length)*' ') + ' | ' 80 | 81 | 82 | elif menunum >= 10 and menunum < 99: 83 | # To be used when the list exceeds 10 options 84 | # could probably be more graceful (but it works) 85 | if o < var_list_length: 86 | if type(variable_list[o]) is type(list()): 87 | variable_string = '' 88 | 89 | for item in variable_list[o]: 90 | variable_string = variable_string + ', ' + item 91 | variable_string = variable_string[2:] 92 | print(' %s) %s' %(menunum, option)) + ((30-option_length)*' ') + '| ' + variable_string 93 | 94 | else: 95 | print(' %s) %s' %(menunum, option)) + ((30-option_length)*' ') + '| ' + variable_list[o] 96 | o += 1 97 | 98 | else: 99 | print(' %s) %s' %(menunum, option)) + ((28-option_length)*' ') + ' | ' 100 | 101 | else: 102 | print(' %s) %s' %(menunum, option)) 103 | if '99' not in text: 104 | print '\n 99) Exit or Return to Main Menu' 105 | return 106 | 107 | class create_advanced_menu: 108 | '''This is used to build an instance of the menu object 109 | and can be called from the main program to instantiate the advanced 110 | menu with passed variables.''' 111 | def __init__(self, menu, text, variable_list): 112 | self.text = text 113 | self.menu = menu 114 | self.variable = variable_list 115 | var_list_length = len(variable_list) 116 | o = 0 117 | 118 | # Build the menu 119 | for i, option in enumerate(menu): 120 | option_length = len(option) 121 | menunum = i + 1 122 | if menunum < 10: 123 | 124 | # If there are variables passed, it prints them 125 | if o < var_list_length: 126 | if type(variable_list[o]) is type(list()): 127 | # Print the variables differently if a list 128 | variable_string = '' 129 | for item in variable_list[o]: 130 | variable_string = variable_string + ' ' + item 131 | variable_string = variable_string 132 | print(' > %s' %( option)) + ((55-option_length)*' ') + '| ' + variable_string 133 | 134 | else: 135 | print(' > %s' %(option)) + ((55-option_length)*' ') + '| ' + variable_list[o] 136 | o += 1 137 | else: 138 | print(' > %s' %(option )) + ((52-option_length)*' ') + ' | ' 139 | else: 140 | 141 | print(' %s) %s' %(menunum, option)) 142 | if '99' not in text: 143 | print '\n 99) Exit or Return to Main Menu' 144 | return 145 | 146 | def setpromt(text): 147 | return text + ' >> ' 148 | -------------------------------------------------------------------------------- /SupportingFiles/deliverEmails.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import smtplib, base64, random, re, string, csv, time 4 | from Emails import secureUpdateBody 5 | from Emails import microsoftUpdateBody 6 | from Emails import microsoftUpdateForward 7 | from Emails import zixmailSecureEmail 8 | from Emails import googleSupport 9 | from Emails import fedEx 10 | from Emails import onsiteTech 11 | from Emails import itControlsDoc 12 | from Emails import xcel 13 | from Emails import tempTest 14 | 15 | # Variable initialization 16 | cleanAddresses = [] 17 | email_pattern = re.compile(r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)") 18 | 19 | 20 | # This will build a CSV file of user's email addresses, base64encoded emails, and if message was successfully sent 21 | def buildCSV(address, email_id, success): 22 | #if (os.path.isfile('addresses.csv')): 23 | # print 'addresses.csv exists, please remove or rename' 24 | #else: 25 | with open('delivered.csv', 'a') as csvfile: 26 | a = csv.writer(csvfile, delimiter=',') 27 | data = [[address, email_id, success]] 28 | a.writerows(data) 29 | 30 | 31 | def build_email(address, temp_dict): 32 | # Builds the phishing message on the fly 33 | body_file = determine_pretext(temp_dict['scenario']) 34 | 35 | # This needs to be removed 36 | if temp_dict['link'] != '': 37 | oldBody = body_file.build_body(temp_dict) 38 | else: 39 | oldBody = body_file.build_body(temp_dict) 40 | 41 | # Creates a custom message for each recipient 42 | PHISHING_URL = temp_dict['url'] 43 | if PHISHING_URL == '': 44 | PHISHING_URL = 'http://google.com' 45 | 46 | 47 | if temp_dict['encoding'] == 'Randomized ID': 48 | # Randomized chars as user ID 49 | if temp_dict['encodinglength'] == '': 50 | temp_dict['encodinglength'] = '4' 51 | random_range = int(temp_dict['encodinglength']) 52 | email_id = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(random_range)]) 53 | newPhishURL = PHISHING_URL + email_id 54 | #oldBody.replace("EMPADDR",address) 55 | newBody = string.replace(oldBody,"EMPADDR",address) 56 | newBody = string.replace(newBody, "URL_Placemarker", newPhishURL) 57 | 58 | else: 59 | # Base64 encoded email as user ID 60 | email_id = base64.b64encode(address) 61 | if temp_dict['scenario'] == 'Secure Update Delivery': 62 | # Have to remove ?uid= when using this pretext in order to have the database accept the value 63 | newPhishURL = PHISHING_URL + email_id 64 | else: 65 | newPhishURL = PHISHING_URL + "?uid=3D" + email_id 66 | newBody = string.replace(oldBody,"EMPADDR",address) 67 | newBody = string.replace(newBody, "URL_Placemarker", newPhishURL) 68 | 69 | return newBody, email_id 70 | 71 | def determine_pretext(pretext): 72 | pretext_file = '' 73 | # The pretext is passed and the correct file is set 74 | # for build_email and then deliverance function 75 | if 'Zixmail Secure Email' in pretext: 76 | # If scenario 1 is selected do the following 77 | pretext_file = zixmailSecureEmail 78 | elif 'Secure Update Delivery' in pretext: 79 | pretext_file = secureUpdateBody 80 | elif 'Microsoft Update' in pretext: 81 | pretext_file = microsoftUpdateBody 82 | elif 'MS Update Forward' in pretext: 83 | pretext_file = microsoftUpdateForward 84 | elif 'Google Support' in pretext: 85 | pretext_file = googleSupport 86 | elif 'FedEx Shipment Unsuccessful' in pretext: 87 | pretext_file = fedEx 88 | elif 'On-site Tech' in pretext: 89 | pretext_file = onsiteTech 90 | elif 'IT Controls Document' in pretext: 91 | pretext_file = itControlsDoc 92 | elif 'Xcel' in pretext: 93 | pretext_file = xcel 94 | elif 'Test' in pretext: 95 | pretext_file = tempTest 96 | 97 | return pretext_file 98 | 99 | # Sends the email 100 | def deliverance(variable_dict): 101 | username = variable_dict['smtpusername'] 102 | password = variable_dict['smtppass'] 103 | smtpServer = variable_dict['smtpserver'] 104 | smtpport = variable_dict['smtpport'] 105 | 106 | #Should this be smtpSender??? 107 | sender = variable_dict['smtpfrom'] 108 | 109 | server = smtplib.SMTP(smtpServer, smtpport) 110 | if variable_dict['verbose'].lower() == 'true': 111 | server.set_debuglevel(1) 112 | server.ehlo() 113 | server.starttls() 114 | if username != '' and password != '': 115 | # To be used when smtp servers do not require authentication 116 | server.login(username,password) 117 | 118 | cleanAddresses = [] 119 | if variable_dict['addressfile'] != '': 120 | # If sending to bulk list 121 | emailOpen = open(variable_dict['addressfile'], 'r') 122 | addresses = emailOpen.readlines() 123 | 124 | print '\nTime started: ' 125 | print (time.strftime("%H:%M:%n\n")) 126 | 127 | # The following removes new line chars and carriage returns from text file 128 | for element in addresses: 129 | element = element.strip('\n\r') 130 | if not email_pattern.match(element): 131 | print "Email addresses are not in correct format, please check. Hint: one address per line." 132 | break 133 | cleanAddresses.append(element) 134 | for address in cleanAddresses: 135 | message, email_id = build_email(address, variable_dict) 136 | 137 | try: 138 | server.sendmail(sender, address, message) 139 | success='Delivered' 140 | buildCSV(address, email_id, success) # adds user email address and b64 encoded address to csv 141 | print 'Successfully sent email to {0}'.format(address) 142 | time.sleep(5) 143 | except: 144 | print "\n\nError: unable to send email to {0}".format(address) 145 | success='Not Delivered' 146 | buildCSV(address, email_id, success) # adds user email address and b64 encoded address to csv 147 | server.quit() 148 | print 'Time Done: ' 149 | print (time.strftime("%H:%M:%S")) 150 | 151 | 152 | def temp_deliverance(test_address, test_variable_dict): 153 | # for use when a test email is being sent 154 | username = test_variable_dict['smtpusername'] 155 | password = test_variable_dict['smtppass'] 156 | smtpServer = test_variable_dict['smtpserver'] 157 | smtpport = test_variable_dict['smtpport'] 158 | 159 | message, email_id = build_email(test_address, test_variable_dict) 160 | 161 | sender = test_variable_dict['smtpfrom'] 162 | server = smtplib.SMTP(smtpServer, smtpport) 163 | if test_variable_dict['verbose'].lower() == 'true': 164 | server.set_debuglevel(1) 165 | 166 | server.ehlo() 167 | server.starttls() 168 | if username != '' and password != '': 169 | # To be used when smtp servers do not require authentication 170 | server.login(username,password) 171 | try: 172 | server.sendmail(sender, test_address, message) 173 | print "Successfully sent test email to {0}".format(test_address) 174 | time.sleep(5) 175 | except Exception: 176 | print "Error: unable to send test email to {0}".format(test_address) 177 | 178 | server.quit() 179 | 180 | 181 | def test_message(choice, temp_test_email, temp_variable_dict): 182 | # Used if the user is testing an email scenario 183 | if choice == '8': 184 | temp_deliverance(temp_test_email, temp_variable_dict) 185 | else: 186 | print('Error, returning to menu') 187 | return 188 | -------------------------------------------------------------------------------- /SupportingFiles/images/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redteamsecurity/PyPhishing/7e9b0a836704e31cf065b8331cc35b41110ad93b/SupportingFiles/images/google.png -------------------------------------------------------------------------------- /SupportingFiles/images/microsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redteamsecurity/PyPhishing/7e9b0a836704e31cf065b8331cc35b41110ad93b/SupportingFiles/images/microsoft.png -------------------------------------------------------------------------------- /SupportingFiles/menuText.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ######################################## 4 | # # 5 | # # 6 | # Used to create the textual # 7 | # menues for the application # 8 | # # 9 | # # 10 | ######################################## 11 | 12 | 13 | 14 | menu_text = '\n Select from the menu \n' 15 | 16 | variable_menu = ['\n Set a variable in the format: "set [variable] [data] "', 17 | 'Example: set smtpfrom it@microsoft.com'] 18 | 19 | main_menu = ['Choose a Pretext', 20 | 'Masked Link?', 21 | 'User Coding Scheme', 22 | 'Attach Address File', 23 | 'Advanced Settings', 24 | 'SMTP Credentials', 25 | 'Import/Export Config File', 26 | 'Test', 27 | 'Send Out!!'] 28 | 29 | scenario_menu = ['Zixmail Secure Email', 30 | 'Secure Update Delivery', 31 | 'Microsoft Update', 32 | 'MS Update Forward', 33 | 'Google Support', 34 | 'FedEx Shipment Unsuccessful', 35 | 'On-site Tech', 36 | 'IT Controls Document', 37 | 'Xcel', 38 | 'Test'] 39 | 40 | masked_menu = ['Use a masked Link? (yes,no)', 41 | 'What do you want it to appear as?'] 42 | 43 | encoding_menu = ['Base64 encoded email', 44 | 'Randomized ID'] 45 | 46 | advanced_menu = ['Sender in email header (headerfrom)', 47 | 'Sender in SMTP settings (smtpfrom)', 48 | 'Client name for message variables (client)', 49 | 'Email address to use within email body (bodysender)', 50 | 'URL to direct users to (unmasked) (url)', 51 | 'Set verbosity (true/false) (verbose)', 52 | 'Attach file to email (attachment)'] 53 | 54 | mail_settings_menu = ['Mail server (ex. smtp.google.com) (server)', 55 | 'SMTP Port (default is 25) (port)', 56 | 'SMTP Username (username)', 57 | 'SMTP Password (password)'] 58 | -------------------------------------------------------------------------------- /config-files/base-config.txt: -------------------------------------------------------------------------------- 1 | # File is imported with user-entered configuration settings. 2 | 3 | # Set pretext (Choose from the following): Zixmail Secure Email, Secure Update Delivery, Microsoft Update, Google Support, 4 | # FedEx Shipment Unsuccessful, iTunes, On-site Tech, CMS, IT Controls Document, Xcel, Test 5 | [Configs] 6 | scenario = Test 7 | 8 | # Set masked link 9 | # the first entry is no masked link 10 | link = 11 | #link = https://microsoft.com/download/update.exe 12 | #link = Click Here! 13 | 14 | # Set User Encoding Scheme: Base64 encoded email, Randomized ID 15 | #encoding = Base64 encoded email 16 | encoding = Randomized ID 17 | encodinglength = 18 | 19 | 20 | # Set address file 21 | addressfile = 22 | 23 | # Set Advanced Settings 24 | # Format: [headersender, smtpsender, client, bodysender, url, verbose, attachment] 25 | # Headerfrom - What the email client sees (Ex. Matt ), 26 | # SMTPFrom - What the email relay sees, 27 | # Client - Some scenarios have a client variable you can add that here, 28 | # BodySender - Some scenarios have a sender within the body variable, change that here, 29 | # URL - what you want the base phishing URL to be (base64 encoded email will be appended to it). 30 | # Verbose - if you want detailed sending information from SMTP server 31 | # Attachment - if you want to attach a file to an email 32 | headerfrom = IT Support 33 | smtpfrom = 34 | client = 35 | bodysender = 36 | url = 37 | verbose = False 38 | attachment = 39 | 40 | # Set SMTP Credentials 41 | # [SMTP server, SMTP username, SMTP password] 42 | smtpserver = 43 | smtpusername = 44 | smtppass = 45 | smtpport = 25 46 | -------------------------------------------------------------------------------- /pyPhishing.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ######################################## 4 | # # 5 | # # 6 | # Used to drive the program # 7 | # and send emails to users # 8 | # # 9 | # Now GIT Enabled :) # 10 | # # 11 | # Created by Matt Grandy # 12 | # Email: grandy[at]redteamsecure.com # 13 | # # 14 | # # 15 | ######################################## 16 | 17 | import os 18 | import ConfigParser 19 | import argparse 20 | import sys 21 | 22 | from SupportingFiles import menuText 23 | from SupportingFiles.buildMenu import * 24 | from SupportingFiles import deliverEmails 25 | 26 | # Initialize variables 27 | argument_list = ['','','','', '',''] 28 | answerList = [] 29 | advanced_answer_list = ['','','','','http://google.com'] 30 | smtp_answer_list = ['','','',''] 31 | argument_list.insert(4, advanced_answer_list) 32 | 33 | parser = argparse.ArgumentParser(prog=sys.argv[0],description=' -c ') 34 | parser.add_argument('-c', '--config', dest='configFile', help='specify a configuration file to use') 35 | parser.add_argument('-v', '--verbose', dest='verboseFlag', action='store_true', help='Specify if you want verbose sending of emails') 36 | 37 | args = parser.parse_args() 38 | 39 | 40 | def importConfig(): 41 | # Imports a given config file (this can be used if a -c flag given) 42 | config = ConfigParser.RawConfigParser(allow_no_value=True) 43 | config.readfp(open(argument_dict['importfile'])) 44 | options_len = len(config.options("Configs")) 45 | starter = 0 46 | for options in config.options("Configs"): 47 | if starter <= options_len: 48 | argument_dict[options] = config.get("Configs",options) 49 | starter = starter + 1 50 | 51 | def exportConfig(): 52 | # Exports a configuration file with a user-supplied name 53 | while 1: 54 | exportFile = raw_input(setpromt('\nName of desired config file:\n')) 55 | argument_dict['exportfile'] = exportFile 56 | if os.path.isfile(argument_dict['exportfile']): 57 | print '\nFile exists, chose a different name\n' 58 | continue 59 | elif exportFile in ['99', 'back', 'exit']: 60 | break 61 | else: 62 | exportFile = open(argument_dict['exportfile'], 'w') 63 | exportFile.write('[Configs]\n') 64 | for key, value in argument_dict.items(): 65 | exportFile.write('\n' + str(key) + ' = ' + str(value)) 66 | exportFile.close() 67 | print '\nFile exported successfully' 68 | break 69 | 70 | def build_empty_dictionary(): 71 | # Builds an empty dictionary with required keys 72 | tempDict = {} 73 | tempDict['scenario'] = '' 74 | tempDict['importfile'] = '' 75 | tempDict['exportfile'] = '' 76 | tempDict['verbose'] = str(args.verboseFlag) 77 | tempDict['link'] = '' 78 | tempDict['encoding'] = '' 79 | tempDict['encodinglength'] = '' 80 | tempDict['addressfile'] = '' 81 | tempDict['headerfrom'] = '' 82 | tempDict['smtpfrom'] = '' 83 | tempDict['client'] = 'no_client' 84 | tempDict['bodysender'] = '' 85 | tempDict['url'] = 'https://google.com' 86 | tempDict['attachment'] = '' 87 | tempDict['smtpserver'] = '' 88 | tempDict['smtpusername'] = '' 89 | tempDict['smtppass'] = '' 90 | tempDict['smtpport'] = '25' 91 | return tempDict 92 | 93 | argument_dict = build_empty_dictionary() 94 | # Call the configuration check if supplied -c flag 95 | if (args.configFile != None): 96 | if os.path.isfile(args.configFile): 97 | argument_dict['importfile'] = args.configFile 98 | importConfig() 99 | else: 100 | print('404: File not found') 101 | else: 102 | pass 103 | 104 | while 1: 105 | 106 | ############################## 107 | # Main Menu # 108 | ############################## 109 | 110 | print('\n\n############################ MAIN MENU #############################\n') 111 | print(' | Selection:') 112 | create_menu(menuText.main_menu, '1', argument_dict) 113 | print('\n######################################################################') 114 | main_menu_choice = raw_input(setpromt(menuText.menu_text)) 115 | if main_menu_choice == '99' or main_menu_choice.lower() == 'exit': 116 | break 117 | 118 | elif main_menu_choice == '1': # Pick scenario 119 | 120 | ############################## 121 | # Scenario # 122 | ############################## 123 | print 124 | show_scenario_menu = create_menu(menuText.scenario_menu, menuText.menu_text, '') 125 | print 126 | scenario_menu_choice = raw_input(setpromt('Select a pretext\n')) 127 | try:scenario_menu_choice_text = menuText.scenario_menu[int(scenario_menu_choice)-1] 128 | except: pass 129 | 130 | # The following will pull the length from the munuText file and determines if the user 131 | # chooses within that list. 132 | if scenario_menu_choice in (str(range(len(menuText.scenario_menu)+1))): 133 | argument_dict['scenario'] = scenario_menu_choice_text 134 | continue 135 | elif scenario_menu_choice in ['99','back','exit']: 136 | pass 137 | else: 138 | print 'Unknown pretext' 139 | continue 140 | 141 | 142 | if main_menu_choice == '2': 143 | 144 | ############################## 145 | # Masked Link # 146 | ############################## 147 | 148 | print('\n\n') 149 | masked_menu_choice = raw_input(setpromt('Use masked link? (y/n)\n')) 150 | if masked_menu_choice == 'y': 151 | masked_menu_string = raw_input(setpromt('\nWhat you want the link to appear as: \n')) 152 | argument_dict['link'] = masked_menu_string 153 | else: 154 | argument_dict['link'] = '' 155 | 156 | 157 | if main_menu_choice =='3': 158 | 159 | ################################ 160 | # Coding Scheme # 161 | ################################ 162 | 163 | print 164 | show_encoding_menu = create_menu(menuText.encoding_menu, menuText.menu_text, '') 165 | print 166 | encoding_menu_choice = raw_input(setpromt('Select an encoding scheme\n')) 167 | try:encoding_menu_choice_text = menuText.encoding_menu[int(encoding_menu_choice)-1] 168 | except: pass 169 | 170 | # Makes sure the selection is within the given list 171 | if encoding_menu_choice in ['1','2']: 172 | argument_dict['encoding'] = encoding_menu_choice_text 173 | if encoding_menu_choice == '2': 174 | encoding_length = raw_input(setpromt('Desired length of list? Max 32 characters\n')) 175 | # set a default value to make things easier 176 | if encoding_length == '': 177 | encoding_length = '4' 178 | try: encoding_length_int = int(encoding_length) 179 | except: pass 180 | if int(encoding_length_int) > 32: 181 | print '\nEncoding length too long, try again.\n' 182 | else: 183 | argument_dict['encodinglength'] = encoding_length_int 184 | 185 | elif encoding_menu_choice in ['99', 'back', 'exit']: 186 | pass 187 | else: 188 | print 'Unknown encoding choice' 189 | 190 | 191 | if main_menu_choice =='4': 192 | 193 | ######################################## 194 | # Attach Address File # 195 | ######################################## 196 | 197 | while 1: 198 | print 199 | addresses_file = raw_input(setpromt('\nPlease input a text file with addresses to phish, one address per line\n')) 200 | 201 | if os.path.isfile(addresses_file): 202 | address_file_temp = open(addresses_file, 'r') 203 | for line in address_file_temp: 204 | if ',' in line: # This needs to be re-done! 205 | print '\nUnknown character in address file, please reformat file to one address per line, no characters other than _, -, ., @\n' 206 | break 207 | else: 208 | print('File exists, using {0} for list of users to phish').format(addresses_file) 209 | argument_dict['addressfile'] = addresses_file 210 | break 211 | break 212 | elif addresses_file in ['99', 'back']: 213 | break 214 | else: 215 | print('404: File not found') 216 | 217 | 218 | if main_menu_choice =='5': 219 | # Have to create a list from the dictionary with advanced settings. Because I'm lazy 220 | advanced_answer_list.insert(0,argument_dict['headerfrom']) 221 | advanced_answer_list.insert(1,argument_dict['smtpfrom']) 222 | advanced_answer_list.insert(2,argument_dict['client']) 223 | advanced_answer_list.insert(3,argument_dict['bodysender']) 224 | advanced_answer_list.insert(4,argument_dict['url']) 225 | advanced_answer_list.insert(5,argument_dict['verbose']) 226 | advanced_answer_list.insert(6, argument_dict['attachment']) 227 | 228 | ############################## 229 | # Advanced Settings # 230 | ############################## 231 | while 1: 232 | 233 | print('\n\n@@@@@@@@@@@@@@@@@@@@@@@ ADVANCED MENU @@@@@@@@@@@@@@@@@@@@@@@') 234 | print('\nUse Metasploit syntax: set [variable] [value] or unset [variable]') 235 | print('Example: set headerfrom matt@gmail.com or matt \n') 236 | print(' Description Variable | Selection') 237 | print('-------------------------------------------------------------------------') 238 | show_advanced_menu = create_advanced_menu(menuText.advanced_menu, menuText.menu_text, advanced_answer_list) 239 | print('\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') 240 | 241 | advanced_menu_list = [] 242 | advanced_menu_string = raw_input(setpromt('\nChange settings\n')) 243 | advanced_menu_list = advanced_menu_string.split() 244 | advanced_menu_list = advanced_menu_string.split(' ', 2) 245 | 246 | # Breaks on whitespace, then checks each index for a specific variable name 247 | # if it is typed correctly, the variable is added, removed, or replaced. 248 | if advanced_menu_list[0].lower() == 'set' or advanced_menu_list[0].lower() == 'unset': 249 | if advanced_menu_list[1].lower() == 'headerfrom': 250 | if advanced_menu_list[0].lower() == 'unset': 251 | argument_dict['headerfrom'] = '' 252 | else: 253 | argument_dict['headerfrom'] = advanced_menu_list[2] 254 | # Still need to account for re-setting 255 | try: del advanced_answer_list[0] 256 | except: pass 257 | advanced_answer_list.insert(0,argument_dict['headerfrom']) 258 | 259 | elif advanced_menu_list[1].lower() == 'smtpfrom': 260 | # This one is what the SMTP server sees as "mail from" 261 | if advanced_menu_list[0].lower() == 'unset': 262 | argument_dict['smtpfrom'] = '' 263 | else: 264 | argument_dict['smtpfrom'] = advanced_menu_list[2] 265 | try: del advanced_answer_list[1] 266 | except: pass 267 | advanced_answer_list.insert(1,argument_dict['smtpfrom']) 268 | 269 | elif advanced_menu_list[1].lower() == 'client': 270 | if advanced_menu_list[0].lower() == 'unset': 271 | argument_dict['client'] = '' 272 | else: 273 | argument_dict['client'] = advanced_menu_list[2] 274 | try: del advanced_answer_list[2] 275 | except: pass 276 | advanced_answer_list.insert(2,argument_dict['client']) 277 | 278 | elif advanced_menu_list[1].lower() == 'bodysender': 279 | if advanced_menu_list[0].lower() == 'unset': 280 | argument_dict['bodysender'] = '' 281 | else: 282 | argument_dict['bodysender'] = advanced_menu_list[2] 283 | try: del advanced_answer_list[3] 284 | except: pass 285 | advanced_answer_list.insert(3,argument_dict['bodysender']) 286 | 287 | elif advanced_menu_list[1].lower() == 'url': 288 | if advanced_menu_list[0].lower() == 'unset': 289 | argument_dict['url'] = '' 290 | else: 291 | argument_dict['url'] = advanced_menu_list[2] 292 | try: del advanced_answer_list[4] 293 | except: pass 294 | advanced_answer_list.insert(4,argument_dict['url']) 295 | 296 | elif advanced_menu_list[1].lower() == 'verbose': 297 | if advanced_menu_list[0].lower() == 'unset': 298 | argument_dict['verbose'] = '' 299 | else: 300 | if advanced_menu_list[2].lower() in ['true', 'false']: 301 | argument_dict['verbose'] = advanced_menu_list[2] 302 | else: print '\nPlease specify either "True" or "False".\n' 303 | try: del advanced_answer_list[5] 304 | except: pass 305 | advanced_answer_list.insert(5,argument_dict['verbose']) 306 | 307 | elif advanced_menu_list[1].lower() == 'attachment': 308 | if advanced_menu_list[0].lower() == 'unset': 309 | argument_dict['attachment'] = '' 310 | try: del advanced_answer_list[6] 311 | except: pass 312 | advanced_answer_list.insert(6,argument_dict['attachment']) 313 | else: 314 | if os.path.isfile(advanced_menu_list[2]): 315 | argument_dict['attachment'] = advanced_menu_list[2] 316 | try: del advanced_answer_list[6] 317 | except: pass 318 | advanced_answer_list.insert(6,argument_dict['attachment']) 319 | else: 320 | print '404, file not found' 321 | continue 322 | else: 323 | print('Unknown command, try again ') 324 | 325 | 326 | elif advanced_menu_list[0] in ['99', 'back', 'exit']: 327 | break 328 | else: 329 | print('Unknown command, try again ') 330 | 331 | 332 | 333 | if main_menu_choice =='6': 334 | 335 | ##################################### 336 | # SMTP Creds # 337 | ##################################### 338 | 339 | 340 | smtp_answer_list.insert(0,argument_dict['smtpserver']) 341 | smtp_answer_list.insert(1,argument_dict['smtpport']) 342 | smtp_answer_list.insert(2,argument_dict['smtpusername']) 343 | smtp_answer_list.insert(3,argument_dict['smtppass']) 344 | 345 | 346 | while 1: 347 | 348 | print('\n\n$$$$$$$$$$$$$$$$$$$$$$$$ SMTP MENU $$$$$$$$$$$$$$$$$$$$$$$$') 349 | print('\nUse Metasploit syntax: set [variable] [value]') 350 | print('Example: set server smtp.google.com\n') 351 | print(' Description Variable | Selection') 352 | print('-------------------------------------------------------------------------') 353 | show_smtp_menu = create_advanced_menu(menuText.mail_settings_menu, menuText.menu_text, smtp_answer_list) 354 | print('\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$') 355 | 356 | smtp_menu_list = [] 357 | smtp_menu_string = raw_input(setpromt('\nChange settings\n')) 358 | smtp_menu_list = smtp_menu_string.split() 359 | smtp_menu_list = smtp_menu_string.split(' ', 2) 360 | 361 | # Breaks on whitespace, then checks each index for a specific variable name 362 | # if it is typed correctly, the variable is added or replaced. 363 | if smtp_menu_list[0].lower() == 'set' or smtp_menu_list[0].lower() == 'unset': 364 | if smtp_menu_list[1].lower() == 'server': 365 | if smtp_menu_list[0].lower() == 'unset': 366 | argument_dict['smtpserver'] = '' 367 | else: 368 | argument_dict['smtpserver'] = smtp_menu_list[2] 369 | try: del smtp_answer_list[0] 370 | except: pass 371 | smtp_answer_list.insert(0,argument_dict['smtpserver']) 372 | 373 | elif smtp_menu_list[1].lower() == 'port': 374 | if smtp_menu_list[0].lower() == 'unset': 375 | argument_dict['smtpport'] = '' 376 | try: del smtp_answer_list[1] 377 | except: pass 378 | smtp_answer_list.insert(1,argument_dict['smtpport']) 379 | else: 380 | if ((smtp_menu_list[2]).isdigit()): 381 | argument_dict['smtpport'] = smtp_menu_list[2] 382 | try: del smtp_answer_list[1] 383 | except: pass 384 | smtp_answer_list.insert(1,argument_dict['smtpport']) 385 | else: 386 | print 'Port entered was not a digit' 387 | continue 388 | 389 | elif smtp_menu_list[1].lower() == 'username': 390 | if smtp_menu_list[0].lower() == 'unset': 391 | argument_dict['smtpusername'] = '' 392 | else: 393 | argument_dict['smtpusername'] = smtp_menu_list[2] 394 | try: del smtp_answer_list[2] 395 | except: pass 396 | smtp_answer_list.insert(2,argument_dict['smtpusername']) 397 | 398 | elif smtp_menu_list[1].lower() == 'password': 399 | if smtp_menu_list[0].lower() == 'unset': 400 | argument_dict['smtppass'] = '' 401 | else: 402 | argument_dict['smtppass'] = smtp_menu_list[2] 403 | try: del smtp_answer_list[3] 404 | except: pass 405 | smtp_answer_list.insert(3,argument_dict['smtppass']) 406 | 407 | else: 408 | print('Unknown command, try again ') 409 | 410 | elif smtp_menu_list[0] in ['99', 'back', 'exit']: 411 | break 412 | else: 413 | print('Unknown command, try again ') 414 | 415 | 416 | if main_menu_choice =='7': 417 | 418 | ######################################## 419 | # Import/export Config # 420 | ######################################## 421 | 422 | while 1: 423 | print 424 | impExpAns = raw_input(setpromt('\nWould you like to import or export a config file (import/export)\n')) 425 | if impExpAns.lower() in ['import', 'export']: 426 | if impExpAns == 'import': 427 | # If the user would like to import a configuration file 428 | importFile = raw_input(setpromt('\nPath to config file:\n')) 429 | if os.path.isfile(importFile): 430 | print('File exists, using {0} for config file').format(importFile) 431 | argument_dict['importfile'] = importFile 432 | importConfig() 433 | break 434 | else: 435 | print('404: File not found') 436 | elif impExpAns == 'export': 437 | # Exports the current configuration to a file 438 | exportConfig() 439 | break 440 | 441 | elif impExpAns in ['99', 'back', 'exit']: 442 | break 443 | else: 444 | print('\nPlease either use "import" or "export".') 445 | 446 | 447 | if main_menu_choice =='8': 448 | 449 | ############################## 450 | # Testing of email # 451 | ############################## 452 | 453 | # THIS NEEDS TO BE REMOVED TO ACCOUNT FOR SERVERS WITHOUT AUTHENTICATION 454 | if argument_dict['smtpserver'] == '': 455 | print('\nPlease enter SMTP server before sending emails!') 456 | continue 457 | 458 | else: 459 | test_email_address = raw_input(setpromt('\nPlease input an email address to test\n')) 460 | 461 | if test_email_address in ['99', 'back']: 462 | continue 463 | else: 464 | deliverEmails.test_message(main_menu_choice, test_email_address, argument_dict) 465 | 466 | 467 | if main_menu_choice =='9': 468 | 469 | ############################## 470 | # Sending of email # 471 | ############################## 472 | 473 | # THIS NEEDS TO BE REMOVED TO ACCOUNT FOR SERVERS WITHOUT AUTHENTICATION 474 | if argument_dict['smtpserver'] == '': 475 | print('\nPlease enter SMTP server before sending emails!') 476 | continue 477 | 478 | verification = raw_input(setpromt('\n\nAre you sure you want to send? (YES/no)\n')) 479 | if verification == 'YES': 480 | deliverEmails.deliverance(argument_dict) 481 | 482 | elif verification.lower() in ['99','no','back']: 483 | continue 484 | else: 485 | print "Unknown command, returning to main menu" 486 | continue 487 | #if main_menu_choice not in range(1,9): 488 | # print '\nUnrecognized choice, please make another selection\n' 489 | else: 490 | continue 491 | --------------------------------------------------------------------------------