bbot 2.5.0__py3-none-any.whl → 2.7.2.7424rc0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bbot/__init__.py +1 -1
- bbot/cli.py +22 -8
- bbot/core/engine.py +1 -1
- bbot/core/event/__init__.py +2 -2
- bbot/core/event/base.py +138 -110
- bbot/core/flags.py +1 -0
- bbot/core/helpers/bloom.py +6 -7
- bbot/core/helpers/command.py +5 -2
- bbot/core/helpers/depsinstaller/installer.py +78 -7
- bbot/core/helpers/dns/dns.py +0 -1
- bbot/core/helpers/dns/engine.py +0 -2
- bbot/core/helpers/files.py +2 -2
- bbot/core/helpers/git.py +17 -0
- bbot/core/helpers/helper.py +6 -5
- bbot/core/helpers/misc.py +15 -28
- bbot/core/helpers/names_generator.py +5 -0
- bbot/core/helpers/ntlm.py +0 -2
- bbot/core/helpers/regex.py +1 -1
- bbot/core/helpers/regexes.py +25 -8
- bbot/core/helpers/web/engine.py +1 -1
- bbot/core/helpers/web/web.py +2 -1
- bbot/core/modules.py +22 -60
- bbot/core/shared_deps.py +38 -0
- bbot/defaults.yml +4 -2
- bbot/modules/apkpure.py +2 -2
- bbot/modules/aspnet_bin_exposure.py +80 -0
- bbot/modules/baddns.py +1 -1
- bbot/modules/baddns_direct.py +1 -1
- bbot/modules/baddns_zone.py +1 -1
- bbot/modules/badsecrets.py +1 -1
- bbot/modules/base.py +129 -40
- bbot/modules/bucket_amazon.py +1 -1
- bbot/modules/bucket_digitalocean.py +1 -1
- bbot/modules/bucket_firebase.py +1 -1
- bbot/modules/bucket_google.py +1 -1
- bbot/modules/{bucket_azure.py → bucket_microsoft.py} +2 -2
- bbot/modules/builtwith.py +4 -2
- bbot/modules/c99.py +1 -1
- bbot/modules/dnsbimi.py +1 -4
- bbot/modules/dnsbrute.py +6 -1
- bbot/modules/dnscommonsrv.py +1 -0
- bbot/modules/dnsdumpster.py +35 -52
- bbot/modules/dnstlsrpt.py +0 -6
- bbot/modules/docker_pull.py +2 -2
- bbot/modules/emailformat.py +17 -1
- bbot/modules/ffuf.py +4 -1
- bbot/modules/ffuf_shortnames.py +6 -3
- bbot/modules/filedownload.py +8 -5
- bbot/modules/fullhunt.py +1 -1
- bbot/modules/git_clone.py +47 -22
- bbot/modules/gitdumper.py +5 -15
- bbot/modules/github_workflows.py +6 -5
- bbot/modules/gitlab_com.py +31 -0
- bbot/modules/gitlab_onprem.py +84 -0
- bbot/modules/gowitness.py +60 -30
- bbot/modules/graphql_introspection.py +145 -0
- bbot/modules/httpx.py +2 -0
- bbot/modules/hunt.py +10 -3
- bbot/modules/iis_shortnames.py +16 -7
- bbot/modules/internal/cloudcheck.py +65 -72
- bbot/modules/internal/unarchive.py +9 -3
- bbot/modules/lightfuzz/lightfuzz.py +6 -2
- bbot/modules/lightfuzz/submodules/esi.py +42 -0
- bbot/modules/{deadly/medusa.py → medusa.py} +4 -7
- bbot/modules/nuclei.py +2 -2
- bbot/modules/otx.py +9 -2
- bbot/modules/output/base.py +3 -11
- bbot/modules/paramminer_headers.py +10 -7
- bbot/modules/passivetotal.py +1 -1
- bbot/modules/portfilter.py +2 -0
- bbot/modules/portscan.py +1 -1
- bbot/modules/postman_download.py +2 -2
- bbot/modules/retirejs.py +232 -0
- bbot/modules/securitytxt.py +0 -3
- bbot/modules/sslcert.py +2 -2
- bbot/modules/subdomaincenter.py +1 -16
- bbot/modules/telerik.py +7 -2
- bbot/modules/templates/bucket.py +24 -4
- bbot/modules/templates/gitlab.py +98 -0
- bbot/modules/trufflehog.py +7 -4
- bbot/modules/wafw00f.py +2 -2
- bbot/presets/web/dotnet-audit.yml +1 -0
- bbot/presets/web/lightfuzz-heavy.yml +1 -1
- bbot/presets/web/lightfuzz-medium.yml +1 -1
- bbot/presets/web/lightfuzz-superheavy.yml +1 -1
- bbot/scanner/manager.py +44 -37
- bbot/scanner/scanner.py +17 -4
- bbot/scripts/benchmark_report.py +433 -0
- bbot/test/benchmarks/__init__.py +2 -0
- bbot/test/benchmarks/test_bloom_filter_benchmarks.py +105 -0
- bbot/test/benchmarks/test_closest_match_benchmarks.py +76 -0
- bbot/test/benchmarks/test_event_validation_benchmarks.py +438 -0
- bbot/test/benchmarks/test_excavate_benchmarks.py +291 -0
- bbot/test/benchmarks/test_ipaddress_benchmarks.py +143 -0
- bbot/test/benchmarks/test_weighted_shuffle_benchmarks.py +70 -0
- bbot/test/conftest.py +1 -1
- bbot/test/test_step_1/test_bbot_fastapi.py +2 -2
- bbot/test/test_step_1/test_events.py +22 -21
- bbot/test/test_step_1/test_helpers.py +20 -0
- bbot/test/test_step_1/test_manager_scope_accuracy.py +45 -0
- bbot/test/test_step_1/test_modules_basic.py +40 -15
- bbot/test/test_step_1/test_python_api.py +2 -2
- bbot/test/test_step_1/test_regexes.py +21 -4
- bbot/test/test_step_1/test_scan.py +7 -8
- bbot/test/test_step_1/test_web.py +46 -0
- bbot/test/test_step_2/module_tests/base.py +6 -1
- bbot/test/test_step_2/module_tests/test_module_aspnet_bin_exposure.py +73 -0
- bbot/test/test_step_2/module_tests/test_module_bucket_amazon.py +52 -18
- bbot/test/test_step_2/module_tests/test_module_bucket_google.py +1 -1
- bbot/test/test_step_2/module_tests/{test_module_bucket_azure.py → test_module_bucket_microsoft.py} +7 -5
- bbot/test/test_step_2/module_tests/test_module_cloudcheck.py +19 -31
- bbot/test/test_step_2/module_tests/test_module_dnsbimi.py +2 -1
- bbot/test/test_step_2/module_tests/test_module_dnsdumpster.py +3 -5
- bbot/test/test_step_2/module_tests/test_module_emailformat.py +1 -1
- bbot/test/test_step_2/module_tests/test_module_emails.py +2 -2
- bbot/test/test_step_2/module_tests/test_module_excavate.py +64 -5
- bbot/test/test_step_2/module_tests/test_module_extractous.py +13 -1
- bbot/test/test_step_2/module_tests/test_module_github_workflows.py +10 -1
- bbot/test/test_step_2/module_tests/test_module_gitlab_com.py +66 -0
- bbot/test/test_step_2/module_tests/{test_module_gitlab.py → test_module_gitlab_onprem.py} +4 -69
- bbot/test/test_step_2/module_tests/test_module_gowitness.py +5 -5
- bbot/test/test_step_2/module_tests/test_module_graphql_introspection.py +34 -0
- bbot/test/test_step_2/module_tests/test_module_iis_shortnames.py +46 -1
- bbot/test/test_step_2/module_tests/test_module_jadx.py +9 -0
- bbot/test/test_step_2/module_tests/test_module_lightfuzz.py +71 -3
- bbot/test/test_step_2/module_tests/test_module_nuclei.py +8 -6
- bbot/test/test_step_2/module_tests/test_module_otx.py +3 -0
- bbot/test/test_step_2/module_tests/test_module_portfilter.py +2 -0
- bbot/test/test_step_2/module_tests/test_module_retirejs.py +161 -0
- bbot/test/test_step_2/module_tests/test_module_telerik.py +1 -1
- bbot/test/test_step_2/module_tests/test_module_trufflehog.py +10 -1
- bbot/test/test_step_2/module_tests/test_module_unarchive.py +9 -0
- {bbot-2.5.0.dist-info → bbot-2.7.2.7424rc0.dist-info}/METADATA +12 -9
- {bbot-2.5.0.dist-info → bbot-2.7.2.7424rc0.dist-info}/RECORD +137 -124
- {bbot-2.5.0.dist-info → bbot-2.7.2.7424rc0.dist-info}/WHEEL +1 -1
- {bbot-2.5.0.dist-info → bbot-2.7.2.7424rc0.dist-info/licenses}/LICENSE +98 -58
- bbot/modules/binaryedge.py +0 -42
- bbot/modules/censys.py +0 -98
- bbot/modules/gitlab.py +0 -141
- bbot/modules/zoomeye.py +0 -77
- bbot/test/test_step_2/module_tests/test_module_binaryedge.py +0 -33
- bbot/test/test_step_2/module_tests/test_module_censys.py +0 -83
- bbot/test/test_step_2/module_tests/test_module_zoomeye.py +0 -35
- {bbot-2.5.0.dist-info → bbot-2.7.2.7424rc0.dist-info}/entry_points.txt +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
GNU GENERAL PUBLIC LICENSE
|
|
2
|
-
Version 3,
|
|
1
|
+
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 19 November 2007
|
|
3
3
|
|
|
4
4
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
5
|
Everyone is permitted to copy and distribute verbatim copies
|
|
@@ -7,17 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
Preamble
|
|
9
9
|
|
|
10
|
-
The GNU General Public License is a free, copyleft license for
|
|
11
|
-
software and other kinds of works
|
|
10
|
+
The GNU Affero General Public License is a free, copyleft license for
|
|
11
|
+
software and other kinds of works, specifically designed to ensure
|
|
12
|
+
cooperation with the community in the case of network server software.
|
|
12
13
|
|
|
13
14
|
The licenses for most software and other practical works are designed
|
|
14
15
|
to take away your freedom to share and change the works. By contrast,
|
|
15
|
-
|
|
16
|
+
our General Public Licenses are intended to guarantee your freedom to
|
|
16
17
|
share and change all versions of a program--to make sure it remains free
|
|
17
|
-
software for all its users.
|
|
18
|
-
GNU General Public License for most of our software; it applies also to
|
|
19
|
-
any other work released this way by its authors. You can apply it to
|
|
20
|
-
your programs, too.
|
|
18
|
+
software for all its users.
|
|
21
19
|
|
|
22
20
|
When we speak of free software, we are referring to freedom, not
|
|
23
21
|
price. Our General Public Licenses are designed to make sure that you
|
|
@@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you
|
|
|
26
24
|
want it, that you can change the software or use pieces of it in new
|
|
27
25
|
free programs, and that you know you can do these things.
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
that
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
products. If such problems arise substantially in other domains, we
|
|
58
|
-
stand ready to extend this provision to those domains in future versions
|
|
59
|
-
of the GPL, as needed to protect the freedom of users.
|
|
60
|
-
|
|
61
|
-
Finally, every program is threatened constantly by software patents.
|
|
62
|
-
States should not allow patents to restrict development and use of
|
|
63
|
-
software on general-purpose computers, but in those that do, we wish to
|
|
64
|
-
avoid the special danger that patents applied to a free program could
|
|
65
|
-
make it effectively proprietary. To prevent this, the GPL assures that
|
|
66
|
-
patents cannot be used to render the program non-free.
|
|
27
|
+
Developers that use our General Public Licenses protect your rights
|
|
28
|
+
with two steps: (1) assert copyright on the software, and (2) offer
|
|
29
|
+
you this License which gives you legal permission to copy, distribute
|
|
30
|
+
and/or modify the software.
|
|
31
|
+
|
|
32
|
+
A secondary benefit of defending all users' freedom is that
|
|
33
|
+
improvements made in alternate versions of the program, if they
|
|
34
|
+
receive widespread use, become available for other developers to
|
|
35
|
+
incorporate. Many developers of free software are heartened and
|
|
36
|
+
encouraged by the resulting cooperation. However, in the case of
|
|
37
|
+
software used on network servers, this result may fail to come about.
|
|
38
|
+
The GNU General Public License permits making a modified version and
|
|
39
|
+
letting the public access it on a server without ever releasing its
|
|
40
|
+
source code to the public.
|
|
41
|
+
|
|
42
|
+
The GNU Affero General Public License is designed specifically to
|
|
43
|
+
ensure that, in such cases, the modified source code becomes available
|
|
44
|
+
to the community. It requires the operator of a network server to
|
|
45
|
+
provide the source code of the modified version running there to the
|
|
46
|
+
users of that server. Therefore, public use of a modified version, on
|
|
47
|
+
a publicly accessible server, gives the public access to the source
|
|
48
|
+
code of the modified version.
|
|
49
|
+
|
|
50
|
+
An older license, called the Affero General Public License and
|
|
51
|
+
published by Affero, was designed to accomplish similar goals. This is
|
|
52
|
+
a different license, not a version of the Affero GPL, but Affero has
|
|
53
|
+
released a new version of the Affero GPL which permits relicensing under
|
|
54
|
+
this license.
|
|
67
55
|
|
|
68
56
|
The precise terms and conditions for copying, distribution and
|
|
69
57
|
modification follow.
|
|
@@ -72,7 +60,7 @@ modification follow.
|
|
|
72
60
|
|
|
73
61
|
0. Definitions.
|
|
74
62
|
|
|
75
|
-
"This License" refers to version 3 of the GNU General Public License.
|
|
63
|
+
"This License" refers to version 3 of the GNU Affero General Public License.
|
|
76
64
|
|
|
77
65
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
78
66
|
works, such as semiconductor masks.
|
|
@@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey
|
|
|
549
537
|
the Program, the only way you could satisfy both those terms and this
|
|
550
538
|
License would be to refrain entirely from conveying the Program.
|
|
551
539
|
|
|
552
|
-
13. Use with the GNU
|
|
540
|
+
13. Remote Network Interaction; Use with the GNU General Public License.
|
|
541
|
+
|
|
542
|
+
Notwithstanding any other provision of this License, if you modify the
|
|
543
|
+
Program, your modified version must prominently offer all users
|
|
544
|
+
interacting with it remotely through a computer network (if your version
|
|
545
|
+
supports such interaction) an opportunity to receive the Corresponding
|
|
546
|
+
Source of your version by providing access to the Corresponding Source
|
|
547
|
+
from a network server at no charge, through some standard or customary
|
|
548
|
+
means of facilitating copying of software. This Corresponding Source
|
|
549
|
+
shall include the Corresponding Source for any work covered by version 3
|
|
550
|
+
of the GNU General Public License that is incorporated pursuant to the
|
|
551
|
+
following paragraph.
|
|
553
552
|
|
|
554
553
|
Notwithstanding any other provision of this License, you have
|
|
555
554
|
permission to link or combine any covered work with a work licensed
|
|
556
|
-
under version 3 of the GNU
|
|
555
|
+
under version 3 of the GNU General Public License into a single
|
|
557
556
|
combined work, and to convey the resulting work. The terms of this
|
|
558
557
|
License will continue to apply to the part which is the covered work,
|
|
559
|
-
but the
|
|
560
|
-
|
|
561
|
-
combination as such.
|
|
558
|
+
but the work with which it is combined will remain governed by version
|
|
559
|
+
3 of the GNU General Public License.
|
|
562
560
|
|
|
563
561
|
14. Revised Versions of this License.
|
|
564
562
|
|
|
565
563
|
The Free Software Foundation may publish revised and/or new versions of
|
|
566
|
-
the GNU General Public License from time to time. Such new versions
|
|
567
|
-
be similar in spirit to the present version, but may differ in detail to
|
|
564
|
+
the GNU Affero General Public License from time to time. Such new versions
|
|
565
|
+
will be similar in spirit to the present version, but may differ in detail to
|
|
568
566
|
address new problems or concerns.
|
|
569
567
|
|
|
570
568
|
Each version is given a distinguishing version number. If the
|
|
571
|
-
Program specifies that a certain numbered version of the GNU General
|
|
569
|
+
Program specifies that a certain numbered version of the GNU Affero General
|
|
572
570
|
Public License "or any later version" applies to it, you have the
|
|
573
571
|
option of following the terms and conditions either of that numbered
|
|
574
572
|
version or of any later version published by the Free Software
|
|
575
573
|
Foundation. If the Program does not specify a version number of the
|
|
576
|
-
GNU General Public License, you may choose any version ever published
|
|
574
|
+
GNU Affero General Public License, you may choose any version ever published
|
|
577
575
|
by the Free Software Foundation.
|
|
578
576
|
|
|
579
577
|
If the Program specifies that a proxy can decide which future
|
|
580
|
-
versions of the GNU General Public License can be used, that proxy's
|
|
578
|
+
versions of the GNU Affero General Public License can be used, that proxy's
|
|
581
579
|
public statement of acceptance of a version permanently authorizes you
|
|
582
580
|
to choose that version for the Program.
|
|
583
581
|
|
|
@@ -619,3 +617,45 @@ Program, unless a warranty or assumption of liability accompanies a
|
|
|
619
617
|
copy of the Program in return for a fee.
|
|
620
618
|
|
|
621
619
|
END OF TERMS AND CONDITIONS
|
|
620
|
+
|
|
621
|
+
How to Apply These Terms to Your New Programs
|
|
622
|
+
|
|
623
|
+
If you develop a new program, and you want it to be of the greatest
|
|
624
|
+
possible use to the public, the best way to achieve this is to make it
|
|
625
|
+
free software which everyone can redistribute and change under these terms.
|
|
626
|
+
|
|
627
|
+
To do so, attach the following notices to the program. It is safest
|
|
628
|
+
to attach them to the start of each source file to most effectively
|
|
629
|
+
state the exclusion of warranty; and each file should have at least
|
|
630
|
+
the "copyright" line and a pointer to where the full notice is found.
|
|
631
|
+
|
|
632
|
+
<one line to give the program's name and a brief idea of what it does.>
|
|
633
|
+
Copyright (C) <year> <name of author>
|
|
634
|
+
|
|
635
|
+
This program is free software: you can redistribute it and/or modify
|
|
636
|
+
it under the terms of the GNU Affero General Public License as published by
|
|
637
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
638
|
+
(at your option) any later version.
|
|
639
|
+
|
|
640
|
+
This program is distributed in the hope that it will be useful,
|
|
641
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
642
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
643
|
+
GNU Affero General Public License for more details.
|
|
644
|
+
|
|
645
|
+
You should have received a copy of the GNU Affero General Public License
|
|
646
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
647
|
+
|
|
648
|
+
Also add information on how to contact you by electronic and paper mail.
|
|
649
|
+
|
|
650
|
+
If your software can interact with users remotely through a computer
|
|
651
|
+
network, you should also make sure that it provides a way for users to
|
|
652
|
+
get its source. For example, if your program is a web application, its
|
|
653
|
+
interface could display a "Source" link that leads users to an archive
|
|
654
|
+
of the code. There are many ways you could offer source, and different
|
|
655
|
+
solutions will be better for different programs; see section 13 for the
|
|
656
|
+
specific requirements.
|
|
657
|
+
|
|
658
|
+
You should also get your employer (if you work as a programmer) or school,
|
|
659
|
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
660
|
+
For more information on this, and how to apply and follow the GNU AGPL, see
|
|
661
|
+
<https://www.gnu.org/licenses/>.
|
bbot/modules/binaryedge.py
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
from bbot.modules.templates.subdomain_enum import subdomain_enum_apikey
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class binaryedge(subdomain_enum_apikey):
|
|
5
|
-
watched_events = ["DNS_NAME"]
|
|
6
|
-
produced_events = ["DNS_NAME"]
|
|
7
|
-
flags = ["subdomain-enum", "passive", "safe"]
|
|
8
|
-
meta = {
|
|
9
|
-
"description": "Query the BinaryEdge API",
|
|
10
|
-
"created_date": "2022-08-17",
|
|
11
|
-
"author": "@TheTechromancer",
|
|
12
|
-
"auth_required": True,
|
|
13
|
-
}
|
|
14
|
-
options = {"api_key": "", "max_records": 1000}
|
|
15
|
-
options_desc = {
|
|
16
|
-
"api_key": "BinaryEdge API key",
|
|
17
|
-
"max_records": "Limit results to help prevent exceeding API quota",
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
base_url = "https://api.binaryedge.io/v2"
|
|
21
|
-
|
|
22
|
-
async def setup(self):
|
|
23
|
-
self.max_records = self.config.get("max_records", 1000)
|
|
24
|
-
return await super().setup()
|
|
25
|
-
|
|
26
|
-
def prepare_api_request(self, url, kwargs):
|
|
27
|
-
kwargs["headers"]["X-Key"] = self.api_key
|
|
28
|
-
return url, kwargs
|
|
29
|
-
|
|
30
|
-
async def ping(self):
|
|
31
|
-
url = f"{self.base_url}/user/subscription"
|
|
32
|
-
j = (await self.api_request(url)).json()
|
|
33
|
-
assert j.get("requests_left", 0) > 0
|
|
34
|
-
|
|
35
|
-
async def request_url(self, query):
|
|
36
|
-
# todo: host query (certs + services)
|
|
37
|
-
url = f"{self.base_url}/query/domains/subdomain/{self.helpers.quote(query)}"
|
|
38
|
-
return await self.api_request(url)
|
|
39
|
-
|
|
40
|
-
async def parse_results(self, r, query):
|
|
41
|
-
j = r.json()
|
|
42
|
-
return j.get("events", [])
|
bbot/modules/censys.py
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
from bbot.modules.templates.subdomain_enum import subdomain_enum_apikey
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class censys(subdomain_enum_apikey):
|
|
5
|
-
"""
|
|
6
|
-
thanks to https://github.com/owasp-amass/amass/blob/master/resources/scripts/cert/censys.ads
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
watched_events = ["DNS_NAME"]
|
|
10
|
-
produced_events = ["DNS_NAME"]
|
|
11
|
-
flags = ["subdomain-enum", "passive", "safe"]
|
|
12
|
-
meta = {
|
|
13
|
-
"description": "Query the Censys API",
|
|
14
|
-
"created_date": "2022-08-04",
|
|
15
|
-
"author": "@TheTechromancer",
|
|
16
|
-
"auth_required": True,
|
|
17
|
-
}
|
|
18
|
-
options = {"api_key": "", "max_pages": 5}
|
|
19
|
-
options_desc = {
|
|
20
|
-
"api_key": "Censys.io API Key in the format of 'key:secret'",
|
|
21
|
-
"max_pages": "Maximum number of pages to fetch (100 results per page)",
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
base_url = "https://search.censys.io/api"
|
|
25
|
-
|
|
26
|
-
async def setup(self):
|
|
27
|
-
self.max_pages = self.config.get("max_pages", 5)
|
|
28
|
-
return await super().setup()
|
|
29
|
-
|
|
30
|
-
async def ping(self):
|
|
31
|
-
url = f"{self.base_url}/v1/account"
|
|
32
|
-
resp = await self.api_request(url)
|
|
33
|
-
d = resp.json()
|
|
34
|
-
assert isinstance(d, dict), f"Invalid response from {url}: {resp}"
|
|
35
|
-
quota = d.get("quota", {})
|
|
36
|
-
used = int(quota.get("used", 0))
|
|
37
|
-
allowance = int(quota.get("allowance", 0))
|
|
38
|
-
assert used < allowance, "No quota remaining"
|
|
39
|
-
|
|
40
|
-
def prepare_api_request(self, url, kwargs):
|
|
41
|
-
api_id, api_secret = self.api_key.split(":", 1)
|
|
42
|
-
kwargs["auth"] = (api_id, api_secret)
|
|
43
|
-
return url, kwargs
|
|
44
|
-
|
|
45
|
-
async def query(self, query):
|
|
46
|
-
results = set()
|
|
47
|
-
cursor = ""
|
|
48
|
-
for i in range(self.max_pages):
|
|
49
|
-
url = f"{self.base_url}/v2/certificates/search"
|
|
50
|
-
json_data = {
|
|
51
|
-
"q": f"names: {query}",
|
|
52
|
-
"per_page": 100,
|
|
53
|
-
}
|
|
54
|
-
if cursor:
|
|
55
|
-
json_data.update({"cursor": cursor})
|
|
56
|
-
resp = await self.api_request(
|
|
57
|
-
url,
|
|
58
|
-
method="POST",
|
|
59
|
-
json=json_data,
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
if resp is None:
|
|
63
|
-
break
|
|
64
|
-
|
|
65
|
-
try:
|
|
66
|
-
d = resp.json()
|
|
67
|
-
except Exception as e:
|
|
68
|
-
self.warning(f"Failed to parse JSON from {url} (response: {resp}): {e}")
|
|
69
|
-
|
|
70
|
-
if resp.status_code < 200 or resp.status_code >= 400:
|
|
71
|
-
if isinstance(d, dict):
|
|
72
|
-
error = d.get("error", "")
|
|
73
|
-
if error:
|
|
74
|
-
self.warning(error)
|
|
75
|
-
self.verbose(f'Non-200 Status code: {resp.status_code} for query "{query}", page #{i + 1}')
|
|
76
|
-
self.debug(f"Response: {resp.text}")
|
|
77
|
-
break
|
|
78
|
-
else:
|
|
79
|
-
if d is None:
|
|
80
|
-
break
|
|
81
|
-
elif not isinstance(d, dict):
|
|
82
|
-
break
|
|
83
|
-
status = d.get("status", "").lower()
|
|
84
|
-
result = d.get("result", {})
|
|
85
|
-
hits = result.get("hits", [])
|
|
86
|
-
if status != "ok" or not hits:
|
|
87
|
-
break
|
|
88
|
-
|
|
89
|
-
for h in hits:
|
|
90
|
-
names = h.get("names", [])
|
|
91
|
-
for n in names:
|
|
92
|
-
results.add(n.strip(".*").lower())
|
|
93
|
-
|
|
94
|
-
cursor = result.get("links", {}).get("next", "")
|
|
95
|
-
if not cursor:
|
|
96
|
-
break
|
|
97
|
-
|
|
98
|
-
return results
|
bbot/modules/gitlab.py
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
from bbot.modules.base import BaseModule
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class gitlab(BaseModule):
|
|
5
|
-
watched_events = ["HTTP_RESPONSE", "TECHNOLOGY", "SOCIAL"]
|
|
6
|
-
produced_events = ["TECHNOLOGY", "SOCIAL", "CODE_REPOSITORY", "FINDING"]
|
|
7
|
-
flags = ["active", "safe", "code-enum"]
|
|
8
|
-
meta = {
|
|
9
|
-
"description": "Detect GitLab instances and query them for repositories",
|
|
10
|
-
"created_date": "2024-03-11",
|
|
11
|
-
"author": "@TheTechromancer",
|
|
12
|
-
}
|
|
13
|
-
options = {"api_key": ""}
|
|
14
|
-
options_desc = {"api_key": "Gitlab access token"}
|
|
15
|
-
|
|
16
|
-
scope_distance_modifier = 2
|
|
17
|
-
|
|
18
|
-
async def setup(self):
|
|
19
|
-
await self.require_api_key()
|
|
20
|
-
return True
|
|
21
|
-
|
|
22
|
-
async def filter_event(self, event):
|
|
23
|
-
# only accept out-of-scope SOCIAL events
|
|
24
|
-
if event.type == "HTTP_RESPONSE":
|
|
25
|
-
if event.scope_distance > self.scan.scope_search_distance:
|
|
26
|
-
return False, "event is out of scope distance"
|
|
27
|
-
elif event.type == "TECHNOLOGY":
|
|
28
|
-
if not event.data["technology"].lower().startswith("gitlab"):
|
|
29
|
-
return False, "technology is not gitlab"
|
|
30
|
-
if not self.helpers.is_ip(event.host) and self.helpers.tldextract(event.host).domain == "gitlab":
|
|
31
|
-
return False, "gitlab instance is not self-hosted"
|
|
32
|
-
elif event.type == "SOCIAL":
|
|
33
|
-
if event.data["platform"] != "gitlab":
|
|
34
|
-
return False, "platform is not gitlab"
|
|
35
|
-
return True
|
|
36
|
-
|
|
37
|
-
async def handle_event(self, event):
|
|
38
|
-
if event.type == "HTTP_RESPONSE":
|
|
39
|
-
await self.handle_http_response(event)
|
|
40
|
-
elif event.type == "TECHNOLOGY":
|
|
41
|
-
await self.handle_technology(event)
|
|
42
|
-
elif event.type == "SOCIAL":
|
|
43
|
-
await self.handle_social(event)
|
|
44
|
-
|
|
45
|
-
async def handle_http_response(self, event):
|
|
46
|
-
# identify gitlab instances from HTTP responses
|
|
47
|
-
# HTTP_RESPONSE --> TECHNOLOGY
|
|
48
|
-
# HTTP_RESPONSE --> FINDING
|
|
49
|
-
headers = event.data.get("header", {})
|
|
50
|
-
if "x_gitlab_meta" in headers:
|
|
51
|
-
url = event.parsed_url._replace(path="/").geturl()
|
|
52
|
-
await self.emit_event(
|
|
53
|
-
{"host": str(event.host), "technology": "GitLab", "url": url},
|
|
54
|
-
"TECHNOLOGY",
|
|
55
|
-
parent=event,
|
|
56
|
-
context=f"{{module}} detected {{event.type}}: GitLab at {url}",
|
|
57
|
-
)
|
|
58
|
-
description = f"GitLab server at {event.host}"
|
|
59
|
-
await self.emit_event(
|
|
60
|
-
{"host": str(event.host), "description": description},
|
|
61
|
-
"FINDING",
|
|
62
|
-
parent=event,
|
|
63
|
-
context=f"{{module}} detected {{event.type}}: {description}",
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
async def handle_technology(self, event):
|
|
67
|
-
# retrieve gitlab groups from gitlab instances
|
|
68
|
-
# TECHNOLOGY --> SOCIAL
|
|
69
|
-
# TECHNOLOGY --> URL
|
|
70
|
-
# TECHNOLOGY --> CODE_REPOSITORY
|
|
71
|
-
base_url = self.get_base_url(event)
|
|
72
|
-
projects_url = self.helpers.urljoin(base_url, "api/v4/projects?simple=true")
|
|
73
|
-
await self.handle_projects_url(projects_url, event)
|
|
74
|
-
groups_url = self.helpers.urljoin(base_url, "api/v4/groups?simple=true")
|
|
75
|
-
await self.handle_groups_url(groups_url, event)
|
|
76
|
-
|
|
77
|
-
async def handle_social(self, event):
|
|
78
|
-
# retrieve repositories from gitlab user
|
|
79
|
-
# SOCIAL --> CODE_REPOSITORY
|
|
80
|
-
# SOCIAL --> SOCIAL
|
|
81
|
-
username = event.data.get("profile_name", "")
|
|
82
|
-
if not username:
|
|
83
|
-
return
|
|
84
|
-
base_url = self.get_base_url(event)
|
|
85
|
-
urls = [
|
|
86
|
-
# group
|
|
87
|
-
self.helpers.urljoin(base_url, f"api/v4/users/{username}/projects?simple=true"),
|
|
88
|
-
# user
|
|
89
|
-
self.helpers.urljoin(base_url, f"api/v4/groups/{username}/projects?simple=true"),
|
|
90
|
-
]
|
|
91
|
-
for url in urls:
|
|
92
|
-
await self.handle_projects_url(url, event)
|
|
93
|
-
|
|
94
|
-
async def handle_projects_url(self, projects_url, event):
|
|
95
|
-
for project in await self.gitlab_json_request(projects_url):
|
|
96
|
-
project_url = project.get("web_url", "")
|
|
97
|
-
if project_url:
|
|
98
|
-
code_event = self.make_event({"url": project_url}, "CODE_REPOSITORY", tags="git", parent=event)
|
|
99
|
-
await self.emit_event(
|
|
100
|
-
code_event, context=f"{{module}} enumerated projects and found {{event.type}} at {project_url}"
|
|
101
|
-
)
|
|
102
|
-
namespace = project.get("namespace", {})
|
|
103
|
-
if namespace:
|
|
104
|
-
await self.handle_namespace(namespace, event)
|
|
105
|
-
|
|
106
|
-
async def handle_groups_url(self, groups_url, event):
|
|
107
|
-
for group in await self.gitlab_json_request(groups_url):
|
|
108
|
-
await self.handle_namespace(group, event)
|
|
109
|
-
|
|
110
|
-
async def gitlab_json_request(self, url):
|
|
111
|
-
response = await self.api_request(url)
|
|
112
|
-
if response is not None:
|
|
113
|
-
try:
|
|
114
|
-
json = response.json()
|
|
115
|
-
except Exception:
|
|
116
|
-
return []
|
|
117
|
-
if json and isinstance(json, list):
|
|
118
|
-
return json
|
|
119
|
-
return []
|
|
120
|
-
|
|
121
|
-
async def handle_namespace(self, namespace, event):
|
|
122
|
-
namespace_name = namespace.get("path", "")
|
|
123
|
-
namespace_url = namespace.get("web_url", "")
|
|
124
|
-
namespace_path = namespace.get("full_path", "")
|
|
125
|
-
if namespace_name and namespace_url and namespace_path:
|
|
126
|
-
namespace_url = self.helpers.parse_url(namespace_url)._replace(path=f"/{namespace_path}").geturl()
|
|
127
|
-
social_event = self.make_event(
|
|
128
|
-
{"platform": "gitlab", "profile_name": namespace_path, "url": namespace_url},
|
|
129
|
-
"SOCIAL",
|
|
130
|
-
parent=event,
|
|
131
|
-
)
|
|
132
|
-
await self.emit_event(
|
|
133
|
-
social_event,
|
|
134
|
-
context=f'{{module}} found GitLab namespace ({{event.type}}) "{namespace_name}" at {namespace_url}',
|
|
135
|
-
)
|
|
136
|
-
|
|
137
|
-
def get_base_url(self, event):
|
|
138
|
-
base_url = event.data.get("url", "")
|
|
139
|
-
if not base_url:
|
|
140
|
-
base_url = f"https://{event.host}"
|
|
141
|
-
return self.helpers.urlparse(base_url)._replace(path="/").geturl()
|
bbot/modules/zoomeye.py
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
from bbot.modules.templates.subdomain_enum import subdomain_enum_apikey
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class zoomeye(subdomain_enum_apikey):
|
|
5
|
-
watched_events = ["DNS_NAME"]
|
|
6
|
-
produced_events = ["DNS_NAME"]
|
|
7
|
-
flags = ["affiliates", "subdomain-enum", "passive", "safe"]
|
|
8
|
-
meta = {
|
|
9
|
-
"description": "Query ZoomEye's API for subdomains",
|
|
10
|
-
"created_date": "2022-08-03",
|
|
11
|
-
"author": "@TheTechromancer",
|
|
12
|
-
"auth_required": True,
|
|
13
|
-
}
|
|
14
|
-
options = {"api_key": "", "max_pages": 20, "include_related": False}
|
|
15
|
-
options_desc = {
|
|
16
|
-
"api_key": "ZoomEye API key",
|
|
17
|
-
"max_pages": "How many pages of results to fetch",
|
|
18
|
-
"include_related": "Include domains which may be related to the target",
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
base_url = "https://api.zoomeye.hk"
|
|
22
|
-
|
|
23
|
-
async def setup(self):
|
|
24
|
-
self.max_pages = self.config.get("max_pages", 20)
|
|
25
|
-
self.include_related = self.config.get("include_related", False)
|
|
26
|
-
return await super().setup()
|
|
27
|
-
|
|
28
|
-
def prepare_api_request(self, url, kwargs):
|
|
29
|
-
kwargs["headers"]["API-KEY"] = self.api_key
|
|
30
|
-
return url, kwargs
|
|
31
|
-
|
|
32
|
-
async def ping(self):
|
|
33
|
-
url = f"{self.base_url}/resources-info"
|
|
34
|
-
r = await self.api_request(url)
|
|
35
|
-
assert int(r.json()["quota_info"]["remain_total_quota"]) > 0, "No quota remaining"
|
|
36
|
-
|
|
37
|
-
async def handle_event(self, event):
|
|
38
|
-
query = self.make_query(event)
|
|
39
|
-
results = await self.query(query)
|
|
40
|
-
if results:
|
|
41
|
-
for hostname in results:
|
|
42
|
-
if hostname == event:
|
|
43
|
-
continue
|
|
44
|
-
tags = []
|
|
45
|
-
if not hostname.endswith(f".{query}"):
|
|
46
|
-
tags = ["affiliate"]
|
|
47
|
-
await self.emit_event(
|
|
48
|
-
hostname,
|
|
49
|
-
"DNS_NAME",
|
|
50
|
-
event,
|
|
51
|
-
tags=tags,
|
|
52
|
-
context=f'{{module}} searched ZoomEye API for "{query}" and found {{event.type}}: {{event.data}}',
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
async def query(self, query):
|
|
56
|
-
results = set()
|
|
57
|
-
query_type = 0 if self.include_related else 1
|
|
58
|
-
url = f"{self.base_url}/domain/search?q={self.helpers.quote(query)}&type={query_type}&page=" + "{page}"
|
|
59
|
-
i = 0
|
|
60
|
-
agen = self.api_page_iter(url)
|
|
61
|
-
try:
|
|
62
|
-
async for j in agen:
|
|
63
|
-
r = list(await self.parse_results(j))
|
|
64
|
-
if r:
|
|
65
|
-
results.update(set(r))
|
|
66
|
-
if not r or i >= (self.max_pages - 1):
|
|
67
|
-
break
|
|
68
|
-
i += 1
|
|
69
|
-
finally:
|
|
70
|
-
await agen.aclose()
|
|
71
|
-
return results
|
|
72
|
-
|
|
73
|
-
async def parse_results(self, r):
|
|
74
|
-
results = set()
|
|
75
|
-
for entry in r.get("list", []):
|
|
76
|
-
results.add(entry["name"])
|
|
77
|
-
return results
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
from .base import ModuleTestBase
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class TestBinaryEdge(ModuleTestBase):
|
|
5
|
-
config_overrides = {"modules": {"binaryedge": {"api_key": "asdf"}}}
|
|
6
|
-
|
|
7
|
-
async def setup_before_prep(self, module_test):
|
|
8
|
-
module_test.httpx_mock.add_response(
|
|
9
|
-
url="https://api.binaryedge.io/v2/query/domains/subdomain/blacklanternsecurity.com",
|
|
10
|
-
match_headers={"X-Key": "asdf"},
|
|
11
|
-
json={
|
|
12
|
-
"query": "blacklanternsecurity.com",
|
|
13
|
-
"page": 1,
|
|
14
|
-
"pagesize": 100,
|
|
15
|
-
"total": 1,
|
|
16
|
-
"events": [
|
|
17
|
-
"asdf.blacklanternsecurity.com",
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
)
|
|
21
|
-
module_test.httpx_mock.add_response(
|
|
22
|
-
url="https://api.binaryedge.io/v2/user/subscription",
|
|
23
|
-
match_headers={"X-Key": "asdf"},
|
|
24
|
-
json={
|
|
25
|
-
"subscription": {"name": "Free"},
|
|
26
|
-
"end_date": "2023-06-17",
|
|
27
|
-
"requests_left": 249,
|
|
28
|
-
"requests_plan": 250,
|
|
29
|
-
},
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
def check(self, module_test, events):
|
|
33
|
-
assert any(e.data == "asdf.blacklanternsecurity.com" for e in events), "Failed to detect subdomain"
|