Full Code of belane/CloudHunter for AI

master 6be47aa00005 cached
8 files
88.9 KB
28.0k tokens
41 symbols
1 requests
Download .txt
Repository: belane/CloudHunter
Branch: master
Commit: 6be47aa00005
Files: 8
Total size: 88.9 KB

Directory structure:
gitextract_fpwhs3ng/

├── .gitignore
├── LICENSE.md
├── README.md
├── cloudhunter.py
├── permutations-big.txt
├── permutations.txt
├── requirements.txt
└── resolvers.txt

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# vscode
.vscode/*

# Project
*.json

# Windows
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
*.exe
*.cab
*.msi
*.msix
*.msm
*.msp
*.lnk

# OSX General
.DS_Store
.AppleDouble
.LSOverride
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Linux 
*~
.fuse_hidden*
.directory
.Trash-*
.nfs*

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
target/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
*.manifest
*.spec
pip-log.txt
pip-delete-this-directory.txt
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
.scrapy
.ipynb_checkpoints
profile_default/
ipython_config.py
.python-version
.spyderproject
.spyproject

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/


================================================
FILE: LICENSE.md
================================================

                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    {project}  Copyright (C) {year}  {fullname}
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.


================================================
FILE: README.md
================================================
# CloudHunter
Looks for AWS, Azure, Alibaba and Google cloud storage buckets and lists permissions for vulnerable buckets.

## Usage

` python3 cloudhunter.py --permutations-file permutations-big.txt COMPANY_NAME `

` python3 cloudhunter.py --services aws,alibaba COMPANY_NAME `

` python3 cloudhunter.py --threads 50 http://example.com `

` python3 cloudhunter.py --write-test -s alibaba --open-only http://example.com `


### Help

```bash
usage: cloudhunter.py [-h] [-p file] [-s aws,google,azure,alibaba] [-w] [-r file] [-t num] [-c num] [-b] [-d] [-v] [-o] input

positional arguments:
  input                          Company name, url or any base name.

options:
  -h, --help                     show this help message and exit
  -p, --permutations-file file   Permutations file.
  -s, --services aws,google,azure,alibaba   Specifies target services.
  -w, --write-test               Enable write test to read rights when other methods fail.
  -r, --resolvers file           DNS resolvers file.
  -t, --threads num              Threads.
  -c, --crawl-deep num           How many pages to crawl after the first.
  -b, --base-only                Checks only the base name, skips permutations generation.
  -d, --disable-bruteforce       Disable discovery by brute force.
  -v, --verbose                  Verbose log.
  -o, --open-only                Show only open buckets.
```


## Output

```bash
 python3 cloudhunter.py -t 10 http://example.com

           ________                ____  __            __
          / ____/ /___  __  ______/ / / / /_  ______  / /____  _____
         / /   / / __ \/ / / / __  / /_/ / / / / __ \/ __/ _ \/ ___/
        / /___/ / /_/ / /_/ / /_/ / __  / /_/ / / / / /_/  __/ /
        \____/_/\____/\__,_/\__,_/_/ /_/\__,_/_/ /_/\__/\___/_/


[>] Crawling http://example.com ...
[>] 61 possible endpoints found
    Azure Cloud           https://dmpcdn.files-example/cdn               PRIVATE
    Google Cloud          http://demo-site.org                           OPEN      Redirect https://demo-site.org/
    Google Cloud          https://other.net                              OPEN

[>] Bruteforce 1591 name permutations.

[+] Check Google Cloud
    Google Storage        example.storage.googleapis.com                 PRIVATE
    Google Storage        example-attachments.storage.googleapis.com     OPEN      AllUsers [LR]
    Google Storage        example-backups.storage.googleapis.com         PRIVATE
    Google Storage        examplestorage.storage.googleapis.com          OPEN      AllUsers [LRWV]
    Google Storage        examplestore.storage.googleapis.com            PRIVATE
    Google App Engine     example.bigtable.appspot.com                   OPEN      WebApp Error
    Google App Engine     example.beta.appspot.com                       OPEN
    Google App Engine     example.data-private.appspot.com               OPEN      Redirect https://accounts.google.com/ServiceLogin
	...
[+] Check Amazon Cloud
    AWS Bucket            examplefiles.s3.amazonaws.com                  OPEN      LIST
    AWS Bucket            finance-example.s3.amazonaws.com               PRIVATE
    AWS Bucket            examplejs.s3.amazonaws.com                     OPEN      gmantri [F] | AllUsers [RW]
    AWS Bucket            example-logs.s3.amazonaws.com                  PRIVATE
    AWS Bucket            example.media.s3.amazonaws.com                 OPEN      zectroxity [RW] | AllUsers [R]
    AWS Bucket            exampleresources.s3.amazonaws.com              PRIVATE
    AWS Bucket            s3-example.s3.amazonaws.com                    OPEN      develop [F] | AuthenticatedUsers [F] | df99361a [F]
    AWS Bucket            exampleshop.s3.amazonaws.com                   PRIVATE
    AWS Bucket            example-web.s3.amazonaws.com                   OPEN      42cf2125 [F]
	...
[+] Check Alibaba Cloud
    Alibaba Bucket        example-admin.oss-cn-hangzhou.aliyuncs.com     PRIVATE
    Alibaba Bucket        example-data.oss-cn-beijing.aliyuncs.com       OPEN      WRITE
    Alibaba Bucket        exampledemo.oss-cn-beijing.aliyuncs.com        OPEN      root [RW] | AllUsers [R]
    Alibaba Bucket        demo-example.oss-cn-shanghai.aliyuncs.com      PRIVATE
    Alibaba Bucket        example-demo.oss-cn-shenzhen.aliyuncs.com      OPEN      LIST
	...
[+] Check Azure Cloud
    Storage Files         example.file.core.windows.net                  PRIVATE
    App Management        example-demo.blob.core.windows.net             PRIVATE
    App Azure             githubexample.blob.core.windows.net            OPEN
    App Azure             exampletest.azurewebsites.net                  PRIVATE
    App Azure             jira-example.azurewebsites.net                 OPEN      Redirect https://jira-example.azurewebsites.net/
    App Azure             examplestats.azurewebsites.net                 OPEN
    Databases-MSSQL       example-project.database.windows.net           DOMAIN
    Email                 example.mail.protection.outlook.com            DOMAIN
    SharePoint            example.sharepoint.com                         PRIVATE   Redirect https://example.sharepoint.com/
	...
```

## Disclaimer

This tool provided is intended for legal and ethical use only. Any unauthorized or malicious use of this tool is strictly prohibited and may result in legal actions. The developers of this tool are not responsible for any misuse or damage caused by the tool. Use this tool at your own risk and with discretion and always obtain proper authorization before using this tool on any system or network that you do not own or have legal permission to test. The "write-test" option performs intrusive operations to determine bucket rights, use only with explicit authorization.


## Thanks

- [@brianwarehime](https://github.com/brianwarehime) ([inSp3ctor](https://github.com/brianwarehime/inSp3ctor))
- [@SpenGietz](https://github.com/SpenGietz) ([GCPBucketBrute](https://github.com/RhinoSecurityLabs/GCPBucketBrute))
- [@kfosaaen](https://github.com/kfosaaen) ([MicroBurst](https://github.com/NetSPI/MicroBurst))
- [@PatrikHudak](https://github.com/PatrikHudak) ([second-order](https://gist.github.com/PatrikHudak/2006c50a694cc76ead705c91805df78b))


================================================
FILE: cloudhunter.py
================================================
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

__title__ = "CloudHunter"
__url__ = "https://github.com/belane/CloudHunter"
__version__ = "0.7.1"

import re
import json
import string
import urllib3
import requests
import argparse
import tldextract
import xmltodict
import dns.resolver
from enum import Enum
from queue import Queue
from random import choices
from itertools import cycle
from threading import Thread
from bs4 import BeautifulSoup
from urllib.parse import urlparse, urljoin

TIMEOUT = 7
USER_AGENT = { 'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36" }

googleCloud = {
    'Google Storage': 'storage.googleapis.com',
    'Google App Engine': 'appspot.com'
}

awsCloud = {
    'AWS Bucket': 's3.amazonaws.com'
}

alibabaCloud = {
    'Alibaba Bucket': 'oss-cn-hangzhou.aliyuncs.com',
    'Alibaba SH Bucket': 'oss-cn-shanghai.aliyuncs.com',
    'Alibaba NJ Bucket': 'oss-cn-nanjing.aliyuncs.com',
    'Alibaba QD Bucket': 'oss-cn-qingdao.aliyuncs.com',
    'Alibaba BJ Bucket': 'oss-cn-beijing.aliyuncs.com',
    'Alibaba ZH Bucket': 'oss-cn-zhangjiakou.aliyuncs.com',
    'Alibaba HH Bucket': 'oss-cn-huhehaote.aliyuncs.com',
    'Alibaba WU Bucket': 'oss-cn-wulanchabu.aliyuncs.com',
    'Alibaba SZ Bucket': 'oss-cn-shenzhen.aliyuncs.com',
    'Alibaba HY Bucket': 'oss-cn-heyuan.aliyuncs.com',
    'Alibaba GG Bucket': 'oss-cn-guangzhou.aliyuncs.com',
    'Alibaba CH Bucket': 'oss-cn-chengdu.aliyuncs.com',
    'Alibaba HK Bucket': 'oss-cn-hongkong.aliyuncs.com',
    'Alibaba W1 Bucket': 'oss-us-west-1.aliyuncs.com',
    'Alibaba E1 Bucket': 'oss-us-east-1.aliyuncs.com',
    'Alibaba N1 Bucket': 'oss-ap-northeast-1.aliyuncs.com',
    'Alibaba N2 Bucket': 'oss-ap-northeast-2.aliyuncs.com',
    'Alibaba S1 Bucket': 'oss-ap-southeast-1.aliyuncs.com',
    'Alibaba S2 Bucket': 'oss-ap-southeast-2.aliyuncs.com',
    'Alibaba S3 Bucket': 'oss-ap-southeast-3.aliyuncs.com',
    'Alibaba S5 Bucket': 'oss-ap-southeast-5.aliyuncs.com',
    'Alibaba S6 Bucket': 'oss-ap-southeast-6.aliyuncs.com',
    'Alibaba S7 Bucket': 'oss-ap-southeast-7.aliyuncs.com',
    'Alibaba SU Bucket': 'oss-ap-south-1.aliyuncs.com',
    'Alibaba EC Bucket': 'oss-eu-central-1.aliyuncs.com',
    'Alibaba EW Bucket': 'oss-eu-west-1.aliyuncs.com',
    'Alibaba ME Bucket': 'oss-me-east-1.aliyuncs.com'
}

azureCloud = {
    'Storage Files': 'file.core.windows.net',
    'Storage Blobs': 'blob.core.windows.net',
    'Storage Queues': 'queue.core.windows.net',
    'Storage Tables': 'table.core.windows.net',
    'App Management': 'scm.azurewebsites.net',
    'App Azure': 'azurewebsites.net',
    'App Web': 'p.azurewebsites.net',
    'CloudApp': 'cloudapp.net',
    'Key Vaults': 'vault.azure.net',
    'Azure CDN': 'azureedge.net',
    # 'Search Appliance': 'search.windows.net',
    'API Services': 'azure-api.net',
    'Hosted Domain': 'onmicrosoft.com',
    'Databases-Redis': 'redis.cache.windows.net',
    'Databases-CosmosDB': 'documents.azure.com',
    'Databases-MSSQL': 'database.windows.net',
    # 'Email': 'mail.protection.outlook.com',
    # 'SharePoint': 'sharepoint.com'
}


class State(Enum):
    CLOSE = 'CLOSE'
    DOMAIN = 'DOMAIN'
    PRIVATE = 'PRIVATE'
    OPEN = 'OPEN'
    UNKNOWN = 'UNKNOWN'


class Risk(Enum):
    LOW = 0
    MEDIUM = 34
    HIGH = 31


class Bucket(object):

    def __init__(self, name, domain, cloud='generic', srv_name='Generic', enable_write = False):
        self.name = name
        self.domain = domain
        self.cloud = cloud
        self.srv_name = srv_name
        self.state = State.CLOSE
        self.risk = Risk.LOW
        self.details = []
        self.enable_write = enable_write

    def process_status(self, response):
        if(response == False):
            self.state = State.DOMAIN
            return

        if self.name == base_name:
            self.risk = Risk.MEDIUM

        if response.status_code == 200:
            self.state = State.OPEN
            self.risk = Risk.MEDIUM
            content_type = response.headers.get('Content-Type', None)
            if content_type and 'application/xml' in content_type:
                self.risk = Risk.HIGH
                self.details.append('LIST')
        elif response.status_code in [400, 401, 403]:
            self.state = State.PRIVATE
        elif response.status_code in [500, 502, 503]:
            self.state = State.OPEN
            self.risk = Risk.MEDIUM
            self.details.append('WebApp Error')
        else:
            self.state = State.UNKNOWN
            self.risk = Risk.MEDIUM
            self.details.append(f'Response: {response.status_code}')

        if(len(response.history) != 0 and response.history[0].status_code in [301, 302]):
            self.details.append(f'Redirect {response.url}')
            if 'login' in response.url or 'signin' in response.url:
                self.state = State.PRIVATE
                self.risk = Risk.LOW

        self.get_rights()

    def print_details(self):
        print('\033[0;{}m{}{:<22}{:<42}\t{:<10}{}\033[0;0m'.format(
            self.risk.value, ' ' * 4, self.srv_name, self.domain, self.state.value, ' | '.join(self.details)))

        if verbose and hasattr(self, 'acl'):
            print(json.dumps(self.acl, indent=4))

    def write_test(self):
        proof = f"proof-{''.join(choices(string.ascii_uppercase, k=4))}"
        try:
            write_test = requests.put(f'https://{self.domain}/{proof}', timeout=TIMEOUT, verify=False, headers=USER_AGENT)
        except:
            return
        if write_test.ok:
            self.state = State.OPEN
            self.risk = Risk.HIGH
            self.details.append('WRITE')
            try:
                delete_test = requests.delete(f'https://{self.domain}/{proof}', timeout=TIMEOUT, verify=False, headers=USER_AGENT)
            except:
                print(f'[e]   Error deleting proof: {self.domain} {proof}')
                return
            if not delete_test.ok:
                print(f'[e]   Error deleting proof: {self.domain} {proof}')

    def get_rights(self):
        if self.cloud == 'azure':
            self._azure_acl()
        elif self.cloud == 'alibaba':
            self._alibaba_acl()
        elif self.cloud == 'aws':
            self._aws_acl()
        elif self.cloud == 'google':
            self._google_acl()

    def _azure_acl(self):
        if 'file.core.windows.net' in self.domain:
            try:
                response = requests.get(f'https://{self.domain}/?comp=list', allow_redirects=True, timeout=15, verify=False, headers=USER_AGENT)
                if response.status_code == 200:
                    self.risk = Risk.HIGH
                    self.state = State.OPEN
                    self.details.append(f'List Shares')
                elif self.enable_write:
                    self.write_test()
            except:
                if(verbose):
                    print(f'[d]   ACL Error {self.domain}')
                return

        if 'blob.core.windows.net' in self.domain:
            COMMON_CONTAINERS = ['images', 'mycontainer', 'downloads', 'backup', 'backups', 'web', 'website', 'private', 'uploads', 'page', 'static', 'logs', 'admin']
            COMMON_CONTAINERS.append(self.name)
            if self.name != base_name:
                COMMON_CONTAINERS.append(base_name)

            findings = []
            for container in COMMON_CONTAINERS:
                try:
                    response = requests.get(f'https://{self.domain}/{container}?restype=container&comp=list', allow_redirects=True, timeout=15, verify=False, headers=USER_AGENT)
                    if response.status_code == 200:
                        findings.append(container)
                except:
                    if(verbose):
                        print(f'[d]   ACL Error {self.domain}')
                    continue
            if findings:
                self.risk = Risk.HIGH
                self.state = State.OPEN
                self.details.append(f'Containers: {",".join(findings)}')

    def _google_acl(self):
        if self.state != State.OPEN:
            return
        google_api = f'https://www.googleapis.com/storage/v1/b/{self.name}/iam/testPermissions?permissions=storage.buckets.delete&permissions=storage.buckets.get&permissions=storage.buckets.getIamPolicy&permissions=storage.buckets.setIamPolicy&permissions=storage.buckets.update&permissions=storage.objects.create&permissions=storage.objects.delete&permissions=storage.objects.get&permissions=storage.objects.list&permissions=storage.objects.update'
        try:
            remote_acl = requests.get(google_api, timeout=TIMEOUT, verify=False, headers=USER_AGENT).json()
        except:
            if self.enable_write:
                self.write_test()
            if(verbose):
                print(f'[d]   ACL Error {self.domain}')
            return

        if remote_acl.get('permissions'):
            self.acl = remote_acl['permissions']
            user = 'AllUsers'
            rights = ''

            if 'storage.objects.list' in self.acl:
                rights += 'L'
            if 'storage.objects.get' in self.acl:
                rights += 'R'
            if 'storage.objects.create' in self.acl or \
                'storage.objects.delete' in self.acl or \
                    'storage.objects.update' in self.acl:
                rights += 'W'
                self.risk = Risk.HIGH
            if 'storage.buckets.setIamPolicy' in self.acl:
                rights += 'V'
                self.risk = Risk.HIGH

            self.details.append(f'{user} [{rights}]')

    def _aws_acl(self):
        if self.state == State.OPEN:
            aws_api = f'https://{self.name}.s3.amazonaws.com/?acl'
            try:
                remote_acl = requests.get(aws_api, timeout=TIMEOUT, verify=False, headers=USER_AGENT).text
            except:
                if(verbose):
                    print(f'[d]   ACL Error {self.domain}')
                return
            acl_dict = xmltodict.parse(remote_acl, dict_constructor=dict)

            if not self._read_s3_acl(acl_dict) and self.enable_write:
                self.write_test()
        elif self.enable_write:
            self.write_test()

    def _alibaba_acl(self):
        self.srv_name = 'Alibaba Bucket'
        alibaba_api = f'https://{self.domain}/?acl'
        try:
            remote_acl = requests.get(alibaba_api, timeout=TIMEOUT, verify=False, headers=USER_AGENT).text
        except:
            if(verbose):
                print(f'[d]   ACL Error {self.domain}')
            return
        acl_dict = xmltodict.parse(remote_acl, dict_constructor=dict)

        if 'Error' in acl_dict and 'Endpoint' in acl_dict['Error']:
            self.domain = f"{self.name}.{acl_dict['Error']['Endpoint']}"
            alibaba_api = f'https://{self.domain}/?acl'
            try:
                remote_acl = requests.get(alibaba_api, timeout=TIMEOUT, verify=False, headers=USER_AGENT).text
            except:
                if(verbose):
                    print(f'[d]   ACL Error {self.domain}')
                return
            acl_dict = xmltodict.parse(remote_acl, dict_constructor=dict)

        if not self._read_s3_acl(acl_dict) and self.enable_write:
            self.write_test()

    def _read_s3_acl(self, acl):
        if 'AccessControlPolicy' in acl:
            acl_rights = acl['AccessControlPolicy']['AccessControlList']
            if 'Grant' in acl_rights:
                self.acl = acl_rights['Grant']
                rights = {}
                if(type(self.acl) != list):
                    items = [self.acl]
                else:
                    items = self.acl

                for right in items:
                    if right['Grantee']['@xsi:type'] == 'CanonicalUser' and 'DisplayName' in right['Grantee']:
                        user = right['Grantee']['DisplayName']
                    elif right['Grantee']['@xsi:type'] == 'Group':
                        user = right['Grantee']['URI'].split('/')[-1]
                    else:
                        user = right['Grantee']['ID'][:8]

                    if right['Permission'] == 'READ' or right['Permission'] == 'READ_ACP':
                        symb = 'R'
                    elif right['Permission'] == 'WRITE' or right['Permission'] == 'WRITE_ACL':
                        self.risk = Risk.HIGH
                        symb = 'W'
                    elif right['Permission'] == 'FULL_CONTROL':
                        self.risk = Risk.HIGH
                        symb = 'F'

                    if user not in rights:
                        rights[user] = symb
                    elif symb not in rights[user]:
                        rights[user] += symb

                for user, symb in rights.items():
                    self.details.append(f'{user} [{symb}]')
            return True
        return False


class HiddenGems(object):

	HTTP_TIMEOUT = 5
	UA = { 'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36" }
	skip_extensions = ['exe','bin','pdf','zip','jpg','png','svg','avi','mp3','mp4','gz','tar','rar','7z','ttf','otf','woff','woff2']
	urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
	known_urls = []

	def __init__(self, url, deep=0, active_crawl=True):
		self.url = url
		self.childs = []
		self.urls = {}
		u = urlparse(url)
		self.scheme = u.scheme
		self.domain = u.netloc
		self.base_url = self.get_base_url(url)

		self.crawl(deep, active_crawl)

	def crawl(self, deep=0, active_crawl=False):
		try:
			self.known_urls.append(self.url)
			r = requests.get(self.url, timeout=self.HTTP_TIMEOUT, verify=False, headers=self.UA)
			if 'text/html' not in r.headers['Content-Type']: return False
		except:
			return False

		self.urls['js'] = self.extract_javascript(r.text)
		self.urls['links'] = self.extract_links(r.text)
		self.urls['styles'] = self.extract_styles(r.text)
		self.urls['images'] = self.extract_images(r.text)
		self.urls['forms'] = self.extract_forms(r.text)
		self.urls['cors'] = self.extract_cors(r.headers)

		if(active_crawl):
			self.urls['js-pluss'] = self.crawl_raw_urls(self.urls['js'])
			self.urls['styles-pluss'] = self.crawl_raw_urls(self.urls['styles'])
			files = [x for x in self.list_urls() if x.endswith('.json') or x.endswith('.xml')]
			self.urls['files'] = self.crawl_raw_urls(files)

		if(deep > 0):
			childs = self.filter_scope(list(set(self.urls['links'] + self.urls['forms'])))
			childs = [x for x in childs if self.url_extension(x) not in self.skip_extensions]
			for child in childs:
				if child not in self.known_urls:
					self.childs.append(HiddenGems(child, deep=deep - 1, active_crawl=active_crawl))

	def crawl_raw_urls(self, urls):
		result = []
		for url in urls:
			if url in self.known_urls:
				continue
			self.known_urls.append(url)
			if self.url_extension(url) in self.skip_extensions:
				continue
			try:
				r = requests.get(url, timeout=self.HTTP_TIMEOUT, verify=False, headers=self.UA)
				result += self.extract_raw_links(r.text)
			except:
				pass
		return result

	def get_base_url(self, url):
		u = urlparse(url)
		if(u.path):
			path = '/'.join(u.path.split('/')[:-1])
		else:
			path = u.path
		return f'{u.scheme}://{u.netloc}{path}'

	def filter_scope(self, values):
		return [x for x in values if self.domain == urlparse(x).netloc]

	def normalize_url(self, src, full_query=False, base_url=None):
		if not base_url:
			base_url = self.base_url
		url = urlparse(urljoin(base_url, src))
		if full_query and url.query:
			return f'{url.scheme}://{url.netloc}{url.path}?{url.query}'
		else:
			return f'{url.scheme}://{url.netloc}{url.path}'

	def url_extension(self, url):
		file = self.normalize_url(url).split('/')[-1]
		parts = file.split('.')
		if len(parts) == 1:
			return None
		return parts[-1].lower()

	def list_urls(self, scope=False, full_query=False):
		result = []
		for url_list in self.urls.values():
			for url in url_list:
				if url.startswith('http'):
					result.append(url)

		for child in self.childs:
			result += child.list_urls(scope)

		if(scope):
			result = self.filter_scope(result)

		result = [self.normalize_url(x, full_query) for x in result]
		result.sort()
		return list(set(result))

	def list_out_urls(self, full_query=False):
		return [x for x in self.list_urls(scope=False, full_query=full_query) if self.domain != urlparse(x).netloc]

	def list_dirs(self, scope=False):
		return list(set([self.get_base_url(x) for x in self.list_urls(scope)]))

	def list_out_dirs(self):
		return list(set([self.get_base_url(x) for x in self.list_out_urls()]))

	def list_domains(self):
		return list(set([urlparse(x).netloc for x in self.list_urls()]))

	def extract_javascript(self, source_code):
		tree = BeautifulSoup(source_code, 'html.parser')
		scripts = [self.normalize_url(s.get('src')) for s in tree.find_all('script') if s.get('src')]
		embedded_scripts = [s.text for s in tree.find_all('script') if not s.get('src')]
		for src in embedded_scripts:
			for url in re.findall(r'([\"\'])([\w\d\?\/&=\#\.\!_-]*?\.\w{2,4})(\1)', src):
				scripts.append(self.normalize_url(url[1]))
		return list(set(scripts))

	def extract_links(self, source_code):
		tree = BeautifulSoup(source_code, 'html.parser')
		hrefs = [self.normalize_url(s.get('href'), True) for s in tree.find_all('a') if s.get('href')]
		return list(set(hrefs))

	def extract_images(self, source_code):
		tree = BeautifulSoup(source_code, 'html.parser')
		imgs = [self.normalize_url(s.get('src')) for s in tree.find_all('img') if s.get('src')]
		return list(set(imgs))

	def extract_raw_links(self, source_code):
		urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[/?=\-_@.&+]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', source_code)
		return list(set(urls))

	def extract_styles(self, source_code):
		tree = BeautifulSoup(source_code, 'html.parser')
		hrefs = [self.normalize_url(s.get('href')) for s in tree.find_all('link') if s.get('href')]
		embedded_styles = [s.text for s in tree.find_all('link') if not s.get('href')]
		for src in embedded_styles:
			for url in re.findall(r'([\"\'])([\w\d\?\/&=\#\.\!_-]*?\.\w{2,4})(\1)', src):
				hrefs.append(self.normalize_url(url[1]))
		return list(set(hrefs))

	def extract_forms(self, source_code):
		tree = BeautifulSoup(source_code, 'html.parser')
		hrefs = [self.normalize_url(s.get('action'), True) for s in tree.find_all('form') if s.get('action')]
		return list(set(hrefs))

	def extract_cors(self, headers):
		cors = []
		if hasattr(headers, 'Access-Control-Allow-Origin'):
			cors = headers['Access-Control-Allow-Origin'].split(',')
			if '*' in cors: return []
		return cors


def generate_permutations(base_name, dict_file):
    p = [base_name]
    rules = ['{}-{}', '{}.{}', '{}{}']

    with open(dict_file, 'r') as f:
        lines = f.read().splitlines()

    for affix in lines:
        p += [x.format(affix, base_name) for x in rules]
        p += [x.format(base_name, affix) for x in rules]

    return p


def check_dns(hostname):
    try:
        resolver = dns.resolver.Resolver(configure=False)
        resolver.timeout = TIMEOUT
        resolver.lifetime = TIMEOUT
        resolver.nameservers = choices(dns_servers, k=2)
        answer = resolver.resolve(hostname)
        return answer[0].address if answer else False
    except:
        return False
    finally:
        del resolver


def check_host(host, ip):
    try:
        response = requests.head(f'http://{ip}', allow_redirects=True, timeout=TIMEOUT, verify=False, headers={'Host': host, **USER_AGENT})
    except:
        return False
    if response.status_code in [404, 400]:
        return False
    return response


def search_buckets(cloud_dict, names, cloud='generic', distribute=False, enable_write = False):
    queue = Queue(maxsize=0)
    results = []

    if distribute:
        srv_name = list(cloud_dict.keys())[0]
        srv_url = cycle(cloud_dict.values())
        for name in names:
            domain = f'{name}.{next(srv_url)}'
            queue.put((srv_name, domain, name))
    else:
        for srv_name, srv_url in cloud_dict.items():
            for name in names:
                domain = f'{name}.{srv_url}'
                queue.put((srv_name, domain, name))

    for w in range(num_threads):
        worker = Thread(target=search_buckets_worker, args=(queue, results, cloud, enable_write))
        worker.daemon = True
        worker.start()

    queue.join()
    return results


def search_buckets_worker(queue, results, cloud, enable_write):
    while not queue.empty():
        work = queue.get()
        srv_name = work[0]
        domain = work[1]
        name = work[2]

        if(verbose):
            print(f'[d]   checking {domain}')

        ip = check_dns(domain)
        if ip:
            response = check_host(domain, ip)
            if(response != False or cloud == 'azure'):
                bucket = Bucket(name, domain, cloud, srv_name, enable_write)
                bucket.process_status(response)

                results.append(bucket)
                if not show_open_only or bucket.state == State.OPEN:
                    bucket.print_details()

        queue.task_done()

    return True


def what_cloud(urls, enable_write):
    queue = Queue(maxsize=0)
    results = []

    for url in urls:
        queue.put((url))

    for w in range(num_threads):
        worker = Thread(target=what_cloud_worker, args=(queue, results, enable_write))
        worker.daemon = True
        worker.start()

    queue.join()
    return results


def what_cloud_worker(queue, results, enable_write):
    while not queue.empty():
        url = queue.get()

        if(verbose):
            print(f'[d]   checking {url}')

        try:
            response = requests.head(url, allow_redirects=True, timeout=TIMEOUT, verify=False, headers=USER_AGENT)
        except:
            queue.task_done()
            continue

        fqdn = tldextract.extract(url).fqdn
        headers = response.headers.keys()

        if any(h in headers for h in ['x-amz-request-id', 'x-amz-id-2']) or any(n in fqdn for n in awsCloud.values()):
            cloud = 'aws'
        elif any(h in headers for h in ['X-GUploader-UploadID', 'x-goog-metageneration', 'X-Cloud-Trace-Context']) or any(n in fqdn for n in googleCloud.values()):
            if urlparse(url).netloc.endswith('.google.com'):
                queue.task_done()
                continue
            cloud = 'google'
        elif any(h in headers for h in ['x-ms-request-id']) or any(n in fqdn for n in azureCloud.values()):
            cloud = 'azure'
        elif any(h in headers for h in ['x-oss-request-id', 'x-oss-server-time']) or 'aliyuncs.com' in fqdn:
            cloud = 'alibaba'
        else:
            queue.task_done()
            continue

        srv_name = f'{cloud.capitalize()} Cloud'
        domain_name = tldextract.extract(url).domain
        u = urlparse(url)
        domain = u.netloc
        srv = u.path.split('/')[1:2]

        if len(domain.split('.')) > 3:
            name = domain.split('.')[0]
        elif not srv:
            name = domain_name
        elif domain_name in ['amazonaws','amazon','google','googleapis','appspot','azure','azureedge','windows','aliyuncs']:
            name = srv
        else:
            name = domain_name

        bucket = Bucket(name, url, cloud, srv_name, enable_write)
        bucket.process_status(response)

        results.append(bucket)
        if not show_open_only or bucket.state == State.OPEN:
            bucket.print_details()

        queue.task_done()


def show_banner():
    banner = f'''\033[0;32m
           ________                ____  __            __
          / ____/ /___  __  ______/ / / / /_  ______  / /____  _____
         / /   / / __ \/ / / / __  / /_/ / / / / __ \/ __/ _ \/ ___/
        / /___/ / /_/ / /_/ / /_/ / __  / /_/ / / / / /_/  __/ /
        \____/_/\____/\__,_/\__,_/_/ /_/\__,_/_/ /_/\__/\___/_/  v{__version__}
        \n\033[0;0m'''
    print(banner)


if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='CloudHunter. Searches for AWS, Azure, Alibaba and Google cloud storage buckets.')
    parser.add_argument('input', metavar='input', type=str, nargs='+', help='Company name, url or any base name.')
    parser.add_argument('-p', '--permutations-file', metavar='file', type=str, default='permutations.txt', help='Permutations file.')
    parser.add_argument('-s', '--services', metavar='aws,google,azure,alibaba', default='aws,google,azure,alibaba', help='Specifies target services.')
    parser.add_argument('-w', '--write-test',  action='store_true', help='Enable write test to read rights when other methods fail.')
    parser.add_argument('-r', '--resolvers', metavar='file', type=str, default='resolvers.txt', help='DNS resolvers file.')
    parser.add_argument('-t', '--threads', metavar='num', type=int, default=10, help='Threads.')
    parser.add_argument('-c', '--crawl-deep', metavar='num', type=int, default=1, help='How many pages to crawl after the first.')
    parser.add_argument('-of', '--output', metavar='file', type=str, default=None, help='Output file name. If not provided - file name will be generated.')
    parser.add_argument('-b', '--base-only',  action='store_true', help='Checks only the base name, skips permutations generation.')
    parser.add_argument('-d', '--disable-bruteforce',  action='store_true', help='Disable discovery by brute force.')
    parser.add_argument('-v', '--verbose', action='store_true', help='Verbose log.')
    parser.add_argument('-o', '--open-only', action='store_true', help='Show only open buckets.')
    args = parser.parse_args()
    args.services = args.services.split(',')
    show_banner()

    num_threads = min(300, args.threads)
    show_open_only = args.open_only
    verbose = args.verbose
    with open(args.resolvers, 'r', encoding='utf-8') as f:
        dns_servers = f.read().splitlines()
    results = []

    if args.input[0].startswith('http'):
        url = args.input[0].strip().lower()
        base_name = tldextract.extract(url).domain

        print(f'[>] Crawling {url} ...')
        urls = [url]
        crawler = HiddenGems(url, args.crawl_deep)
        urls += crawler.list_out_dirs()

        print(f'[>] {len(urls)} possible endpoints found')
        results += what_cloud(urls, args.write_test)

    else:
        base_name = args.input[0].strip().lower()

    if(args.disable_bruteforce):
        exit(0)

    if(args.base_only):
        permutations = [base_name]
    else:
        permutations = generate_permutations(base_name, args.permutations_file)
    print(f'[>] Bruteforce {len(permutations)} name permutations.')

    if 'google' in args.services:
        print('\n[+] Check Google Cloud')
        results += search_buckets(googleCloud, permutations, 'google', False, args.write_test)

    if 'aws' in args.services:
        print('\n[+] Check Amazon Cloud')
        results += search_buckets(awsCloud, permutations, 'aws', False, args.write_test)

    if 'azure' in args.services:
        print('\n[+] Check Azure Cloud')
        results += search_buckets(azureCloud, permutations, 'azure', False, args.write_test)

    if 'alibaba' in args.services:
        print('\n[+] Check Alibaba Cloud')
        results += search_buckets(alibabaCloud, permutations, 'alibaba', True, args.write_test)

    output = [{
        'cloud': item.cloud,
        'name': item.name,
        'domain': item.domain,
        'state': item.state.value,
        'risk': item.risk.name,
        'details': item.details
    } for item in results]

    output_file = args.output or f'{base_name}-output.json'
    with open(output_file, 'w', encoding='utf-8') as f:
        json.dump(output, f, ensure_ascii=False, indent=2)


================================================
FILE: permutations-big.txt
================================================
0
001
002
003
01
02
03
1
2
2014
2015
2016
2017
2018
2019
3
4
5
6
7
8
9
access.logs
access-logs
accounting
admin
administrator
ae
alpha
analytics
android
api
app
appengine
artifacts
assets
attachments
audit
audit-logs
aws.billing
aws.logs
aws-billing
aws-logs
azure
azure-logs
backup
backups
bak
bamboo
beta
betas
bigquery
bigtable
billing
blog
bucket
build
builds
cache
cdn
ce
centralus
cf
chef
client
cloud
cloudfunction
club
cluster
common
composer
compute
computeengine
conf
confidential
config
configuration
consultants
contact
content
corp
corporate
customer
data
data.private
data.public
database
dataflow
data-private
dataproc
data-public
datastore
debug
demo
dev
developer
developers
development
devops
directory
discount
dl
dns
docker
download
downloads
elastic
emails
endpoints
es
events
exe
export
files
fileshare
filestorage
filestore
finance
firestore
functions
gcp
gcplogs
gcp-logs
git
github
gitlab
gke
graphite
graphql
gs
help
hidden
hr
hub
iam
images
img
infra
internal
internal.dist
internal.repo
internal-dist
internal-repo
internal-tools
ios
iot
it
jenkins
jira
js
key
keys
kube
kubeengine
kubernetes
kubernetesengine
landing
ldap
loadbalancer
logs
logstash
mail
main
manuals
mattermost
media
memorystore
mercurial
ml
mobile
monitoring
my
mysql
northcentralus
ops
oracle
packages
photos
pics
pictures
postgres
presentations
preview
private
pro
processed
prod
product
productcontent
production
products
project
projects
psql
public
pubsub
qa
repo
reports
resources
root
s3
screenshots
scripts
sec
secret
secrets
security
service
services
share
shop
site
sitemaps
slack
snapshots
source
spanner
splunk
sql
sql-logs
src
ssh
stackdriver
stage
staging
static
stats
storage
storageaccount
store
subversion
support
svn
syslog
tasks
teamcity
temp
templates
terraform
test
themes
tmp
tmp.logs
tmp-logs
trace
traffic
training
travis
troposphere
uploads
useast
useast2
userfiles
userpictures
users
ux
videos
web
website
westcentralus
westus
westus2
wp
www

================================================
FILE: permutations.txt
================================================
access-logs
accounting
admin
api
assets
attachments
aws-logs
azure
azure-logs
central
client
conf
confidential
config
configuration
content
customer
data
database
data-private
data-public
demo
dev
dist
dns
docker
files
filestorage
finance
hidden
hr
images
img
internal
it
jenkins
key
keys
logs
panel
photos
private
prod
product
productcontent
production
public
repo
root
s3
secret
secrets
service
services
site
splunk
sql
sql-logs
staging
storage
storageaccount
test
themes
tmp
tmp-logs
userfiles
web

================================================
FILE: requirements.txt
================================================
beautifulsoup4>=4.8
requests>=2.22
urllib3>=1.25
tldextract>=2.2
xmltodict>=0.12.0
dnspython>=2.0.0


================================================
FILE: resolvers.txt
================================================
8.26.56.182
45.90.30.126
193.111.144.145
66.28.0.61
8.20.247.196
219.252.2.100
8.26.56.148
60.250.132.102
162.159.46.167
208.67.220.2
194.90.119.243
172.64.37.227
172.64.37.122
172.64.37.83
162.159.36.114
50.217.25.200
8.26.56.102
12.204.162.62
172.64.36.66
172.64.36.92
172.64.36.135
172.64.37.153
172.64.37.19
172.64.36.194
172.64.37.148
8.20.247.234
73.54.161.169
64.94.1.1
216.106.1.2
24.98.20.141
50.58.111.74
172.64.37.193
162.159.46.18
172.64.36.58
203.176.144.12
76.104.155.196
197.155.92.20
8.20.247.67
198.54.117.10
172.64.37.200
162.159.51.117
172.64.36.172
88.80.64.8
162.159.51.224
45.90.30.129
202.138.120.87
172.64.37.80
24.170.199.20
8.26.56.41
8.26.56.214
202.30.143.11
8.243.126.127
162.159.57.193
96.53.102.66
4.4.53.164
8.20.247.34
172.64.36.44
8.26.56.119
172.64.36.186
172.64.36.218
8.17.194.36
67.100.88.27
8.25.185.131
172.64.36.136
203.146.237.237
114.114.115.115
162.159.36.216
8.26.56.86
8.20.247.101
8.20.247.219
172.64.36.49
172.64.37.246
162.159.50.239
162.159.56.21
195.153.19.10
8.26.56.94
172.64.37.159
162.159.50.221
8.26.56.240
172.64.37.11
8.26.56.219
172.64.37.196
203.160.160.1
172.64.36.98
172.64.36.176
162.159.56.255
12.11.83.5
8.26.56.201
98.247.49.35
172.64.37.220
8.26.56.99
162.159.51.205
61.244.186.189
8.20.247.60
8.26.56.227
185.74.5.1
8.26.56.116
51.15.88.152
58.186.80.17
8.20.247.3
89.163.140.67
8.20.247.102
162.159.57.109
172.64.36.34
172.64.37.134
213.55.96.166
103.246.244.143
103.121.228.1
172.64.36.103
212.94.34.34
64.105.199.76
172.64.36.243
37.120.142.115
172.64.37.226
8.20.247.53
172.64.37.86
8.20.247.140
8.26.56.93
98.38.222.6
172.64.46.159
162.159.51.23
63.96.227.103
172.64.36.252
75.73.8.108
8.29.64.122
168.215.165.186
167.114.180.97
8.34.34.11
172.64.36.109
89.107.129.15
198.99.193.1
172.64.36.187
172.64.37.51
172.64.37.30
8.26.56.141
73.118.159.191
77.88.8.8
8.28.113.202
72.52.104.74
217.18.206.22
172.64.37.245
162.159.36.11
8.26.56.153
172.64.36.151
184.187.143.241
172.64.37.45
172.64.37.94
45.225.123.205
161.11.228.11
8.243.126.9
45.90.28.12
162.159.50.248
193.95.93.77
172.64.37.253
8.20.247.150
162.159.56.156
162.159.56.132
8.26.56.221
172.64.36.64
209.65.105.165
164.124.101.2
200.85.61.90
8.26.56.83
202.46.34.76
4.79.132.219
172.64.46.109
172.64.37.154
8.35.35.103
162.159.50.144
12.7.53.90
172.64.37.221
172.64.47.44
8.20.247.189
172.64.37.92
172.64.36.124
12.97.174.103
8.20.247.79
8.20.247.45
203.239.131.1
8.26.56.217
4.7.75.194
59.120.77.163
75.103.115.95
8.26.56.154
172.64.37.136
209.244.104.186
212.211.132.4
8.20.247.199
98.195.112.169
8.26.56.175
172.64.36.200
50.201.178.29
162.159.50.140
103.51.144.212
172.64.36.88
4.79.140.163
172.64.36.207
8.26.56.19
64.105.97.90
14.225.232.19
162.159.51.80
64.81.159.2
172.64.36.6
202.248.37.74
64.157.63.18
172.64.37.3
98.232.103.71
172.64.47.107
23.19.245.88
172.64.36.74
172.64.37.168
172.64.36.48
172.64.37.110
172.64.36.52
14.41.60.11
45.90.30.24
194.44.221.230
172.64.36.223
8.26.56.31
195.35.110.4
172.64.36.96
172.64.37.143
45.225.123.174
172.64.37.18
46.175.171.234
8.20.247.166
172.64.36.4
8.26.56.53
172.64.37.239
8.26.56.246
203.113.135.26
77.68.45.252
8.26.56.178
8.243.126.20
4.14.199.129
172.64.37.189
162.159.50.18
8.26.56.173
8.26.56.127
172.64.46.142
172.64.36.80
8.26.56.72
50.238.53.126
162.159.50.46
172.64.36.15
162.159.46.165
207.248.224.72
216.84.166.166
174.47.212.70
172.64.37.68
8.26.56.233
8.20.247.55
85.11.24.148
172.64.37.81
8.26.56.198
8.20.247.247
8.26.56.46
172.64.36.204
172.64.36.201
50.229.154.179
172.64.36.213
172.64.36.145
172.64.36.173
188.225.225.25
172.64.36.164
202.51.96.5
172.64.37.25
194.172.160.4
172.64.36.35
8.20.247.11
162.159.57.131
45.90.30.23
198.181.254.34
8.26.56.101
162.159.36.252
8.243.126.21
4.7.220.241
172.64.36.62
69.75.150.3
202.87.213.253
8.243.126.135
69.67.97.18
162.159.57.251
203.129.31.67
8.20.247.175
64.81.127.2
172.64.36.82
8.26.56.65
12.127.16.67
73.32.84.89
130.61.69.123
172.64.46.213
165.158.1.2
65.249.143.193
8.26.56.226
203.119.8.106
50.238.46.219
205.151.222.250
60.231.9.89
172.64.37.241
79.141.83.250
190.216.69.5
172.64.36.89
172.64.37.99
217.73.17.110
176.103.130.136
172.64.36.72
63.143.125.14
8.20.247.213
202.5.192.9
73.31.121.3
172.64.36.123
8.26.56.111
37.120.232.43
193.226.128.129
45.90.28.126
50.21.174.18
8.27.177.11
200.221.11.101
162.159.36.86
172.64.37.8
156.154.70.10
168.95.1.1
195.99.66.220
172.64.37.187
24.99.148.175
172.64.37.62
8.19.132.51
172.64.47.242
213.244.72.31
45.11.45.11
172.64.46.202
162.159.56.149
172.64.37.181
45.90.28.18
202.86.8.100
8.20.247.120
172.64.37.141
190.216.19.21
45.225.123.206
193.240.207.200
162.159.57.229
211.23.165.165
66.92.224.2
8.20.247.0
8.20.247.97
8.26.56.68
162.159.51.183
8.26.56.109
77.88.8.2
212.230.255.1
82.96.65.2
67.166.30.234
103.47.134.195
172.64.37.46
172.64.37.212
103.196.38.39
172.64.47.254
103.3.252.5
205.171.2.65
172.64.36.29
45.90.30.25
172.64.36.212
202.130.97.65
8.26.56.90
173.234.56.115
24.125.55.22
67.29.170.126
172.64.36.83
162.159.36.181
5.11.11.11
212.230.255.3
4.15.208.86
68.105.172.184
172.64.37.98
172.64.37.171
73.31.207.113
172.64.36.137
172.64.37.178
211.75.71.229
162.159.51.155
216.175.203.51
172.64.37.64
172.64.36.162
172.64.46.161
172.64.37.39
172.64.36.97
200.57.7.61
92.43.224.1
23.19.245.84
213.157.50.130
66.163.0.173
50.233.102.227
185.38.27.139
195.113.144.194
193.58.204.59
5.2.75.75
194.25.0.60
162.159.36.134
162.159.46.48
8.26.56.155
162.159.56.16
172.64.37.115
18.167.5.157
8.20.247.112
172.64.36.33
172.64.37.59
212.118.0.2
64.210.72.157
63.171.232.38
172.64.36.117
117.103.228.101
45.90.28.15
8.20.247.138
8.26.56.11
172.64.37.139
162.159.46.177
172.64.36.13
84.200.69.80
190.216.19.30
204.57.114.215
8.26.56.107
172.64.37.96
162.159.56.64
207.248.224.71
159.203.187.29
172.64.36.113
162.159.36.243
172.64.36.140
162.159.50.42
8.20.247.42
209.0.191.6
8.20.247.5
206.253.33.130
162.159.46.119
50.59.58.165
8.26.56.115
172.64.37.225
216.17.128.2
212.96.1.70
172.64.36.154
208.67.222.220
51.15.69.236
162.159.50.27
8.26.56.143
172.64.36.254
8.20.247.89
172.64.36.110
8.20.247.119
209.244.104.180
84.200.70.40
172.64.37.53
172.64.37.35
172.64.37.192
172.64.36.225
8.26.56.232
73.7.179.224
64.76.25.124
162.159.50.157
8.20.247.10
172.64.37.44
172.64.36.184
8.26.56.156
82.221.128.44
222.255.237.207
88.150.249.220
70.184.7.113
212.14.253.242
172.64.36.183
8.20.247.146
12.246.178.222
203.98.192.114
172.64.37.223
38.242.202.141
45.90.28.19
172.64.37.234
115.84.252.3
8.243.126.116
4.28.150.154
8.20.247.214
87.204.28.12
45.225.123.249
172.64.37.132
172.64.36.36
41.65.236.56
98.249.57.2
162.159.57.12
58.96.3.34
172.64.37.229
8.26.56.78
194.36.144.87
88.99.39.199
172.64.36.150
172.64.37.142
162.159.57.180
8.20.247.70
162.159.50.129
45.90.30.0
141.1.1.1
162.159.51.97
84.8.2.11
217.170.133.134
172.64.36.159
172.64.36.121
172.64.36.67
172.64.37.90
203.27.182.202
37.120.235.187
8.20.247.221
103.3.46.105
162.159.50.138
172.64.37.29
172.64.47.104
202.78.224.134
8.26.56.230
210.181.4.25
172.64.36.202
212.199.114.12
8.243.126.117
95.158.128.2
172.64.37.128
162.159.56.234
211.115.194.2
193.58.251.251
8.20.247.30
198.60.22.2
12.195.135.217
172.64.46.36
8.20.247.71
172.64.36.167
162.159.50.3
162.159.57.114
162.159.57.6
8.26.56.27
8.26.56.123
8.2.192.205
147.29.10.6
8.26.56.20
172.64.47.178
172.64.37.242
212.78.94.40
172.64.36.221
212.19.96.2
147.29.10.55
172.64.36.85
8.26.56.30
216.84.166.42
103.196.16.3
8.20.247.2
195.67.27.18
149.112.122.20
65.27.154.0
162.159.57.139
109.228.22.126
45.90.30.11
172.64.36.226
8.26.56.15
172.64.37.138
62.140.239.1
162.159.51.116
8.26.56.12
172.64.37.50
8.20.247.240
204.116.57.2
211.188.180.21
172.64.37.247
45.63.101.129
45.90.28.26
210.220.163.82
24.154.1.4
162.159.50.95
162.159.51.229
8.20.204.150
172.64.37.137
63.118.166.102
172.64.37.175
45.90.30.169
172.64.37.22
162.159.36.139
8.8.8.8
172.64.46.34
92.60.50.40
172.64.36.211
200.113.10.155
8.20.247.61
173.70.25.32
8.243.126.119
221.139.13.130
165.87.201.244
172.64.36.132
216.248.55.141
172.64.37.250
172.64.46.127
172.64.36.59
194.69.194.3
8.20.247.36
62.76.62.76
172.64.36.130
64.105.199.74
95.158.129.2
210.67.33.3
8.20.247.93
172.64.37.214
8.20.247.91
162.159.46.28
172.64.36.209
172.64.37.74
24.170.197.68
209.244.104.187
172.64.37.218
172.64.37.176
198.6.1.4
172.64.36.163
165.87.13.129
202.138.120.6
207.70.161.182
8.20.247.154
172.64.37.203
172.64.37.248
172.64.37.155
172.64.37.71
8.20.247.224
172.64.37.97
217.160.70.42
76.76.10.5
208.72.120.204
190.216.19.17
202.248.20.133
8.20.247.65
8.20.247.31
172.64.37.236
83.137.41.9
162.159.50.152
172.64.37.0
8.20.247.191
50.201.178.59
172.64.47.147
172.64.36.104
208.91.112.53
50.248.90.249
50.223.23.54
8.243.126.14
4.15.141.202
206.51.143.55
212.73.221.104
8.26.56.77
155.254.21.250
65.56.156.249
172.64.37.194
103.246.161.78
162.159.57.219
8.20.247.121
172.64.37.56
172.64.36.206
8.20.247.176
172.64.37.82
66.163.0.161
162.159.46.1
162.159.56.162
88.208.244.225
45.90.30.13
24.172.82.94
139.130.4.4
172.64.36.5
8.20.247.95
172.64.36.25
12.127.17.72
172.64.46.9
172.64.36.12
8.20.247.210
172.64.36.249
172.64.37.235
8.26.56.36
193.95.93.243
168.126.63.1
103.239.32.81
8.20.247.254
162.159.36.136
8.20.247.77
12.229.148.195
70.171.50.159
193.42.159.2
37.235.206.211
155.137.78.72
162.159.51.239
8.26.56.171
93.91.163.99
206.253.194.65
75.103.115.94
80.211.55.138
190.217.25.34
27.254.66.8
172.64.36.227
162.159.36.237
12.247.54.106
172.64.36.143
4.16.64.169
172.64.46.53
172.64.36.237
162.159.51.69
172.64.36.179
216.136.95.2
4.53.133.131
103.29.250.10
67.187.17.182
75.103.55.4
45.90.28.25
208.79.56.204
149.112.112.11
172.64.36.26
168.215.210.50
172.64.36.142
211.114.145.7
27.110.243.20
172.64.36.193
172.64.36.208
193.226.61.1
172.64.36.39
1.0.0.19
185.107.80.84
172.64.36.215
8.26.56.222
98.38.222.66
12.51.21.245
172.64.36.238
172.64.37.4
172.64.36.23
8.26.56.39
64.76.25.125
162.159.51.248
212.97.32.2
162.159.56.33
172.64.36.71
50.234.132.241
194.77.8.1
8.26.56.133
8.26.56.13
103.143.28.17
165.246.10.2
164.163.1.90
8.20.247.139
87.229.99.1
8.35.35.10
162.159.36.123
8.26.56.40
162.159.50.119
172.64.36.111
162.159.56.128
8.26.56.54
45.67.219.208
8.20.247.16
176.98.80.97
172.64.37.33
216.111.107.73
45.90.28.189
8.20.247.21
8.20.247.106
172.64.36.114
172.64.37.70
24.99.148.61
212.12.18.120
51.158.169.242
172.64.37.93
8.26.56.236
198.71.117.66
8.20.247.168
9.9.9.11
66.251.199.51
212.230.255.129
8.26.56.103
8.26.56.118
172.64.36.1
172.64.37.172
162.159.46.8
172.64.36.177
45.90.30.20
172.64.36.20
172.64.37.204
77.88.8.88
12.69.230.197
8.243.126.107
141.1.27.249
4.0.0.53
162.159.51.11
172.64.36.69
64.42.181.227
172.64.37.208
129.250.35.251
162.159.57.78
8.20.247.141
65.203.109.2
27.71.233.116
172.64.36.120
162.159.51.100
8.26.56.245
193.111.144.161
198.6.1.146
66.92.64.2
162.159.56.244
8.20.247.170
172.64.36.246
202.46.33.250
172.64.37.84
63.171.232.39
8.20.247.125
172.64.46.217
218.102.23.228
211.188.180.22
172.64.37.238
66.92.159.2
8.20.247.230
172.64.36.126
201.234.231.130
194.25.0.52
172.64.36.43
52.226.49.57
208.67.220.222
212.187.140.53
45.90.28.11
209.216.160.2
172.64.37.163
172.64.36.108
45.90.28.22
64.119.80.100
8.26.56.105
172.64.37.114
200.56.224.11
8.26.56.33
172.64.36.77
172.64.37.32
217.144.6.6
8.20.247.17
172.64.37.14
162.159.36.199
8.20.247.225
137.82.1.1
203.117.96.181
210.180.98.69
190.216.69.4
8.20.247.238
172.64.36.115
8.20.247.109
113.196.177.211
216.194.28.33
81.116.141.156
80.172.241.62
162.159.56.228
216.52.65.1
8.26.56.206
109.228.24.15
185.184.222.222
98.208.56.152
172.64.36.175
172.64.37.147
8.20.247.174
162.159.51.140
8.20.247.182
8.26.56.62
172.64.36.106
1.1.1.1
204.194.232.200
172.64.46.28
172.64.37.10
199.58.81.218
8.26.56.151
172.64.36.56
67.191.149.125
172.64.47.224
194.177.199.1
169.53.182.120
217.138.219.219
8.20.247.239
62.40.32.34
172.64.36.119
172.64.37.118
195.69.65.98
162.159.50.233
35.155.221.215
216.106.1.254
8.20.247.74
172.64.37.77
162.159.56.242
114.114.114.114
63.118.166.105
172.64.36.192
162.159.56.111
41.65.236.61
193.47.83.251
66.28.0.45
172.64.37.27
212.94.32.32
45.90.30.30
8.20.247.13
45.90.30.16
8.20.247.148
98.244.8.17
162.159.36.247
8.20.247.127
98.212.26.255
63.208.141.14
8.20.247.250
172.64.36.9
162.159.51.90
172.64.46.27
211.115.194.3
172.64.47.45
12.165.204.88
8.26.56.63
172.64.36.76
172.64.37.112
209.12.133.148
172.64.37.72
210.94.0.7
8.26.56.6
172.64.47.167
200.55.59.102
176.103.130.130
8.20.247.33
8.26.56.183
156.154.71.25
172.64.37.121
172.64.37.107
172.64.36.155
8.20.247.80
76.81.95.43
172.64.36.75
172.64.36.37
149.112.121.10
200.221.11.100
162.159.36.61
50.216.244.79
129.250.35.250
12.207.98.14
216.254.141.13
66.192.104.191
172.64.46.42
162.159.27.90
35.167.25.37
4.59.81.39
64.76.25.127
190.216.19.24
8.26.56.135
4.14.233.222
24.98.20.247
203.39.3.133
172.64.36.170
50.222.112.82
45.90.28.14
8.26.56.113
172.64.36.95
162.159.56.1
172.64.37.131
83.137.41.8
204.117.214.10
172.64.36.24
202.134.52.103
172.64.36.116
8.20.247.88
8.20.247.26
197.210.211.1
201.234.130.31
216.27.175.2
172.64.37.108
172.64.36.180
172.64.47.174
210.87.253.60
162.159.36.132
172.64.37.183
172.64.37.13
8.18.4.19
172.64.37.43
172.64.36.128
8.20.247.172
66.93.87.2
216.17.128.1
45.90.28.29
96.64.201.177
172.64.37.52
8.26.56.100
172.64.47.85
172.64.36.197
172.64.37.47
45.90.30.12
208.67.222.222
12.201.176.131
172.64.37.75
172.64.37.28
8.26.56.247
172.64.37.12
73.176.118.83
52.24.103.199
172.64.36.210
8.20.247.56
45.19.183.181
172.64.37.113
172.64.36.101
172.64.36.253
195.153.19.5
172.64.46.144
8.242.6.242
172.64.36.232
4.4.26.135
8.20.247.105
172.64.37.219
80.67.169.12
172.64.46.52
8.243.126.7
172.64.36.70
50.201.178.63
98.255.2.112
172.64.37.162
172.64.36.65
172.64.36.233
211.63.64.11
202.130.97.66
72.237.206.37
172.64.37.166
172.64.47.166
172.64.37.161
31.154.3.161
172.64.37.26
162.159.36.158
212.89.130.180
172.64.36.169
162.159.57.86
149.112.112.10
208.78.24.238
24.154.1.5
203.115.130.74
172.64.36.28
110.142.40.60
66.243.10.180
8.20.247.215
172.64.37.104
172.64.46.17
8.20.247.249
24.4.172.85
64.105.172.26
8.20.247.78
172.64.37.42
8.26.56.174
172.64.36.198
8.34.34.103
172.64.36.156
172.64.36.178
8.26.56.104
8.26.56.64
8.26.56.97
172.64.37.95
172.64.36.158
8.20.247.245
172.64.37.185
98.38.222.51
45.90.30.17
8.26.56.58
172.64.37.211
64.94.1.33
8.26.56.110
217.17.34.68
8.243.126.10
162.159.50.187
194.145.240.6
172.64.46.137
172.64.36.78
95.67.59.140
172.64.46.203
189.125.136.9
172.64.37.76
45.55.147.169
8.20.247.92
162.159.56.39
162.159.50.115
200.11.52.202
162.159.51.37
203.160.186.170
77.88.8.1
203.113.130.221
172.64.36.27
209.244.104.185
8.26.56.205
98.38.222.125
104.255.175.2
8.26.56.158
172.64.37.109
50.234.50.134
45.90.28.30
198.6.1.142
172.64.36.222
209.87.64.70
8.26.56.237
58.177.179.58
200.57.2.108
172.64.36.54
172.64.37.1
76.120.201.96
172.64.46.255
172.64.37.244
8.20.247.118
172.64.37.199
172.64.37.119
8.20.247.85
172.64.36.38
172.64.37.160
172.64.36.2
8.20.247.47
62.76.76.62
172.64.36.147
172.64.36.18
8.26.56.22
8.20.247.35
172.64.37.152
8.26.56.196
8.26.56.243
45.90.28.10
190.216.19.22
172.64.36.73
8.20.247.52
82.151.90.1
172.64.36.174
172.64.36.107
172.64.37.127
51.15.42.162
172.64.37.117
172.64.36.100
172.64.37.129
50.77.209.154
216.21.128.22
8.20.247.63
8.35.35.35
8.243.126.122
172.64.37.124
45.225.123.110
162.159.50.124
104.40.153.131
49.231.140.120
46.245.253.5
162.159.57.81
172.64.37.106
203.2.193.67
172.64.37.125
216.244.192.3
46.166.189.68
209.51.161.14
172.64.47.9
162.159.57.1
172.64.36.231
162.159.57.49
172.64.36.84
202.0.145.23
8.20.247.235
195.77.235.10
66.115.98.85
162.159.36.125
192.172.250.8
172.64.37.149
172.64.37.146
164.124.107.9
210.94.0.73
45.90.28.0
195.243.214.4
8.26.56.255
84.96.26.129
8.20.247.201
50.217.25.205
162.159.57.36
45.24.191.81
172.64.36.55
172.64.46.22
172.64.37.63
172.64.37.49
96.102.121.126
220.64.135.149
162.159.56.66
72.198.188.68
172.64.37.120
8.20.247.103
8.243.126.28
142.46.1.130
8.26.56.213
212.72.130.20
64.105.202.138
8.20.247.58
8.26.56.25
8.20.247.90
193.238.77.62
172.64.36.61
207.17.190.5
172.64.36.182
172.64.37.205
89.255.2.228
172.64.37.206
103.87.243.149
172.64.36.239
50.216.25.75
8.20.247.43
8.26.56.87
213.211.50.1
194.61.59.25
172.64.37.252
195.27.1.1
211.21.7.246
63.96.227.100
172.64.47.171
63.151.67.7
172.64.46.103
162.159.46.250
80.248.48.14
219.250.36.130
8.26.56.211
172.64.36.7
162.159.46.53
8.46.206.93
207.248.57.10
210.0.255.250
116.92.184.177
45.90.30.1
79.141.81.250
194.108.42.2
193.227.50.3
208.48.253.106
209.216.160.131
203.146.237.222
50.223.22.178
81.16.18.228
172.64.37.89
45.90.30.21
84.54.226.50
162.159.36.6
172.64.37.150
205.134.162.209
5.152.215.29
202.136.162.11
203.248.252.2
172.64.46.229
107.191.48.176
162.159.36.43
8.26.56.142
79.141.82.250
172.64.37.20
45.90.30.22
162.159.56.217
8.20.247.149
172.64.46.192
172.64.37.209
208.67.220.220
70.171.61.101
211.72.109.235
8.26.56.70
103.51.144.214
1.0.0.3
8.26.56.146
8.26.56.157
8.20.247.110
162.159.46.38
162.159.50.116
62.149.128.2
172.64.37.6
109.224.233.174
8.26.56.160
130.226.161.34
1.0.0.2
172.64.37.174
162.159.57.128
172.64.36.188
198.82.247.34
172.64.36.47
1.1.176.44
172.64.36.127
8.20.247.126
202.55.176.10
8.26.56.42
199.44.194.2
66.192.104.68
172.64.36.57
23.224.78.68
172.64.37.38
8.26.56.28
172.64.36.235
193.111.200.191
172.64.36.46
172.64.36.14
203.119.36.106
172.64.37.79
172.64.37.240
152.101.4.130
203.113.148.12
172.64.46.72
216.21.129.22
172.64.37.198
8.20.247.231
162.159.50.85
64.132.94.250
85.204.79.2
89.233.43.71
190.216.69.6
8.20.247.183
8.243.126.25
8.243.126.69
172.64.37.31
114.198.144.44
172.64.47.18
8.20.247.81
172.64.46.179
172.64.37.16
8.20.247.211
172.64.37.123
8.12.246.73
199.77.135.211
67.97.247.50
162.159.57.170
8.20.247.188
206.253.33.131
222.255.167.61
45.90.28.165
129.71.254.12
12.97.174.104
8.26.56.202
110.145.237.30
8.20.247.72
209.136.132.136
193.202.121.50
162.159.46.117
162.159.46.144
172.64.37.37
8.20.247.37
172.64.37.54
8.20.247.25
213.211.50.2
154.212.129.20
194.1.154.37
162.159.24.69
8.26.56.203
216.254.141.2
63.211.67.251
172.64.37.101
172.64.37.140
8.20.247.94
216.52.65.33
8.8.4.4
172.64.36.16
8.20.247.137
211.237.65.21
109.224.233.190
162.159.46.202
172.64.36.50
149.112.122.30
209.143.0.10
190.216.229.111
172.64.36.236
64.135.1.20
8.20.247.242
162.159.46.134
50.204.42.225
142.103.1.1
8.26.56.136
162.159.36.224
50.59.232.9
217.18.206.12
Download .txt
gitextract_fpwhs3ng/

├── .gitignore
├── LICENSE.md
├── README.md
├── cloudhunter.py
├── permutations-big.txt
├── permutations.txt
├── requirements.txt
└── resolvers.txt
Download .txt
SYMBOL INDEX (41 symbols across 1 files)

FILE: cloudhunter.py
  class State (line 89) | class State(Enum):
  class Risk (line 97) | class Risk(Enum):
  class Bucket (line 103) | class Bucket(object):
    method __init__ (line 105) | def __init__(self, name, domain, cloud='generic', srv_name='Generic', ...
    method process_status (line 115) | def process_status(self, response):
    method print_details (line 149) | def print_details(self):
    method write_test (line 156) | def write_test(self):
    method get_rights (line 174) | def get_rights(self):
    method _azure_acl (line 184) | def _azure_acl(self):
    method _google_acl (line 220) | def _google_acl(self):
    method _aws_acl (line 253) | def _aws_acl(self):
    method _alibaba_acl (line 269) | def _alibaba_acl(self):
    method _read_s3_acl (line 294) | def _read_s3_acl(self, acl):
  class HiddenGems (line 333) | class HiddenGems(object):
    method __init__ (line 341) | def __init__(self, url, deep=0, active_crawl=True):
    method crawl (line 352) | def crawl(self, deep=0, active_crawl=False):
    method crawl_raw_urls (line 380) | def crawl_raw_urls(self, urls):
    method get_base_url (line 395) | def get_base_url(self, url):
    method filter_scope (line 403) | def filter_scope(self, values):
    method normalize_url (line 406) | def normalize_url(self, src, full_query=False, base_url=None):
    method url_extension (line 415) | def url_extension(self, url):
    method list_urls (line 422) | def list_urls(self, scope=False, full_query=False):
    method list_out_urls (line 439) | def list_out_urls(self, full_query=False):
    method list_dirs (line 442) | def list_dirs(self, scope=False):
    method list_out_dirs (line 445) | def list_out_dirs(self):
    method list_domains (line 448) | def list_domains(self):
    method extract_javascript (line 451) | def extract_javascript(self, source_code):
    method extract_links (line 460) | def extract_links(self, source_code):
    method extract_images (line 465) | def extract_images(self, source_code):
    method extract_raw_links (line 470) | def extract_raw_links(self, source_code):
    method extract_styles (line 474) | def extract_styles(self, source_code):
    method extract_forms (line 483) | def extract_forms(self, source_code):
    method extract_cors (line 488) | def extract_cors(self, headers):
  function generate_permutations (line 496) | def generate_permutations(base_name, dict_file):
  function check_dns (line 510) | def check_dns(hostname):
  function check_host (line 524) | def check_host(host, ip):
  function search_buckets (line 534) | def search_buckets(cloud_dict, names, cloud='generic', distribute=False,...
  function search_buckets_worker (line 559) | def search_buckets_worker(queue, results, cloud, enable_write):
  function what_cloud (line 585) | def what_cloud(urls, enable_write):
  function what_cloud_worker (line 601) | def what_cloud_worker(queue, results, enable_write):
  function show_banner (line 657) | def show_banner():
Condensed preview — 8 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (95K chars).
[
  {
    "path": ".gitignore",
    "chars": 1042,
    "preview": "# vscode\n.vscode/*\n\n# Project\n*.json\n\n# Windows\nThumbs.db\nThumbs.db:encryptable\nehthumbs.db\nehthumbs_vista.db\n*.exe\n*.ca"
  },
  {
    "path": "LICENSE.md",
    "chars": 35142,
    "preview": "\n                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free"
  },
  {
    "path": "README.md",
    "chars": 6216,
    "preview": "# CloudHunter\nLooks for AWS, Azure, Alibaba and Google cloud storage buckets and lists permissions for vulnerable bucket"
  },
  {
    "path": "cloudhunter.py",
    "chars": 27868,
    "preview": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n__title__ = \"CloudHunter\"\n__url__ = \"https://github.com/belane/CloudHunt"
  },
  {
    "path": "permutations-big.txt",
    "chars": 1964,
    "preview": "0\n001\n002\n003\n01\n02\n03\n1\n2\n2014\n2015\n2016\n2017\n2018\n2019\n3\n4\n5\n6\n7\n8\n9\naccess.logs\naccess-logs\naccounting\nadmin\nadminist"
  },
  {
    "path": "permutations.txt",
    "chars": 500,
    "preview": "access-logs\naccounting\nadmin\napi\nassets\nattachments\naws-logs\nazure\nazure-logs\ncentral\nclient\nconf\nconfidential\nconfig\nco"
  },
  {
    "path": "requirements.txt",
    "chars": 100,
    "preview": "beautifulsoup4>=4.8\nrequests>=2.22\nurllib3>=1.25\ntldextract>=2.2\nxmltodict>=0.12.0\ndnspython>=2.0.0\n"
  },
  {
    "path": "resolvers.txt",
    "chars": 18168,
    "preview": "8.26.56.182\n45.90.30.126\n193.111.144.145\n66.28.0.61\n8.20.247.196\n219.252.2.100\n8.26.56.148\n60.250.132.102\n162.159.46.167"
  }
]

About this extraction

This page contains the full source code of the belane/CloudHunter GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 8 files (88.9 KB), approximately 28.0k tokens, and a symbol index with 41 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!