Codebase list altdns / a2f6804
Import upstream version 1.0.2 Kali Janitor 1 year, 5 months ago
13 changed file(s) with 143 addition(s) and 322 deletion(s). Raw diff Collapse all Expand all
+0
-73
LICENSE less more
0 Apache License, Version 2.0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
1
2 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
3
4 1. Definitions.
5
6 "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
7
8 "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
9
10 "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
11
12 "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
13
14 "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
15
16 "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
17
18 "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
19
20 "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
21
22 "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
23
24 "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
25
26 2. Grant of Copyright License.
27
28 Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
29
30 3. Grant of Patent License.
31
32 Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
33
34 4. Redistribution.
35
36 You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
37
38 You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
39
40 5. Submission of Contributions.
41
42 Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
43
44 6. Trademarks.
45
46 This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
47
48 7. Disclaimer of Warranty.
49
50 Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
51
52 8. Limitation of Liability.
53
54 In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
55
56 9. Accepting Warranty or Additional Liability.
57
58 While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
59
60 END OF TERMS AND CONDITIONS
61
62 APPENDIX: How to apply the Apache License to your work
63
64 To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
65
66 Copyright 2016 Shubham Shah (infosec-au)
67
68 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
69
70 http://www.apache.org/licenses/LICENSE-2.0
71
72 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
0 Metadata-Version: 2.1
1 Name: py-altdns
2 Version: 1.0.2
3 Summary: Generates permutations, alterations and mutations of subdomains and then resolves them.
4 Home-page: https://github.com/infosec-au/altdns
5 Author: Shubham Shah
6 Author-email: [email protected]
7 License: UNKNOWN
8 Description: # Altdns - Subdomain discovery through alterations and permutations
9
10 Altdns is a DNS recon tool that allows for the discovery of subdomains that conform to patterns. Altdns takes in words that could be present in subdomains under a domain (such as test, dev, staging) as well as takes in a list of subdomains that you know of.
11
12 From these two lists that are provided as input to altdns, the tool then generates a _massive_ output of "altered" or "mutated" potential subdomains that could be present. It saves this output so that it can then be used by your favourite DNS bruteforcing tool.
13
14 Alternatively, the `-r` flag can be passed to altdns so that once this output is generated, the tool can then resolve these subdomains (multi-threaded) and save the results to a file.
15
16 Altdns works best with large datasets. Having an initial dataset of 200 or more subdomains should churn out some valid subdomains via the alterations generated.
17
18 Further information on attack methodology and this tool release can be found here: https://docs.google.com/presentation/d/1PCnjzCeklOeGMoWiE2IUzlRGOBxNp8K5hLQuvBNzrFY/
19
20 # Installation
21
22 `pip install py-altdns`
23
24 # Usage
25
26 `# altdns -i subdomains.txt -o data_output -w words.txt -r -s results_output.txt`
27
28 - `subdomains.txt` contains the known subdomains for an organization
29 - `data_output` is a file that will contain the _massive_ list of altered and permuted subdomains
30 - `words.txt` is your list of words that you'd like to permute your current subdomains with (i.e. `admin`, `staging`, `dev`, `qa`) - one word per line
31 - the `-r` command resolves each generated, permuted subdomain
32 - the `-s` command tells altdns where to save the results of the resolved permuted subdomains. `results_output.txt` will contain the final list of permuted subdomains found that are valid and have a DNS record.
33 - the `-t` command limits how many threads the resolver will use simultaneously
34 - `-d 1.2.3.4` overrides the system default DNS resolver and will use the specified IP address as the resolving server. Setting this to the authoritative DNS server of the target domain *may* increase resolution performance
35
36 # Screenshots
37
38 <img src="https://i.imgur.com/fkfZqkl.png" width="600px"/>
39
40 <img src="https://i.imgur.com/Jyfue26.png" width="600px"/>
41
42 # Show some love
43
44 If this tool was useful at all to you during DNS recon stages - we'd love to know. Any suggestions or ideas for this tool are welcome - just tweet [@infosec_au](https://twitter.com/infosec_au) or [@nnwakelam](https://twitter.com/nnwakelam) and we'll work on it.
45
46 Platform: UNKNOWN
47 Classifier: Programming Language :: Python :: 3.9
48 Classifier: License :: OSI Approved :: Apache Software License
49 Classifier: Operating System :: OS Independent
50 Classifier: Topic :: Security
51 Description-Content-Type: text/markdown
66 import time
77 import datetime
88 from threading import Lock
9 from queue import Queue as Queue
9 try:
10 import Queue as queue
11 except ImportError:
12 import queue as queue
1013
1114 import tldextract
1215 from tldextract.tldextract import LOG
4144 # save full URL as line in file
4245 full_url = "{0}.{1}.{2}\n".format(
4346 actual_sub, ext.domain, ext.suffix)
44 if actual_sub[-1:] is not ".":
47 if actual_sub[-1:] != ".":
4548 write_domain(args, wp, full_url)
4649 current_sub.pop(index)
4750 current_sub.append(word.strip())
98101 # save full URL as line in file
99102 full_url = "{0}.{1}.{2}\n".format(
100103 actual_sub, ext.domain, ext.suffix)
101 if len(current_sub[0]) > 0 and actual_sub[:1] is not "-":
104 if len(current_sub[0]) > 0 and actual_sub[:1] != "-":
102105 write_domain(args, wp, full_url)
103106 current_sub[index] = original_sub
104107 # second dash alteration
108111 # save second full URL as line in file
109112 full_url = "{0}.{1}.{2}\n".format(
110113 actual_sub, ext.domain, ext.suffix)
111 if actual_sub[-1:] is not "-":
114 if actual_sub[-1:] != "-":
112115 write_domain(args, wp, full_url)
113116 current_sub[index] = original_sub
114117
164167 result = list()
165168 result.append(target)
166169 resolver = dns.resolver.Resolver()
167 if(resolverName is not None): #if a DNS server has been manually specified
170 if(resolverName != None): #if a DNS server has been manually specified
168171 resolver.nameservers = [resolverName]
169172 try:
170173 for rdata in resolver.query(final_hostname, 'CNAME'):
171174 result.append(rdata.target)
172175 except:
173176 pass
174 if len(result) is 1:
177 if len(result) == 1:
175178 try:
176179 A = resolver.query(final_hostname, "A")
177180 if len(A) > 0:
244247
245248
246249 def main():
247 q = Queue()
250 q = queue.Queue()
248251
249252 parser = argparse.ArgumentParser()
250253 parser.add_argument("-i", "--input",
290293 alteration_words = get_alteration_words(args.wordlist)
291294
292295 # if we should remove existing, save the output to a temporary file
293 if args.ignore_existing is True:
296 if args.ignore_existing == True:
294297 args.output_tmp = args.output + '.tmp'
295298 else:
296299 args.output_tmp = args.output
300303
301304 insert_all_indexes(args, alteration_words)
302305 insert_dash_subdomains(args, alteration_words)
303 if args.add_number_suffix is True:
306 if args.add_number_suffix == True:
304307 insert_number_suffix_subdomains(args, alteration_words)
305308 join_words_subdomains(args, alteration_words)
306309
307310 threadhandler = []
308311
309312 # Removes already existing + dupes from output
310 if args.ignore_existing is True:
313 if args.ignore_existing == True:
311314 remove_existing(args)
312315 else:
313316 remove_duplicates(args)
0 Metadata-Version: 2.1
1 Name: py-altdns
2 Version: 1.0.2
3 Summary: Generates permutations, alterations and mutations of subdomains and then resolves them.
4 Home-page: https://github.com/infosec-au/altdns
5 Author: Shubham Shah
6 Author-email: [email protected]
7 License: UNKNOWN
8 Description: # Altdns - Subdomain discovery through alterations and permutations
9
10 Altdns is a DNS recon tool that allows for the discovery of subdomains that conform to patterns. Altdns takes in words that could be present in subdomains under a domain (such as test, dev, staging) as well as takes in a list of subdomains that you know of.
11
12 From these two lists that are provided as input to altdns, the tool then generates a _massive_ output of "altered" or "mutated" potential subdomains that could be present. It saves this output so that it can then be used by your favourite DNS bruteforcing tool.
13
14 Alternatively, the `-r` flag can be passed to altdns so that once this output is generated, the tool can then resolve these subdomains (multi-threaded) and save the results to a file.
15
16 Altdns works best with large datasets. Having an initial dataset of 200 or more subdomains should churn out some valid subdomains via the alterations generated.
17
18 Further information on attack methodology and this tool release can be found here: https://docs.google.com/presentation/d/1PCnjzCeklOeGMoWiE2IUzlRGOBxNp8K5hLQuvBNzrFY/
19
20 # Installation
21
22 `pip install py-altdns`
23
24 # Usage
25
26 `# altdns -i subdomains.txt -o data_output -w words.txt -r -s results_output.txt`
27
28 - `subdomains.txt` contains the known subdomains for an organization
29 - `data_output` is a file that will contain the _massive_ list of altered and permuted subdomains
30 - `words.txt` is your list of words that you'd like to permute your current subdomains with (i.e. `admin`, `staging`, `dev`, `qa`) - one word per line
31 - the `-r` command resolves each generated, permuted subdomain
32 - the `-s` command tells altdns where to save the results of the resolved permuted subdomains. `results_output.txt` will contain the final list of permuted subdomains found that are valid and have a DNS record.
33 - the `-t` command limits how many threads the resolver will use simultaneously
34 - `-d 1.2.3.4` overrides the system default DNS resolver and will use the specified IP address as the resolving server. Setting this to the authoritative DNS server of the target domain *may* increase resolution performance
35
36 # Screenshots
37
38 <img src="https://i.imgur.com/fkfZqkl.png" width="600px"/>
39
40 <img src="https://i.imgur.com/Jyfue26.png" width="600px"/>
41
42 # Show some love
43
44 If this tool was useful at all to you during DNS recon stages - we'd love to know. Any suggestions or ideas for this tool are welcome - just tweet [@infosec_au](https://twitter.com/infosec_au) or [@nnwakelam](https://twitter.com/nnwakelam) and we'll work on it.
45
46 Platform: UNKNOWN
47 Classifier: Programming Language :: Python :: 3.9
48 Classifier: License :: OSI Approved :: Apache Software License
49 Classifier: Operating System :: OS Independent
50 Classifier: Topic :: Security
51 Description-Content-Type: text/markdown
0 README.md
1 setup.py
2 altdns/__init__.py
3 altdns/__main__.py
4 py_altdns.egg-info/PKG-INFO
5 py_altdns.egg-info/SOURCES.txt
6 py_altdns.egg-info/dependency_links.txt
7 py_altdns.egg-info/entry_points.txt
8 py_altdns.egg-info/requires.txt
9 py_altdns.egg-info/top_level.txt
0 [console_scripts]
1 altdns = altdns.__main__:main
2
0 tldextract
1 argparse
2 termcolor
3 dnspython
+0
-4
requirements.txt less more
0 tldextract
1 argparse
2 termcolor
3 dnspython
0 [egg_info]
1 tag_build =
2 tag_date = 0
3
44
55 setuptools.setup(
66 name="py-altdns",
7 version="1.0.0",
7 version="1.0.2",
88 author="Shubham Shah",
99 author_email="[email protected]",
1010 description="Generates permutations, alterations and mutations of subdomains and then resolves them.",
1919 },
2020 install_requires=["tldextract","argparse","termcolor","dnspython"],
2121 classifiers=[
22 "Programming Language :: Python :: 2.7",
22 "Programming Language :: Python :: 3.9",
2323 "License :: OSI Approved :: Apache Software License",
2424 "Operating System :: OS Independent",
2525 "Topic :: Security"
2626 ],
27 )
27 )
+0
-232
words.txt less more
0 1
1 10
2 11
3 12
4 13
5 14
6 15
7 16
8 17
9 18
10 19
11 2
12 20
13 2009
14 2010
15 2011
16 2012
17 2013
18 2014
19 2015
20 2016
21 2017
22 2018
23 2019
24 3
25 4
26 5
27 6
28 7
29 8
30 9
31 a
32 acc
33 accept
34 accounts
35 admin
36 admin1
37 administrator
38 akali
39 akamai
40 alpha
41 alt
42 america
43 analytics
44 api
45 api1
46 api-docs
47 apollo
48 april
49 aws
50 b
51 backend
52 beta
53 billing
54 boards
55 box
56 brand
57 brasil
58 brazil
59 bucket
60 bucky
61 c
62 cdn
63 cf
64 chef
65 ci
66 client
67 cloudfront
68 cms
69 cms1
70 cn
71 com
72 confluence
73 container
74 control
75 data
76 dec
77 demo
78 dev
79 dev1
80 developer
81 devops
82 docker
83 docs
84 drop
85 edge
86 elasticbeanstalk
87 elb
88 email
89 eng
90 engima
91 engine
92 engineering
93 eu
94 europe
95 europewest
96 euw
97 euwe
98 evelynn
99 events
100 feb
101 fet
102 firewall
103 forms
104 forum
105 frontpage
106 fw
107 games
108 germany
109 gh
110 ghcpi
111 git
112 github
113 global
114 hkg
115 hw
116 hwcdn
117 i
118 ids
119 int
120 internal
121 jenkins
122 jinx
123 july
124 june
125 kor
126 korea
127 kr
128 lan
129 las
130 latin
131 latinamerica
132 lax
133 lax1
134 lb
135 loadbalancer
136 login
137 machine
138 mail
139 march
140 merch
141 mirror
142 na
143 nautilus
144 net
145 netherlands
146 nginx
147 nl
148 node
149 northamerica
150 nov
151 oceania
152 oct
153 ops
154 org
155 origin
156 page
157 pantheon
158 pass
159 pay
160 payment
161 pc
162 php
163 pl
164 poland
165 preferences
166 priv
167 private
168 prod
169 production
170 profile
171 profiles
172 promo
173 promotion
174 proxy
175 redirector
176 region
177 repo
178 repository
179 reset
180 restrict
181 restricted
182 reviews
183 s
184 s3
185 sandbox
186 search
187 secure
188 security
189 sept
190 server
191 service
192 singed
193 skins
194 spring
195 ssl
196 staff
197 stage
198 stage1
199 staging
200 static
201 support
202 swagger
203 system
204 t
205 train
206 training
207 team
208 test
209 test1
210 testbed
211 testing
212 testing1
213 tomcat
214 tpe
215 tr
216 trial
217 tur
218 turk
219 turkey
220 twitch
221 uat
222 v1
223 v2
224 vi
225 vpn
226 w3
227 web
228 web1
229 webapp
230 westeurope
231 z