├── .gitignore ├── .gitmodules ├── .travis.yml ├── LICENSE ├── MUA ├── Apple │ └── Mail │ │ └── MISP Mail Rule Action.txt ├── Microsoft │ └── Office365 │ │ └── README.md └── Mozilla │ └── Thunderbird │ └── thunderbird_wrapper.sh ├── README.md ├── __init__.py ├── certs └── .keepdir ├── fake_smtp.py ├── fake_smtp_config.py-example ├── mail2misp ├── __init__.py ├── hashmarker.py ├── mail2misp.py └── urlmarker.py ├── mail_to_misp.py ├── mail_to_misp_config.py-example ├── mail_to_misp_forward.py ├── mail_to_misp_o365.py ├── poetry.lock ├── pyproject.toml ├── requirements.txt ├── setup.py └── tests ├── __init__.py ├── config_carrier.py ├── config_forward.py ├── config_spamtrap.py └── tests.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | 103 | # Redis 104 | *.rdb 105 | 106 | # Storage 107 | rawdata 108 | 109 | # ardb 110 | storage/ardb.pid 111 | storage/data 112 | storage/repl 113 | 114 | # Config files of running instance 115 | *config.py 116 | 117 | # python-o365 token file 118 | o365_token.txt 119 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tests/mails"] 2 | path = tests/mails 3 | url = https://github.com/MISP/mail_to_misp_test.git 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | 3 | cache: pip 4 | 5 | addons: 6 | apt: 7 | packages: 8 | - libfuzzy-dev 9 | 10 | python: 11 | - "3.6-dev" 12 | - "3.7-dev" 13 | - "3.8-dev" 14 | 15 | install: 16 | - pip install poetry chardet 17 | - poetry install -E fileobjects -E openioc -E virustotal -E docs -E pdfexport -E email 18 | - git submodule init 19 | - git submodule update 20 | 21 | script: 22 | - poetry run nosetests --with-coverage --cover-package=mail2misp tests/tests.py 23 | 24 | after_success: 25 | - poetry run codecov 26 | - poetry run coveralls 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 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 Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /MUA/Apple/Mail/MISP Mail Rule Action.txt: -------------------------------------------------------------------------------- 1 | using terms from application "Mail" 2 | on perform mail action with messages these_messages for rule this_rule 3 | tell application "Mail" 4 | set the message_count to the count of these_messages 5 | repeat with i from 1 to the message_count 6 | set this_message to item i of these_messages 7 | 8 | try 9 | set this_subject to (subject of this_message) as Unicode text 10 | if this_subject is "" then error 11 | on error 12 | set this_subject to "NO SUBJECT" 13 | end try 14 | 15 | try 16 | set this_content to (every character of content of this_message) as Unicode text 17 | if this_content is in {"", "?"} then error 18 | on error error_message 19 | set this_content to "NO CONTENT" 20 | end try 21 | do shell script "/Library/Frameworks/Python.framework/Versions/3.4/bin/python3 /Users/rommelfs/Scripts/mail_to_misp/mail_to_misp.py " & quoted form of this_content & " " & quoted form of this_subject 22 | end repeat 23 | end tell 24 | end perform mail action with messages 25 | end using terms from 26 | 27 | -------------------------------------------------------------------------------- /MUA/Microsoft/Office365/README.md: -------------------------------------------------------------------------------- 1 | # O365MISPClient 2 | 3 | A mail_to_misp client to connect your O365 mail infrastructure to [MISP](https://github.com/MISP/MISP) in order to create events based on the information contained within emails. 4 | 5 | 6 | ## Getting Started 7 | ### OAuth Setup (Pre Requisite) 8 | You will need to register your application at [Microsoft Apps](https://apps.dev.microsoft.com/). Steps below: 9 | 10 | 1. Login to https://apps.dev.microsoft.com/ 11 | 2. Create an app, note your app id (**client_id**) 12 | 3. Generate a new password (**client_secret**) under **Application Secrets** section 13 | 4. Under the **Platform** section, add a new Web platform and set "https://outlook.office365.com/owa/" as the redirect URL 14 | 5. Under **Microsoft Graph Permissions** section, Add the below delegated permission (or based on what scopes you plan to use) 15 | 1. offline_access 16 | 2. Mail.Read 17 | 3. Mail.Read.Shared 18 | 6. Note the **client_id** and **client_secret** as they will be using for establishing the connection through the api 19 | 20 | Detailed documentation for getting [Oauth Authentication](https://github.com/O365/python-o365/blob/master/README.md#oauth-authentication) configured. 21 | 22 | ## Token Storage 23 | When authenticating you will retrieve oauth tokens. If you don't want a one time access you will have to store the token somewhere. O365 makes no assumptions on where to store the token and tries to abstract this from the library usage point of view. 24 | 25 | You can choose where and how to store tokens by using the proper Token Backend. 26 | 27 | **Take care: the access (and refresh) token must remain protected from unauthorized users.** 28 | 29 | To store the token you will have to provide a properly configured TokenBackend. 30 | 31 | 32 | ### FileSystemTokenBackend 33 | (Default backend): Stores and retrieves tokens from the file system. Tokens are stored as files. You can explicitly initialize this as shown below. 34 | ```python 35 | from O365.utils import FileSystemTokenBackend 36 | 37 | 38 | # initialize Mail2MISP 39 | m2m = Mail2MISP(misp_url, misp_key, misp_verifycert, config=config) 40 | 41 | tb = FileSystemTokenBackend(token_path='/path/to/store/token', token_filename='o365_token.txt') 42 | 43 | # initialize O365MISPClient 44 | o365 = m2m.O365MISPClient( 45 | client_id=o365_client_id, 46 | client_secret=o365_client_secret, 47 | tenant_id=o365_tenant_id, 48 | resource=o365_resource, 49 | scopes=o365_scopes, 50 | token_backend=tb 51 | ) 52 | ``` 53 | 54 | As this is the default backend, you do not need to explicitly initialize FileSystemTokenBackend. If ```token_backend``` is ```None``` the token file will be saved as ```o365_token.txt``` to the directory the script is running in. 55 | 56 | ```python 57 | # initialize Mail2MISP 58 | m2m = Mail2MISP(misp_url, misp_key, misp_verifycert, config=config) 59 | 60 | # initialize O365MISPClient 61 | o365 = m2m.O365MISPClient( 62 | client_id=o365_client_id, 63 | client_secret=o365_client_secret, 64 | tenant_id=o365_tenant_id, 65 | resource=o365_resource, 66 | scopes=o365_scopes, 67 | token_backend=None 68 | ) 69 | ``` 70 | 71 | ### AWSSecretsBackend 72 | Stores and retrieves tokens from an AWS Secrets Management vault. 73 | ```python 74 | from O365.utils import AWSSecretsBackend 75 | 76 | 77 | # initialize Mail2MISP 78 | m2m = Mail2MISP(misp_url, misp_key, misp_verifycert, config=config) 79 | 80 | tb = AWSSecretsBackend(secret_name='o365_m2m_token', region_name='us-east-1') 81 | 82 | # initialize O365MISPClient 83 | o365 = m2m.O365MISPClient( 84 | client_id=o365_client_id, 85 | client_secret=o365_client_secret, 86 | tenant_id=o365_tenant_id, 87 | resource=o365_resource, 88 | scopes=o365_scopes, 89 | token_backend=tb 90 | ) 91 | ``` 92 | 93 | ### EnvTokenBackend 94 | Stores and retrieves tokens from environment variables. 95 | ```python 96 | from O365.utils import EnvTokenBackend 97 | 98 | 99 | # initialize Mail2MISP 100 | m2m = Mail2MISP(misp_url, misp_key, misp_verifycert, config=config) 101 | 102 | tb = EnvTokenBackend('O365_M2M_TOKEN') 103 | 104 | # initialize O365MISPClient 105 | o365 = m2m.O365MISPClient( 106 | client_id=o365_client_id, 107 | client_secret=o365_client_secret, 108 | tenant_id=o365_tenant_id, 109 | resource=o365_resource, 110 | scopes=o365_scopes, 111 | token_backend=tb 112 | ) 113 | ``` -------------------------------------------------------------------------------- /MUA/Mozilla/Thunderbird/thunderbird_wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | MESSAGE=`cat $1` 3 | SUBJECT=`head -n 1 $1` 4 | /Library/Frameworks/Python.framework/Versions/3.4/bin/python3 /Users/rommelfs/Scripts/mail_to_misp/mail_to_misp.py "$MESSAGE" "$SUBJECT" 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://app.travis-ci.com/SteveClement/mail_to_misp.svg?branch=main)](https://app.travis-ci.com/SteveClement/mail_to_misp) 2 | [![codecov](https://codecov.io/gh/MISP/mail_to_misp/branch/main/graph/badge.svg)](https://codecov.io/gh/MISP/mail_to_misp) 3 | 4 | # mail_to_misp 5 | 6 | Connect your mail infrastructure to [MISP](https://github.com/MISP/MISP) in order to create events based on the information contained within mails. 7 | 8 | ## Features 9 | 10 | - Extraction of URLs and IP addresses (and port numbers) from free text emails 11 | - Extraction of hostnames from URLs 12 | - Extraction of hashes (MD5, SHA1, SHA256) 13 | - DNS expansion 14 | - Custom filter list for lines containing specific words 15 | - Subject filters 16 | - Respecting TLP classification mentioned in free text (including optional spelling robustness) 17 | - Refanging of URLs ('hxxp://...') 18 | - Add tags automatically based on key words (configurable) 19 | - Add tags automatically depending on the presence of other tags (configurable) 20 | - Add tags automatically depending on presence of hashes (e.g. for automatic expansion) 21 | - Ignore 'whitelisted' domains (configurable) 22 | - Specify a stop word term to no further process input 23 | - Configurable list of attributes not to enable the IDS flag 24 | - Automatically create 'external analysis' links based on filter list (e.g. VirusTotal, malwr.com) 25 | - Automatically create 'internal reference' links based on filter list 26 | - Detection of forwarded messages 27 | - Process attachments as malware samples or specify that they are processed as benign files (`m2m_attachment_keyword`) 28 | 29 | You can send mails with attachments to mail_to_misp and tell it, to treat the attachment as a benign document (in contrast to the default behaviour: treating it as a malware sample). You need to set a keyword in the configuration: 30 | `m2m_attachment_keyword = 'attachment:benign'` 31 | - Logging to syslog 32 | - Remove "[tags]", "Re:" and "Fwd:" from subjects 33 | - Optionally attach entire mail to event 34 | - Contains now a fake-smtpd spamtrap which delivers IoCs/mails to MISP 35 | - Automatically filter out attributes that are on a server side warning list (`enforcewarninglist=True`) 36 | - Support for value sighting (`sighting=True`, `sighting_source="YOUR_MAIL_TO_MISP_IDENTIFIER"`) 37 | - Auto-publish when `key:yourkey` is specified in mail (configurable, `m2m_key`, `m2m_auto_distribution`) 38 | The `m2m_key configuration` is used to specify a secret only you and your users know. If you know the key, you can send a mail to your mail_to_misp instance, and when this key is present in the body of the message, it will automatically publish the event. So let's assume your config says: `m2m_key = 'ABCDEFGHIJKLMN0PQRSTUVWXYZ'` 39 | If you send a mail to mail_to_misp containing: `key:ABCDEFGHIJKLMN0PQRSTUVWXYZ` the event is automatically published. 40 | If you don't want to use this feature, just don't put it in the message body. 41 | The distribution is defined in the configuration as well: `m2m_auto_distribution = '3' # 3 = All communities` 42 | 43 | For OSINT collection purposes (like collecting URLs to OSINT reports), you can tell `mail_to_misp` to only extract URLs (`--urlsonly`) and append them to a predefined MISP event (`--event N`). The subject of such a mail goes into the comment field of the value. 44 | 45 | Example: 46 | ``` 47 | osinturlcollection: "|/path/to/mail_to_misp.py --urlsonly --event 12345 -" 48 | ``` 49 | 50 | 51 | # Pass parameters in the email body 52 | 53 | ``` 54 | m2m:: 55 | 56 | # Examples 57 | m2m:attachment:benign # Email attachment considered benign (attachment in MISP, malware-sample by default) 58 | m2m:attach_original_mail:1 # Attach the full original email to the MISP Event (may contain private information) 59 | 60 | m2m:m2mkey:YOUSETYOURKEYHERE # Key required for some actions 61 | # The following key are ignored if M2M:m2mkey is invalid 62 | m2m:distribution:<0-3,5> # Note: impossible to pass a sharing group yet. 63 | m2m:threat_level:<0-2> 64 | m2m:analysis:<0-3> 65 | m2m:publish:1 # Autopublish 66 | ``` 67 | 68 | ## Implementation 69 | 70 | The implemented workflow is mainly for mail servers like Postfix. Client side implementations exist but are no longer supported: 71 | 72 | 1. Postfix and others 73 | 74 | `Email -> mail_to_misp` 75 | 76 | 2. Office 365 77 | 78 | `Email -> Outlook -> O365MISPClient -> mail_to_misp` 79 | 80 | 3. Apple Mail [unmaintained] 81 | 82 | `Email -> Apple Mail -> Mail rule -> AppleScript -> mail_to_misp -> PyMISP -> MISP` 83 | 84 | 4. Mozilla Thunderbird [unmaintained] 85 | 86 | `Email -> Thunderbird -> Mail rule -> filterscript -> thunderbird_wrapper -> mail_to_misp -> PyMISP -> MISP` 87 | 88 | 89 | ## Installation 90 | 91 | ### Postfix (or other MTA) - preferred method 92 | 93 | 1. Setup a new email address in the aliases file (e.g. /etc/aliases) and configure the correct path: 94 | 95 | `misp_handler: "|/path/to/mail_to_misp.py -"` 96 | 97 | 2. Rebuild the DB: 98 | 99 | `$ sudo newaliases` 100 | 101 | 3. Configure mail_to_misp_config.py 102 | 103 | You should now be able to send your IoC-containing mails to misp_handler@YOURDOMAIN. 104 | 105 | #### Bonus: Fake-SMTPD spamtrap 106 | 107 | If you want to process all incoming junk mails automatically and collect the contained information in a separate throw-away MISP instance, you could use the fake_smtp.py script. It listens on port 25, accepts all mails and pushes them through mail_to_misp to a MISP instance. 108 | It can also be configured to listen on an SSL port. (465) 109 | 110 | 1. Configure mail_to_misp_config.py 111 | 112 | 2. cp fake_smtp_config.py-example fake_smtp_config.py 113 | 114 | 3. Make port 25 accessible to normal users 115 | 116 | ``` 117 | $ sudo apt install authbind 118 | $ sudo touch /etc/authbind/byport/25 119 | $ sudo chown misp:misp /etc/authbind/byport/25 120 | $ sudo chmod 770 /etc/authbind/byport/25 121 | ``` 122 | 123 | 4. Run fake_smtp.py 124 | 125 | `$ python3 fake_smtp.py` 126 | 127 | ### Office 365 128 | - Full [documentation](MUA/Microsoft/Office365/README.md) for getting started in MUA/Microsoft/Office365 129 | - Built-in O365MISPClient for Mail2MISP 130 | - Uses new Mail2MISP methods: `.load_o365_email` and `.process_o365_email_body` 131 | 132 | Run mail_to_misp_o365.py to get the last 1 day of messages 133 | 134 | `$ python3 mail_to_misp_0365.py -nd 1` 135 | 136 | ### Apple Mail [unmaintained] 137 | 138 | 1. Mail rule script 139 | - git clone this repository 140 | - open the AppleScript file MUA/Apple/Mail/MISP Mail Rule Action.txt in Apple's 'Script Editor' 141 | - adjust the path to the python installation and location of the mail_to_misp.py script 142 | - save it in ~/Library/Application Scripts/com.apple.mail/ 143 | 2. Create a mail rule based on your needs, executing the AppleScript defined before 144 | 3. Configure mail_to_misp_config.py 145 | 146 | ### Thunderbird [unmaintained] 147 | 148 | 1. Git clone https://github.com/rommelfs/filterscript and install plugin (instructions within the project description) 149 | 2. Mail rule script 150 | - git clone this repository 151 | - open the bash script MUA/Mozilla/Thunderbird/thunderbird_wrapper.sh and adujst the paths 152 | - adjust the path to the python installation and location of the mail_to_misp.py script 153 | 3. Create a mail rule based on your needs, executing the thunderbird_wrapper.sh script 154 | 4. Configure mail_to_misp_config.py 155 | 156 | You should be able to create MISP events now. 157 | 158 | ### Outlook [unmaintained] 159 | 160 | Outlook is not implemented due to lack of test environment. However, it should be feasible to do it this way: 161 | 162 | ``` 163 | import win32com.client 164 | import pythoncom 165 | 166 | class Handler_Class(object): 167 | def OnNewMailEx(self, receivedItemsIDs): 168 | for ID in receivedItemsIDs.split(","): 169 | # Microsoft.Office.Interop.Outlook _MailItem properties: 170 | # https://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._mailitem_properties.aspx 171 | mailItem = outlook.Session.GetItemFromID(ID) 172 | print "Subj: " + mailItem.Subject 173 | print "Body: " + mailItem.Body.encode( 'ascii', 'ignore' ) 174 | print "========" 175 | 176 | outlook = win32com.client.DispatchWithEvents("Outlook.Application", Handler_Class) 177 | pythoncom.PumpMessages() 178 | ``` 179 | (from: https://blog.matthewurch.ca/?p=236) 180 | 181 | Obviously, you would like to filter mails based on subject or from address and pass subject and body to mail_to_misp.py in order to do something useful. Pull-requests welcome for actual implementations :) 182 | 183 | 184 | ## Requirements 185 | 186 | ### The easy way 187 | 188 | ```bash 189 | pip install --user poetry 190 | 191 | # Install other python requirements 192 | poetry install -E fileobjects -E openioc -E virustotal -E email -E url 193 | 194 | # Test if the script is working 195 | ./mail_to_misp.py -h 196 | ``` 197 | 198 | ### General 199 | 200 | - mail_to_misp requires access to a MISP instance (via API). 201 | - Python >=3.6 202 | - dnspython 203 | - PyMISP 204 | - faup from https://github.com/stricaud/faup 205 | - urlmarker from https://github.com/rcompton/ryancompton.net/blob/master/assets/praw_drugs/urlmarker.py (contained in this project) 206 | - ftfy from https://github.com/LuminosoInsight/python-ftfy (to fix unicode text) 207 | - defang from https://github.com/Rafiot/defang.git (fork of: https://bitbucket.org/johannestaas/defang) 208 | 209 | ### Office 365 210 | 211 | - O365 from https://github.com/O365/python-o365 212 | 213 | ### Thunderbird [unmaintained] 214 | 215 | - https://github.com/rommelfs/filterscript (modified fork from https://github.com/adamnew123456/filterscript) 216 | 217 | ## License 218 | 219 | This software is licensed under [GNU Affero General Public License version 3](http://www.gnu.org/licenses/agpl-3.0.html) 220 | 221 | * Copyright (C) 2017 - 2019 Sascha Rommelfangen, Raphaël Vinot 222 | * Copyright (C) 2017 - 2021 CIRCL - Computer Incident Response Center Luxembourg 223 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MISP/mail_to_misp/799041bdc1d797d003012d6c758554ba544e055d/__init__.py -------------------------------------------------------------------------------- /certs/.keepdir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MISP/mail_to_misp/799041bdc1d797d003012d6c758554ba544e055d/certs/.keepdir -------------------------------------------------------------------------------- /fake_smtp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import ssl 3 | from pathlib import Path 4 | import importlib 5 | from subprocess import run, PIPE 6 | from aiosmtpd.controller import Controller 7 | from aiosmtpd.smtp import SMTP 8 | import subprocess 9 | import argparse 10 | 11 | 12 | def get_context(): 13 | key_path = Path('certs', 'key.pem') 14 | cert_path = Path('certs', 'cert.pem') 15 | 16 | if not cert_path.exists() and not key_path.exists(): 17 | subprocess.call(f'openssl req -x509 -newkey rsa:4096 -keyout {key_path.as_posix()} -out {cert_path.as_posix()} -days 365 -nodes -subj "/CN=localhost"', shell=True) 18 | 19 | context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) 20 | context.load_cert_chain(cert_path.as_posix(), key_path.as_posix()) 21 | 22 | 23 | # Pass SSL context to aiosmtpd 24 | class ControllerSSL(Controller): 25 | def factory(self): 26 | return SMTP(self.handler, ssl_context=get_context()) 27 | 28 | 29 | # Pass SSL context to aiosmtpd 30 | class ControllerSTARTTLS(Controller): 31 | def factory(self): 32 | return SMTP(self.handler, require_starttls=False, tls_context=get_context()) 33 | 34 | 35 | class CustomSMTPHandler: 36 | async def handle_DATA(self, server, session, envelope): 37 | print(f'Receiving message from: {session.peer}') 38 | print(f'Message addressed from: {envelope.mail_from}') 39 | print(f'Message addressed to : {envelope.rcpt_tos}') 40 | print(f'Message length : {len(envelope.content)}') 41 | if email_forward in envelope.rcpt_tos: 42 | p = run([binpath_forward, "-"], stdout=PIPE, input=envelope.content) 43 | else: 44 | p = run([binpath, "-"], stdout=PIPE, input=envelope.content) 45 | print(p) 46 | return '250 OK' 47 | 48 | 49 | if __name__ == '__main__': 50 | parser = argparse.ArgumentParser(description='Launch a fake SMTP server to push SPAMs to a MISP instance') 51 | parser.add_argument("--path", default='./mail_to_misp.py', help="Path to the mail_to_misp.py script.") 52 | parser.add_argument("--path_forward", default='./mail_to_misp.py', help="Path to the mail_to_misp.py script.") 53 | parser.add_argument("--email_forward", default='mail2misp@example.com', help="Path to the mail_to_misp.py script.") 54 | parser.add_argument("--host", default='127.0.0.1', help="IP to attach the SMTP server to.") 55 | parser.add_argument("--port", default='2525', help="Port of the SMTP server") 56 | parser.add_argument("--ssl", action='store_true', help="Pure SMTPs.") 57 | parser.add_argument("--ident", default='Python SMTPd', help="SMTPd ident string") 58 | args = parser.parse_args() 59 | 60 | configmodule = Path(__file__).as_posix().replace('.py', '_config') 61 | if Path(f'{configmodule}.py').exists(): 62 | config = importlib.import_module(configmodule) 63 | binpath = config.binpath 64 | binpath_forward = config.binpath_forward 65 | email_forward = config.email_forward 66 | smtp_addr = config.smtp_addr 67 | smtp_port = config.smtp_port 68 | smtps = config.ssl 69 | ident = config.ident 70 | else: 71 | binpath = args.path 72 | binpath_forward = args.path_forward 73 | email_forward = args.email_forward 74 | smtp_addr = args.host 75 | smtp_port = args.port 76 | smtps = args.ssl 77 | ident = args.ident 78 | 79 | print("Starting Fake-SMTP-to-MISP server") 80 | 81 | handler = CustomSMTPHandler() 82 | if smtps: 83 | server = ControllerSSL(handler, hostname=smtp_addr, port=smtp_port, ident=ident) 84 | else: 85 | server = ControllerSTARTTLS(handler, hostname=smtp_addr, port=smtp_port, ident=ident) 86 | server.start() 87 | input("Server started. Press Return to quit.") 88 | server.stop() 89 | -------------------------------------------------------------------------------- /fake_smtp_config.py-example: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | from pathlib import Path 4 | 5 | binpath = Path(__file__).parent / 'mail_to_misp.py' 6 | binpath_forward = Path(__file__).parent / 'mail_to_misp_forward.py' 7 | 8 | # default ident: Python SMTP 1.4.2 9 | ident = 'ESMTP Postfix (Ubuntu)' 10 | 11 | email_forward = 'mail2misp@example.com' 12 | 13 | smtp_addr = '127.0.0.1' 14 | smtp_port = 2525 15 | ssl = False 16 | -------------------------------------------------------------------------------- /mail2misp/__init__.py: -------------------------------------------------------------------------------- 1 | from . import urlmarker 2 | from . import hashmarker 3 | from .mail2misp import Mail2MISP 4 | -------------------------------------------------------------------------------- /mail2misp/hashmarker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | MD5_REGEX = r"""\b([a-f0-9]{32})\b""" 5 | SHA1_REGEX = r"""\b([a-f0-9]{40})\b""" 6 | SHA256_REGEX = r"""\b([a-f0-9]{64})\b""" 7 | -------------------------------------------------------------------------------- /mail2misp/mail2misp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | import base64 4 | import re 5 | import syslog 6 | import html 7 | import os 8 | from io import BytesIO 9 | from ipaddress import ip_address 10 | from email import message_from_bytes, policy, message 11 | from email.parser import BytesParser 12 | 13 | from . import urlmarker, hashmarker 14 | from pyfaup.faup import Faup # type: ignore 15 | from pymisp import ExpandedPyMISP, MISPEvent, MISPObject, MISPSighting, InvalidMISPObject 16 | from pymisp.tools import EMailObject, make_binary_objects, VTReportObject 17 | from defang import refang # type: ignore 18 | 19 | from datetime import datetime 20 | from O365 import Account 21 | from O365.message import Message 22 | from O365.utils import AWSS3Backend, AWSSecretsBackend, EnvTokenBackend, FileSystemTokenBackend, FirestoreBackend 23 | from typing import Iterator, List, Optional, Union 24 | try: 25 | import dns.resolver 26 | HAS_DNS = True 27 | except ImportError: 28 | HAS_DNS = False 29 | 30 | 31 | def is_ip(address): 32 | try: 33 | ip_address(address) 34 | except ValueError: 35 | return False 36 | return True 37 | 38 | 39 | class Mail2MISP(): 40 | 41 | def __init__(self, misp_url, misp_key, verifycert, config, offline=False, urlsonly=False): 42 | self.offline = offline 43 | if not self.offline: 44 | self.misp = ExpandedPyMISP(misp_url, misp_key, verifycert, debug=config.debug) 45 | self.config = config 46 | self.urlsonly = urlsonly 47 | if not hasattr(self.config, 'enable_dns'): 48 | setattr(self.config, 'enable_dns', True) 49 | if self.urlsonly is False: 50 | setattr(self.config, 'enable_dns', False) 51 | self.debug = self.config.debug 52 | self.config_from_email_body = {} 53 | if not hasattr(self.config, 'ignore_nullsize_attachments'): 54 | setattr(self.config, 'ignore_nullsize_attachments', False) 55 | self.ignore_nullsize_attachments = self.config.ignore_nullsize_attachments 56 | # Init Faup 57 | self.f = Faup() 58 | self.sightings_to_add = [] 59 | 60 | def load_email(self, pseudofile): 61 | self.pseudofile = pseudofile 62 | self.original_mail = message_from_bytes(self.pseudofile.getvalue(), policy=policy.default) 63 | 64 | try: 65 | self.sender = self.original_mail.get('From') 66 | except Exception: 67 | self.sender = "" 68 | 69 | try: 70 | self.subject = self.original_mail.get('Subject') 71 | # Remove words from subject 72 | for removeword in self.config.removelist: 73 | self.subject = re.sub(removeword, "", self.subject).strip() 74 | except Exception as ex: 75 | self.subject = "" 76 | if self.debug: 77 | syslog.syslog(ex) 78 | 79 | # Initialize the MISP event 80 | self.misp_event = MISPEvent() 81 | self.misp_event.info = f'{self.config.email_subject_prefix} - {self.subject}' 82 | self.misp_event.distribution = self.config.default_distribution 83 | self.misp_event.threat_level_id = self.config.default_threat_level 84 | self.misp_event.analysis = self.config.default_analysis 85 | self.misp_event.add_tag(self.config.id_tag) 86 | 87 | def load_o365_email(self, msg: Message): 88 | self.msg = msg 89 | 90 | try: 91 | self.sender = self.msg.sender.address 92 | except Exception as ex: 93 | self.sender = "" 94 | if self.debug: 95 | syslog.syslog(ex) 96 | 97 | try: 98 | self.reply_to = self.msg.reply_to[0].address 99 | except Exception as ex: 100 | self.reply_to = None 101 | if self.debug: 102 | syslog.syslog(ex) 103 | 104 | try: 105 | self.subject = self.msg.subject 106 | # remove words from subject 107 | for removeword in self.config.removelist: 108 | self.subject = re.sub(removeword, "", self.subject).strip() 109 | except Exception as ex: 110 | self.subject = "" 111 | if self.debug: 112 | syslog.syslog(ex) 113 | 114 | # initialize the MISP event 115 | self.misp_event = MISPEvent() 116 | self.misp_event.info = self.subject 117 | self.misp_event.distribution = self.config.default_distribution 118 | self.misp_event.threat_level_id = self.config.default_threat_level 119 | self.misp_event.analysis = self.config.default_analysis 120 | self.misp_event.add_tag(self.config.id_tag) 121 | 122 | def sighting(self, value, source): 123 | if self.offline: 124 | raise Exception('The script is running in offline mode, ') 125 | '''Add a sighting''' 126 | s = MISPSighting() 127 | s.from_dict(value=value, source=source) 128 | self.misp.add_sighting(s) 129 | 130 | def _find_inline_forward(self): 131 | '''Does the body contains a forwarded email?''' 132 | for identifier in self.config.forward_identifiers: 133 | if identifier in self.clean_email_body: 134 | self.clean_email_body, fw_email = self.clean_email_body.split(identifier) 135 | return self.forwarded_email(pseudofile=BytesIO(fw_email.encode())) 136 | 137 | def _find_attached_forward(self): 138 | forwarded_emails = [] 139 | for attachment in self.original_mail.iter_attachments(): 140 | try: 141 | attachment_content = attachment.get_content() 142 | except KeyError: 143 | # Attachment type has no handler 144 | continue 145 | 146 | # Search for email forwarded as attachment 147 | # I could have more than one, attaching everything. 148 | if isinstance(attachment_content, message.EmailMessage): 149 | forwarded_emails.append(self.forwarded_email(pseudofile=BytesIO(attachment_content.as_bytes()))) 150 | else: 151 | if isinstance(attachment_content, str): 152 | attachment_content = attachment_content.encode() 153 | filename = attachment.get_filename() 154 | if not filename: 155 | filename = 'missing_filename' 156 | if self.config_from_email_body.get('attachment') == self.config.m2m_benign_attachment_keyword: 157 | # Attach sane file 158 | self.misp_event.add_attribute('attachment', value=filename, data=BytesIO(attachment_content)) 159 | else: 160 | f_object, main_object, sections = make_binary_objects(pseudofile=BytesIO(attachment_content), filename=filename, standalone=False) 161 | self.misp_event.add_object(f_object) 162 | if main_object: 163 | self.misp_event.add_object(main_object) 164 | [self.misp_event.add_object(section) for section in sections] 165 | return forwarded_emails 166 | 167 | def _find_o365_attached_forward(self, msg: Message): 168 | forwarded_emails = [] 169 | if msg.has_attachments: 170 | if msg.attachments.download_attachments(): 171 | for attachment in msg.attachments: 172 | if '.eml' in attachment.name: 173 | decoded_attachment = base64.b64decode(attachment.content) 174 | pseudofile = BytesIO(decoded_attachment) 175 | eml = BytesParser(policy=policy.default).parse(pseudofile) 176 | if isinstance(eml, message.EmailMessage): 177 | forwarded_emails.append(self.forwarded_email(pseudofile=pseudofile)) 178 | return forwarded_emails 179 | 180 | def email_from_spamtrap(self): 181 | '''The email comes from a spamtrap and should be attached as-is.''' 182 | raw_body = self.original_mail.get_body(preferencelist=('html', 'plain')) 183 | if raw_body: 184 | self.clean_email_body = html.unescape(raw_body.get_payload(decode=True).decode('utf8', 'surrogateescape')) 185 | else: 186 | self.clean_email_body = '' 187 | return self.forwarded_email(self.pseudofile) 188 | 189 | def forwarded_email(self, pseudofile: BytesIO): 190 | '''Extracts all possible indicators out of an email and create a MISP event out of it. 191 | * Gets all relevant Headers 192 | * Attach the body 193 | * Create MISP file objects (uses lief if possible) 194 | * Set all references 195 | ''' 196 | email_object = EMailObject(pseudofile=pseudofile, attach_original_mail=True, standalone=False) 197 | if email_object.attachments: 198 | # Create file objects for the attachments 199 | for attachment_name, attachment in email_object.attachments: 200 | if not (self.ignore_nullsize_attachments and attachment.getbuffer().nbytes == 0): 201 | if not attachment_name: 202 | attachment_name = 'NameMissing.txt' 203 | if self.config_from_email_body.get('attachment') == self.config.m2m_benign_attachment_keyword: 204 | a = self.misp_event.add_attribute('attachment', value=attachment_name, data=attachment) 205 | email_object.add_reference(a.uuid, 'related-to', 'Email attachment') 206 | else: 207 | f_object, main_object, sections = make_binary_objects(pseudofile=attachment, filename=attachment_name, standalone=False) 208 | if self.config.vt_key: 209 | try: 210 | vt_object = VTReportObject(self.config.vt_key, f_object.get_attributes_by_relation('sha256')[0].value, standalone=False) 211 | self.misp_event.add_object(vt_object) 212 | f_object.add_reference(vt_object.uuid, 'analysed-with') 213 | except InvalidMISPObject as e: 214 | print(e) 215 | pass 216 | self.misp_event.add_object(f_object) 217 | if main_object: 218 | self.misp_event.add_object(main_object) 219 | for section in sections: 220 | self.misp_event.add_object(section) 221 | email_object.add_reference(f_object.uuid, 'related-to', 'Email attachment') 222 | self.process_body_iocs(email_object) 223 | if self.config.spamtrap or self.config.attach_original_mail or self.config_from_email_body.get('attach_original_mail'): 224 | self.misp_event.add_object(email_object) 225 | return email_object 226 | 227 | def process_email_body(self): 228 | mail_as_bytes = self.original_mail.get_body(preferencelist=('html', 'plain')).get_payload(decode=True) 229 | if mail_as_bytes: 230 | self.clean_email_body = html.unescape(mail_as_bytes.decode('utf8', 'surrogateescape')) 231 | # Check if there are config lines in the body & convert them to a python dictionary: 232 | # :: => {: } 233 | self.config_from_email_body = {k.strip(): v.strip() for k, v in re.findall(f'{self.config.body_config_prefix}:(.*):(.*)', self.clean_email_body)} 234 | if self.config_from_email_body: 235 | # ... remove the config lines from the body 236 | self.clean_email_body = re.sub(rf'^{self.config.body_config_prefix}.*\n?', '', 237 | html.unescape(self.original_mail.get_body(preferencelist=('html', 'plain')).get_payload(decode=True).decode('utf8', 'surrogateescape')), flags=re.MULTILINE) 238 | # Check if autopublish key is present and valid 239 | if self.config_from_email_body.get('m2mkey') == self.config.m2m_key: 240 | if self.config_from_email_body.get('distribution') is not None: 241 | self.misp_event.distribution = self.config_from_email_body.get('distribution') 242 | if self.config_from_email_body.get('threat_level') is not None: 243 | self.misp_event.threat_level_id = self.config_from_email_body.get('threat_level') 244 | if self.config_from_email_body.get('analysis') is not None: 245 | self.misp_event.analysis = self.config_from_email_body.get('analysis') 246 | if self.config_from_email_body.get('publish'): 247 | self.misp_event.publish() 248 | 249 | self._find_inline_forward() 250 | else: 251 | self.clean_email_body = '' 252 | self._find_attached_forward() 253 | 254 | def process_o365_email_body(self): 255 | if self.msg: 256 | self.clean_email_body = html.unescape(self.msg.body) 257 | if re.search(r"
You don't often get email from .*?
", self.clean_email_body): 258 | self.clean_email_body = re.sub(r"
You don't often get email from .*?
", "", html.unescape(self.msg.body)) 259 | # Check if there are config lines in the body & convert them to a python dictionary: 260 | # :: => {: } 261 | self.config_from_email_body = {k.strip(): v.strip() for k, v in re.findall(f'{self.config.body_config_prefix}:(.*):(.*)', self.clean_email_body)} 262 | if self.config_from_email_body: 263 | # ... remove the config lines from the body 264 | self.clean_email_body = re.sub(rf'^{self.config.body_config_prefix}.*\n?', '', html.unescape(self.msg.body), flags=re.MULTILINE) 265 | # Check if autopublish key is present and valid 266 | if self.config_from_email_body.get('m2mkey') == self.config.m2m_key: 267 | if self.config_from_email_body.get('distribution') is not None: 268 | self.misp_event.distribution = self.config_from_email_body.get('distribution') 269 | if self.config_from_email_body.get('threat_level') is not None: 270 | self.misp_event.threat_level_id = self.config_from_email_body.get('threat_level') 271 | if self.config_from_email_body.get('analysis') is not None: 272 | self.misp_event.analysis = self.config_from_email_body.get('analysis') 273 | if self.config_from_email_body.get('publish'): 274 | self.misp_event.publish() 275 | else: 276 | self.clean_email_body = '' 277 | self._find_o365_attached_forward(self.msg) 278 | 279 | def process_body_iocs(self, email_object=None): 280 | if email_object: 281 | body = html.unescape(email_object.email.get_body(preferencelist=('html', 'plain')).get_payload(decode=True).decode('utf8', 'surrogateescape')) 282 | else: 283 | body = self.clean_email_body 284 | 285 | # Cleanup body content 286 | # Depending on the source of the mail, there is some cleanup to do. Ignore lines in body of message 287 | for ignoreline in self.config.ignorelist: 288 | body = re.sub(rf'^{ignoreline}.*\n?', '', body, flags=re.MULTILINE) 289 | 290 | # Remove everything after the stopword from the body 291 | body = body.split(self.config.stopword, 1)[0] 292 | 293 | # Add tags to the event if keywords are found in the mail 294 | for tag in self.config.tlptags: 295 | for alternativetag in self.config.tlptags[tag]: 296 | if alternativetag in body.lower(): 297 | self.misp_event.add_tag(tag) 298 | 299 | # Prepare extraction of IOCs 300 | # Refang email data 301 | body = refang(body) 302 | 303 | # Extract and add hashes 304 | contains_hash = False 305 | for h in set(re.findall(hashmarker.MD5_REGEX, body)): 306 | contains_hash = True 307 | attribute = self.misp_event.add_attribute('md5', h, enforceWarninglist=self.config.enforcewarninglist) 308 | if email_object: 309 | email_object.add_reference(attribute.uuid, 'contains') 310 | if self.config.sighting: 311 | self.sightings_to_add.append((h, self.config.sighting_source)) 312 | for h in set(re.findall(hashmarker.SHA1_REGEX, body)): 313 | contains_hash = True 314 | attribute = self.misp_event.add_attribute('sha1', h, enforceWarninglist=self.config.enforcewarninglist) 315 | if email_object: 316 | email_object.add_reference(attribute.uuid, 'contains') 317 | if self.config.sighting: 318 | self.sightings_to_add.append((h, self.config.sighting_source)) 319 | for h in set(re.findall(hashmarker.SHA256_REGEX, body)): 320 | contains_hash = True 321 | attribute = self.misp_event.add_attribute('sha256', h, enforceWarninglist=self.config.enforcewarninglist) 322 | if email_object: 323 | email_object.add_reference(attribute.uuid, 'contains') 324 | if self.config.sighting: 325 | self.sightings_to_add.append((h, self.config.sighting_source)) 326 | 327 | if contains_hash: 328 | [self.misp_event.add_tag(tag) for tag in self.config.hash_only_tags] 329 | 330 | # # Extract network IOCs 331 | urllist = [] 332 | urllist += re.findall(urlmarker.WEB_URL_REGEX, body) 333 | urllist += re.findall(urlmarker.IP_REGEX, body) 334 | if self.debug: 335 | syslog.syslog(str(urllist)) 336 | 337 | hostname_processed = [] 338 | 339 | # Add IOCs and expanded information to MISP 340 | for entry in set(urllist): 341 | ids_flag = True 342 | self.f.decode(entry) 343 | 344 | domainname = self.f.get_domain() 345 | if domainname in self.config.excludelist: 346 | # Ignore the entry 347 | continue 348 | 349 | hostname = self.f.get_host() 350 | 351 | scheme = self.f.get_scheme() 352 | if scheme: 353 | scheme = scheme 354 | 355 | resource_path = self.f.get_resource_path() 356 | if resource_path: 357 | resource_path = resource_path 358 | 359 | if self.debug: 360 | syslog.syslog(domainname) 361 | 362 | if domainname in self.config.internallist and self.urlsonly is False: # Add link to internal reference unless in urlsonly mode 363 | attribute = self.misp_event.add_attribute('link', entry, category='Internal reference', 364 | to_ids=False, enforceWarninglist=False) 365 | if email_object: 366 | email_object.add_reference(attribute.uuid, 'contains') 367 | elif domainname in self.config.externallist and self.urlsonly is False: # External analysis 368 | attribute = self.misp_event.add_attribute('link', entry, category='External analysis', 369 | to_ids=False, enforceWarninglist=False) 370 | if email_object: 371 | email_object.add_reference(attribute.uuid, 'contains') 372 | elif domainname in self.config.externallist or self.urlsonly: # External analysis 373 | if self.urlsonly: 374 | comment = self.subject + f" (from: {self.sender})" 375 | else: 376 | comment = "" 377 | attribute = self.misp.add_attribute(self.urlsonly, {"type": 'link', "value": entry, "category": 'External analysis', 378 | "to_ids": False, "comment": comment}) 379 | for tag in self.config.tlptags: 380 | for alternativetag in self.config.tlptags[tag]: 381 | if alternativetag in self.subject.lower(): 382 | self.misp.tag(attribute["uuid"], tag) 383 | new_subject = comment.replace(alternativetag, '') 384 | self.misp.change_comment(attribute["uuid"], new_subject) 385 | 386 | else: # The URL is probably an indicator. 387 | comment = "" 388 | if (domainname in self.config.noidsflaglist) or (hostname in self.config.noidsflaglist): 389 | ids_flag = False 390 | comment = "Known host (mostly for connectivity test or IP lookup)" 391 | if self.debug: 392 | syslog.syslog(str(entry)) 393 | 394 | if scheme: 395 | if is_ip(hostname): 396 | attribute = self.misp_event.add_attribute('url', entry, to_ids=False, 397 | enforceWarninglist=self.config.enforcewarninglist) 398 | if email_object: 399 | email_object.add_reference(attribute.uuid, 'contains') 400 | else: 401 | if resource_path: # URL has path, ignore warning list 402 | attribute = self.misp_event.add_attribute('url', entry, to_ids=ids_flag, 403 | enforceWarninglist=False, comment=comment) 404 | if email_object: 405 | email_object.add_reference(attribute.uuid, 'contains') 406 | else: # URL has no path 407 | attribute = self.misp_event.add_attribute('url', entry, to_ids=ids_flag, 408 | enforceWarninglist=self.config.enforcewarninglist, comment=comment) 409 | if email_object: 410 | email_object.add_reference(attribute.uuid, 'contains') 411 | if self.config.sighting: 412 | self.sightings_to_add.append((entry, self.config.sighting_source)) 413 | 414 | if hostname in hostname_processed: 415 | # Hostname already processed. 416 | continue 417 | 418 | hostname_processed.append(hostname) 419 | if self.config.sighting: 420 | self.sightings_to_add.append((hostname, self.config.sighting_source)) 421 | 422 | if self.debug: 423 | syslog.syslog(hostname) 424 | 425 | comment = '' 426 | port = self.f.get_port() 427 | if port: 428 | port = port 429 | comment = f'on port: {port}' 430 | 431 | if is_ip(hostname): 432 | attribute = self.misp_event.add_attribute('ip-dst', hostname, to_ids=ids_flag, 433 | enforceWarninglist=self.config.enforcewarninglist, 434 | comment=comment) 435 | if email_object: 436 | email_object.add_reference(attribute.uuid, 'contains') 437 | else: 438 | related_ips = [] 439 | if HAS_DNS and self.config.enable_dns: 440 | try: 441 | syslog.syslog(hostname) 442 | for rdata in dns.resolver.query(hostname, 'A'): 443 | if self.debug: 444 | syslog.syslog(str(rdata)) 445 | related_ips.append(rdata.to_text()) 446 | except Exception as e: 447 | if self.debug: 448 | syslog.syslog(str(e)) 449 | 450 | if related_ips: 451 | hip = MISPObject(name='ip-port') 452 | hip.add_attribute('hostname', value=hostname, to_ids=ids_flag, 453 | enforceWarninglist=self.config.enforcewarninglist, comment=comment) 454 | for ip in set(related_ips): 455 | hip.add_attribute('ip', type='ip-dst', value=ip, to_ids=False, 456 | enforceWarninglist=self.config.enforcewarninglist) 457 | self.misp_event.add_object(hip) 458 | if email_object: 459 | email_object.add_reference(hip.uuid, 'contains') 460 | else: 461 | if self.urlsonly is False: 462 | attribute = self.misp_event.add_attribute('hostname', value=hostname, 463 | to_ids=ids_flag, enforceWarninglist=self.config.enforcewarninglist, 464 | comment=comment) 465 | if email_object: 466 | email_object.add_reference(attribute.uuid, 'contains') 467 | 468 | def add_event(self): 469 | '''Add event on the remote MISP instance.''' 470 | 471 | # Add additional tags depending on others 472 | tags = [] 473 | for tag in [t.name for t in self.misp_event.tags]: 474 | if self.config.dependingtags.get(tag): 475 | tags += self.config.dependingtags.get(tag) 476 | 477 | # Add additional tags according to configuration 478 | for malware in self.config.malwaretags: 479 | if malware.lower() in self.subject.lower(): 480 | tags += self.config.malwaretags.get(malware) 481 | if tags: 482 | [self.misp_event.add_tag(tag) for tag in tags] 483 | 484 | has_tlp_tag = False 485 | for tag in [t.name for t in self.misp_event.tags]: 486 | if tag.lower().startswith('tlp'): 487 | has_tlp_tag = True 488 | if not has_tlp_tag: 489 | self.misp_event.add_tag(self.config.tlptag_default) 490 | 491 | if self.offline: 492 | return self.misp_event.to_json() 493 | event = self.misp.add_event(self.misp_event, pythonify=True) 494 | if self.config.sighting: 495 | for value, source in self.sightings_to_add: 496 | self.sighting(value, source) 497 | if self.config.freetext: 498 | if self.config.o365_freetext: 499 | self.misp.freetext(event, string=self.clean_email_body, adhereToWarninglists=self.config.enforcewarninglist) 500 | else: 501 | self.misp.freetext(event, string=self.original_mail.get_body(preferencelist=('html', 'plain')), adhereToWarninglists=self.config.enforcewarninglist) 502 | return event 503 | 504 | def get_attached_emails(self, pseudofile): 505 | 506 | if self.debug: 507 | syslog.syslog("get_attached_emails Job started.") 508 | 509 | forwarded_emails = [] 510 | self.pseudofile = pseudofile 511 | self.original_mail = message_from_bytes(self.pseudofile.getvalue(), policy=policy.default) 512 | for attachment in self.original_mail.iter_attachments(): 513 | attachment_content = attachment.get_content() 514 | filename = attachment.get_filename() 515 | if self.debug: 516 | syslog.syslog(f'get_attached_emails: filename = {filename}') 517 | # Search for email forwarded as attachment 518 | # I could have more than one, attaching everything. 519 | if isinstance(attachment, message.EmailMessage) and os.path.splitext(filename)[1] == '.eml': 520 | # all attachments are identified as message.EmailMessage so filtering on extension for now. 521 | forwarded_emails.append(BytesIO(attachment_content)) 522 | return forwarded_emails 523 | 524 | class O365MISPClient: 525 | """ 526 | A client (MUA) to allow mail_to_misp to interact with Microsoft Graph and Office 365 API to get email messages. 527 | """ 528 | def __init__( 529 | self, 530 | client_id: str, 531 | client_secret: str, 532 | tenant_id: str, 533 | resource: str, 534 | scopes: List[str], 535 | token_backend: Optional[ 536 | Union[AWSS3Backend, AWSSecretsBackend, EnvTokenBackend, FileSystemTokenBackend, FirestoreBackend] 537 | ] = None, 538 | ): 539 | """ 540 | Init O365MISPClient 541 | :param client_id: OAuth Client ID 542 | :param client_secret: OAuth Client Secret 543 | :param tenant_id: Your Tenant ID 544 | :param resource: The email address you want to access 545 | :param scopes: The permission scopes for the resource 546 | :param token_backend: The backend used for storing OAuth token 547 | """ 548 | self.scopes = scopes 549 | self.resource = resource 550 | self.o365_acct = Account( 551 | credentials=(client_id, client_secret), 552 | auth_flow_type='authorization', 553 | tenant_id=tenant_id, 554 | token_backend=token_backend 555 | ) 556 | if not self.o365_acct.is_authenticated: 557 | self.o365_acct.authenticate(scopes=self.scopes) 558 | self.mailbox = self.o365_acct.mailbox(resource=self.resource) 559 | self.inbox = self.mailbox.inbox_folder() 560 | self.query_properties = [ 561 | 'internet_message_headers', 562 | 'subject', 563 | 'body', 564 | 'unique_body', 565 | 'from', 566 | 'reply_to', 567 | 'is_read', 568 | 'is_draft', 569 | 'received_date_time', 570 | 'has_attachments', 571 | 'attachments' 572 | ] 573 | 574 | def get_email_messages(self, from_time: datetime, to_time: datetime, folder: Optional[str] = None) -> Iterator[Message]: 575 | """ 576 | Get messages for a certain timeframe. Defaults to looking for messages in the Inbox folder, however by 577 | supplying a folder name as a parameter you can change where to get the messages from. 578 | 579 | :param from_time: start time to search for 580 | :param to_time: end time to search for 581 | :param folder: specific folder to get messages from (don't supply if getting from the inbox folder) 582 | :return: an iterator of O365.messages.Message from the resource 583 | """ 584 | query = self.mailbox.new_query().select(*self.query_properties) 585 | # https://learn.microsoft.com/en-us/graph/api/resources/message?view=graph-rest-1.0#properties 586 | query = query.chain('and').on_attribute('received_date_time').greater(from_time) 587 | query = query.chain('and').on_attribute('received_date_time').less(to_time) 588 | 589 | if folder: 590 | messages = self.mailbox.get_folder(folder_name=folder).get_messages(query=query) 591 | else: 592 | messages = self.inbox.get_messages(query=query) 593 | 594 | return messages 595 | 596 | -------------------------------------------------------------------------------- /mail2misp/urlmarker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | url matching regex 6 | http://daringfireball.net/2010/07/improved_regex_for_matching_urls 7 | """ 8 | 9 | 10 | """ 11 | The regex patterns in this gist are intended to match any URLs, 12 | including "mailto:foo@example.com", "x-whatever://foo", etc. For a 13 | pattern that attempts only to match web URLs (http, https), see: 14 | https://gist.github.com/gruber/8891611 15 | """ 16 | ANY_URL_REGEX = r"""(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))""" 17 | 18 | """ 19 | The regex patterns in this gist are intended only to match web URLs -- http, 20 | https, and naked domains like "example.com". For a pattern that attempts to 21 | match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502 22 | """ 23 | WEB_URL_REGEX = r"""(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|Ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)/)(?:[^\s()<>{}\[\]]+|\([^\s()]*?\([^\s()]+\)[^\s()]*?\)|\([^\s]+?\))+(?:\([^\s()]*?\([^\s()]+\)[^\s()]*?\)|\([^\s]+?\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’])|(?:(?"] 6 | license = "AGPL-3.0" 7 | repository = "https://github.com/MISP/mail_to_misp" 8 | 9 | readme = "README.md" 10 | 11 | [tool.poetry.urls] 12 | "Bug Tracker" = "https://github.com/MISP/mail_to_misp/issues" 13 | "Source" = "https://github.com/MISP/mail_to_misp" 14 | 15 | [tool.poetry.dependencies] 16 | python = "^3.8.1" 17 | requests = "^2.31.0" 18 | python-dateutil = "^2.8.2" 19 | jsonschema = "^4.19.0" 20 | deprecated = "^1.2.14" 21 | dnspython = "^2.4.2" 22 | defang = "^0.5.3" 23 | extract_msg = {version = "^0.40.0", optional = true} 24 | RTFDE = {version = "^0.0.2", optional = true} 25 | oletools = {version = "^0.60.1", optional = true} 26 | python-magic = {version = "^0.4.27", optional = true} 27 | pydeep = {version = "^0.4", optional = true} 28 | lief = {version = "^0.13.2", optional = true} 29 | beautifulsoup4 = {version = "<4.12.0", optional = true} 30 | validators = {version = "^0.20.0", optional = true} 31 | sphinx-autodoc-typehints = {version = "^1.24.0", optional = true} 32 | recommonmark = {version = "^0.7.1", optional = true} 33 | reportlab = {version = "^3.6.13", optional = true} 34 | pyfaup = {version = "^1.2", optional = false} 35 | urllib3 = {extras = ["brotli"], version = "^1.26.17", optional = true} 36 | pymisp = "^2.4.174" 37 | flask = "^2.3.2" 38 | flask-bootstrap = "^3.3.7.1" 39 | gunicorn = "^20.1.0" 40 | chardet = "^5.2.0" 41 | aiosmtpd = "^1.4.4.post2" 42 | O365 = {extras = ["o365"], version = "^2.0.31", optional = true} 43 | 44 | [tool.poetry.extras] 45 | fileobjects = ['python-magic', 'pydeep', 'lief'] 46 | openioc = ['beautifulsoup4'] 47 | virustotal = ['validators'] 48 | docs = ['sphinx-autodoc-typehints', 'recommonmark'] 49 | pdfexport = ['reportlab'] 50 | url = ['pyfaup'] 51 | email = ['extract_msg', "RTFDE", "oletools"] 52 | brotli = ['urllib3'] 53 | o365 = ['O365'] 54 | 55 | [tool.poetry.dev-dependencies] 56 | nose = "^1.3.7" 57 | coveralls = "^3.3.1" 58 | codecov = "^2.1.13" 59 | requests-mock = "^1.11.0" 60 | mypy = "^1.5.1" 61 | flake8 = "^6.1.0" 62 | ipython = [ 63 | {version = "<8.13.0", python = "<3.9"}, 64 | {version = "^8.13.0", python = ">=3.9"} 65 | ] 66 | jupyterlab = "^3.6.5" 67 | 68 | [build-system] 69 | requires = ["poetry_core>=1.0", "setuptools"] 70 | build-backend = "poetry.core.masonry.api" 71 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | aiosmtpd==1.4.4.post2 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 2 | --hash=sha256:f821fe424b703b2ea391dc2df11d89d2afd728af27393e13cf1a3530f19fdc5e \ 3 | --hash=sha256:f9243b7dfe00aaf567da8728d891752426b51392174a34d2cf5c18053b63dcbc 4 | atpublic==4.0 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 5 | --hash=sha256:0f40433219e124edf115c6c363808ca6f0e1cfa7d160d86b2fb94793086d1294 \ 6 | --hash=sha256:80057c55641253b86dcb68b524f82328172371b6547d4c7462a9127fbfbbabfc 7 | attrs==23.1.0 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 8 | --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ 9 | --hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 10 | beautifulsoup4==4.11.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 11 | --hash=sha256:0e79446b10b3ecb499c1556f7e228a53e64a2bfcebd455f370d8927cb5b59e39 \ 12 | --hash=sha256:bc4bdda6717de5a2987436fb8d72f45dc90dd856bdfd512a1314ce90349a0106 13 | blinker==1.6.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 14 | --hash=sha256:4afd3de66ef3a9f8067559fb7a1cbe555c17dcbe15971b05d1b625c3e7abe213 \ 15 | --hash=sha256:c3d739772abb7bc2860abf5f2ec284223d9ad5c76da018234f6f50d6f31ab1f0 16 | brotli==1.0.9 ; python_full_version >= "3.8.1" and platform_python_implementation == "CPython" and python_full_version < "4.0.0" \ 17 | --hash=sha256:02177603aaca36e1fd21b091cb742bb3b305a569e2402f1ca38af471777fb019 \ 18 | --hash=sha256:11d3283d89af7033236fa4e73ec2cbe743d4f6a81d41bd234f24bf63dde979df \ 19 | --hash=sha256:12effe280b8ebfd389022aa65114e30407540ccb89b177d3fbc9a4f177c4bd5d \ 20 | --hash=sha256:160c78292e98d21e73a4cc7f76a234390e516afcd982fa17e1422f7c6a9ce9c8 \ 21 | --hash=sha256:16d528a45c2e1909c2798f27f7bf0a3feec1dc9e50948e738b961618e38b6a7b \ 22 | --hash=sha256:19598ecddd8a212aedb1ffa15763dd52a388518c4550e615aed88dc3753c0f0c \ 23 | --hash=sha256:1c48472a6ba3b113452355b9af0a60da5c2ae60477f8feda8346f8fd48e3e87c \ 24 | --hash=sha256:268fe94547ba25b58ebc724680609c8ee3e5a843202e9a381f6f9c5e8bdb5c70 \ 25 | --hash=sha256:269a5743a393c65db46a7bb982644c67ecba4b8d91b392403ad8a861ba6f495f \ 26 | --hash=sha256:26d168aac4aaec9a4394221240e8a5436b5634adc3cd1cdf637f6645cecbf181 \ 27 | --hash=sha256:29d1d350178e5225397e28ea1b7aca3648fcbab546d20e7475805437bfb0a130 \ 28 | --hash=sha256:2aad0e0baa04517741c9bb5b07586c642302e5fb3e75319cb62087bd0995ab19 \ 29 | --hash=sha256:3148362937217b7072cf80a2dcc007f09bb5ecb96dae4617316638194113d5be \ 30 | --hash=sha256:330e3f10cd01da535c70d09c4283ba2df5fb78e915bea0a28becad6e2ac010be \ 31 | --hash=sha256:336b40348269f9b91268378de5ff44dc6fbaa2268194f85177b53463d313842a \ 32 | --hash=sha256:3496fc835370da351d37cada4cf744039616a6db7d13c430035e901443a34daa \ 33 | --hash=sha256:35a3edbe18e876e596553c4007a087f8bcfd538f19bc116917b3c7522fca0429 \ 34 | --hash=sha256:3b78a24b5fd13c03ee2b7b86290ed20efdc95da75a3557cc06811764d5ad1126 \ 35 | --hash=sha256:3b8b09a16a1950b9ef495a0f8b9d0a87599a9d1f179e2d4ac014b2ec831f87e7 \ 36 | --hash=sha256:3c1306004d49b84bd0c4f90457c6f57ad109f5cc6067a9664e12b7b79a9948ad \ 37 | --hash=sha256:3ffaadcaeafe9d30a7e4e1e97ad727e4f5610b9fa2f7551998471e3736738679 \ 38 | --hash=sha256:40d15c79f42e0a2c72892bf407979febd9cf91f36f495ffb333d1d04cebb34e4 \ 39 | --hash=sha256:44bb8ff420c1d19d91d79d8c3574b8954288bdff0273bf788954064d260d7ab0 \ 40 | --hash=sha256:4688c1e42968ba52e57d8670ad2306fe92e0169c6f3af0089be75bbac0c64a3b \ 41 | --hash=sha256:495ba7e49c2db22b046a53b469bbecea802efce200dffb69b93dd47397edc9b6 \ 42 | --hash=sha256:4d1b810aa0ed773f81dceda2cc7b403d01057458730e309856356d4ef4188438 \ 43 | --hash=sha256:503fa6af7da9f4b5780bb7e4cbe0c639b010f12be85d02c99452825dd0feef3f \ 44 | --hash=sha256:56d027eace784738457437df7331965473f2c0da2c70e1a1f6fdbae5402e0389 \ 45 | --hash=sha256:5913a1177fc36e30fcf6dc868ce23b0453952c78c04c266d3149b3d39e1410d6 \ 46 | --hash=sha256:5b6ef7d9f9c38292df3690fe3e302b5b530999fa90014853dcd0d6902fb59f26 \ 47 | --hash=sha256:5bf37a08493232fbb0f8229f1824b366c2fc1d02d64e7e918af40acd15f3e337 \ 48 | --hash=sha256:5cb1e18167792d7d21e21365d7650b72d5081ed476123ff7b8cac7f45189c0c7 \ 49 | --hash=sha256:61a7ee1f13ab913897dac7da44a73c6d44d48a4adff42a5701e3239791c96e14 \ 50 | --hash=sha256:622a231b08899c864eb87e85f81c75e7b9ce05b001e59bbfbf43d4a71f5f32b2 \ 51 | --hash=sha256:68715970f16b6e92c574c30747c95cf8cf62804569647386ff032195dc89a430 \ 52 | --hash=sha256:6b2ae9f5f67f89aade1fab0f7fd8f2832501311c363a21579d02defa844d9296 \ 53 | --hash=sha256:6c772d6c0a79ac0f414a9f8947cc407e119b8598de7621f39cacadae3cf57d12 \ 54 | --hash=sha256:6d847b14f7ea89f6ad3c9e3901d1bc4835f6b390a9c71df999b0162d9bb1e20f \ 55 | --hash=sha256:73fd30d4ce0ea48010564ccee1a26bfe39323fde05cb34b5863455629db61dc7 \ 56 | --hash=sha256:76ffebb907bec09ff511bb3acc077695e2c32bc2142819491579a695f77ffd4d \ 57 | --hash=sha256:7bbff90b63328013e1e8cb50650ae0b9bac54ffb4be6104378490193cd60f85a \ 58 | --hash=sha256:7cb81373984cc0e4682f31bc3d6be9026006d96eecd07ea49aafb06897746452 \ 59 | --hash=sha256:7ee83d3e3a024a9618e5be64648d6d11c37047ac48adff25f12fa4226cf23d1c \ 60 | --hash=sha256:854c33dad5ba0fbd6ab69185fec8dab89e13cda6b7d191ba111987df74f38761 \ 61 | --hash=sha256:85f7912459c67eaab2fb854ed2bc1cc25772b300545fe7ed2dc03954da638649 \ 62 | --hash=sha256:87fdccbb6bb589095f413b1e05734ba492c962b4a45a13ff3408fa44ffe6479b \ 63 | --hash=sha256:88c63a1b55f352b02c6ffd24b15ead9fc0e8bf781dbe070213039324922a2eea \ 64 | --hash=sha256:8a674ac10e0a87b683f4fa2b6fa41090edfd686a6524bd8dedbd6138b309175c \ 65 | --hash=sha256:8ed6a5b3d23ecc00ea02e1ed8e0ff9a08f4fc87a1f58a2530e71c0f48adf882f \ 66 | --hash=sha256:93130612b837103e15ac3f9cbacb4613f9e348b58b3aad53721d92e57f96d46a \ 67 | --hash=sha256:9744a863b489c79a73aba014df554b0e7a0fc44ef3f8a0ef2a52919c7d155031 \ 68 | --hash=sha256:9749a124280a0ada4187a6cfd1ffd35c350fb3af79c706589d98e088c5044267 \ 69 | --hash=sha256:97f715cf371b16ac88b8c19da00029804e20e25f30d80203417255d239f228b5 \ 70 | --hash=sha256:9bf919756d25e4114ace16a8ce91eb340eb57a08e2c6950c3cebcbe3dff2a5e7 \ 71 | --hash=sha256:9d12cf2851759b8de8ca5fde36a59c08210a97ffca0eb94c532ce7b17c6a3d1d \ 72 | --hash=sha256:9ed4c92a0665002ff8ea852353aeb60d9141eb04109e88928026d3c8a9e5433c \ 73 | --hash=sha256:a72661af47119a80d82fa583b554095308d6a4c356b2a554fdc2799bc19f2a43 \ 74 | --hash=sha256:afde17ae04d90fbe53afb628f7f2d4ca022797aa093e809de5c3cf276f61bbfa \ 75 | --hash=sha256:b1375b5d17d6145c798661b67e4ae9d5496920d9265e2f00f1c2c0b5ae91fbde \ 76 | --hash=sha256:b336c5e9cf03c7be40c47b5fd694c43c9f1358a80ba384a21969e0b4e66a9b17 \ 77 | --hash=sha256:b3523f51818e8f16599613edddb1ff924eeb4b53ab7e7197f85cbc321cdca32f \ 78 | --hash=sha256:b43775532a5904bc938f9c15b77c613cb6ad6fb30990f3b0afaea82797a402d8 \ 79 | --hash=sha256:b663f1e02de5d0573610756398e44c130add0eb9a3fc912a09665332942a2efb \ 80 | --hash=sha256:b83bb06a0192cccf1eb8d0a28672a1b79c74c3a8a5f2619625aeb6f28b3a82bb \ 81 | --hash=sha256:ba72d37e2a924717990f4d7482e8ac88e2ef43fb95491eb6e0d124d77d2a150d \ 82 | --hash=sha256:c2415d9d082152460f2bd4e382a1e85aed233abc92db5a3880da2257dc7daf7b \ 83 | --hash=sha256:c83aa123d56f2e060644427a882a36b3c12db93727ad7a7b9efd7d7f3e9cc2c4 \ 84 | --hash=sha256:c8e521a0ce7cf690ca84b8cc2272ddaf9d8a50294fd086da67e517439614c755 \ 85 | --hash=sha256:cab1b5964b39607a66adbba01f1c12df2e55ac36c81ec6ed44f2fca44178bf1a \ 86 | --hash=sha256:cb02ed34557afde2d2da68194d12f5719ee96cfb2eacc886352cb73e3808fc5d \ 87 | --hash=sha256:cc0283a406774f465fb45ec7efb66857c09ffefbe49ec20b7882eff6d3c86d3a \ 88 | --hash=sha256:cfc391f4429ee0a9370aa93d812a52e1fee0f37a81861f4fdd1f4fb28e8547c3 \ 89 | --hash=sha256:db844eb158a87ccab83e868a762ea8024ae27337fc7ddcbfcddd157f841fdfe7 \ 90 | --hash=sha256:defed7ea5f218a9f2336301e6fd379f55c655bea65ba2476346340a0ce6f74a1 \ 91 | --hash=sha256:e16eb9541f3dd1a3e92b89005e37b1257b157b7256df0e36bd7b33b50be73bcb \ 92 | --hash=sha256:e1abbeef02962596548382e393f56e4c94acd286bd0c5afba756cffc33670e8a \ 93 | --hash=sha256:e23281b9a08ec338469268f98f194658abfb13658ee98e2b7f85ee9dd06caa91 \ 94 | --hash=sha256:e2d9e1cbc1b25e22000328702b014227737756f4b5bf5c485ac1d8091ada078b \ 95 | --hash=sha256:e48f4234f2469ed012a98f4b7874e7f7e173c167bed4934912a29e03167cf6b1 \ 96 | --hash=sha256:e4c4e92c14a57c9bd4cb4be678c25369bf7a092d55fd0866f759e425b9660806 \ 97 | --hash=sha256:ec1947eabbaf8e0531e8e899fc1d9876c179fc518989461f5d24e2223395a9e3 \ 98 | --hash=sha256:f909bbbc433048b499cb9db9e713b5d8d949e8c109a2a548502fb9aa8630f0b1 99 | brotlicffi==1.0.9.2 ; python_full_version >= "3.8.1" and platform_python_implementation != "CPython" and python_full_version < "4.0.0" \ 100 | --hash=sha256:0c248a68129d8fc6a217767406c731e498c3e19a7be05ea0a90c3c86637b7d96 \ 101 | --hash=sha256:137c4635edcdf593de5ce9d0daa596bf499591b16b8fca5fd72a490deb54b2ee \ 102 | --hash=sha256:15e0db52c56056be6310fc116b3d7c6f34185594e261f23790b2fb6489998363 \ 103 | --hash=sha256:16a0c9392a1059e2e62839fbd037d2e7e03c8ae5da65e9746f582464f7fab1bb \ 104 | --hash=sha256:1e27c43ef72a278f9739b12b2df80ee72048cd4cbe498f8bbe08aaaa67a5d5c8 \ 105 | --hash=sha256:21cd400d24b344c218d8e32b394849e31b7c15784667575dbda9f65c46a64b0a \ 106 | --hash=sha256:2be4fb8a7cb482f226af686cd06d2a2cab164ccdf99e460f8e3a5ec9a5337da2 \ 107 | --hash=sha256:2e4629f7690ded66c8818715c6d4dd6a7ff6a4f10fad6186fe99850f781ce210 \ 108 | --hash=sha256:408c810c599786fb806556ff17e844a903884e6370ca400bcec7fa286149f39c \ 109 | --hash=sha256:408ec4359f9763280d5c4e0ad29c51d1240b25fdd18719067e972163b4125b98 \ 110 | --hash=sha256:4454c3baedc277fd6e65f983e3eb8e77f4bc15060f69370a0201746e2edeca81 \ 111 | --hash=sha256:52c1c12dad6eb1d44213a0a76acf5f18f64653bd801300bef5e2f983405bdde5 \ 112 | --hash=sha256:551305703d12a2dd1ae43d3dde35dee20b1cb49b5796279d4d34e2c6aec6be4d \ 113 | --hash=sha256:586f0ea3c2eed455d5f2330b9ab4a591514c8de0ee53d445645efcfbf053c69f \ 114 | --hash=sha256:71061f8bc86335b652e442260c4367b782a92c6e295cf5a10eff84c7d19d8cf5 \ 115 | --hash=sha256:75a46bc5ed2753e1648cc211dcb2c1ac66116038766822dc104023f67ff4dfd8 \ 116 | --hash=sha256:7bb913d5bf3b4ce2ec59872711dc9faaff5f320c3c3827cada2d8a7b793a7753 \ 117 | --hash=sha256:7e72978f4090a161885b114f87b784f538dcb77dafc6602592c1cf39ae8d243d \ 118 | --hash=sha256:8e7221d8a084d32d15c7b58e0ce0573972375c5038423dbe83f217cfe512e680 \ 119 | --hash=sha256:9030cd5099252d16bfa4e22659c84a89c102e94f8e81d30764788b72e2d7cfb7 \ 120 | --hash=sha256:9078432af4785f35ab3840587eed7fb131e3fc77eb2a739282b649b343c584dd \ 121 | --hash=sha256:916b790f967a18a595e61f218c252f83718ac91f24157d622cf0fa710cd26ab7 \ 122 | --hash=sha256:94d2810efc5723f1447b332223b197466190518a3eeca93b9f357efb5b22c6dc \ 123 | --hash=sha256:9e70f3e20f317d70912b10dbec48b29114d3dbd0e9d88475cb328e6c086f0546 \ 124 | --hash=sha256:a6208d82c3172eeeb3be83ed4efd5831552c7cd47576468e50fcf0fb23fcf97f \ 125 | --hash=sha256:a73099858ee343e8801710a08be8d194f47715ff21e98d92a19ac461058f52d1 \ 126 | --hash=sha256:af8a1b7bcfccf9c41a3c8654994d6a81821fdfe4caddcfe5045bfda936546ca3 \ 127 | --hash=sha256:ba4a00263af40e875ec3d6c7f623cbf8c795b55705da18c64ec36b6bf0848bc5 \ 128 | --hash=sha256:df78aa47741122b0d5463f1208b7bb18bc9706dee5152d9f56e0ead4865015cd \ 129 | --hash=sha256:feb942814285bdc5e97efc77a04e48283c17dfab9ea082d79c0a7b9e53ef1eab 130 | certifi==2023.7.22 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 131 | --hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \ 132 | --hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9 133 | cffi==1.15.1 ; python_full_version >= "3.8.1" and platform_python_implementation != "CPython" and python_full_version < "4.0.0" \ 134 | --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ 135 | --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ 136 | --hash=sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104 \ 137 | --hash=sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426 \ 138 | --hash=sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405 \ 139 | --hash=sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375 \ 140 | --hash=sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a \ 141 | --hash=sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e \ 142 | --hash=sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc \ 143 | --hash=sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf \ 144 | --hash=sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185 \ 145 | --hash=sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497 \ 146 | --hash=sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3 \ 147 | --hash=sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35 \ 148 | --hash=sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c \ 149 | --hash=sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83 \ 150 | --hash=sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21 \ 151 | --hash=sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca \ 152 | --hash=sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984 \ 153 | --hash=sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac \ 154 | --hash=sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd \ 155 | --hash=sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee \ 156 | --hash=sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a \ 157 | --hash=sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2 \ 158 | --hash=sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192 \ 159 | --hash=sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7 \ 160 | --hash=sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585 \ 161 | --hash=sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f \ 162 | --hash=sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e \ 163 | --hash=sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27 \ 164 | --hash=sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b \ 165 | --hash=sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e \ 166 | --hash=sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e \ 167 | --hash=sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d \ 168 | --hash=sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c \ 169 | --hash=sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415 \ 170 | --hash=sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82 \ 171 | --hash=sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02 \ 172 | --hash=sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314 \ 173 | --hash=sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325 \ 174 | --hash=sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c \ 175 | --hash=sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3 \ 176 | --hash=sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914 \ 177 | --hash=sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045 \ 178 | --hash=sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d \ 179 | --hash=sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9 \ 180 | --hash=sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5 \ 181 | --hash=sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2 \ 182 | --hash=sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c \ 183 | --hash=sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3 \ 184 | --hash=sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2 \ 185 | --hash=sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8 \ 186 | --hash=sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d \ 187 | --hash=sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d \ 188 | --hash=sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9 \ 189 | --hash=sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162 \ 190 | --hash=sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76 \ 191 | --hash=sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4 \ 192 | --hash=sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e \ 193 | --hash=sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9 \ 194 | --hash=sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6 \ 195 | --hash=sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b \ 196 | --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ 197 | --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 198 | chardet==5.2.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 199 | --hash=sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7 \ 200 | --hash=sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970 201 | charset-normalizer==3.2.0 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 202 | --hash=sha256:04e57ab9fbf9607b77f7d057974694b4f6b142da9ed4a199859d9d4d5c63fe96 \ 203 | --hash=sha256:09393e1b2a9461950b1c9a45d5fd251dc7c6f228acab64da1c9c0165d9c7765c \ 204 | --hash=sha256:0b87549028f680ca955556e3bd57013ab47474c3124dc069faa0b6545b6c9710 \ 205 | --hash=sha256:1000fba1057b92a65daec275aec30586c3de2401ccdcd41f8a5c1e2c87078706 \ 206 | --hash=sha256:1249cbbf3d3b04902ff081ffbb33ce3377fa6e4c7356f759f3cd076cc138d020 \ 207 | --hash=sha256:1920d4ff15ce893210c1f0c0e9d19bfbecb7983c76b33f046c13a8ffbd570252 \ 208 | --hash=sha256:193cbc708ea3aca45e7221ae58f0fd63f933753a9bfb498a3b474878f12caaad \ 209 | --hash=sha256:1a100c6d595a7f316f1b6f01d20815d916e75ff98c27a01ae817439ea7726329 \ 210 | --hash=sha256:1f30b48dd7fa1474554b0b0f3fdfdd4c13b5c737a3c6284d3cdc424ec0ffff3a \ 211 | --hash=sha256:203f0c8871d5a7987be20c72442488a0b8cfd0f43b7973771640fc593f56321f \ 212 | --hash=sha256:246de67b99b6851627d945db38147d1b209a899311b1305dd84916f2b88526c6 \ 213 | --hash=sha256:2dee8e57f052ef5353cf608e0b4c871aee320dd1b87d351c28764fc0ca55f9f4 \ 214 | --hash=sha256:2efb1bd13885392adfda4614c33d3b68dee4921fd0ac1d3988f8cbb7d589e72a \ 215 | --hash=sha256:2f4ac36d8e2b4cc1aa71df3dd84ff8efbe3bfb97ac41242fbcfc053c67434f46 \ 216 | --hash=sha256:3170c9399da12c9dc66366e9d14da8bf7147e1e9d9ea566067bbce7bb74bd9c2 \ 217 | --hash=sha256:3b1613dd5aee995ec6d4c69f00378bbd07614702a315a2cf6c1d21461fe17c23 \ 218 | --hash=sha256:3bb3d25a8e6c0aedd251753a79ae98a093c7e7b471faa3aa9a93a81431987ace \ 219 | --hash=sha256:3bb7fda7260735efe66d5107fb7e6af6a7c04c7fce9b2514e04b7a74b06bf5dd \ 220 | --hash=sha256:41b25eaa7d15909cf3ac4c96088c1f266a9a93ec44f87f1d13d4a0e86c81b982 \ 221 | --hash=sha256:45de3f87179c1823e6d9e32156fb14c1927fcc9aba21433f088fdfb555b77c10 \ 222 | --hash=sha256:46fb8c61d794b78ec7134a715a3e564aafc8f6b5e338417cb19fe9f57a5a9bf2 \ 223 | --hash=sha256:48021783bdf96e3d6de03a6e39a1171ed5bd7e8bb93fc84cc649d11490f87cea \ 224 | --hash=sha256:4957669ef390f0e6719db3613ab3a7631e68424604a7b448f079bee145da6e09 \ 225 | --hash=sha256:5e86d77b090dbddbe78867a0275cb4df08ea195e660f1f7f13435a4649e954e5 \ 226 | --hash=sha256:6339d047dab2780cc6220f46306628e04d9750f02f983ddb37439ca47ced7149 \ 227 | --hash=sha256:681eb3d7e02e3c3655d1b16059fbfb605ac464c834a0c629048a30fad2b27489 \ 228 | --hash=sha256:6c409c0deba34f147f77efaa67b8e4bb83d2f11c8806405f76397ae5b8c0d1c9 \ 229 | --hash=sha256:7095f6fbfaa55defb6b733cfeb14efaae7a29f0b59d8cf213be4e7ca0b857b80 \ 230 | --hash=sha256:70c610f6cbe4b9fce272c407dd9d07e33e6bf7b4aa1b7ffb6f6ded8e634e3592 \ 231 | --hash=sha256:72814c01533f51d68702802d74f77ea026b5ec52793c791e2da806a3844a46c3 \ 232 | --hash=sha256:7a4826ad2bd6b07ca615c74ab91f32f6c96d08f6fcc3902ceeedaec8cdc3bcd6 \ 233 | --hash=sha256:7c70087bfee18a42b4040bb9ec1ca15a08242cf5867c58726530bdf3945672ed \ 234 | --hash=sha256:855eafa5d5a2034b4621c74925d89c5efef61418570e5ef9b37717d9c796419c \ 235 | --hash=sha256:8700f06d0ce6f128de3ccdbc1acaea1ee264d2caa9ca05daaf492fde7c2a7200 \ 236 | --hash=sha256:89f1b185a01fe560bc8ae5f619e924407efca2191b56ce749ec84982fc59a32a \ 237 | --hash=sha256:8b2c760cfc7042b27ebdb4a43a4453bd829a5742503599144d54a032c5dc7e9e \ 238 | --hash=sha256:8c2f5e83493748286002f9369f3e6607c565a6a90425a3a1fef5ae32a36d749d \ 239 | --hash=sha256:8e098148dd37b4ce3baca71fb394c81dc5d9c7728c95df695d2dca218edf40e6 \ 240 | --hash=sha256:94aea8eff76ee6d1cdacb07dd2123a68283cb5569e0250feab1240058f53b623 \ 241 | --hash=sha256:95eb302ff792e12aba9a8b8f8474ab229a83c103d74a750ec0bd1c1eea32e669 \ 242 | --hash=sha256:9bd9b3b31adcb054116447ea22caa61a285d92e94d710aa5ec97992ff5eb7cf3 \ 243 | --hash=sha256:9e608aafdb55eb9f255034709e20d5a83b6d60c054df0802fa9c9883d0a937aa \ 244 | --hash=sha256:a103b3a7069b62f5d4890ae1b8f0597618f628b286b03d4bc9195230b154bfa9 \ 245 | --hash=sha256:a386ebe437176aab38c041de1260cd3ea459c6ce5263594399880bbc398225b2 \ 246 | --hash=sha256:a38856a971c602f98472050165cea2cdc97709240373041b69030be15047691f \ 247 | --hash=sha256:a401b4598e5d3f4a9a811f3daf42ee2291790c7f9d74b18d75d6e21dda98a1a1 \ 248 | --hash=sha256:a7647ebdfb9682b7bb97e2a5e7cb6ae735b1c25008a70b906aecca294ee96cf4 \ 249 | --hash=sha256:aaf63899c94de41fe3cf934601b0f7ccb6b428c6e4eeb80da72c58eab077b19a \ 250 | --hash=sha256:b0dac0ff919ba34d4df1b6131f59ce95b08b9065233446be7e459f95554c0dc8 \ 251 | --hash=sha256:baacc6aee0b2ef6f3d308e197b5d7a81c0e70b06beae1f1fcacffdbd124fe0e3 \ 252 | --hash=sha256:bf420121d4c8dce6b889f0e8e4ec0ca34b7f40186203f06a946fa0276ba54029 \ 253 | --hash=sha256:c04a46716adde8d927adb9457bbe39cf473e1e2c2f5d0a16ceb837e5d841ad4f \ 254 | --hash=sha256:c0b21078a4b56965e2b12f247467b234734491897e99c1d51cee628da9786959 \ 255 | --hash=sha256:c1c76a1743432b4b60ab3358c937a3fe1341c828ae6194108a94c69028247f22 \ 256 | --hash=sha256:c4983bf937209c57240cff65906b18bb35e64ae872da6a0db937d7b4af845dd7 \ 257 | --hash=sha256:c4fb39a81950ec280984b3a44f5bd12819953dc5fa3a7e6fa7a80db5ee853952 \ 258 | --hash=sha256:c57921cda3a80d0f2b8aec7e25c8aa14479ea92b5b51b6876d975d925a2ea346 \ 259 | --hash=sha256:c8063cf17b19661471ecbdb3df1c84f24ad2e389e326ccaf89e3fb2484d8dd7e \ 260 | --hash=sha256:ccd16eb18a849fd8dcb23e23380e2f0a354e8daa0c984b8a732d9cfaba3a776d \ 261 | --hash=sha256:cd6dbe0238f7743d0efe563ab46294f54f9bc8f4b9bcf57c3c666cc5bc9d1299 \ 262 | --hash=sha256:d62e51710986674142526ab9f78663ca2b0726066ae26b78b22e0f5e571238dd \ 263 | --hash=sha256:db901e2ac34c931d73054d9797383d0f8009991e723dab15109740a63e7f902a \ 264 | --hash=sha256:e03b8895a6990c9ab2cdcd0f2fe44088ca1c65ae592b8f795c3294af00a461c3 \ 265 | --hash=sha256:e1c8a2f4c69e08e89632defbfabec2feb8a8d99edc9f89ce33c4b9e36ab63037 \ 266 | --hash=sha256:e4b749b9cc6ee664a3300bb3a273c1ca8068c46be705b6c31cf5d276f8628a94 \ 267 | --hash=sha256:e6a5bf2cba5ae1bb80b154ed68a3cfa2fa00fde979a7f50d6598d3e17d9ac20c \ 268 | --hash=sha256:e857a2232ba53ae940d3456f7533ce6ca98b81917d47adc3c7fd55dad8fab858 \ 269 | --hash=sha256:ee4006268ed33370957f55bf2e6f4d263eaf4dc3cfc473d1d90baff6ed36ce4a \ 270 | --hash=sha256:eef9df1eefada2c09a5e7a40991b9fc6ac6ef20b1372abd48d2794a316dc0449 \ 271 | --hash=sha256:f058f6963fd82eb143c692cecdc89e075fa0828db2e5b291070485390b2f1c9c \ 272 | --hash=sha256:f25c229a6ba38a35ae6e25ca1264621cc25d4d38dca2942a7fce0b67a4efe918 \ 273 | --hash=sha256:f2a1d0fd4242bd8643ce6f98927cf9c04540af6efa92323e9d3124f57727bfc1 \ 274 | --hash=sha256:f7560358a6811e52e9c4d142d497f1a6e10103d3a6881f18d04dbce3729c0e2c \ 275 | --hash=sha256:f779d3ad205f108d14e99bb3859aa7dd8e9c68874617c72354d7ecaec2a054ac \ 276 | --hash=sha256:f87f746ee241d30d6ed93969de31e5ffd09a2961a051e60ae6bddde9ec3583aa 277 | click==8.1.7 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 278 | --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ 279 | --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de 280 | colorama==0.4.6 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" and platform_system == "Windows" \ 281 | --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ 282 | --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 283 | defang==0.5.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 284 | --hash=sha256:86aeff658d7cd4c3b61d16089872e1c1f0a1b7b3c64d4ca9525c017caeb284d7 285 | deprecated==1.2.14 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 286 | --hash=sha256:6fac8b097794a90302bdbb17b9b815e732d3c4720583ff1b198499d78470466c \ 287 | --hash=sha256:e5323eb936458dccc2582dc6f9c322c852a775a27065ff2b0c4970b9d53d01b3 288 | dnspython==2.4.2 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 289 | --hash=sha256:57c6fbaaeaaf39c891292012060beb141791735dbb4004798328fc2c467402d8 \ 290 | --hash=sha256:8dcfae8c7460a2f84b4072e26f1c9f4101ca20c071649cb7c34e8b6a93d58984 291 | dominate==2.8.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 292 | --hash=sha256:1a916479c45b95fedba0d077b081d77c2d2e0f0f484ac827105087af23661d73 \ 293 | --hash=sha256:4c90c3befaf88e612b71f4b39af7bcbef8977acfa855cec957225a8fbf504007 294 | flask-bootstrap==3.3.7.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 295 | --hash=sha256:cb08ed940183f6343a64e465e83b3a3f13c53e1baabb8d72b5da4545ef123ac8 296 | flask==2.3.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 297 | --hash=sha256:77fd4e1249d8c9923de34907236b747ced06e5467ecac1a7bb7115ae0e9670b0 \ 298 | --hash=sha256:8c2f9abd47a9e8df7f0c3f091ce9497d011dc3b31effcf4c85a6e2b50f4114ef 299 | gunicorn==20.1.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 300 | --hash=sha256:9dcc4547dbb1cb284accfb15ab5667a0e5d1881cc443e0677b4882a4067a807e \ 301 | --hash=sha256:e0a968b5ba15f8a328fdfd7ab1fcb5af4470c28aaf7e55df02a99bc13138e6e8 302 | idna==3.4 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 303 | --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ 304 | --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 305 | importlib-metadata==6.8.0 ; python_full_version >= "3.8.1" and python_version < "3.10" \ 306 | --hash=sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb \ 307 | --hash=sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743 308 | importlib-resources==6.0.1 ; python_full_version >= "3.8.1" and python_version < "3.9" \ 309 | --hash=sha256:134832a506243891221b88b4ae1213327eea96ceb4e407a00d790bb0626f45cf \ 310 | --hash=sha256:4359457e42708462b9626a04657c6208ad799ceb41e5c58c57ffa0e6a098a5d4 311 | itsdangerous==2.1.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 312 | --hash=sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44 \ 313 | --hash=sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a 314 | jinja2==3.1.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 315 | --hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \ 316 | --hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61 317 | jsonschema-specifications==2023.7.1 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 318 | --hash=sha256:05adf340b659828a004220a9613be00fa3f223f2b82002e273dee62fd50524b1 \ 319 | --hash=sha256:c91a50404e88a1f6ba40636778e2ee08f6e24c5613fe4c53ac24578a5a7f72bb 320 | jsonschema==4.19.0 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 321 | --hash=sha256:043dc26a3845ff09d20e4420d6012a9c91c9aa8999fa184e7efcfeccb41e32cb \ 322 | --hash=sha256:6e1e7569ac13be8139b2dd2c21a55d350066ee3f80df06c608b398cdc6f30e8f 323 | markupsafe==2.1.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 324 | --hash=sha256:05fb21170423db021895e1ea1e1f3ab3adb85d1c2333cbc2310f2a26bc77272e \ 325 | --hash=sha256:0a4e4a1aff6c7ac4cd55792abf96c915634c2b97e3cc1c7129578aa68ebd754e \ 326 | --hash=sha256:10bbfe99883db80bdbaff2dcf681dfc6533a614f700da1287707e8a5d78a8431 \ 327 | --hash=sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686 \ 328 | --hash=sha256:1577735524cdad32f9f694208aa75e422adba74f1baee7551620e43a3141f559 \ 329 | --hash=sha256:1b40069d487e7edb2676d3fbdb2b0829ffa2cd63a2ec26c4938b2d34391b4ecc \ 330 | --hash=sha256:282c2cb35b5b673bbcadb33a585408104df04f14b2d9b01d4c345a3b92861c2c \ 331 | --hash=sha256:2c1b19b3aaacc6e57b7e25710ff571c24d6c3613a45e905b1fde04d691b98ee0 \ 332 | --hash=sha256:2ef12179d3a291be237280175b542c07a36e7f60718296278d8593d21ca937d4 \ 333 | --hash=sha256:338ae27d6b8745585f87218a3f23f1512dbf52c26c28e322dbe54bcede54ccb9 \ 334 | --hash=sha256:3c0fae6c3be832a0a0473ac912810b2877c8cb9d76ca48de1ed31e1c68386575 \ 335 | --hash=sha256:3fd4abcb888d15a94f32b75d8fd18ee162ca0c064f35b11134be77050296d6ba \ 336 | --hash=sha256:42de32b22b6b804f42c5d98be4f7e5e977ecdd9ee9b660fda1a3edf03b11792d \ 337 | --hash=sha256:504b320cd4b7eff6f968eddf81127112db685e81f7e36e75f9f84f0df46041c3 \ 338 | --hash=sha256:525808b8019e36eb524b8c68acdd63a37e75714eac50e988180b169d64480a00 \ 339 | --hash=sha256:56d9f2ecac662ca1611d183feb03a3fa4406469dafe241673d521dd5ae92a155 \ 340 | --hash=sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac \ 341 | --hash=sha256:65c1a9bcdadc6c28eecee2c119465aebff8f7a584dd719facdd9e825ec61ab52 \ 342 | --hash=sha256:68e78619a61ecf91e76aa3e6e8e33fc4894a2bebe93410754bd28fce0a8a4f9f \ 343 | --hash=sha256:69c0f17e9f5a7afdf2cc9fb2d1ce6aabdb3bafb7f38017c0b77862bcec2bbad8 \ 344 | --hash=sha256:6b2b56950d93e41f33b4223ead100ea0fe11f8e6ee5f641eb753ce4b77a7042b \ 345 | --hash=sha256:787003c0ddb00500e49a10f2844fac87aa6ce977b90b0feaaf9de23c22508b24 \ 346 | --hash=sha256:7ef3cb2ebbf91e330e3bb937efada0edd9003683db6b57bb108c4001f37a02ea \ 347 | --hash=sha256:8023faf4e01efadfa183e863fefde0046de576c6f14659e8782065bcece22198 \ 348 | --hash=sha256:8758846a7e80910096950b67071243da3e5a20ed2546e6392603c096778d48e0 \ 349 | --hash=sha256:8afafd99945ead6e075b973fefa56379c5b5c53fd8937dad92c662da5d8fd5ee \ 350 | --hash=sha256:8c41976a29d078bb235fea9b2ecd3da465df42a562910f9022f1a03107bd02be \ 351 | --hash=sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2 \ 352 | --hash=sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707 \ 353 | --hash=sha256:962f82a3086483f5e5f64dbad880d31038b698494799b097bc59c2edf392fce6 \ 354 | --hash=sha256:9dcdfd0eaf283af041973bff14a2e143b8bd64e069f4c383416ecd79a81aab58 \ 355 | --hash=sha256:aa7bd130efab1c280bed0f45501b7c8795f9fdbeb02e965371bbef3523627779 \ 356 | --hash=sha256:ab4a0df41e7c16a1392727727e7998a467472d0ad65f3ad5e6e765015df08636 \ 357 | --hash=sha256:ad9e82fb8f09ade1c3e1b996a6337afac2b8b9e365f926f5a61aacc71adc5b3c \ 358 | --hash=sha256:af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad \ 359 | --hash=sha256:b076b6226fb84157e3f7c971a47ff3a679d837cf338547532ab866c57930dbee \ 360 | --hash=sha256:b7ff0f54cb4ff66dd38bebd335a38e2c22c41a8ee45aa608efc890ac3e3931bc \ 361 | --hash=sha256:bfce63a9e7834b12b87c64d6b155fdd9b3b96191b6bd334bf37db7ff1fe457f2 \ 362 | --hash=sha256:c011a4149cfbcf9f03994ec2edffcb8b1dc2d2aede7ca243746df97a5d41ce48 \ 363 | --hash=sha256:c9c804664ebe8f83a211cace637506669e7890fec1b4195b505c214e50dd4eb7 \ 364 | --hash=sha256:ca379055a47383d02a5400cb0d110cef0a776fc644cda797db0c5696cfd7e18e \ 365 | --hash=sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b \ 366 | --hash=sha256:cd0f502fe016460680cd20aaa5a76d241d6f35a1c3350c474bac1273803893fa \ 367 | --hash=sha256:ceb01949af7121f9fc39f7d27f91be8546f3fb112c608bc4029aef0bab86a2a5 \ 368 | --hash=sha256:d080e0a5eb2529460b30190fcfcc4199bd7f827663f858a226a81bc27beaa97e \ 369 | --hash=sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb \ 370 | --hash=sha256:df0be2b576a7abbf737b1575f048c23fb1d769f267ec4358296f31c2479db8f9 \ 371 | --hash=sha256:e09031c87a1e51556fdcb46e5bd4f59dfb743061cf93c4d6831bf894f125eb57 \ 372 | --hash=sha256:e4dd52d80b8c83fdce44e12478ad2e85c64ea965e75d66dbeafb0a3e77308fcc \ 373 | --hash=sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2 374 | pkgutil-resolve-name==1.3.10 ; python_full_version >= "3.8.1" and python_version < "3.9" \ 375 | --hash=sha256:357d6c9e6a755653cfd78893817c0853af365dd51ec97f3d358a819373bbd174 \ 376 | --hash=sha256:ca27cc078d25c5ad71a9de0a7a330146c4e014c2462d9af19c6b828280649c5e 377 | publicsuffixlist==0.10.0.20230814 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 378 | --hash=sha256:0f582a24087bda335903d49c8e07f2aa5e917680bceab4ad21a376fdbaae0d33 \ 379 | --hash=sha256:186ea295451ab954f6bbf06e4b86a0cc9550772744b86c29c495739d60dbe3a4 380 | pycparser==2.21 ; python_full_version >= "3.8.1" and platform_python_implementation != "CPython" and python_full_version < "4.0.0" \ 381 | --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ 382 | --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 383 | pyfaup==1.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 384 | --hash=sha256:5648bc3ebd80239aec927aedfc218c3a6ff36de636cc53822bfeb70b0869b1e7 \ 385 | --hash=sha256:75f96f7da86ffb5402d3fcc2dbf98a511e792cf9100c159e34cdba8996ddc7f9 386 | pymisp==2.4.174 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 387 | --hash=sha256:173247f368e78c9069d201621f3d7746b41cc478d76b923e1a4c1e7f29ada287 \ 388 | --hash=sha256:2030402737a7f656ec17814fa92a220b8b6fc973e5a99abe644b62a4e8b9a375 389 | python-dateutil==2.8.2 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 390 | --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ 391 | --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 392 | referencing==0.30.2 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 393 | --hash=sha256:449b6669b6121a9e96a7f9e410b245d471e8d48964c67113ce9afe50c8dd7bdf \ 394 | --hash=sha256:794ad8003c65938edcdbc027f1933215e0d0ccc0291e3ce20a4d87432b59efc0 395 | requests==2.31.0 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 396 | --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ 397 | --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 398 | rpds-py==0.9.2 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 399 | --hash=sha256:0173c0444bec0a3d7d848eaeca2d8bd32a1b43f3d3fde6617aac3731fa4be05f \ 400 | --hash=sha256:01899794b654e616c8625b194ddd1e5b51ef5b60ed61baa7a2d9c2ad7b2a4238 \ 401 | --hash=sha256:02938432352359805b6da099c9c95c8a0547fe4b274ce8f1a91677401bb9a45f \ 402 | --hash=sha256:03421628f0dc10a4119d714a17f646e2837126a25ac7a256bdf7c3943400f67f \ 403 | --hash=sha256:03975db5f103997904c37e804e5f340c8fdabbb5883f26ee50a255d664eed58c \ 404 | --hash=sha256:0766babfcf941db8607bdaf82569ec38107dbb03c7f0b72604a0b346b6eb3298 \ 405 | --hash=sha256:07e2c54bef6838fa44c48dfbc8234e8e2466d851124b551fc4e07a1cfeb37260 \ 406 | --hash=sha256:0836d71ca19071090d524739420a61580f3f894618d10b666cf3d9a1688355b1 \ 407 | --hash=sha256:095b460e117685867d45548fbd8598a8d9999227e9061ee7f012d9d264e6048d \ 408 | --hash=sha256:0e7521f5af0233e89939ad626b15278c71b69dc1dfccaa7b97bd4cdf96536bb7 \ 409 | --hash=sha256:0f2996fbac8e0b77fd67102becb9229986396e051f33dbceada3debaacc7033f \ 410 | --hash=sha256:1054a08e818f8e18910f1bee731583fe8f899b0a0a5044c6e680ceea34f93876 \ 411 | --hash=sha256:13b602dc3e8dff3063734f02dcf05111e887f301fdda74151a93dbbc249930fe \ 412 | --hash=sha256:141acb9d4ccc04e704e5992d35472f78c35af047fa0cfae2923835d153f091be \ 413 | --hash=sha256:14c408e9d1a80dcb45c05a5149e5961aadb912fff42ca1dd9b68c0044904eb32 \ 414 | --hash=sha256:159fba751a1e6b1c69244e23ba6c28f879a8758a3e992ed056d86d74a194a0f3 \ 415 | --hash=sha256:190ca6f55042ea4649ed19c9093a9be9d63cd8a97880106747d7147f88a49d18 \ 416 | --hash=sha256:196cb208825a8b9c8fc360dc0f87993b8b260038615230242bf18ec84447c08d \ 417 | --hash=sha256:1fcdee18fea97238ed17ab6478c66b2095e4ae7177e35fb71fbe561a27adf620 \ 418 | --hash=sha256:207f57c402d1f8712618f737356e4b6f35253b6d20a324d9a47cb9f38ee43a6b \ 419 | --hash=sha256:24a81c177379300220e907e9b864107614b144f6c2a15ed5c3450e19cf536fae \ 420 | --hash=sha256:29cd8bfb2d716366a035913ced99188a79b623a3512292963d84d3e06e63b496 \ 421 | --hash=sha256:2d8b3b3a2ce0eaa00c5bbbb60b6713e94e7e0becab7b3db6c5c77f979e8ed1f1 \ 422 | --hash=sha256:35da5cc5cb37c04c4ee03128ad59b8c3941a1e5cd398d78c37f716f32a9b7f67 \ 423 | --hash=sha256:44659b1f326214950a8204a248ca6199535e73a694be8d3e0e869f820767f12f \ 424 | --hash=sha256:47c5f58a8e0c2c920cc7783113df2fc4ff12bf3a411d985012f145e9242a2764 \ 425 | --hash=sha256:4bd4dc3602370679c2dfb818d9c97b1137d4dd412230cfecd3c66a1bf388a196 \ 426 | --hash=sha256:4ea6b73c22d8182dff91155af018b11aac9ff7eca085750455c5990cb1cfae6e \ 427 | --hash=sha256:50025635ba8b629a86d9d5474e650da304cb46bbb4d18690532dd79341467846 \ 428 | --hash=sha256:517cbf6e67ae3623c5127206489d69eb2bdb27239a3c3cc559350ef52a3bbf0b \ 429 | --hash=sha256:5855c85eb8b8a968a74dc7fb014c9166a05e7e7a8377fb91d78512900aadd13d \ 430 | --hash=sha256:5a46859d7f947061b4010e554ccd1791467d1b1759f2dc2ec9055fa239f1bc26 \ 431 | --hash=sha256:65a0583c43d9f22cb2130c7b110e695fff834fd5e832a776a107197e59a1898e \ 432 | --hash=sha256:674c704605092e3ebbbd13687b09c9f78c362a4bc710343efe37a91457123044 \ 433 | --hash=sha256:682726178138ea45a0766907957b60f3a1bf3acdf212436be9733f28b6c5af3c \ 434 | --hash=sha256:686ba516e02db6d6f8c279d1641f7067ebb5dc58b1d0536c4aaebb7bf01cdc5d \ 435 | --hash=sha256:6a5d3fbd02efd9cf6a8ffc2f17b53a33542f6b154e88dd7b42ef4a4c0700fdad \ 436 | --hash=sha256:6aa8326a4a608e1c28da191edd7c924dff445251b94653988efb059b16577a4d \ 437 | --hash=sha256:700375326ed641f3d9d32060a91513ad668bcb7e2cffb18415c399acb25de2ab \ 438 | --hash=sha256:71f2f7715935a61fa3e4ae91d91b67e571aeb5cb5d10331ab681256bda2ad920 \ 439 | --hash=sha256:745f5a43fdd7d6d25a53ab1a99979e7f8ea419dfefebcab0a5a1e9095490ee5e \ 440 | --hash=sha256:79f594919d2c1a0cc17d1988a6adaf9a2f000d2e1048f71f298b056b1018e872 \ 441 | --hash=sha256:7d68dc8acded354c972116f59b5eb2e5864432948e098c19fe6994926d8e15c3 \ 442 | --hash=sha256:7f67da97f5b9eac838b6980fc6da268622e91f8960e083a34533ca710bec8611 \ 443 | --hash=sha256:83b32f0940adec65099f3b1c215ef7f1d025d13ff947975a055989cb7fd019a4 \ 444 | --hash=sha256:876bf9ed62323bc7dcfc261dbc5572c996ef26fe6406b0ff985cbcf460fc8a4c \ 445 | --hash=sha256:890ba852c16ace6ed9f90e8670f2c1c178d96510a21b06d2fa12d8783a905193 \ 446 | --hash=sha256:8b08605d248b974eb02f40bdcd1a35d3924c83a2a5e8f5d0fa5af852c4d960af \ 447 | --hash=sha256:8b2eb034c94b0b96d5eddb290b7b5198460e2d5d0c421751713953a9c4e47d10 \ 448 | --hash=sha256:8b9ec12ad5f0a4625db34db7e0005be2632c1013b253a4a60e8302ad4d462afd \ 449 | --hash=sha256:8c8d7594e38cf98d8a7df25b440f684b510cf4627fe038c297a87496d10a174f \ 450 | --hash=sha256:8d3335c03100a073883857e91db9f2e0ef8a1cf42dc0369cbb9151c149dbbc1b \ 451 | --hash=sha256:8d70e8f14900f2657c249ea4def963bed86a29b81f81f5b76b5a9215680de945 \ 452 | --hash=sha256:9039a11bca3c41be5a58282ed81ae422fa680409022b996032a43badef2a3752 \ 453 | --hash=sha256:91378d9f4151adc223d584489591dbb79f78814c0734a7c3bfa9c9e09978121c \ 454 | --hash=sha256:9251eb8aa82e6cf88510530b29eef4fac825a2b709baf5b94a6094894f252387 \ 455 | --hash=sha256:933a7d5cd4b84f959aedeb84f2030f0a01d63ae6cf256629af3081cf3e3426e8 \ 456 | --hash=sha256:978fa96dbb005d599ec4fd9ed301b1cc45f1a8f7982d4793faf20b404b56677d \ 457 | --hash=sha256:987b06d1cdb28f88a42e4fb8a87f094e43f3c435ed8e486533aea0bf2e53d931 \ 458 | --hash=sha256:99b1c16f732b3a9971406fbfe18468592c5a3529585a45a35adbc1389a529a03 \ 459 | --hash=sha256:99e7c4bb27ff1aab90dcc3e9d37ee5af0231ed98d99cb6f5250de28889a3d502 \ 460 | --hash=sha256:9c439fd54b2b9053717cca3de9583be6584b384d88d045f97d409f0ca867d80f \ 461 | --hash=sha256:9ea4d00850ef1e917815e59b078ecb338f6a8efda23369677c54a5825dbebb55 \ 462 | --hash=sha256:9f30d205755566a25f2ae0382944fcae2f350500ae4df4e795efa9e850821d82 \ 463 | --hash=sha256:a06418fe1155e72e16dddc68bb3780ae44cebb2912fbd8bb6ff9161de56e1798 \ 464 | --hash=sha256:a0805911caedfe2736935250be5008b261f10a729a303f676d3d5fea6900c96a \ 465 | --hash=sha256:a1f044792e1adcea82468a72310c66a7f08728d72a244730d14880cd1dabe36b \ 466 | --hash=sha256:a216b26e5af0a8e265d4efd65d3bcec5fba6b26909014effe20cd302fd1138fa \ 467 | --hash=sha256:a987578ac5214f18b99d1f2a3851cba5b09f4a689818a106c23dbad0dfeb760f \ 468 | --hash=sha256:aad51239bee6bff6823bbbdc8ad85136c6125542bbc609e035ab98ca1e32a192 \ 469 | --hash=sha256:ab2299e3f92aa5417d5e16bb45bb4586171c1327568f638e8453c9f8d9e0f020 \ 470 | --hash=sha256:ab6919a09c055c9b092798ce18c6c4adf49d24d4d9e43a92b257e3f2548231e7 \ 471 | --hash=sha256:b0c43f8ae8f6be1d605b0465671124aa8d6a0e40f1fb81dcea28b7e3d87ca1e1 \ 472 | --hash=sha256:b1440c291db3f98a914e1afd9d6541e8fc60b4c3aab1a9008d03da4651e67386 \ 473 | --hash=sha256:b52e7c5ae35b00566d244ffefba0f46bb6bec749a50412acf42b1c3f402e2c90 \ 474 | --hash=sha256:bf4151acb541b6e895354f6ff9ac06995ad9e4175cbc6d30aaed08856558201f \ 475 | --hash=sha256:c27ee01a6c3223025f4badd533bea5e87c988cb0ba2811b690395dfe16088cfe \ 476 | --hash=sha256:c545d9d14d47be716495076b659db179206e3fd997769bc01e2d550eeb685596 \ 477 | --hash=sha256:c5934e2833afeaf36bd1eadb57256239785f5af0220ed8d21c2896ec4d3a765f \ 478 | --hash=sha256:c7671d45530fcb6d5e22fd40c97e1e1e01965fc298cbda523bb640f3d923b387 \ 479 | --hash=sha256:c861a7e4aef15ff91233751619ce3a3d2b9e5877e0fcd76f9ea4f6847183aa16 \ 480 | --hash=sha256:d25b1c1096ef0447355f7293fbe9ad740f7c47ae032c2884113f8e87660d8f6e \ 481 | --hash=sha256:d55777a80f78dd09410bd84ff8c95ee05519f41113b2df90a69622f5540c4f8b \ 482 | --hash=sha256:d576c3ef8c7b2d560e301eb33891d1944d965a4d7a2eacb6332eee8a71827db6 \ 483 | --hash=sha256:dd9da77c6ec1f258387957b754f0df60766ac23ed698b61941ba9acccd3284d1 \ 484 | --hash=sha256:de0b6eceb46141984671802d412568d22c6bacc9b230174f9e55fc72ef4f57de \ 485 | --hash=sha256:e07e5dbf8a83c66783a9fe2d4566968ea8c161199680e8ad38d53e075df5f0d0 \ 486 | --hash=sha256:e564d2238512c5ef5e9d79338ab77f1cbbda6c2d541ad41b2af445fb200385e3 \ 487 | --hash=sha256:ed89861ee8c8c47d6beb742a602f912b1bb64f598b1e2f3d758948721d44d468 \ 488 | --hash=sha256:ef1f08f2a924837e112cba2953e15aacfccbbfcd773b4b9b4723f8f2ddded08e \ 489 | --hash=sha256:f411330a6376fb50e5b7a3e66894e4a39e60ca2e17dce258d53768fea06a37bd \ 490 | --hash=sha256:f68996a3b3dc9335037f82754f9cdbe3a95db42bde571d8c3be26cc6245f2324 \ 491 | --hash=sha256:f7fdf55283ad38c33e35e2855565361f4bf0abd02470b8ab28d499c663bc5d7c \ 492 | --hash=sha256:f963c6b1218b96db85fc37a9f0851eaf8b9040aa46dec112611697a7023da535 \ 493 | --hash=sha256:fa2818759aba55df50592ecbc95ebcdc99917fa7b55cc6796235b04193eb3c55 \ 494 | --hash=sha256:fae5cb554b604b3f9e2c608241b5d8d303e410d7dfb6d397c335f983495ce7f6 \ 495 | --hash=sha256:fb39aca7a64ad0c9490adfa719dbeeb87d13be137ca189d2564e596f8ba32c07 496 | setuptools==68.1.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 497 | --hash=sha256:3d4dfa6d95f1b101d695a6160a7626e15583af71a5f52176efa5d39a054d475d \ 498 | --hash=sha256:3d8083eed2d13afc9426f227b24fd1659489ec107c0e86cec2ffdde5c92e790b 499 | six==1.16.0 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 500 | --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ 501 | --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 502 | soupsieve==2.4.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 503 | --hash=sha256:1c1bfee6819544a3447586c889157365a27e10d88cde3ad3da0cf0ddf646feb8 \ 504 | --hash=sha256:89d12b2d5dfcd2c9e8c22326da9d9aa9cb3dfab0a83a024f05704076ee8d35ea 505 | urllib3==1.26.16 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 506 | --hash=sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f \ 507 | --hash=sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14 508 | urllib3[brotli]==1.26.16 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 509 | --hash=sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f \ 510 | --hash=sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14 511 | visitor==0.1.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 512 | --hash=sha256:2c737903b2b6864ebc6167eef7cf3b997126f1aa94bdf590f90f1436d23e480a 513 | werkzeug==2.3.7 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" \ 514 | --hash=sha256:2b8c0e447b4b9dbcc85dd97b6eeb4dcbaf6c8b6c3be0bd654e25553e0a2157d8 \ 515 | --hash=sha256:effc12dba7f3bd72e605ce49807bbe692bd729c3bb122a3b91747a6ae77df528 516 | wrapt==1.15.0 ; python_full_version >= "3.8.1" and python_version < "4.0" \ 517 | --hash=sha256:02fce1852f755f44f95af51f69d22e45080102e9d00258053b79367d07af39c0 \ 518 | --hash=sha256:077ff0d1f9d9e4ce6476c1a924a3332452c1406e59d90a2cf24aeb29eeac9420 \ 519 | --hash=sha256:078e2a1a86544e644a68422f881c48b84fef6d18f8c7a957ffd3f2e0a74a0d4a \ 520 | --hash=sha256:0970ddb69bba00670e58955f8019bec4a42d1785db3faa043c33d81de2bf843c \ 521 | --hash=sha256:1286eb30261894e4c70d124d44b7fd07825340869945c79d05bda53a40caa079 \ 522 | --hash=sha256:21f6d9a0d5b3a207cdf7acf8e58d7d13d463e639f0c7e01d82cdb671e6cb7923 \ 523 | --hash=sha256:230ae493696a371f1dbffaad3dafbb742a4d27a0afd2b1aecebe52b740167e7f \ 524 | --hash=sha256:26458da5653aa5b3d8dc8b24192f574a58984c749401f98fff994d41d3f08da1 \ 525 | --hash=sha256:2cf56d0e237280baed46f0b5316661da892565ff58309d4d2ed7dba763d984b8 \ 526 | --hash=sha256:2e51de54d4fb8fb50d6ee8327f9828306a959ae394d3e01a1ba8b2f937747d86 \ 527 | --hash=sha256:2fbfbca668dd15b744418265a9607baa970c347eefd0db6a518aaf0cfbd153c0 \ 528 | --hash=sha256:38adf7198f8f154502883242f9fe7333ab05a5b02de7d83aa2d88ea621f13364 \ 529 | --hash=sha256:3a8564f283394634a7a7054b7983e47dbf39c07712d7b177b37e03f2467a024e \ 530 | --hash=sha256:3abbe948c3cbde2689370a262a8d04e32ec2dd4f27103669a45c6929bcdbfe7c \ 531 | --hash=sha256:3bbe623731d03b186b3d6b0d6f51865bf598587c38d6f7b0be2e27414f7f214e \ 532 | --hash=sha256:40737a081d7497efea35ab9304b829b857f21558acfc7b3272f908d33b0d9d4c \ 533 | --hash=sha256:41d07d029dd4157ae27beab04d22b8e261eddfc6ecd64ff7000b10dc8b3a5727 \ 534 | --hash=sha256:46ed616d5fb42f98630ed70c3529541408166c22cdfd4540b88d5f21006b0eff \ 535 | --hash=sha256:493d389a2b63c88ad56cdc35d0fa5752daac56ca755805b1b0c530f785767d5e \ 536 | --hash=sha256:4ff0d20f2e670800d3ed2b220d40984162089a6e2c9646fdb09b85e6f9a8fc29 \ 537 | --hash=sha256:54accd4b8bc202966bafafd16e69da9d5640ff92389d33d28555c5fd4f25ccb7 \ 538 | --hash=sha256:56374914b132c702aa9aa9959c550004b8847148f95e1b824772d453ac204a72 \ 539 | --hash=sha256:578383d740457fa790fdf85e6d346fda1416a40549fe8db08e5e9bd281c6a475 \ 540 | --hash=sha256:58d7a75d731e8c63614222bcb21dd992b4ab01a399f1f09dd82af17bbfc2368a \ 541 | --hash=sha256:5c5aa28df055697d7c37d2099a7bc09f559d5053c3349b1ad0c39000e611d317 \ 542 | --hash=sha256:5fc8e02f5984a55d2c653f5fea93531e9836abbd84342c1d1e17abc4a15084c2 \ 543 | --hash=sha256:63424c681923b9f3bfbc5e3205aafe790904053d42ddcc08542181a30a7a51bd \ 544 | --hash=sha256:64b1df0f83706b4ef4cfb4fb0e4c2669100fd7ecacfb59e091fad300d4e04640 \ 545 | --hash=sha256:74934ebd71950e3db69960a7da29204f89624dde411afbfb3b4858c1409b1e98 \ 546 | --hash=sha256:75669d77bb2c071333417617a235324a1618dba66f82a750362eccbe5b61d248 \ 547 | --hash=sha256:75760a47c06b5974aa5e01949bf7e66d2af4d08cb8c1d6516af5e39595397f5e \ 548 | --hash=sha256:76407ab327158c510f44ded207e2f76b657303e17cb7a572ffe2f5a8a48aa04d \ 549 | --hash=sha256:76e9c727a874b4856d11a32fb0b389afc61ce8aaf281ada613713ddeadd1cfec \ 550 | --hash=sha256:77d4c1b881076c3ba173484dfa53d3582c1c8ff1f914c6461ab70c8428b796c1 \ 551 | --hash=sha256:780c82a41dc493b62fc5884fb1d3a3b81106642c5c5c78d6a0d4cbe96d62ba7e \ 552 | --hash=sha256:7dc0713bf81287a00516ef43137273b23ee414fe41a3c14be10dd95ed98a2df9 \ 553 | --hash=sha256:7eebcdbe3677e58dd4c0e03b4f2cfa346ed4049687d839adad68cc38bb559c92 \ 554 | --hash=sha256:896689fddba4f23ef7c718279e42f8834041a21342d95e56922e1c10c0cc7afb \ 555 | --hash=sha256:96177eb5645b1c6985f5c11d03fc2dbda9ad24ec0f3a46dcce91445747e15094 \ 556 | --hash=sha256:96e25c8603a155559231c19c0349245eeb4ac0096fe3c1d0be5c47e075bd4f46 \ 557 | --hash=sha256:9d37ac69edc5614b90516807de32d08cb8e7b12260a285ee330955604ed9dd29 \ 558 | --hash=sha256:9ed6aa0726b9b60911f4aed8ec5b8dd7bf3491476015819f56473ffaef8959bd \ 559 | --hash=sha256:a487f72a25904e2b4bbc0817ce7a8de94363bd7e79890510174da9d901c38705 \ 560 | --hash=sha256:a4cbb9ff5795cd66f0066bdf5947f170f5d63a9274f99bdbca02fd973adcf2a8 \ 561 | --hash=sha256:a74d56552ddbde46c246b5b89199cb3fd182f9c346c784e1a93e4dc3f5ec9975 \ 562 | --hash=sha256:a89ce3fd220ff144bd9d54da333ec0de0399b52c9ac3d2ce34b569cf1a5748fb \ 563 | --hash=sha256:abd52a09d03adf9c763d706df707c343293d5d106aea53483e0ec8d9e310ad5e \ 564 | --hash=sha256:abd8f36c99512755b8456047b7be10372fca271bf1467a1caa88db991e7c421b \ 565 | --hash=sha256:af5bd9ccb188f6a5fdda9f1f09d9f4c86cc8a539bd48a0bfdc97723970348418 \ 566 | --hash=sha256:b02f21c1e2074943312d03d243ac4388319f2456576b2c6023041c4d57cd7019 \ 567 | --hash=sha256:b06fa97478a5f478fb05e1980980a7cdf2712015493b44d0c87606c1513ed5b1 \ 568 | --hash=sha256:b0724f05c396b0a4c36a3226c31648385deb6a65d8992644c12a4963c70326ba \ 569 | --hash=sha256:b130fe77361d6771ecf5a219d8e0817d61b236b7d8b37cc045172e574ed219e6 \ 570 | --hash=sha256:b56d5519e470d3f2fe4aa7585f0632b060d532d0696c5bdfb5e8319e1d0f69a2 \ 571 | --hash=sha256:b67b819628e3b748fd3c2192c15fb951f549d0f47c0449af0764d7647302fda3 \ 572 | --hash=sha256:ba1711cda2d30634a7e452fc79eabcadaffedf241ff206db2ee93dd2c89a60e7 \ 573 | --hash=sha256:bbeccb1aa40ab88cd29e6c7d8585582c99548f55f9b2581dfc5ba68c59a85752 \ 574 | --hash=sha256:bd84395aab8e4d36263cd1b9308cd504f6cf713b7d6d3ce25ea55670baec5416 \ 575 | --hash=sha256:c99f4309f5145b93eca6e35ac1a988f0dc0a7ccf9ccdcd78d3c0adf57224e62f \ 576 | --hash=sha256:ca1cccf838cd28d5a0883b342474c630ac48cac5df0ee6eacc9c7290f76b11c1 \ 577 | --hash=sha256:cd525e0e52a5ff16653a3fc9e3dd827981917d34996600bbc34c05d048ca35cc \ 578 | --hash=sha256:cdb4f085756c96a3af04e6eca7f08b1345e94b53af8921b25c72f096e704e145 \ 579 | --hash=sha256:ce42618f67741d4697684e501ef02f29e758a123aa2d669e2d964ff734ee00ee \ 580 | --hash=sha256:d06730c6aed78cee4126234cf2d071e01b44b915e725a6cb439a879ec9754a3a \ 581 | --hash=sha256:d5fe3e099cf07d0fb5a1e23d399e5d4d1ca3e6dfcbe5c8570ccff3e9208274f7 \ 582 | --hash=sha256:d6bcbfc99f55655c3d93feb7ef3800bd5bbe963a755687cbf1f490a71fb7794b \ 583 | --hash=sha256:d787272ed958a05b2c86311d3a4135d3c2aeea4fc655705f074130aa57d71653 \ 584 | --hash=sha256:e169e957c33576f47e21864cf3fc9ff47c223a4ebca8960079b8bd36cb014fd0 \ 585 | --hash=sha256:e20076a211cd6f9b44a6be58f7eeafa7ab5720eb796975d0c03f05b47d89eb90 \ 586 | --hash=sha256:e826aadda3cae59295b95343db8f3d965fb31059da7de01ee8d1c40a60398b29 \ 587 | --hash=sha256:eef4d64c650f33347c1f9266fa5ae001440b232ad9b98f1f43dfe7a79435c0a6 \ 588 | --hash=sha256:f2e69b3ed24544b0d3dbe2c5c0ba5153ce50dcebb576fdc4696d52aa22db6034 \ 589 | --hash=sha256:f87ec75864c37c4c6cb908d282e1969e79763e0d9becdfe9fe5473b7bb1e5f09 \ 590 | --hash=sha256:fbec11614dba0424ca72f4e8ba3c420dba07b4a7c206c8c8e4e73f2e98f4c559 \ 591 | --hash=sha256:fd69666217b62fa5d7c6aa88e507493a34dec4fa20c5bd925e4bc12fce586639 592 | zipp==3.16.2 ; python_full_version >= "3.8.1" and python_version < "3.10" \ 593 | --hash=sha256:679e51dd4403591b2d6838a48de3d283f3d188412a9782faadf845f298736ba0 \ 594 | --hash=sha256:ebc15946aa78bd63458992fc81ec3b6f7b1e92d51c35e6de1c3804e73b799147 595 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | from setuptools import setup 4 | 5 | 6 | setup( 7 | name='mail2misp', 8 | version='0.2', 9 | author='Raphaël Vinot', 10 | author_email='raphael.vinot@circl.lu', 11 | maintainer='Raphaël Vinot', 12 | url='https://github.com/MISP/mail_to_misp', 13 | description='Importer of EML files into a MISP instance', 14 | packages=['mail2misp'], 15 | scripts=[], # TODO 16 | classifiers=[ 17 | 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', 18 | 'Development Status :: 3 - Alpha', 19 | 'Environment :: Console', 20 | 'Operating System :: POSIX :: Linux', 21 | 'Intended Audience :: Science/Research', 22 | 'Intended Audience :: Telecommunications Industry', 23 | 'Intended Audience :: Information Technology', 24 | 'Programming Language :: Python :: 3', 25 | 'Topic :: Security', 26 | 'Topic :: Internet', 27 | ] 28 | ) 29 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MISP/mail_to_misp/799041bdc1d797d003012d6c758554ba544e055d/tests/__init__.py -------------------------------------------------------------------------------- /tests/config_carrier.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | misp_url = 'YOUR_MISP_URL' 5 | misp_key = 'YOUR_KEY_HERE' # The MISP auth key can be found on the MISP web interface under the automation section 6 | misp_verifycert = True 7 | spamtrap = False 8 | default_distribution = 0 9 | default_threat_level = 3 10 | default_analysis = 1 11 | id_tag = 'host:m2m:tld' 12 | 13 | body_config_prefix = 'm2m' # every line in the body starting with this value will be skipped from the IOCs 14 | m2m_key = 'YOUSETYOURKEYHERE' 15 | m2m_benign_attachment_keyword = 'benign' 16 | 17 | debug = True 18 | nameservers = ['8.8.8.8'] 19 | email_subject_prefix = 'M2M' 20 | attach_original_mail = True 21 | ignore_carrier_mail = True 22 | 23 | excludelist = ('google.com', 'microsoft.com') 24 | externallist = ('virustotal.com', 'malwr.com', 'hybrid-analysis.com', 'emergingthreats.net') 25 | internallist = ('internal.system.local') 26 | noidsflaglist = ('myexternalip.com', 'ipinfo.io', 'icanhazip.com', 'wtfismyip.com', 'ipecho.net', 27 | 'api.ipify.org', 'checkip.amazonaws.com', 'whatismyipaddress.com', 'google.com', 28 | 'dropbox.com' 29 | ) 30 | 31 | # Stop parsing when this term is found 32 | stopword = 'Whois & IP Information' 33 | 34 | # Ignore lines in body of message containing: 35 | ignorelist = ("From:", "Sender:", "Received:", "Sender IP:", "Reply-To:", "Registrar WHOIS Server:", 36 | "Registrar:", "Domain Status:", "Registrant Email:", "IP Location:", 37 | "X-Get-Message-Sender-Via:", "X-Authenticated-Sender:") 38 | 39 | # Ignore (don't add) attributes that are on server side warning list 40 | enforcewarninglist = True 41 | 42 | # Add a sighting for each value 43 | sighting = False 44 | sighting_source = "YOUR_MAIL_TO_MISP_IDENTIFIER" 45 | 46 | # Remove "Re:", "Fwd:" and {Spam?} from subject 47 | # add: "[\(\[].*?[\)\]]" to remove everything between [] and (): i.e. [tag] 48 | removelist = (r'Re:', r'Fwd:', r'\{Spam\?\}') 49 | 50 | # TLP tag setup 51 | # Tuples contain different variations of spelling 52 | tlptags = {'tlp:amber': ['tlp:amber', 'tlp: amber', 'tlp amber'], 53 | 'tlp:green': ['tlp:green', 'tlp: green', 'tlp green'], 54 | 'tlp:white': ['tlp:white', 'tlp: white', 'tlp white'] 55 | } 56 | tlptag_default = sorted(tlptags.keys())[0] 57 | 58 | malwaretags = {'locky': ['ecsirt:malicious-code="ransomware"', 'misp-galaxy:ransomware="Locky"'], 59 | 'jaff': ['ecsirt:malicious-code="ransomware"', 'misp-galaxy:ransomware="Jaff"'], 60 | 'dridex': ['misp-galaxy:tool="dridex"'], 61 | 'netwire': ['Netwire RAT'], 62 | 'Pony': ['misp-galaxy:tool="Hancitor"'], 63 | 'ursnif': ['misp-galaxy:tool="Snifula"'], 64 | 'NanoCore': ['misp-galaxy:tool="NanoCoreRAT"'], 65 | 'trickbot': ['misp-galaxy:tool="Trick Bot"'] 66 | } 67 | 68 | # Tags to be set depending on the presence of other tags 69 | dependingtags = {'tlp:white': ['circl:osint-feed'] 70 | } 71 | 72 | # Known identifiers for forwarded messages 73 | forward_identifiers = {'-------- Forwarded Message --------', 'Begin forwarded message:'} 74 | 75 | # Tags to add when hashes are found (e.g. to do automatic expansion) 76 | hash_only_tags = {'TODO:VT-ENRICHMENT'} 77 | 78 | # If an attribute is on any MISP server side `warning list`, skip the creation of the attribute 79 | skip_item_on_warninglist = True 80 | 81 | vt_key = None 82 | -------------------------------------------------------------------------------- /tests/config_forward.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | misp_url = 'YOUR_MISP_URL' 5 | misp_key = 'YOUR_KEY_HERE' # The MISP auth key can be found on the MISP web interface under the automation section 6 | misp_verifycert = True 7 | spamtrap = False 8 | default_distribution = 0 9 | default_threat_level = 3 10 | default_analysis = 1 11 | id_tag = 'host:m2m:tld' 12 | 13 | body_config_prefix = 'm2m' # every line in the body starting with this value will be skipped from the IOCs 14 | m2m_key = 'YOUSETYOURKEYHERE' 15 | m2m_benign_attachment_keyword = 'benign' 16 | 17 | debug = True 18 | nameservers = ['8.8.8.8'] 19 | email_subject_prefix = 'M2M' 20 | attach_original_mail = True 21 | 22 | excludelist = ('google.com', 'microsoft.com') 23 | externallist = ('virustotal.com', 'malwr.com', 'hybrid-analysis.com', 'emergingthreats.net') 24 | internallist = ('internal.system.local') 25 | noidsflaglist = ('myexternalip.com', 'ipinfo.io', 'icanhazip.com', 'wtfismyip.com', 'ipecho.net', 26 | 'api.ipify.org', 'checkip.amazonaws.com', 'whatismyipaddress.com', 'google.com', 27 | 'dropbox.com' 28 | ) 29 | 30 | # Stop parsing when this term is found 31 | stopword = 'Whois & IP Information' 32 | 33 | # Ignore lines in body of message containing: 34 | ignorelist = ("From:", "Sender:", "Received:", "Sender IP:", "Reply-To:", "Registrar WHOIS Server:", 35 | "Registrar:", "Domain Status:", "Registrant Email:", "IP Location:", 36 | "X-Get-Message-Sender-Via:", "X-Authenticated-Sender:") 37 | 38 | # Ignore (don't add) attributes that are on server side warning list 39 | enforcewarninglist = True 40 | 41 | # Add a sighting for each value 42 | sighting = False 43 | sighting_source = "YOUR_MAIL_TO_MISP_IDENTIFIER" 44 | 45 | # Remove "Re:", "Fwd:" and {Spam?} from subject 46 | # add: "[\(\[].*?[\)\]]" to remove everything between [] and (): i.e. [tag] 47 | removelist = (r'Re:', r'Fwd:', r'\{Spam?\}') 48 | 49 | # TLP tag setup 50 | # Tuples contain different variations of spelling 51 | tlptags = {'tlp:amber': ['tlp:amber', 'tlp: amber', 'tlp amber'], 52 | 'tlp:green': ['tlp:green', 'tlp: green', 'tlp green'], 53 | 'tlp:white': ['tlp:white', 'tlp: white', 'tlp white'] 54 | } 55 | tlptag_default = sorted(tlptags.keys())[0] 56 | 57 | malwaretags = {'locky': ['ecsirt:malicious-code="ransomware"', 'misp-galaxy:ransomware="Locky"'], 58 | 'jaff': ['ecsirt:malicious-code="ransomware"', 'misp-galaxy:ransomware="Jaff"'], 59 | 'dridex': ['misp-galaxy:tool="dridex"'], 60 | 'netwire': ['Netwire RAT'], 61 | 'Pony': ['misp-galaxy:tool="Hancitor"'], 62 | 'ursnif': ['misp-galaxy:tool="Snifula"'], 63 | 'NanoCore': ['misp-galaxy:tool="NanoCoreRAT"'], 64 | 'trickbot': ['misp-galaxy:tool="Trick Bot"'] 65 | } 66 | 67 | # Tags to be set depending on the presence of other tags 68 | dependingtags = {'tlp:white': ['circl:osint-feed'] 69 | } 70 | 71 | # Known identifiers for forwarded messages 72 | forward_identifiers = {'-------- Forwarded Message --------', 'Begin forwarded message:'} 73 | 74 | # Tags to add when hashes are found (e.g. to do automatic expansion) 75 | hash_only_tags = {'TODO:VT-ENRICHMENT'} 76 | 77 | # If an attribute is on any MISP server side `warning list`, skip the creation of the attribute 78 | skip_item_on_warninglist = True 79 | 80 | vt_key = None 81 | -------------------------------------------------------------------------------- /tests/config_spamtrap.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | misp_url = 'YOUR_MISP_URL' 5 | misp_key = 'YOUR_KEY_HERE' # The MISP auth key can be found on the MISP web interface under the automation section 6 | misp_verifycert = True 7 | spamtrap = True 8 | default_distribution = 0 9 | default_threat_level = 3 10 | default_analysis = 1 11 | id_tag = 'host:m2m:tld' 12 | 13 | body_config_prefix = 'm2m' # every line in the body starting with this value will be skipped from the IOCs 14 | m2m_key = 'YOUSETYOURKEYHERE' 15 | m2m_benign_attachment_keyword = 'benign' 16 | 17 | debug = True 18 | nameservers = ['8.8.8.8'] 19 | email_subject_prefix = 'M2M' 20 | attach_original_mail = True 21 | 22 | excludelist = ('google.com', 'microsoft.com') 23 | externallist = ('virustotal.com', 'malwr.com', 'hybrid-analysis.com', 'emergingthreats.net') 24 | internallist = ('internal.system.local') 25 | noidsflaglist = ('myexternalip.com', 'ipinfo.io', 'icanhazip.com', 'wtfismyip.com', 'ipecho.net', 26 | 'api.ipify.org', 'checkip.amazonaws.com', 'whatismyipaddress.com', 'google.com', 27 | 'dropbox.com' 28 | ) 29 | 30 | # Stop parsing when this term is found 31 | stopword = 'Whois & IP Information' 32 | 33 | # Ignore lines in body of message containing: 34 | ignorelist = ("From:", "Sender:", "Received:", "Sender IP:", "Reply-To:", "Registrar WHOIS Server:", 35 | "Registrar:", "Domain Status:", "Registrant Email:", "IP Location:", 36 | "X-Get-Message-Sender-Via:", "X-Authenticated-Sender:") 37 | 38 | # Ignore (don't add) attributes that are on server side warning list 39 | enforcewarninglist = True 40 | 41 | # Add a sighting for each value 42 | sighting = False 43 | sighting_source = "YOUR_MAIL_TO_MISP_IDENTIFIER" 44 | 45 | # Remove "Re:", "Fwd:" and {Spam?} from subject 46 | # add: "[\(\[].*?[\)\]]" to remove everything between [] and (): i.e. [tag] 47 | removelist = (r'Re:', r'Fwd:', r'\{Spam\?\}') 48 | 49 | # TLP tag setup 50 | # Tuples contain different variations of spelling 51 | tlptags = {'tlp:amber': ['tlp:amber', 'tlp: amber', 'tlp amber'], 52 | 'tlp:green': ['tlp:green', 'tlp: green', 'tlp green'], 53 | 'tlp:white': ['tlp:white', 'tlp: white', 'tlp white'] 54 | } 55 | tlptag_default = sorted(tlptags.keys())[0] 56 | 57 | malwaretags = {'locky': ['ecsirt:malicious-code="ransomware"', 'misp-galaxy:ransomware="Locky"'], 58 | 'jaff': ['ecsirt:malicious-code="ransomware"', 'misp-galaxy:ransomware="Jaff"'], 59 | 'dridex': ['misp-galaxy:tool="dridex"'], 60 | 'netwire': ['Netwire RAT'], 61 | 'Pony': ['misp-galaxy:tool="Hancitor"'], 62 | 'ursnif': ['misp-galaxy:tool="Snifula"'], 63 | 'NanoCore': ['misp-galaxy:tool="NanoCoreRAT"'], 64 | 'trickbot': ['misp-galaxy:tool="Trick Bot"'] 65 | } 66 | 67 | # Tags to be set depending on the presence of other tags 68 | dependingtags = {'tlp:white': ['circl:osint-feed'] 69 | } 70 | 71 | # Known identifiers for forwarded messages 72 | forward_identifiers = {'-------- Forwarded Message --------', 'Begin forwarded message:'} 73 | 74 | # Tags to add when hashes are found (e.g. to do automatic expansion) 75 | hash_only_tags = {'TODO:VT-ENRICHMENT'} 76 | 77 | # If an attribute is on any MISP server side `warning list`, skip the creation of the attribute 78 | skip_item_on_warninglist = True 79 | 80 | vt_key = None 81 | -------------------------------------------------------------------------------- /tests/tests.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import unittest 5 | import importlib 6 | import sys 7 | from io import BytesIO 8 | sys.path.insert(0, ".") 9 | 10 | from mail2misp import Mail2MISP 11 | 12 | 13 | class TestMailToMISP(unittest.TestCase): 14 | 15 | def test_spamtrap(self): 16 | config = importlib.import_module('tests.config_spamtrap') 17 | self.mail2misp = Mail2MISP('', '', '', config=config, offline=True) 18 | with open('tests/mails/simple_spamtrap.eml', 'rb') as f: 19 | self.mail2misp.load_email(BytesIO(f.read())) 20 | self.mail2misp.email_from_spamtrap() 21 | self.mail2misp.process_body_iocs() 22 | event = self.mail2misp.add_event() 23 | print(event) 24 | 25 | def test_spamtrap_attachment(self): 26 | config = importlib.import_module('tests.config_spamtrap') 27 | self.mail2misp = Mail2MISP('', '', '', config=config, offline=True) 28 | with open('tests/mails/attachment_spamtrap.eml', 'rb') as f: 29 | self.mail2misp.load_email(BytesIO(f.read())) 30 | self.mail2misp.email_from_spamtrap() 31 | self.mail2misp.process_body_iocs() 32 | event = self.mail2misp.add_event() 33 | print(event) 34 | 35 | def test_forward(self): 36 | config = importlib.import_module('tests.config_forward') 37 | self.mail2misp = Mail2MISP('', '', '', config=config, offline=True) 38 | with open('tests/mails/simple_forward.eml', 'rb') as f: 39 | self.mail2misp.load_email(BytesIO(f.read())) 40 | self.mail2misp.process_email_body() 41 | self.mail2misp.process_body_iocs() 42 | event = self.mail2misp.add_event() 43 | print(event) 44 | 45 | def test_forward_attachment(self): 46 | config = importlib.import_module('tests.config_forward') 47 | self.mail2misp = Mail2MISP('', '', '', config=config, offline=True) 48 | with open('tests/mails/attachment_forward.eml', 'rb') as f: 49 | self.mail2misp.load_email(BytesIO(f.read())) 50 | self.mail2misp.process_email_body() 51 | self.mail2misp.process_body_iocs() 52 | event = self.mail2misp.add_event() 53 | print(event) 54 | 55 | def test_benign(self): 56 | config = importlib.import_module('tests.config_forward') 57 | self.mail2misp = Mail2MISP('', '', '', config=config, offline=True) 58 | with open('tests/mails/test_benign.eml', 'rb') as f: 59 | self.mail2misp.load_email(BytesIO(f.read())) 60 | self.mail2misp.process_email_body() 61 | self.mail2misp.process_body_iocs() 62 | self.assertTrue('attachment' in [a.type for a in self.mail2misp.misp_event.attributes]) 63 | self.assertTrue(self.mail2misp.misp_event.publish) 64 | 65 | def test_textfile(self): 66 | config = importlib.import_module('tests.config_forward') 67 | self.mail2misp = Mail2MISP('', '', '', config=config, offline=True) 68 | with open('tests/mails/test_textattachment.eml', 'rb') as f: 69 | self.mail2misp.load_email(BytesIO(f.read())) 70 | self.mail2misp.process_email_body() 71 | 72 | def test_meta_event(self): 73 | config = importlib.import_module('tests.config_forward') 74 | self.mail2misp = Mail2MISP('', '', '', config=config, offline=True) 75 | with open('tests/mails/test_meta.eml', 'rb') as f: 76 | self.mail2misp.load_email(BytesIO(f.read())) 77 | self.mail2misp.process_email_body() 78 | self.mail2misp.process_body_iocs() 79 | self.assertTrue(self.mail2misp.misp_event.publish) 80 | self.assertEqual(self.mail2misp.misp_event.distribution, '3') 81 | self.assertEqual(self.mail2misp.misp_event.threat_level_id, '2') 82 | self.assertEqual(self.mail2misp.misp_event.analysis, '0') 83 | self.mail2misp.add_event() 84 | 85 | def test_nested_mime(self): 86 | config = importlib.import_module('tests.config_forward') 87 | self.mail2misp = Mail2MISP('', '', '', config=config, offline=True) 88 | with open('tests/mails/test_nested_mime.eml', 'rb') as f: 89 | self.mail2misp.load_email(BytesIO(f.read())) 90 | self.mail2misp.process_email_body() 91 | self.assertEqual(self.mail2misp.clean_email_body, 'example.org\r\nwww.example.org\r\n') 92 | 93 | def test_attached_emails(self): 94 | config = importlib.import_module('tests.config_carrier') 95 | self.mail2misp = Mail2MISP('', '', '', config=config, offline=True) 96 | with open('tests/mails/test_7_email_attachments.eml', 'rb') as f: 97 | attached_emails = self.mail2misp.get_attached_emails(BytesIO(f.read())) 98 | self.assertEqual(len(attached_emails), 7) 99 | 100 | 101 | if __name__ == '__main__': 102 | unittest.main() 103 | --------------------------------------------------------------------------------