├── .gitignore
├── LICENSE
├── README.md
├── blacklist.txt
├── chomp-scan.sh
├── config
├── install.sh
├── interesting.txt
├── requirements2.txt
├── requirements3.txt
├── resolvers.txt
├── screenshots
├── screenshot01.png
├── screenshot02.png
├── screenshot03.png
├── screenshot04.png
├── screenshot05.png
├── screenshot06.png
└── screenshot07.png
└── wordlists
├── altdns-words.txt
├── big.txt
├── haddix-seclists-combined.txt
├── haddix_content_discovery_all.txt
├── huge-200k.txt
├── provider.json
├── raft-large-combined.txt
├── seclists-combined.txt
├── sortedcombined-knock-dnsrecon-fierce-reconng.txt
└── subdomains-top1mil-20000.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | config-test
2 | tesla*
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Chomp Scan
2 | 
3 | 
4 | 
5 | 
6 | 
7 |
8 | A scripted pipeline of tools to simplify the bug bounty/penetration test reconnaissance phase, so you can focus on chomping bugs.
9 |
10 | 
11 |
12 | *If you've found any bugs using this tool, please let me know!*
13 |
14 | ### Scope
15 | Chomp Scan is a Bash script that chains together the fastest and most effective tools (in my opinion/experience) for doing the long and sometimes tedious process of recon. No more looking for word lists and trying to remember when you started a scan and where the output is. Chomp Scan can focus on a list of potentially interesting subdomains, letting you save time and focus on high-value targets. It can even notify you via Notica when it's done running!
16 |
17 | Chomp Scan now integrates [Notica](https://notica.us), which allows you to receive a notification when the script finishes. Simply visit Notica and get a unique URL parameter, e.g. notica.us/?xxxxxxxx. Pass the parameter to Chomp Scan via the `-n` flag, keep the Notica page open in a browser tab on your computer or phone, and you will receive a message when Chomp Scan has finished running. No more constantly checking/forgetting to check those long running scans.
18 |
19 | A list of interesting words is included, such as *dev, test, uat, staging,* etc., and domains containing those terms are flagged. This way you can focus on the interesting domains first if you wish. This list can be customized to suit your own needs, or replaced with a different file via the `-X` flag.
20 |
21 | Chomp Scan runs in multiple modes. A new [Configuration File](https://github.com/SolomonSklash/chomp-scan/wiki/Configuration-File) is the recommended way to run scans, as it allows the most granular control of tools and settings. A standard CLI mode is included, which functions the same as any other CLI tool. A guided interactive mode is available, as well as a non-interactive mode, useful if you do not want to lookup parameters or worry about setting multiple arguments.
22 |
23 | **New** Chomp Scan now includes [rescope](https://github.com/root4loot/rescope). Rescope will parse all resolved domains discovered by Chomp Scan and generate a JSON scope file that can be imported into Burp Suite. This option can be enabled by setting the `ENABLE_RESCOPE` variable in the configuration file or by passing the `-r` flag via the command line.
24 |
25 | Please see the [Wiki](https://github.com/SolomonSklash/chomp-scan/wiki) for detailed documentation.
26 |
27 | **Note: Chomp Scan is in active development, and new/different tools will be added as I come across them. Pull requests and comments welcome!**
28 |
29 | ### Scanning Phases
30 |
31 | #### Subdomain Discovery (3 different sized wordlists)
32 | * [dnscan](https://github.com/rbsec/dnscan)
33 | * [subfinder](https://github.com/subfinder/subfinder)
34 | * [sublist3r](https://github.com/aboul3la/Sublist3r)
35 | * [knockpy](https://github.com/SolomonSklash/knock) (forked from the original [here](https://github.com/guelfoweb/knock))
36 | * [amass](https://github.com/OWASP/Amass)
37 | * [massdns](https://github.com/blechschmidt/massdns) + [goaltdns](https://github.com/subfinder/goaltdns)
38 |
39 | #### Screenshots (optional)
40 | * [aquatone](https://github.com/michenriksen/aquatone)
41 |
42 | #### Port Scanning (optional)
43 | * [masscan](https://github.com/robertdavidgraham/masscan) and/or [nmap](https://www.nmap.org)
44 | * nmap output styled with [nmap-bootstrap-xsl](https://github.com/honze-net/nmap-bootstrap-xsl/)
45 |
46 | #### Information Gathering (optional) (4 different sized wordlists)
47 | * [subjack](https://github.com/haccer/subjack)
48 | * [CORStest](https://github.com/RUB-NDS/CORStest)
49 | * [S3Scanner](https://github.com/sa7mon/S3Scanner)
50 | * [bfac](https://github.com/mazen160/bfac)
51 | * [whatweb](https://github.com/urbanadventurer/whatweb/)
52 | * [wafw00f](https://github.com/EnableSecurity/wafw00f)
53 | * [httprobe](https://github.com/tomnomnom/httprobe)
54 | * [nikto](https://github.com/sullo/nikto)
55 |
56 | #### Content Discovery (optional) (4 different sized wordlists)
57 | * [inception](https://github.com/proabiral/inception)
58 | * [waybackurls](https://github.com/tomnomnom/waybackurls)
59 | * [ffuf](https://github.com/ffuf/ffuf)
60 | * [gobuster](https://github.com/OJ/gobuster)
61 | * [dirsearch](https://github.com/maurosoria/dirsearch)
62 |
63 | ### Configuration File
64 | Chomp Scan now features a configuration file option that provides more granular control over which tools are run and is less cumbersome than passing a large number of CLI arguments. It is the recommended way to run Chomp Scan. It can be used by passing the `-L` flag. An [example config](https://github.com/SolomonSklash/chomp-scan/blob/master/config) file is included in this repo as a template, and complete config file details are available at the [Configuration File](https://github.com/SolomonSklash/chomp-scan/wiki/Configuration-File) wiki page.
65 |
66 | ### Wordlists
67 |
68 | A variety of wordlists are used, both for subdomain bruteforcing and content discovery. Daniel Miessler's [Seclists](https://github.com/danielmiessler/SecLists) are used heavily, as well as Jason Haddix's [lists](https://gist.github.com/jhaddix). Different wordlists can be used by passing in a custom wordlist or using one of the built-in named argument lists. See the [Wordlist](https://github.com/SolomonSklash/chomp-scan/wiki/Wordlists) wiki page for more details.
69 |
70 | ### Installation
71 | Clone this repo and run the included `installer.sh` script, optionally including a custom file path to install necessary tools to. Make sure to run `source ~/.profile` in your terminal after running the installer in order to add the Go binary path to your $PATH variable. Then run Chomp Scan. If you are using zsh, fish, or some other shell, make sure that `~/go/bin` is in your path. For more details, see the [Installation](https://github.com/SolomonSklash/chomp-scan/wiki/Installation) wiki page.
72 |
73 | TLDR: `root@kali:~/chomp-scan# ./installer.sh [/some/optional/install/path]`
74 |
75 | ### Usage
76 | For complete usage information, see the [Usage](https://github.com/SolomonSklash/chomp-scan/wiki/Usage) page of the wiki. *Please note that the configuration is the recommended and most powerful way to run Chomp Scan.*
77 |
78 | Chomp Scan always runs subdomain enumeration, thus a domain is required via the `-u` flag. The domain should not contain a scheme, e.g. http:// or https://. By default, HTTPS is always used. This can be changed to HTTP by passing the `-H` flag. A wordlist is optional, and if one is not provided the built-in short list (20k words) is used.
79 |
80 | Other scan phases are optional. Content discovery can take an optional wordlist, otherwise it defaults to the built-in short (22k words) list.
81 |
82 | The final results of the scan are stored in three text files in the output directory. All unique domains that are found, whether they resolve or not, are stored in `all_discovered_domains.txt`, and all unique IPs that are discovered are stored in `all_discovered_ips.txt`. All domains that resolve to an IP are stored in `all_resolved_domains.txt`. As of v4.1 these domains are used to generate the interesting domain list and the all domains list, which can then be used for content discovery and information gathering.
83 | ```
84 | chomp-scan.sh -u example.com -a d short -cC large -p -o path/to/directory
85 |
86 | Usage of Chomp Scan:
87 | -u domain
88 | (required) Domain name to scan. This should not include a scheme, e.g. https:// or http://.
89 | -L config-file
90 | (optional) The path to a config file. This can be used to provide more granular control over what tools are run.
91 | -d wordlist
92 | (optional) The wordlist to use for subdomain enumeration. Three built-in lists, short, long, and huge can be used, as well as the path to a custom wordlist. The default is short.
93 | -c
94 | (optional) Enable content discovery phase. The wordlist for this option defaults to short if not provided.
95 | -C wordlist
96 | (optional) The wordlist to use for content discovery. Five built-in lists, small, medium, large, xl, and xxl can be used, as well as the path to a custom wordlist. The default is small.
97 | -P file-path
98 | (optional) Set a custom directory for the location of tools. The path must exist and the directory must contain all needed tools.
99 | -s
100 | (optional) Enable screenshots using Aquatone.
101 | -i
102 | (optional) Enable information gathering phase, using subjack, CORStest, S3Scanner, bfac, whatweb, wafw00f, httprobe, and nikto.
103 | -p
104 | (optional) Enable portscanning phase, using masscan (run as root) and nmap.
105 | -I
106 | (optional) Enable interactive mode. This allows you to select certain tool options and inputs interactively. This cannot be run with -D.
107 | -D
108 | (optional) Enable default non-interactive mode. This mode uses pre-selected defaults and requires no user interaction or options. This cannot be run with -I.
109 | Options: Subdomain enumeration wordlist: short.
110 | Content discovery wordlist: small.
111 | Aquatone screenshots: yes.
112 | Portscanning: yes.
113 | Information gathering: yes.
114 | Domains to scan: all unique discovered.
115 | -b wordlist
116 | (optional) Set custom domain blacklist file.
117 | -X wordlist
118 | (optional) Set custom interesting word list.
119 | -o directory
120 | (optional) Set custom output directory. It must exist and be writable.
121 | -a
122 | (optional) Use all unique discovered domains for scans, rather than interesting domains. This cannot be used with -A.
123 | -A
124 | (optional, default) Use only interesting discovered domains for scans, rather than all discovered domains. This cannot be used with -a.
125 | -H
126 | (optional) Use HTTP for connecting to sites instead of HTTPS.
127 | -r
128 | (optional) Enable creation of Burp scope JSON file with rescope.
129 | -h
130 | (optional) Display this help page.
131 | ```
132 |
133 | ### In The Future
134 |
135 | Chomp Scan is still in active development, as I use it myself for bug hunting, so I intend to continue adding new features and tools as I come across them. New tool suggestions, feedback, and pull requests are all welcomed. Possible additions:
136 |
137 | * The generation of an HTML report, similar to what aquatone provides
138 |
139 | ### Screenshots
140 | 
141 | 
142 | 
143 | 
144 | 
145 | 
146 |
147 | ## Thanks
148 | Thanks to all the authors of the included tools. They do all the heavy lifting.
149 |
--------------------------------------------------------------------------------
/blacklist.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SolomonSklash/chomp-scan/d366cea3ece0ef5e2da3d17429973ef8f042eec1/blacklist.txt
--------------------------------------------------------------------------------
/chomp-scan.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Colors
4 | NC='\033[0m';
5 | RED='\033[0;31m';
6 | GREEN='\033[0;32m';
7 | BLUE='\033[0;34m';
8 | ORANGE='\033[0;33m';
9 |
10 | # Wordlists
11 | SHORT=wordlists/subdomains-top1mil-20000.txt;
12 | LONG=wordlists/sortedcombined-knock-dnsrecon-fierce-reconng.txt;
13 | HUGE=wordlists/huge-200k.txt;
14 | SMALL=wordlists/big.txt;
15 | MEDIUM=wordlists/raft-large-combined.txt;
16 | LARGE=wordlists/seclists-combined.txt;
17 | XL=wordlists/haddix_content_discovery_all.txt;
18 | XXL=wordlists/haddix-seclists-combined.txt;
19 |
20 | # User-defined CLI argument variables
21 | DOMAIN="";
22 | SUBDOMAIN_WORDLIST="";
23 | SUBDOMAIN_BRUTE=1; # Constant
24 | CONTENT_WORDLIST="";
25 | CONTENT_DISCOVERY=0;
26 | SCREENSHOTS=0;
27 | INFO_GATHERING=0;
28 | PORTSCANNING=0;
29 | HTTP="https"
30 | CUSTOM_WORKING_DIR="";
31 | WORKING_DIR="";
32 | BLACKLIST=blacklist.txt;
33 | INTERACTIVE=0;
34 | USE_ALL=0;
35 | USE_DISCOVERED=0;
36 | DEFAULT_MODE=0;
37 | INTERESTING=interesting.txt;
38 | SKIP_MASSCAN=0;
39 | NOTICA="";
40 | CONFIG_FILE="";
41 | TOOL_PATH="$HOME/bounty/tools";
42 | TOOL_PATH_SET=0;
43 |
44 | # Config file variables
45 | ENABLE_DNSCAN=0;
46 | ENABLE_SUBFINDER=0;
47 | ENABLE_SUBLIST3R=0;
48 | ENABLE_AMASS=0;
49 | ENABLE_GOALTDNS=0;
50 | ENABLE_MASSDNS=1; # Constant
51 | ENABLE_HTTPROBE=0;
52 | ENABLE_INCEPTION=0;
53 | ENABLE_WAYBACKURLS=0;
54 | ENABLE_FFUF=0;
55 | ENABLE_GOBUSTER=0;
56 | ENABLE_DIRSEARCH=0;
57 | ENABLE_SUBJACK=0;
58 | ENABLE_CORSTEST=0;
59 | ENABLE_S3SCANNER=0;
60 | ENABLE_BFAC=0;
61 | ENABLE_WHATWEB=0;
62 | ENABLE_WAFW00F=0;
63 | ENABLE_NIKTO=0;
64 | ENABLE_MASSCAN=0;
65 | ENABLE_NMAP=0;
66 | ENABLE_SCREENSHOTS=0;
67 | ENABLE_RESCOPE=0;
68 | ENABLE_KNOCK=0;
69 |
70 | # Other variables
71 | ALL_IP=all_discovered_ips.txt;
72 | ALL_DOMAIN=all_discovered_domains.txt;
73 | ALL_RESOLVED=all_resolved_domains.txt;
74 |
75 | function set_tool_paths() {
76 | # If tool paths have not been set, set them
77 | if [[ "$TOOL_PATH_SET" -eq 0 ]]; then
78 | TOOL_PATH_SET=1;
79 | SUBFINDER=$(which subfinder);
80 | SUBJACK=$(which subjack);
81 | FFUF=$(which ffuf);
82 | WHATWEB=$(which whatweb);
83 | WAFW00F=$(which wafw00f);
84 | GOBUSTER=$(which gobuster);
85 | CHROMIUM=$(which chromium);
86 | NMAP=$(which nmap);
87 | MASSCAN=$(which masscan);
88 | NIKTO=$(which nikto);
89 | INCEPTION=$(which inception);
90 | WAYBACKURLS=$(which waybackurls);
91 | GOALTDNS=$(which goaltdns);
92 | RESCOPE=$(which rescope);
93 | KNOCK=$(which knockpy);
94 | HTTPROBE=$(which httprobe);
95 | SUBLIST3R=$TOOL_PATH/Sublist3r/sublist3r.py;
96 | DNSCAN=$TOOL_PATH/dnscan/dnscan.py;
97 | MASSDNS_BIN=$TOOL_PATH/massdns/bin/massdns;
98 | MASSDNS_RESOLVERS=resolvers.txt;
99 | AQUATONE=$TOOL_PATH/aquatone/aquatone;
100 | BFAC=$TOOL_PATH/bfac/bfac;
101 | DIRSEARCH=$TOOL_PATH/dirsearch/dirsearch.py;
102 | SNALLY=$TOOL_PATH/snallygaster/snallygaster;
103 | CORSTEST=$TOOL_PATH/CORStest/corstest.py;
104 | S3SCANNER=$TOOL_PATH/S3Scanner/s3scanner.py;
105 | AMASS=$TOOL_PATH/amass/amass;
106 | else
107 | return;
108 | fi
109 | }
110 |
111 | function banner() {
112 | BANNER='
113 | *****************************************************************************************************
114 | * ______ __ ______ *
115 | * / \/ | / \ *
116 | * /$$$$$$ $$ |____ ______ _____ ____ ______ /$$$$$$ | _______ ______ _______ *
117 | * $$ | $$/$$ \ / \/ \/ \ / \ $$ \__$$/ / |/ \/ \ *
118 | * $$ | $$$$$$$ /$$$$$$ $$$$$$ $$$$ /$$$$$$ | $$ \/$$$$$$$/ $$$$$$ $$$$$$$ | *
119 | * $$ | __$$ | $$ $$ | $$ $$ | $$ | $$ $$ | $$ | $$$$$$ $$ | / $$ $$ | $$ | *
120 | * $$ \__/ $$ | $$ $$ \__$$ $$ | $$ | $$ $$ |__$$ | / \__$$ $$ \_____/$$$$$$$ $$ | $$ | *
121 | * $$ $$/$$ | $$ $$ $$/$$ | $$ | $$ $$ $$/ $$ $$/$$ $$ $$ $$ | $$ | *
122 | * $$$$$$/ $$/ $$/ $$$$$$/ $$/ $$/ $$/$$$$$$$/ $$$$$$/ $$$$$$$/ $$$$$$$/$$/ $$/ *
123 | * $$ | *
124 | * $$ | *
125 | * $$/ *
126 | * *
127 | *****************************************************************************************************
128 | By SolomonSklash - github.com/SolomonSklash/chomp-scan - solomonsklash@0xfeed.io
129 | ';
130 | echo -e "$BLUE""$BANNER";
131 | }
132 |
133 | function usage() {
134 | banner;
135 | echo -e "$GREEN""chomp-scan.sh -u example.com -a d short -cC large -p -o path/to/directory\\n""$NC";
136 | echo -e "$GREEN""Usage of Chomp Scan:""$NC";
137 | echo -e "$BLUE""\\t-u domain \\n\\t\\t$ORANGE (required) Domain name to scan. This should not include a scheme, e.g. https:// or http://.""$NC";
138 | echo -e "$BLUE""\\t-L config-file \\n\\t\\t$ORANGE (optional) The path to a config file. This can be used to provide more granular control over what tools are run.""$NC";
139 | echo -e "$BLUE""\\t-d wordlist\\n\\t\\t$ORANGE (optional) The wordlist to use for subdomain enumeration. Three built-in lists, short, long, and huge can be used, as well as the path to a custom wordlist. The default is short.""$NC";
140 | echo -e "$BLUE""\\t-c \\n\\t\\t$ORANGE (optional) Enable content discovery phase. The wordlist for this option defaults to short if not provided.""$NC";
141 | echo -e "$BLUE""\\t-C wordlist \\n\\t\\t$ORANGE (optional) The wordlist to use for content discovery. Five built-in lists, small, medium, large, xl, and xxl can be used, as well as the path to a custom wordlist. The default is small.""$NC";
142 | echo -e "$BLUE""\\t-P file-path \\n\\t\\t$ORANGE (optional) Set a custom directory for the location of tools. The path must exist and the directory must contain all needed tools.""$NC";
143 | echo -e "$BLUE""\\t-s \\n\\t\\t$ORANGE (optional) Enable screenshots using Aquatone.""$NC";
144 | echo -e "$BLUE""\\t-i \\n\\t\\t$ORANGE (optional) Enable information gathering phase, using subjack, CORStest, S3Scanner, bfac, whatweb, wafw00f, httprobe, and nikto.""$NC";
145 | echo -e "$BLUE""\\t-p \\n\\t\\t$ORANGE (optional) Enable portscanning phase, using masscan (run as root) and nmap.""$NC";
146 | echo -e "$BLUE""\\t-I \\n\\t\\t$ORANGE (optional) Enable interactive mode. This allows you to select certain tool options and inputs interactively. This cannot be run with -D.""$NC";
147 | echo -e "$BLUE""\\t-D \\n\\t\\t$ORANGE (optional) Enable default non-interactive mode. This mode uses pre-selected defaults and requires no user interaction or options. This cannot be run with -I.""$NC";
148 | echo -e "\\t\\t\\t$ORANGE Options: Subdomain enumeration wordlist: short.""$NC";
149 | echo -e "\\t\\t\\t$ORANGE Content discovery wordlist: small.""$NC";
150 | echo -e "\\t\\t\\t$ORANGE Aquatone screenshots: yes.""$NC";
151 | echo -e "\\t\\t\\t$ORANGE Portscanning: yes.""$NC";
152 | echo -e "\\t\\t\\t$ORANGE Information gathering: yes.""$NC";
153 | echo -e "\\t\\t\\t$ORANGE Domains to scan: all unique discovered.""$NC";
154 | echo -e "$BLUE""\\t-b wordlist \\n\\t\\t$ORANGE (optional) Set custom domain blacklist file.""$NC";
155 | echo -e "$BLUE""\\t-X wordlist \\n\\t\\t$ORANGE (optional) Set custom interesting word list.""$NC";
156 | echo -e "$BLUE""\\t-o directory \\n\\t\\t$ORANGE (optional) Set custom output directory. It must exist and be writable.""$NC";
157 | echo -e "$BLUE""\\t-n string \\n\\t\\t$ORANGE (optional) Notica URL parameter for notification when the script has completed. See notica.us for details.""$NC";
158 | echo -e "$BLUE""\\t-a \\n\\t\\t$ORANGE (optional) Use all unique discovered domains for scans, rather than interesting domains. This cannot be used with -A.""$NC";
159 | echo -e "$BLUE""\\t-A \\n\\t\\t$ORANGE (optional, default) Use only interesting discovered domains for scans, rather than all discovered domains. This cannot be used with -a.""$NC";
160 | echo -e "$BLUE""\\t-H \\n\\t\\t$ORANGE (optional) Use HTTP for connecting to sites instead of HTTPS.""$NC";
161 | echo -e "$BLUE""\\t-r \\n\\t\\t$ORANGE (optional) Enable creation of Burp scope JSON file with rescope.""$NC";
162 | echo -e "$BLUE""\\t-h \\n\\t\\t$ORANGE (optional) Display this help page.""$NC";
163 | }
164 |
165 | # Check that a file path exists and is not empty
166 | function exists() {
167 | if [[ -e "$1" ]]; then
168 | if [[ -s "$1" ]]; then
169 | return 1;
170 | else
171 | return 0;
172 | fi
173 | else
174 | return 0;
175 | fi
176 | }
177 |
178 | # Check for root for runs using masscan
179 | function check_root() {
180 | if [[ $EUID -ne 0 ]]; then
181 | while true; do
182 | echo -e "$ORANGE""[!] Please note: Script is not being run as root."
183 | echo -e "$ORANGE""[!] Provided script options include masscan, which must run as root."
184 | echo -e "$ORANGE""[!] The script will hang while waiting for the sudo password."
185 | echo -e "$ORANGE""[!] If you are using Notica notifications, you will be notified when the sudo password is needed."
186 | read -rp "Do you want to exit and [R]e-run as root, [S]kip masscan, or [E]nter sudo password? " CHOICE;
187 | case $CHOICE in
188 | [rR]* )
189 | echo -e "$RED""[!] Exiting script.""$NC";
190 | exit 1;
191 | ;;
192 | [sS]* )
193 | echo -e "$ORANGE""Skipping masscan.""$NC";
194 | SKIP_MASSCAN=1;
195 | break;
196 | ;;
197 | [eE]* )
198 | echo -e "$ORANGE""Script will wait for sudo password.""$NC";
199 | break;
200 | ;;
201 | * )
202 | echo -e "$ORANGE""Please enter [R]e-run, [S]kip masscan, or [E]nter sudo password.""$NC";
203 | ;;
204 | esac
205 | done
206 | fi
207 | }
208 |
209 | # Parse configuration file
210 | function parse_config() {
211 | # Parse [general]
212 |
213 | DOMAIN=$(grep '^DOMAIN' "$CONFIG_FILE" | cut -d '=' -f 2);
214 | if [[ "$DOMAIN" == "" ]]; then
215 | echo -e "$RED""[!] No domain was provided in the configuration file.""$NC";
216 | exit 1;
217 | else
218 | DOMAIN_COUNT=$(echo "$DOMAIN" | awk -F "," "{ print NF }")
219 | if [[ "$DOMAIN_COUNT" -gt 1 ]]; then
220 | DOMAIN_ARRAY=();
221 | for (( i=1; i<=$DOMAIN_COUNT; i++ )); do
222 | DOMAIN_ARRAY+=($(echo $DOMAIN | cut -d ',' -f $i | tr -d " "));
223 | done
224 | fi
225 | fi
226 |
227 | if [[ $(grep '^ENABLE_HTTP' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
228 | HTTP="http";
229 | fi
230 |
231 | OUTPUT_DIR=$(grep '^OUTPUT_DIR' "$CONFIG_FILE" | cut -d '=' -f 2);
232 | if [[ "$OUTPUT_DIR" != "" ]]; then
233 | if [[ -w "$OUTPUT_DIR" ]]; then
234 | CUSTOM_WORKING_DIR="$OUTPUT_DIR";
235 | else
236 | echo -e "$RED""[!] Output directory $OUTPUT_DIR does not exist or is not writable. Please check the configuration file.""$NC";
237 | exit 1;
238 | fi
239 | fi
240 |
241 | if [[ $(grep '^USE_ALL' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
242 | USE_ALL=1;
243 | fi
244 |
245 | if [[ $(grep '^NOTICA' "$CONFIG_FILE" | cut -d '=' -f 2) != "" ]]; then
246 | NOTICA=$(grep '^NOTICA' "$CONFIG_FILE" | cut -d '=' -f 2)
247 | fi
248 |
249 | BLACKLIST_FILE=$(grep '^BLACKLIST' "$CONFIG_FILE" | cut -d '=' -f 2);
250 | if [[ "$BLACKLIST_FILE" != "" ]]; then
251 | if [[ -w "$BLACKLIST_FILE" ]]; then
252 | BLACKLIST="$BLACKLIST_FILE";
253 | else
254 | echo -e "$RED""[!] Blacklist file $BLACKLIST_FILE does not exist or is not writable. Please check the configuration file.""$NC";
255 | exit 1;
256 | fi
257 | fi
258 |
259 | INTERESTING_FILE=$(grep '^INTERESTING' "$CONFIG_FILE" | cut -d '=' -f 2);
260 | if [[ "$INTERESTING_FILE" != "" ]]; then
261 | if [[ -w "$INTERESTING_FILE" ]]; then
262 | INTERESTING="$INTERESTING_FILE";
263 | else
264 | echo -e "$RED""[!] Interesting file $INTERESTING_FILE does not exist or is not writable. Please check the configuration file.""$NC";
265 | exit 1;
266 | fi
267 | fi
268 |
269 | CONFIG_TOOL_PATH=$(grep '^TOOL_PATH' "$CONFIG_FILE" | cut -d '=' -f 2);
270 | if [[ "$CONFIG_TOOL_PATH" != "" ]]; then
271 | if [[ -w "$CONFIG_TOOL_PATH" ]]; then
272 | TOOL_PATH="$CONFIG_TOOL_PATH";
273 | set_tool_paths;
274 | else
275 | echo -e "$RED""[!] Custom tool path $CONFIG_TOOL_PATH does not exist or is not writable. Please check the configuration file.""$NC";
276 | exit 1;
277 | fi
278 | fi
279 |
280 | if [[ $(grep '^ENABLE_RESCOPE' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
281 | ENABLE_RESCOPE=1;
282 | fi
283 |
284 | # Parse [subdomain enumeration]
285 |
286 | if [[ $(grep '^ENABLE_DNSCAN' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
287 | ENABLE_DNSCAN=1;
288 | fi
289 |
290 | if [[ $(grep '^ENABLE_SUBFINDER' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
291 | ENABLE_SUBFINDER=1;
292 | fi
293 |
294 | if [[ $(grep '^ENABLE_SUBLIST3R' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
295 | ENABLE_SUBLIST3R=1;
296 | fi
297 |
298 | if [[ $(grep '^ENABLE_KNOCK' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
299 | ENABLE_KNOCK=1;
300 | fi
301 |
302 | if [[ $(grep '^ENABLE_GOALTDNS' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
303 | ENABLE_GOALTDNS=1;
304 | fi
305 |
306 | if [[ $(grep '^ENABLE_AMASS' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
307 | ENABLE_AMASS=1;
308 | fi
309 |
310 | SUB_WORDLIST=$(grep '^SUBDOMAIN_WORDLIST' "$CONFIG_FILE" | cut -d '=' -f 2);
311 | # Set to one of the defaults, else use provided wordlist
312 | case "$SUB_WORDLIST" in
313 | SHORT )
314 | SUBDOMAIN_WORDLIST="$SHORT";
315 | ;;
316 | LONG )
317 | SUBDOMAIN_WORDLIST="$LONG";
318 | ;;
319 | HUGE )
320 | SUBDOMAIN_WORDLIST="$HUGE";
321 | ;;
322 | esac
323 | if [[ "$SUBDOMAIN_WORDLIST" == "" ]]; then
324 | if [[ "$SUB_WORDLIST" != "" ]]; then
325 | if [[ -w "$SUB_WORDLIST" ]]; then
326 | SUBDOMAIN_WORDLIST="$SUB_WORDLIST";
327 | else
328 | echo -e "$RED""[!] Subdomain enumeration wordlist $SUB_WORDLIST does not exist or is not writable. Please check the configuration file.""$NC";
329 | exit 1;
330 | fi
331 | fi
332 | fi
333 |
334 | # Check that at least one subdomain enumeration tool is enabled
335 | if [[ "$ENABLE_DNSCAN" -eq 0 ]] && [[ "$ENABLE_SUBFINDER" -eq 0 ]] && [[ "$ENABLE_SUBLIST3R" -eq 0 ]] && [[ "$ENABLE_KNOCK" -eq 0 ]] && [[ "$ENABLE_AMASS" -eq 0 ]]; then
336 | echo -e "$RED""[!] At least one subdomain enumeration tool must be enabled. Please check the configuration file.""$NC";
337 | exit 1;
338 | fi
339 |
340 | # Parse [content discovery]
341 |
342 | if [[ $(grep '^ENABLE_INCEPTION' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
343 | ENABLE_INCEPTION=1;
344 | fi
345 |
346 | if [[ $(grep '^ENABLE_WAYBACKURLS' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
347 | ENABLE_WAYBACKURLS=1;
348 | fi
349 |
350 | if [[ $(grep '^ENABLE_FFUF' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
351 | ENABLE_FFUF=1;
352 | fi
353 |
354 | if [[ $(grep '^ENABLE_GOBUSTER' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
355 | ENABLE_GOBUSTER=1;
356 | fi
357 |
358 | if [[ $(grep '^ENABLE_DIRSEARCH' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
359 | ENABLE_DIRSEARCH=1;
360 | fi
361 |
362 | CON_WORDLIST=$(grep '^CONTENT_WORDLIST' "$CONFIG_FILE" | cut -d '=' -f 2);
363 | # Set to one of the defaults, else use provided wordlist
364 | case "$CON_WORDLIST" in
365 | SMALL )
366 | CONTENT_WORDLIST="$SMALL";
367 | ;;
368 | MEDIUM )
369 | CONTENT_WORDLIST="$MEDIUM";
370 | ;;
371 | LARGE )
372 | CONTENT_WORDLIST="$LARGE";
373 | ;;
374 | XL )
375 | CONTENT_WORDLIST="$XL";
376 | ;;
377 | XXL )
378 | CONTENT_WORDLIST="$XXL";
379 | ;;
380 | esac
381 | if [[ "$CONTENT_WORDLIST" == "" ]]; then
382 | if [[ "$CON_WORDLIST" != "" ]]; then
383 | if [[ -w "$CON_WORDLIST" ]]; then
384 | CONTENT_WORDLIST="$CON_WORDLIST";
385 | else
386 | echo -e "$RED""[!] Content discovery wordlist $CON_WORDLIST does not exist or is not writable. Please check the configuration file.""$NC";
387 | exit 1;
388 | fi
389 | fi
390 | fi
391 |
392 | # Parse [information gathering]
393 |
394 | if [[ $(grep '^ENABLE_SUBJACK' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
395 | ENABLE_SUBJACK=1;
396 | fi
397 |
398 | if [[ $(grep '^ENABLE_CORSTEST' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
399 | ENABLE_CORSTEST=1;
400 | fi
401 |
402 | if [[ $(grep '^ENABLE_S3SCANNER' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
403 | ENABLE_S3SCANNER=1;
404 | fi
405 |
406 | if [[ $(grep '^ENABLE_BFAC' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
407 | ENABLE_BFAC=1;
408 | fi
409 |
410 | if [[ $(grep '^ENABLE_WHATWEB' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
411 | ENABLE_WHATWEB=1;
412 | fi
413 |
414 | if [[ $(grep '^ENABLE_WAFW00F' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
415 | ENABLE_WAFW00F=1;
416 | fi
417 |
418 | if [[ $(grep '^ENABLE_HTTPROBE' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
419 | ENABLE_HTTPROBE=1;
420 | fi
421 |
422 | if [[ $(grep '^ENABLE_NIKTO' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
423 | ENABLE_NIKTO=1;
424 | fi
425 |
426 | # Parse [port scanning]
427 |
428 | if [[ $(grep '^ENABLE_MASSCAN' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
429 | check_root
430 | ENABLE_MASSCAN=1;
431 | fi
432 |
433 | if [[ $(grep '^ENABLE_NMAP' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
434 | ENABLE_NMAP=1;
435 | fi
436 |
437 | # Parse [screenshots]
438 |
439 | if [[ $(grep '^ENABLE_SCREENSHOTS' "$CONFIG_FILE" | cut -d '=' -f 2) == "YES" ]]; then
440 | ENABLE_SCREENSHOTS=1;
441 | fi
442 | }
443 |
444 | # Handle CLI arguments
445 | while getopts ":hu:d:L:C:sicb:IaADX:po:Hn:P:r" opt; do
446 | case ${opt} in
447 | h ) # -h help
448 | usage;
449 | exit;
450 | ;;
451 | u ) # -u URL/domain
452 | DOMAIN=$OPTARG;
453 | ;;
454 | L ) # -L configuration file
455 | exists "$OPTARG";
456 | RESULT=$?;
457 | if [[ "$RESULT" -eq 1 ]]; then
458 | CONFIG_FILE="$OPTARG";
459 | parse_config;
460 | else
461 | echo -e "$RED""[!] Provided configuration file $OPTARG is empty or doesn't exist.""$NC";
462 | usage;
463 | exit 1;
464 | fi
465 | # Exit early if config file is found
466 | break;
467 | ;;
468 | d ) # -d subdomain enumeration wordlist
469 | # Set to one of the defaults, else use provided wordlist
470 | case "$OPTARG" in
471 | short )
472 | SUBDOMAIN_WORDLIST="$SHORT";
473 | ;;
474 | long )
475 | SUBDOMAIN_WORDLIST="$LONG";
476 | ;;
477 | huge )
478 | SUBDOMAIN_WORDLIST="$HUGE";
479 | ;;
480 | esac
481 |
482 | if [[ "$SUBDOMAIN_WORDLIST" == "" ]]; then
483 | exists "$OPTARG";
484 | RESULT=$?;
485 | if [[ "$RESULT" -eq 1 ]]; then
486 | SUBDOMAIN_WORDLIST="$OPTARG";
487 | else
488 | echo -e "$RED""[!] Provided subdomain enumeration wordlist $OPTARG is empty or doesn't exist.""$NC";
489 | usage;
490 | exit 1;
491 | fi
492 | fi
493 | ;;
494 | C ) # -C content discovery wordlist
495 | # Set to one of the defaults, else use provided wordlist
496 | case "$OPTARG" in
497 | small )
498 | CONTENT_WORDLIST="$SMALL";
499 | ;;
500 | medium )
501 | CONTENT_WORDLIST="$MEDIUM";
502 | ;;
503 | large )
504 | CONTENT_WORDLIST="$LARGE";
505 | ;;
506 | xl )
507 | CONTENT_WORDLIST="$XL";
508 | ;;
509 | xxl )
510 | CONTENT_WORDLIST="$XXL";
511 | ;;
512 | esac
513 |
514 | if [[ "$CONTENT_WORDLIST" == "" ]]; then
515 | exists "$OPTARG";
516 | RESULT=$?;
517 | if [[ "$RESULT" -eq 1 ]]; then
518 | CONTENT_WORDLIST="$OPTARG";
519 | else
520 | echo -e "$RED""[!] Provided content discovery wordlist $OPTARG is empty or doesn't exist.""$NC";
521 | usage;
522 | exit 1;
523 | fi
524 | fi
525 | ;;
526 | c ) # -c enable content discovery
527 | CONTENT_DISCOVERY=1;
528 | ;;
529 | s ) # -s enable screenshots
530 | SCREENSHOTS=1;
531 | ;;
532 | i ) # -i enable information gathering
533 | INFO_GATHERING=1;
534 | ;;
535 | b ) # -b domain blacklist file
536 | exists "$OPTARG";
537 | RESULT=$?;
538 | if [[ "$RESULT" -eq 1 ]]; then
539 | BLACKLIST="$OPTARG";
540 | else
541 | echo -e "$RED""[!] Provided blacklist $OPTARG is empty or doesn't exist.""$NC";
542 | usage;
543 | exit 1;
544 | fi
545 | ;;
546 | I ) # -I enable interactive mode
547 | INTERACTIVE=1;
548 | ;;
549 | a ) # -a use all discovered domains
550 | echo "Use all discovered domains."
551 | # Check that USE_DISCOVERED is not set
552 | if [[ "$USE_DISCOVERED" != 1 ]]; then
553 | USE_ALL=1;
554 | else
555 | echo -e "$RED""[!] Using -A interesting domains is mutually exclusive to using -a all domains.""$NC";
556 | usage;
557 | exit 1;
558 | fi
559 | ;;
560 | A ) # -A use only interesting discovered domains
561 | # Check that USE_DISCOVERED is not set
562 | if [[ "$USE_ALL" != 1 ]]; then
563 | USE_DISCOVERED=1;
564 | else
565 | echo -e "$RED""[!] Using -a all domains is mutually exclusive to using -A interesting domains.""$NC";
566 | usage;
567 | exit 1;
568 | fi
569 | echo "Use only interesting discovered domains."
570 | ;;
571 | D ) # -D enable default non-interactive mode
572 | DEFAULT_MODE=1;
573 | ;;
574 | X ) # -X interesting word list file
575 | exists "$OPTARG";
576 | RESULT=$?;
577 | if [[ "$RESULT" -eq 1 ]]; then
578 | INTERESTING="$OPTARG";
579 | else
580 | echo -e "$RED""[!] Provided interesting words file $OPTARG is empty or doesn't exist.""$NC";
581 | usage;
582 | exit 1;
583 | fi
584 | ;;
585 | p ) # -p enable port scanning
586 | PORTSCANNING=1;
587 | ;;
588 | P ) # -P custom tool path
589 | exists "$OPTARG";
590 | RESULT=$?;
591 | if [[ "$RESULT" -eq 1 ]]; then
592 | TOOL_PATH="$OPTARG";
593 | set_tool_paths;
594 | else
595 | echo -e "$RED""[!] Provided tool path $OPTARG is empty or doesn't exist.""$NC";
596 | usage;
597 | exit 1;
598 | fi
599 | ;;
600 | o ) # -o output directory
601 | if [[ -w "$OPTARG" ]]; then
602 | WORKING_DIR="$OPTARG";
603 | CUSTOM_WORKING_DIR="$OPTARG";
604 | else
605 | echo -e "$RED""[!] Provided output directory $OPTARG is not writable or doesn't exist.""$NC";
606 | usage;
607 | exit 1;
608 | fi
609 | ;;
610 | H ) # -H enable HTTP for URLs
611 | HTTP="http";
612 | ;;
613 | n ) # -n Notica URL parameter
614 | NOTICA="$OPTARG";
615 | ;;
616 | r ) # -r run rescope
617 | ENABLE_RESCOPE=1;
618 | ;;
619 | \? ) # Invalid option
620 | echo -e "$RED""[!] Invalid Option: -$OPTARG" 1>&2;
621 | usage;
622 | exit 1;
623 | ;;
624 | : ) # Invalid option
625 | echo -e "$RED""[!] Invalid Option: -$OPTARG requires an argument" 1>&2;
626 | usage;
627 | exit 1;
628 | ;;
629 | * ) # Invalid option
630 | echo -e "$RED""[!] Invalid Option: -$OPTARG" 1>&2;
631 | usage;
632 | exit 1;
633 | ;;
634 | esac
635 | done
636 | shift $((OPTIND -1));
637 |
638 | function check_paths() {
639 | # Check if paths haven't been set and set them
640 | set_tool_paths;
641 |
642 | # Check for Debian/Ubuntu and set proper paths
643 | grep 'Ubuntu' /etc/issue 1>/dev/null;
644 | UBUNTU="$?";
645 | if [[ "$UBUNTU" -eq 0 ]]; then
646 | CHROMIUM=$(command -v chromium-browser);
647 | fi
648 | grep 'Debian' /etc/issue 1>/dev/null;
649 | DEBIAN="$?";
650 | if [[ "$DEBIAN" -eq 0 ]]; then
651 | NIKTO="$TOOL_PATH/nikto/program/nikto.pl";
652 | fi
653 |
654 | # Check that all paths are set
655 | if [[ "$SUBFINDER" == "" ]] || [[ ! -f "$SUBFINDER" ]]; then
656 | echo -e "$RED""[!] The path or the file specified by the path for subfinder does not exit.";
657 | exit 1;
658 | fi
659 | if [[ "$SUBJACK" == "" ]] || [[ ! -f "$SUBJACK" ]]; then
660 | echo -e "$RED""[!] The path or the file specified by the path for subjack does not exit.";
661 | exit 1;
662 | fi
663 | if [[ "$FFUF" == "" ]] || [[ ! -f "$FFUF" ]]; then
664 | echo -e "$RED""[!] The path or the file specified by the path for ffuf does not exit.";
665 | exit 1;
666 | fi
667 | if [[ "$WHATWEB" == "" ]] || [[ ! -f "$WHATWEB" ]]; then
668 | echo -e "$RED""[!] The path or the file specified by the path for whatweb does not exit.";
669 | exit 1;
670 | fi
671 | if [[ "$WAFW00F" == "" ]] || [[ ! -f "$WAFW00F" ]]; then
672 | echo -e "$RED""[!] The path or the file specified by the path for wafw00f does not exit.";
673 | exit 1;
674 | fi
675 | if [[ "$GOBUSTER" == "" ]] || [[ ! -f "$GOBUSTER" ]]; then
676 | echo -e "$RED""[!] The path or the file specified by the path for gobuster does not exit.";
677 | exit 1;
678 | fi
679 | if [[ "$CHROMIUM" == "" ]] || [[ ! -f "$CHROMIUM" ]]; then
680 | echo -e "$RED""[!] The path or the file specified by the path for chromium does not exit.";
681 | exit 1;
682 | fi
683 | if [[ "$NMAP" == "" ]] || [[ ! -f "$NMAP" ]]; then
684 | echo -e "$RED""[!] The path or the file specified by the path for nmap does not exit.";
685 | exit 1;
686 | fi
687 | if [[ "$MASSCAN" == "" ]] || [[ ! -f "$MASSCAN" ]]; then
688 | echo -e "$RED""[!] The path or the file specified by the path for masscan does not exit.";
689 | exit 1;
690 | fi
691 | # if [[ "$INCEPTION" == "" ]] || [[ ! -f "$INCEPTION" ]]; then
692 | # echo -e "$RED""[!] The path or the file specified by the path for inception does not exit.";
693 | # exit 1;
694 | # fi
695 | if [[ "$WAYBACKURLS" == "" ]] || [[ ! -f "$WAYBACKURLS" ]]; then
696 | echo -e "$RED""[!] The path or the file specified by the path for waybackurls does not exit.";
697 | exit 1;
698 | fi
699 | if [[ "$GOALTDNS" == "" ]] || [[ ! -f "$GOALTDNS" ]]; then
700 | echo -e "$RED""[!] The path or the file specified by the path for goaltdns does not exit.";
701 | exit 1;
702 | fi
703 | if [[ "$SUBLIST3R" == "" ]] || [[ ! -f "$SUBLIST3R" ]]; then
704 | grep 'Kali' /etc/issue 1>/dev/null;
705 | KALI=$?;
706 | if [[ "$KALI" -eq 0 ]]; then
707 | SUBLIST3R=$(command -v sublist3r);
708 | else
709 | echo -e "$RED""[!] The path or the file specified by the path for sublist3r does not exit.";
710 | exit 1;
711 | fi
712 | fi
713 | if [[ "$DNSCAN" == "" ]] || [[ ! -f "$DNSCAN" ]]; then
714 | echo -e "$RED""[!] The path or the file specified by the path for dnscan does not exit.";
715 | exit 1;
716 | fi
717 | if [[ "$MASSDNS_BIN" == "" ]] || [[ ! -f "$MASSDNS_BIN" ]]; then
718 | echo -e "$RED""[!] The path or the file specified by the path for the massdns binary does not exit.";
719 | exit 1;
720 | fi
721 | if [[ "$MASSDNS_RESOLVERS" == "" ]] || [[ ! -f "$MASSDNS_RESOLVERS" ]]; then
722 | echo -e "$RED""[!] The path or the file specified by the path for massdns resolver file does not exit.";
723 | exit 1;
724 | fi
725 | if [[ "$AQUATONE" == "" ]] || [[ ! -f "$AQUATONE" ]]; then
726 | echo -e "$RED""[!] The path or the file specified by the path for aquatone does not exit.";
727 | exit 1;
728 | fi
729 | if [[ "$BFAC" == "" ]] || [[ ! -f "$BFAC" ]]; then
730 | echo -e "$RED""[!] The path or the file specified by the path for bfac does not exit.";
731 | exit 1;
732 | fi
733 | if [[ "$DIRSEARCH" == "" ]] || [[ ! -f "$DIRSEARCH" ]]; then
734 | echo -e "$RED""[!] The path or the file specified by the path for dirsearch does not exit.";
735 | exit 1;
736 | fi
737 | if [[ "$CORSTEST" == "" ]] || [[ ! -f "$CORSTEST" ]]; then
738 | echo -e "$RED""[!] The path or the file specified by the path for CORStest does not exit.";
739 | exit 1;
740 | fi
741 | if [[ "$S3SCANNER" == "" ]] || [[ ! -f "$S3SCANNER" ]]; then
742 | echo -e "$RED""[!] The path or the file specified by the path for S3Scanner does not exit.";
743 | exit 1;
744 | fi
745 | if [[ "$AMASS" == "" ]] || [[ ! -f "$AMASS" ]]; then
746 | echo -e "$RED""[!] The path or the file specified by the path for amass does not exit.";
747 | exit 1;
748 | fi
749 | if [[ "$RESCOPE" == "" ]] || [[ ! -f "$RESCOPE" ]]; then
750 | echo -e "$RED""[!] The path or the file specified by the path for rescope does not exit.";
751 | exit 1;
752 | fi
753 | if [[ "$KNOCK" == "" ]] || [[ ! -f "$KNOCK" ]]; then
754 | echo -e "$RED""[!] The path or the file specified by the path for knockpy does not exit.";
755 | exit 1;
756 | fi
757 | if [[ "$HTTPROBE" == "" ]] || [[ ! -f "$HTTPROBE" ]]; then
758 | echo -e "$RED""[!] The path or the file specified by the path for httprobe does not exit.";
759 | exit 1;
760 | fi
761 | }
762 |
763 | function unique() {
764 | # Remove blacklisted domains from all discovered domains
765 | if [[ ! -z $BLACKLIST ]]; then
766 | while read -r bad; do
767 | grep -v "$bad" "$WORKING_DIR"/$ALL_DOMAIN > "$WORKING_DIR"/temp;
768 | mv "$WORKING_DIR"/temp "$WORKING_DIR"/$ALL_DOMAIN;
769 | done < "$BLACKLIST";
770 | fi
771 |
772 | # Remove blacklisted domains from all resolved domains
773 | if [[ ! -z $BLACKLIST ]]; then
774 | while read -r bad; do
775 | grep -v "$bad" "$WORKING_DIR"/$ALL_RESOLVED > "$WORKING_DIR"/temp1;
776 | mv "$WORKING_DIR"/temp1 "$WORKING_DIR"/$ALL_RESOLVED;
777 | done < "$BLACKLIST";
778 | fi
779 |
780 | # Get unique list of IPs and domains, ignoring case
781 | sort "$WORKING_DIR"/$ALL_DOMAIN | uniq -i > "$WORKING_DIR"/temp2;
782 | mv "$WORKING_DIR"/temp2 "$WORKING_DIR"/$ALL_DOMAIN;
783 |
784 | sort -V "$WORKING_DIR"/$ALL_IP | uniq -i > "$WORKING_DIR"/temp2;
785 | mv "$WORKING_DIR"/temp2 "$WORKING_DIR"/$ALL_IP;
786 |
787 | sort "$WORKING_DIR"/$ALL_RESOLVED | uniq -i > "$WORKING_DIR"/temp3;
788 | mv "$WORKING_DIR"/temp3 "$WORKING_DIR"/$ALL_RESOLVED;
789 | }
790 |
791 | function list_found() {
792 | unique;
793 | echo -e "$GREEN""[+] Found $(wc -l "$WORKING_DIR"/$ALL_IP | awk '{print $1}') unique IPs so far.""$NC"
794 | echo -e "$GREEN""[+] Found $(wc -l "$WORKING_DIR"/$ALL_DOMAIN | awk '{print $1}') unique discovered domains so far.""$NC"
795 | echo -e "$GREEN""[+] Found $(wc -l "$WORKING_DIR"/$ALL_RESOLVED | awk '{print $1}') unique resolvable domains so far.""$NC"
796 | }
797 |
798 | function get_interesting() {
799 | # Takes optional silent argument as $1
800 |
801 | while read -r word; do
802 | grep "$word" "$WORKING_DIR"/$ALL_RESOLVED >> "$WORKING_DIR"/"$INTERESTING_DOMAINS";
803 | done < "$INTERESTING";
804 |
805 | # Make sure no there are duplicates
806 | sort -u "$WORKING_DIR"/"$INTERESTING_DOMAINS" > "$WORKING_DIR"/temp4;
807 | mv "$WORKING_DIR"/temp4 "$WORKING_DIR"/"$INTERESTING_DOMAINS";
808 |
809 | if [[ "$1" == "silent" ]]; then
810 | return;
811 | else
812 | # Make sure > 0 domains are found
813 | FOUND=$(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}');
814 | if [[ $FOUND -gt 0 ]]; then
815 | echo -e "$RED""[!] The following $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') potentially interesting subdomains have been found ($WORKING_DIR/$INTERESTING_DOMAINS):""$ORANGE";
816 | cat "$WORKING_DIR"/"$INTERESTING_DOMAINS";
817 | sleep 1;
818 | else
819 | echo -e "$RED""[!] No interesting domains have been found yet.""$NC";
820 | sleep 1;
821 | fi
822 | fi
823 | }
824 |
825 | function cancel() {
826 | echo -e "$RED""\\n[!] Cancelling command.""$NC";
827 | }
828 |
829 | function run_dnscan() {
830 | # Call with domain as $1 and wordlist as $2
831 |
832 | # Trap SIGINT so broken dnscan runs can be cancelled
833 | trap cancel SIGINT;
834 |
835 | echo -e "$GREEN""[i]$BLUE Scanning $1 with dnscan.""$NC";
836 | echo -e "$GREEN""[i]$ORANGE Command: $DNSCAN -d $1 -t 25 -o $WORKING_DIR/dnscan_out.txt -w $2.""$NC";
837 | START=$(date +%s);
838 | $DNSCAN -d "$1" -t 25 -o "$WORKING_DIR"/dnscan_out.txt -w "$2";
839 | END=$(date +%s);
840 | DIFF=$(( END - START ));
841 |
842 | # Remove headers and leading spaces
843 | sed '1,/A records/d' "$WORKING_DIR"/dnscan_out.txt | tr -d ' ' > "$WORKING_DIR"/trimmed;
844 | cut "$WORKING_DIR"/trimmed -d '-' -f 1 > "$WORKING_DIR"/dnscan-ips.txt;
845 | cut "$WORKING_DIR"/trimmed -d '-' -f 2 > "$WORKING_DIR"/dnscan-domains.txt;
846 | rm "$WORKING_DIR"/trimmed;
847 |
848 | # Cat output into main lists
849 | cat "$WORKING_DIR"/dnscan-ips.txt >> "$WORKING_DIR"/$ALL_IP;
850 | cat "$WORKING_DIR"/dnscan-domains.txt >> "$WORKING_DIR"/"$ALL_DOMAIN";
851 |
852 | echo -e "$GREEN""[i]$BLUE dnsscan took $DIFF seconds to run.""$NC";
853 | echo -e "$GREEN""[!]$ORANGE dnscan found $(wc -l "$WORKING_DIR"/dnscan-ips.txt | awk '{print $1}') IP/domain pairs.""$NC";
854 | list_found;
855 | sleep 1;
856 |
857 | # Check if Ctrl+C was pressed and added to domain and IP files
858 | grep -v 'KeyboardInterrupt' "$WORKING_DIR"/"$ALL_DOMAIN" > "$WORKING_DIR"/tmp;
859 | mv "$WORKING_DIR"/tmp "$WORKING_DIR"/"$ALL_DOMAIN";
860 | grep -v 'KeyboardInterrupt' "$WORKING_DIR"/"$ALL_IP" > "$WORKING_DIR"/tmp2;
861 | mv "$WORKING_DIR"/tmp2 "$WORKING_DIR"/"$ALL_IP";
862 | }
863 |
864 | function run_subfinder() {
865 | # Call with domain as $1 and wordlist as $2
866 |
867 | # Trap SIGINT so broken subfinder runs can be cancelled
868 | trap cancel SIGINT;
869 |
870 | # Check for wordlist argument, else run without
871 | echo -e "$GREEN""[i]$BLUE Scanning $1 with subfinder.""$NC";
872 | echo -e "$GREEN""[i]$ORANGE Command: subfinder -nW -v --timeout 5 -d $1 -o $WORKING_DIR/subfinder-domains.txt -t 25.""$NC";
873 | START=$(date +%s);
874 | "$SUBFINDER" -nW -v --timeout 5 -d "$1" -o "$WORKING_DIR"/subfinder-domains.txt -t 25;
875 | END=$(date +%s);
876 | DIFF=$(( END - START ));
877 |
878 | cat "$WORKING_DIR"/subfinder-domains.txt >> "$WORKING_DIR"/$ALL_DOMAIN;
879 |
880 | echo -e "$GREEN""[i]$BLUE Subfinder took $DIFF seconds to run.""$NC";
881 | echo -e "$GREEN""[!]$ORANGE Subfinder found $(wc -l "$WORKING_DIR"/subfinder-domains.txt | awk '{print $1}') domains.""$NC";
882 | list_found;
883 | sleep 1;
884 | }
885 |
886 | function run_sublist3r() {
887 | # Call with domain as $1, doesn't support wordlists
888 |
889 | # Trap SIGINT so broken sublist3r runs can be cancelled
890 | trap cancel SIGINT;
891 |
892 | echo -e "$GREEN""[i]$BLUE Scanning $1 with sublist3r.""$NC";
893 | echo -e "$GREEN""[i]$ORANGE Command: $SUBLIST3R -d $1 -v -t 50 -o $WORKING_DIR/sublist3r-output.txt.""$NC";
894 | START=$(date +%s);
895 | "$SUBLIST3R" -d "$1" -v -t 50 -o "$WORKING_DIR"/sublist3r-output.txt
896 | END=$(date +%s);
897 | DIFF=$(( END - START ));
898 |
899 | # Check that output file exists
900 | if [[ -f "$WORKING_DIR"/sublist3r-output.txt ]]; then
901 | # Cat output into main lists
902 | cat "$WORKING_DIR"/sublist3r-output.txt >> "$WORKING_DIR"/$ALL_DOMAIN;
903 | echo -e "$GREEN""[i]$BLUE sublist3r took $DIFF seconds to run.""$NC";
904 | echo -e "$GREEN""[!]$ORANGE sublist3r found $(wc -l "$WORKING_DIR"/sublist3r-output.txt | awk '{print $1}') domains.""$NC";
905 | fi
906 |
907 | list_found;
908 | sleep 1;
909 | }
910 |
911 | function run_knock() {
912 | # Call with domain as $1 and wordlist as $2
913 |
914 | # Trap SIGINT so broken knock runs can be cancelled
915 | trap cancel SIGINT;
916 |
917 | echo -e "$GREEN""[i]$BLUE Scanning $1 with knock.""$NC";
918 | echo -e "$GREEN""[i]$ORANGE Command: knockpy $DOMAIN -w $2 -o $WORKING_DIR/knock-output.txt""$NC";
919 |
920 | START=$(date +%s);
921 | "$KNOCK" "$1" -w "$2" -o "$WORKING_DIR"/knock-output.txt;
922 | END=$(date +%s);
923 | DIFF=$(( END - START ));
924 |
925 | # Parse output and add to all domain and IP lists
926 | awk -F ',' '{print $2" "$3}' "$WORKING_DIR"/knock-output.txt | grep -e "$DOMAIN$" > "$WORKING_DIR"/knock-tmp.txt;
927 | cut -d ' ' -f 1 "$WORKING_DIR"/knock-tmp.txt >> "$WORKING_DIR"/"$ALL_IP";
928 | cut -d ' ' -f 2 "$WORKING_DIR"/knock-tmp.txt >> "$WORKING_DIR"/"$ALL_DOMAIN";
929 |
930 | echo -e "$GREEN""[i]$BLUE knock took $DIFF seconds to run.""$NC";
931 | echo -e "$GREEN""[!]$ORANGE knock found $(wc -l "$WORKING_DIR"/knock-tmp.txt | awk '{print $1}') domains.""$NC";
932 |
933 | list_found;
934 | sleep 1;
935 | rm "$WORKING_DIR"/knock-tmp.txt;
936 | }
937 |
938 | function run_amass() {
939 | # Call with domain as $1 and wordlist as $2
940 |
941 | echo -e "$GREEN""[i]$BLUE Scanning $1 with amass.""$NC";
942 | echo -e "$GREEN""[i]$ORANGE Command: amass enum -d $1 -w $2 -ip -rf resolvers.txt -active -o $WORKING_DIR/amass-output.txt -min-for-recursive 3 -bl $BLACKLIST""$NC";
943 | START=$(date +%s);
944 | "$AMASS" enum -d "$1" -brute -w "$2" -ipv4 -rf resolvers.txt -active -o "$WORKING_DIR"/amass-output.txt -min-for-recursive 3 -bl "$BLACKLIST";
945 | END=$(date +%s);
946 | DIFF=$(( END - START ));
947 |
948 | # Check that output file exists amd parse output
949 | if [[ -f "$WORKING_DIR"/amass-output.txt ]]; then
950 | # Cat output into main lists
951 | cut -d ' ' -f 1 "$WORKING_DIR"/amass-output.txt >> "$WORKING_DIR"/"$ALL_DOMAIN";
952 | cut -d ' ' -f 2 "$WORKING_DIR"/amass-output.txt >> "$WORKING_DIR"/"$ALL_IP";
953 | echo -e "$GREEN""[i]$BLUE amass took $DIFF seconds to run.""$NC";
954 | echo -e "$GREEN""[!]$ORANGE amass found $(wc -l "$WORKING_DIR"/amass-output.txt | awk '{print $1}') domains.""$NC";
955 | fi
956 |
957 | list_found;
958 | sleep 1;
959 | }
960 |
961 | function run_goaltdns() {
962 | # Run goaltdns with found subdomains combined with altdns-wordlist.txt
963 |
964 | echo -e "$GREEN""[i]$BLUE Running goaltdns against all $(wc -l "$WORKING_DIR"/$ALL_DOMAIN | awk '{print $1}') unique discovered subdomains to generate domains for masscan to resolve.""$NC";
965 | echo -e "$GREEN""[i]$ORANGE Command: goaltdns -l $WORKING_DIR/$ALL_DOMAIN -w wordlists/altdns-words.txt -o $WORKING_DIR/goaltdns-output.txt.""$NC";
966 | START=$(date +%s);
967 | "$GOALTDNS" -l "$WORKING_DIR"/$ALL_DOMAIN -w wordlists/altdns-words.txt -o "$WORKING_DIR"/goaltdns-output.txt;
968 | END=$(date +%s);
969 | DIFF=$(( END - START ));
970 |
971 | echo -e "$GREEN""[i]$BLUE Goaltdns took $DIFF seconds to run.""$NC";
972 | echo -e "$GREEN""[i]$BLUE Goaltdns generated $(wc -l "$WORKING_DIR"/goaltdns-output.txt | awk '{print $1}') subdomains.""$NC";
973 | sleep 1;
974 | }
975 |
976 | function run_massdns() {
977 | # Call with domain as $1, wordlist as $2, and alone as $3
978 |
979 | # Check if being called without goaltdns
980 | if [[ "$3" == "alone" ]]; then
981 | # Create wordlist with appended domain for massdns
982 | sed "/.*/ s/$/\.$1/" $2 > "$WORKING_DIR"/massdns-appended.txt;
983 |
984 | echo -e "$GREEN""[i]$BLUE Scanning $(cat "$WORKING_DIR"/$ALL_DOMAIN "$WORKING_DIR"/$ALL_IP "$WORKING_DIR"/massdns-appended.txt | sort | uniq | wc -l) current unique $1 domains with massdns (in quiet mode).""$NC";
985 | echo -e "$GREEN""[i]$ORANGE Command: cat (all found domains and IPs) | $MASSDNS_BIN -r $MASSDNS_RESOLVERS -q -t A -o S -w $WORKING_DIR/massdns-result.txt.""$NC";
986 | START=$(date +%s);
987 | cat "$WORKING_DIR"/$ALL_DOMAIN "$WORKING_DIR"/$ALL_IP "$WORKING_DIR"/massdns-appended.txt | sort | uniq | $MASSDNS_BIN -r $MASSDNS_RESOLVERS -q -t A -o S -w "$WORKING_DIR"/massdns-result.txt;
988 | END=$(date +%s);
989 | DIFF=$(( END - START ));
990 | else
991 | # Run goaltdns to get altered domains to resolve along with other discovered domains
992 | run_goaltdns;
993 |
994 | # Create wordlist with appended domain for massdns
995 | sed "/.*/ s/$/\.$1/" $2 > "$WORKING_DIR"/massdns-appended.txt;
996 |
997 | echo -e "$GREEN""[i]$BLUE Scanning $(cat "$WORKING_DIR"/$ALL_DOMAIN "$WORKING_DIR"/$ALL_IP "$WORKING_DIR"/goaltdns-output.txt "$WORKING_DIR"/massdns-appended.txt | sort | uniq | wc -l) current unique $1 domains and IPs, goaltdns generated domains, and domain-appended wordlist with massdns (in quiet mode).""$NC";
998 | echo -e "$GREEN""[i]$ORANGE Command: cat (all found domains and IPs) | $MASSDNS_BIN -r $MASSDNS_RESOLVERS -q -t A -o S -w $WORKING_DIR/massdns-result.txt.""$NC";
999 | START=$(date +%s);
1000 | cat "$WORKING_DIR"/$ALL_DOMAIN "$WORKING_DIR"/$ALL_IP "$WORKING_DIR"/goaltdns-output.txt "$WORKING_DIR"/massdns-appended.txt | sort | uniq | $MASSDNS_BIN -r $MASSDNS_RESOLVERS -q -t A -o S -w "$WORKING_DIR"/massdns-result.txt;
1001 | END=$(date +%s);
1002 | DIFF=$(( END - START ));
1003 | fi
1004 |
1005 | # Parse results
1006 | grep CNAME "$WORKING_DIR"/massdns-result.txt > "$WORKING_DIR"/massdns-CNAMEs.txt;
1007 | grep -v CNAME "$WORKING_DIR"/massdns-result.txt | cut -d ' ' -f 3 >> "$WORKING_DIR"/$ALL_IP;
1008 |
1009 | # Add any new in-scope CNAMEs to main list
1010 | cut -d ' ' -f 3 "$WORKING_DIR"/massdns-CNAMEs.txt | grep "$DOMAIN.$" >> "$WORKING_DIR"/$ALL_DOMAIN;
1011 |
1012 | # Add newly discovered domains to all domains list
1013 | grep -v CNAME "$WORKING_DIR"/massdns-result.txt | cut -d ' ' -f 1 >> "$WORKING_DIR"/"$ALL_DOMAIN";
1014 | # Remove trailing periods from results
1015 | sed -i 's/\.$//' "$WORKING_DIR"/"$ALL_DOMAIN";
1016 |
1017 | # Add all resolved domains to resolved domain list
1018 | grep -v CNAME "$WORKING_DIR"/massdns-result.txt | cut -d ' ' -f 1 >> "$WORKING_DIR"/"$ALL_RESOLVED";
1019 | # Remove trailing periods from results
1020 | sed -i 's/\.$//' "$WORKING_DIR"/"$ALL_RESOLVED";
1021 |
1022 | echo -e "$GREEN""[i]$BLUE Massdns took $DIFF seconds to run.""$NC";
1023 | echo -e "$GREEN""[!]$ORANGE Check $WORKING_DIR/massdns-CNAMEs.txt for a list of CNAMEs found.""$NC";
1024 | sleep 1;
1025 |
1026 | list_found;
1027 | sleep 1;
1028 | }
1029 |
1030 | function run_httprobe() {
1031 | # Run httprobe to filter $ALL_RESOLVED for running server on port 443,80
1032 | echo -e "$GREEN""[i]$BLUE Running httprobe against $(cat "$WORKING_DIR"/"$ALL_RESOLVED" | sort -u | wc -l) resolved domains.";
1033 | echo -e "$GREEN""[i]$ORANGE Command: cat "$WORKING_DIR"/"$ALL_RESOLVED" | httprobe -c 40 -t 3000 -p http:8443 -p https:8443 -p http:8080 -p https:8080 -p http:8008 -p https:8008 -p http:591 -p https:591 -p http:593 -p https:593 -p http:981 -p https:981 -p http:2480 -p https:2480 -p http:4567 -p https:4567 -p http:5000 -p https:5000 -p http:5800 -p https:5800 -p http:7001 -p https:7001 -p http:7002 -p https:7002 -p http:9080 -p https:9080 -p http:9090 -p https:9090 -p https:9443 -p https:18091 -p https:18092 | tee "$WORKING_DIR"/httprobe-out.txt.""$NC";
1034 | START=$(date +%s);
1035 | cat "$WORKING_DIR"/$ALL_RESOLVED | httprobe -c 40 -t 3000 -p http:8443 -p https:8443 -p http:8080 -p https:8080 -p http:8008 -p https:8008 -p http:591 -p https:591 -p http:593 -p https:593 -p http:981 -p https:981 -p http:2480 -p https:2480 -p http:4567 -p https:4567 -p http:5000 -p https:5000 -p http:5800 -p https:5800 -p http:7001 -p https:7001 -p http:7002 -p https:7002 -p http:9080 -p https:9080 -p http:9090 -p https:9090 -p https:9443 -p https:18091 -p https:18092 | tee "$WORKING_DIR"/httprobe-out.txt;
1036 | END=$(date +%s);
1037 | DIFF=$(( END - START ));
1038 |
1039 | echo -e "$GREEN""[i]$BLUE httprobe took $DIFF seconds to run.""$NC";
1040 | sleep 1;
1041 | }
1042 |
1043 | function run_subdomain_brute() {
1044 | # Ask user for wordlist size
1045 | while true; do
1046 | echo -e "$ORANGE""[i] Beginning subdomain enumeration. This will use dnscan, subfinder, sublist3r, knockpy, amass, and massdns + goaltdns.";
1047 | echo -e "$GREEN""[?] What size wordlist would you like to use for subdomain bruteforcing?";
1048 | echo -e "$GREEN""[i] Sizes are [S]mall (22k domains), [L]arge (102k domains), and [H]uge (199k domains).";
1049 | echo -e "$ORANGE";
1050 | read -rp "[?] Please enter S/s, L/l, or H/h. " ANSWER
1051 |
1052 | case $ANSWER in
1053 | [sS]* )
1054 | run_dnscan "$DOMAIN" "$SHORT";
1055 | run_subfinder "$DOMAIN" "$SHORT";
1056 | run_sublist3r "$DOMAIN";
1057 | run_knock "$DOMAIN" "$SHORT";
1058 | run_amass "$DOMAIN" "$SHORT";
1059 | run_massdns "$DOMAIN" "$SHORT";
1060 | break
1061 | ;;
1062 |
1063 | [lL]* )
1064 | run_dnscan "$DOMAIN" "$LONG";
1065 | run_subfinder "$DOMAIN" "$LONG";
1066 | run_sublist3r "$DOMAIN";
1067 | run_knock "$DOMAIN" "$LONG";
1068 | run_amass "$DOMAIN" "$LONG";
1069 | run_massdns "$DOMAIN" "$LONG";
1070 | return;
1071 | ;;
1072 |
1073 | [hH]* )
1074 | run_dnscan "$DOMAIN" "$SHORT";
1075 | run_subfinder "$DOMAIN" "$HUGE";
1076 | run_sublist3r "$DOMAIN";
1077 | run_knock "$DOMAIN" "$HUGE";
1078 | run_amass "$DOMAIN" "$HUGE";
1079 | run_massdns "$DOMAIN" "$HUGE";
1080 | break;
1081 | ;;
1082 | * )
1083 | echo -e "$RED"""[!] Please enter S/s, L/l, or H/h. "$NC"
1084 | ;;
1085 | esac
1086 | done
1087 | }
1088 |
1089 | function run_aquatone () {
1090 | # Call empty or with default as $1 for -D default non-interactive mode
1091 | if [[ "$1" == "default" ]]; then
1092 | if [[ "$USE_ALL" -eq 1 ]]; then
1093 | mkdir "$WORKING_DIR"/aquatone;
1094 | echo -e "$BLUE""[i] Running aquatone against all $(wc -l "$WORKING_DIR"/$ALL_RESOLVED | awk '{print $1}') unique discovered subdomains.""$NC";
1095 | START=$(date +%s);
1096 | $AQUATONE -threads 10 -chrome-path "$CHROMIUM" -ports medium -out "$WORKING_DIR"/aquatone < "$WORKING_DIR"/$ALL_RESOLVED;
1097 | END=$(date +%s);
1098 | DIFF=$(( END - START ));
1099 | echo -e "$GREEN""[i]$BLUE Aquatone took $DIFF seconds to run.""$NC";
1100 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
1101 | mkdir "$WORKING_DIR"/aquatone;
1102 | echo -e "$BLUE""[i] Running aquatone against all $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') interesting discovered subdomains.""$NC";
1103 | START=$(date +%s);
1104 | $AQUATONE -threads 10 -chrome-path "$CHROMIUM" -ports medium -out "$WORKING_DIR"/aquatone < "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1105 | END=$(date +%s);
1106 | DIFF=$(( END - START ));
1107 | echo -e "$GREEN""[i]$BLUE Aquatone took $DIFF seconds to run.""$NC";
1108 | else
1109 | mkdir "$WORKING_DIR"/aquatone;
1110 | echo -e "$BLUE""[i] Running aquatone against all $(wc -l "$WORKING_DIR"/$ALL_RESOLVED | awk '{print $1}') unique discovered subdomains.""$NC";
1111 | START=$(date +%s);
1112 | $AQUATONE -threads 10 -chrome-path "$CHROMIUM" -ports medium -out "$WORKING_DIR"/aquatone < "$WORKING_DIR"/$ALL_RESOLVED;
1113 | END=$(date +%s);
1114 | DIFF=$(( END - START ));
1115 | echo -e "$GREEN""[i]$BLUE Aquatone took $DIFF seconds to run.""$NC";
1116 | fi
1117 | else
1118 | # Ask user to run aquatone
1119 | while true; do
1120 | echo -e "$ORANGE";
1121 | read -rp "[?] Do you want to screenshot discovered domains with aquatone? [Y/N] " ANSWER
1122 |
1123 | case $ANSWER in
1124 | [yY]* )
1125 | break
1126 | ;;
1127 |
1128 | [nN]* )
1129 | echo -e "$ORANGE""[!] Skipping aquatone.""$NC";
1130 | return;
1131 | ;;
1132 |
1133 | * )
1134 | echo -e "$RED""[!] Please enter Y/y or N/n. ""$NC"
1135 | ;;
1136 | esac
1137 | done
1138 | mkdir "$WORKING_DIR"/aquatone;
1139 |
1140 | echo -e "$GREEN""[i]$BLUE Running aquatone against all $(wc -l "$WORKING_DIR"/$ALL_RESOLVED | awk '{print $1}') unique discovered subdomains.""$NC";
1141 | START=$(date +%s);
1142 | $AQUATONE -threads 10 -chrome-path "$CHROMIUM" -ports medium -out "$WORKING_DIR"/aquatone < "$WORKING_DIR"/$ALL_RESOLVED;
1143 | END=$(date +%s);
1144 | DIFF=$(( END - START ));
1145 | echo -e "$GREEN""[i]$BLUE Aquatone took $DIFF seconds to run.""$NC";
1146 | fi
1147 | }
1148 |
1149 | function run_masscan() {
1150 | # Check if not root and SKIP_MASSCAN is set
1151 | if [[ "$SKIP_MASSCAN" -eq 1 ]]; then
1152 | echo -e "$ORANGE""[!] Skipping masscan since script is not being run as root.""$NC";
1153 | sleep 1;
1154 | else
1155 | # Run masscan against all IPs found on all ports
1156 | echo -e "$GREEN""[i]$BLUE Running masscan against all $(wc -l "$WORKING_DIR"/$ALL_IP | awk '{print $1}') unique discovered IP addresses.""$NC";
1157 | echo -e "$GREEN""[i]$BLUE Command: masscan -p1-65535 -il $WORKING_DIR/$ALL_IP --rate=7000 -oL $WORKING_DIR/masscan-output.txt.""$NC";
1158 |
1159 | # Check that IP list is not empty
1160 | IP_COUNT=$(wc -l "$WORKING_DIR"/$ALL_IP | awk '{print $1}');
1161 | if [[ "$IP_COUNT" -lt 1 ]]; then
1162 | echo -e "$RED""[i] No IP addresses have been found. Skipping masscan scan.""$NC";
1163 | return;
1164 | fi
1165 |
1166 | START=$(date +%s);
1167 | if [[ "$NOTICA" != "" ]]; then
1168 | run_notica_sudo;
1169 | fi
1170 | sudo "$MASSCAN" -p1-65535 -iL "$WORKING_DIR"/$ALL_IP --rate=7000 -oL "$WORKING_DIR"/root-masscan-output.txt;
1171 | END=$(date +%s);
1172 | DIFF=$(( END - START ));
1173 | echo -e "$GREEN""[i]$BLUE Masscan took $DIFF seconds to run.""$NC";
1174 |
1175 | # Trim # from first and last lines of output
1176 | grep -v '#' "$WORKING_DIR"/root-masscan-output.txt > "$WORKING_DIR"/masscan-output.txt;
1177 | fi
1178 | }
1179 |
1180 | function run_nmap() {
1181 | # Check that IP list is not empty
1182 | IP_COUNT=$(wc -l "$WORKING_DIR"/$ALL_IP | awk '{print $1}');
1183 | if [[ "$IP_COUNT" -lt 1 ]]; then
1184 | echo -e "$RED""[i] No IP addresses have been found. Skipping nmap scan.""$NC";
1185 | return;
1186 | fi
1187 |
1188 | # Run nmap against all-ip.txt against ports found by masscan, unless alone arg is passed as $1
1189 | if [[ "$1" == "alone" ]]; then
1190 | echo -e "$GREEN""[i]$BLUE Running nmap against all $(wc -l "$WORKING_DIR"/"$ALL_IP" | awk '{print $1}') unique discovered IP addresses.""$NC";
1191 | echo -e "$GREEN""[i]$BLUE Command: nmap -n -v -sV -iL $WORKING_DIR/all_ip.txt -oA $WORKING_DIR/nmap-output --stylesheet https://raw.githubusercontent.com/honze-net/nmap-bootstrap-xsl/master/nmap-bootstrap.xsl.""$NC";
1192 | START=$(date +%s);
1193 | "$NMAP" -n -v -sV -iL "$WORKING_DIR"/"$ALL_IP" -oA "$WORKING_DIR"/nmap-output --stylesheet https://raw.githubusercontent.com/honze-net/nmap-bootstrap-xsl/master/nmap-bootstrap.xsl;
1194 | END=$(date +%s);
1195 | DIFF=$(( END - START ));
1196 | echo -e "$GREEN""[i]$BLUE Nmap took $DIFF seconds to run.""$NC";
1197 | # Make sure masscan actually created output
1198 | elif [[ ! -s "$WORKING_DIR"/masscan-output.txt ]]; then
1199 | echo -e "$GREEN""[i]$BLUE Running nmap against all $(wc -l "$WORKING_DIR"/"$ALL_IP" | awk '{print $1}') unique discovered IP addresses.""$NC";
1200 | echo -e "$GREEN""[i]$BLUE Command: nmap -n -v -sV -iL $WORKING_DIR/all_discovered_ips.txt -oA $WORKING_DIR/nmap-output --stylesheet https://raw.githubusercontent.com/honze-net/nmap-bootstrap-xsl/master/nmap-bootstrap.xsl.""$NC";
1201 | START=$(date +%s);
1202 | "$NMAP" -n -v -sV -iL "$WORKING_DIR"/"$ALL_IP" -oA "$WORKING_DIR"/nmap-output --stylesheet https://raw.githubusercontent.com/honze-net/nmap-bootstrap-xsl/master/nmap-bootstrap.xsl;
1203 | END=$(date +%s);
1204 | DIFF=$(( END - START ));
1205 | echo -e "$GREEN""[i]$BLUE Nmap took $DIFF seconds to run.""$NC";
1206 | else
1207 | # Process masscan output for ports found
1208 | cut -d ' ' -f 3 "$WORKING_DIR"/masscan-output.txt >> "$WORKING_DIR"/temp;
1209 | sort "$WORKING_DIR"/temp | uniq > "$WORKING_DIR"/ports;
1210 | rm "$WORKING_DIR"/temp;
1211 |
1212 | # Count ports in case it's over nmap's ~22k parameter limit, then run multiple scans
1213 | PORT_NUMBER=$(wc -l "$WORKING_DIR"/ports | awk '{print $1}');
1214 |
1215 | if [[ $PORT_NUMBER -gt 22000 ]]; then
1216 | echo -e "$GREEN""[!]$RED WARNING: Masscan found more than 22k open ports. This is more than nmap's port argument length limit, and likely indicates lots of false positives. Consider running nmap with -p- to scan all ports.""$NC";
1217 | sleep 2;
1218 | return;
1219 | fi
1220 |
1221 | # Get live IPs from masscan
1222 | cut -d ' ' -f 4 "$WORKING_DIR"/masscan-output.txt >> "$WORKING_DIR"/"$ALL_IP";
1223 |
1224 | echo -e "$GREEN""[i]$BLUE Running nmap against $(wc -l "$WORKING_DIR"/"$ALL_IP" | awk '{print $1}') unique discovered IP addresses and $(wc -l "$WORKING_DIR"/ports | awk '{print $1}') ports identified by masscan.""$NC";
1225 | echo -e "$GREEN""[i]$BLUE Command: nmap -n -v -sV -iL $WORKING_DIR/all_discovered_ips.txt -p $(tr '\n' , < "$WORKING_DIR"/ports) -oA $WORKING_DIR/nmap-output.""$NC";
1226 | START=$(date +%s);
1227 | nmap -n -v -sV -iL "$WORKING_DIR"/"$ALL_IP" -p "$(tr '\n' , < "$WORKING_DIR"/ports)" -oA "$WORKING_DIR"/nmap-output --stylesheet https://raw.githubusercontent.com/honze-net/nmap-bootstrap-xsl/master/nmap-bootstrap.xsl;
1228 | END=$(date +%s);
1229 | DIFF=$(( END - START ));
1230 | echo -e "$GREEN""[i]$BLUE Nmap took $DIFF seconds to run.""$NC";
1231 | fi
1232 | echo -e "$GREEN""[i]$BLUE Nmap took $DIFF seconds to run.""$NC";
1233 | }
1234 |
1235 | function run_portscan() {
1236 | while true; do
1237 | echo -e "$GREEN""[?] Do you want to perform port scanning?""$NC";
1238 | echo -e "$ORANGE""[i] This will use masscan and/or nmap.""$NC";
1239 | echo -e "$ORANGE";
1240 | read -rp "[i] Enter Y/N " CHOICE;
1241 | case $CHOICE in
1242 | [yY]* )
1243 | while true; do
1244 | echo -e "$GREEN""[i] Do you want to run [B]oth masscan and nmap, only [N]map, or only [M]asscan?";
1245 | read -rp "[i] Enter B/N/M " CHOICE;
1246 | case $CHOICE in
1247 | [bB]* )
1248 | run_masscan;
1249 | run_nmap;
1250 | break;
1251 | ;;
1252 | [nN]* )
1253 | run_nmap alone;
1254 | break;
1255 | ;;
1256 | [mM]* )
1257 | run_masscan;
1258 | break;
1259 | ;;
1260 | * )
1261 | echo -e "$RED""[!] Please enter B/b, N/n, or M/m. ""$NC"
1262 | ;;
1263 | esac
1264 | done
1265 | break;
1266 | ;;
1267 | [nN]* )
1268 | echo -e "$RED""[!] Cancelling port scan.""$NC";
1269 | return;
1270 | ;;
1271 | * )
1272 | echo -e "$RED""[!] Please enter Y/y or N/n. ""$NC"
1273 | ;;
1274 | esac
1275 | done
1276 | }
1277 |
1278 | function parse_gobuster() {
1279 | # Call with file name as $1
1280 | FILE=$1;
1281 |
1282 | # Get total line count
1283 | TOTAL=$(wc -l "$1" | awk '{print $1}');
1284 | if [[ "$TOTAL" -eq 0 ]]; then
1285 | return
1286 | fi
1287 |
1288 | # Get counts of different return codes
1289 | COUNT_200=$(grep -c 'Status: 200' "$FILE");
1290 | COUNT_201=$(grep -c 'Status: 201' "$FILE");
1291 | COUNT_202=$(grep -c 'Status: 202' "$FILE");
1292 | COUNT_204=$(grep -c 'Status: 204' "$FILE");
1293 | COUNT_307=$(grep -c 'Status: 307' "$FILE");
1294 | COUNT_308=$(grep -c 'Status: 308' "$FILE");
1295 | COUNT_400=$(grep -c 'Status: 400' "$FILE");
1296 | COUNT_401=$(grep -c 'Status: 401' "$FILE");
1297 | COUNT_403=$(grep -c 'Status: 403' "$FILE");
1298 | COUNT_405=$(grep -c 'Status: 405' "$FILE");
1299 | COUNT_500=$(grep -c 'Status: 500' "$FILE");
1300 | COUNT_501=$(grep -c 'Status: 501' "$FILE");
1301 | COUNT_502=$(grep -c 'Status: 502' "$FILE");
1302 | COUNT_503=$(grep -c 'Status: 503' "$FILE");
1303 |
1304 | # Write return code counts to top of file
1305 | echo -e "$GREEN""Number of 200 responses:\\t$BLUE $COUNT_200" >> "$FILE"-parsed;
1306 | echo -e "$GREEN""Number of 201 responses:\\t$BLUE $COUNT_201" >> "$FILE"-parsed;
1307 | echo -e "$GREEN""Number of 202 responses:\\t$BLUE $COUNT_202" >> "$FILE"-parsed;
1308 | echo -e "$GREEN""Number of 204 responses:\\t$BLUE $COUNT_204" >> "$FILE"-parsed;
1309 | echo -e "$GREEN""Number of 307 responses:\\t$BLUE $COUNT_307" >> "$FILE"-parsed;
1310 | echo -e "$GREEN""Number of 308 responses:\\t$BLUE $COUNT_308" >> "$FILE"-parsed;
1311 | echo -e "$GREEN""Number of 400 responses:\\t$BLUE $COUNT_400" >> "$FILE"-parsed;
1312 | echo -e "$GREEN""Number of 401 responses:\\t$BLUE $COUNT_401" >> "$FILE"-parsed;
1313 | echo -e "$GREEN""Number of 403 responses:\\t$BLUE $COUNT_403" >> "$FILE"-parsed;
1314 | echo -e "$GREEN""Number of 405 responses:\\t$BLUE $COUNT_405" >> "$FILE"-parsed;
1315 | echo -e "$GREEN""Number of 500 responses:\\t$BLUE $COUNT_500" >> "$FILE"-parsed;
1316 | echo -e "$GREEN""Number of 501 responses:\\t$BLUE $COUNT_501" >> "$FILE"-parsed;
1317 | echo -e "$GREEN""Number of 502 responses:\\t$BLUE $COUNT_502" >> "$FILE"-parsed;
1318 | echo -e "$GREEN""Number of 503 responses:\\t$BLUE $COUNT_503" >> "$FILE"-parsed;
1319 |
1320 | if [[ "$TOTAL" -gt 1000 ]]; then
1321 | echo -e "$GREEN""False positives:\\t\\t$RED Likely! Total count is $TOTAL.""$NC" >> "$FILE"-parsed;
1322 | else
1323 | echo -e $"$GREEN""False positives:\\t\\t$BLUE Unlikely. Total count is $TOTAL.""$NC" >> "$FILE"-parsed;
1324 | fi
1325 | echo -e "\\n\\n\\n" >> "$FILE"-parsed;
1326 |
1327 | # Echo all parse d output to file
1328 | cat "$FILE" >> "$FILE"-parsed;
1329 | }
1330 |
1331 | function run_gobuster() {
1332 | # Call with domain as $1, wordlist size as $2, and domain list as $3
1333 | if [[ $3 == $WORKING_DIR/$ALL_RESOLVED ]]; then # Run against all resolvable domains
1334 | echo -e "$GREEN""[i]$BLUE Running gobuster against all $(wc -l "$3" | awk '{print $1}') unique discovered domains.""$NC";
1335 | echo -e "$GREEN""[i]$BLUE Command: gobuster dir -u https://$DOMAIN -s '200,201,202,204,307,308,400,401,403,405,500,501,502,503' --timeout 3s -e -k -t 20 -w $2 -o gobuster.""$NC";
1336 | # Run gobuster
1337 | mkdir "$WORKING_DIR"/gobuster;
1338 | COUNT=$(wc -l "$3" | awk '{print $1}')
1339 | START=$(date +%s);
1340 | while read -r ADOMAIN; do
1341 | "$GOBUSTER" dir -u "$HTTP"://"$ADOMAIN" -s '200,201,202,204,307,308,400,401,403,405,500,501,502,503' --timeout 3s -e -k -t 20 -w "$2" -o "$WORKING_DIR"/gobuster/"$ADOMAIN".txt;
1342 | COUNT=$((COUNT - 1));
1343 | if [[ "$COUNT" != 0 ]]; then
1344 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1345 | fi
1346 | done < "$3"
1347 | END=$(date +%s);
1348 | DIFF=$(( END - START ));
1349 | echo -e "$GREEN""[i]$BLUE Gobuster took $DIFF seconds to run.""$NC";
1350 | else # Run against all interesting domains
1351 | echo -e "$GREEN""[i]$BLUE Running gobuster against all $(wc -l "$3" | awk '{print $1}') discovered interesting domains.""$NC";
1352 | echo -e "$GREEN""[i]$BLUE Command: gobuster dir -u $HTTP://$DOMAIN -s '200,201,202,204,307,308,400,401,403,405,500,501,502,503' --timeout 3s -e -k -t 20 -w $2 -o $WORKING_DIR/gobuster""$NC";
1353 | # Run gobuster
1354 | mkdir "$WORKING_DIR"/gobuster;
1355 | COUNT=$(wc -l "$3" | awk '{print $1}')
1356 | START=$(date +%s);
1357 | while read -r ADOMAIN; do
1358 | "$GOBUSTER" dir -u "$HTTP"://"$ADOMAIN" -s '200,201,202,204,307,308,400,401,403,405,500,501,502,503' --timeout 3s -e -k -t 20 -w "$2" -o "$WORKING_DIR"/gobuster/"$ADOMAIN".txt;
1359 | COUNT=$((COUNT - 1));
1360 | if [[ "$COUNT" != 0 ]]; then
1361 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1362 | fi
1363 | done < "$3"
1364 | END=$(date +%s);
1365 | DIFF=$(( END - START ));
1366 | echo -e "$GREEN""[i]$BLUE Gobuster took $DIFF seconds to run.""$NC";
1367 | fi
1368 |
1369 | # Parse results for better readability of the output
1370 | for file in "$WORKING_DIR"/gobuster/*; do
1371 | COUNT=$(wc -l "$file" | awk '{print $1}');
1372 | # No output files have 17 lines
1373 | if [[ $COUNT -gt 17 ]]; then
1374 | parse_gobuster "$file";
1375 | fi
1376 | done
1377 | }
1378 |
1379 | function parse_ffuf() {
1380 | # Call with file name as $1
1381 | FILE=$1;
1382 |
1383 | # Get total line count
1384 | TOTAL=$(wc -l "$1" | awk '{print $1}');
1385 |
1386 | # Get counts of different return codes
1387 | COUNT_200=$(grep 'Status' "$1" | grep -c 200);
1388 | COUNT_201=$(grep 'Status' "$1" | grep -c 201);
1389 | COUNT_202=$(grep 'Status' "$1" | grep -c 202);
1390 | COUNT_204=$(grep 'Status' "$1" | grep -c 204);
1391 | COUNT_307=$(grep 'Status' "$1" | grep -c 307);
1392 | COUNT_308=$(grep 'Status' "$1" | grep -c 308);
1393 | COUNT_400=$(grep 'Status' "$1" | grep -c 400);
1394 | COUNT_401=$(grep 'Status' "$1" | grep -c 401);
1395 | COUNT_403=$(grep 'Status' "$1" | grep -c 403);
1396 | COUNT_405=$(grep 'Status' "$1" | grep -c 405);
1397 | COUNT_500=$(grep 'Status' "$1" | grep -c 500);
1398 | COUNT_501=$(grep 'Status' "$1" | grep -c 501);
1399 | COUNT_502=$(grep 'Status' "$1" | grep -c 502);
1400 | COUNT_503=$(grep 'Status' "$1" | grep -c 503);
1401 |
1402 | # Write return code counts to top of file
1403 | echo -e "$GREEN""Number of 200 responses:\\t$BLUE $COUNT_200" >> "$FILE"-parsed;
1404 | echo -e "$GREEN""Number of 201 responses:\\t$BLUE $COUNT_201" >> "$FILE"-parsed;
1405 | echo -e "$GREEN""Number of 202 responses:\\t$BLUE $COUNT_202" >> "$FILE"-parsed;
1406 | echo -e "$GREEN""Number of 204 responses:\\t$BLUE $COUNT_204" >> "$FILE"-parsed;
1407 | echo -e "$GREEN""Number of 307 responses:\\t$BLUE $COUNT_307" >> "$FILE"-parsed;
1408 | echo -e "$GREEN""Number of 308 responses:\\t$BLUE $COUNT_308" >> "$FILE"-parsed;
1409 | echo -e "$GREEN""Number of 400 responses:\\t$BLUE $COUNT_400" >> "$FILE"-parsed;
1410 | echo -e "$GREEN""Number of 401 responses:\\t$BLUE $COUNT_401" >> "$FILE"-parsed;
1411 | echo -e "$GREEN""Number of 403 responses:\\t$BLUE $COUNT_403" >> "$FILE"-parsed;
1412 | echo -e "$GREEN""Number of 405 responses:\\t$BLUE $COUNT_405" >> "$FILE"-parsed;
1413 | echo -e "$GREEN""Number of 500 responses:\\t$BLUE $COUNT_500" >> "$FILE"-parsed;
1414 | echo -e "$GREEN""Number of 501 responses:\\t$BLUE $COUNT_501" >> "$FILE"-parsed;
1415 | echo -e "$GREEN""Number of 502 responses:\\t$BLUE $COUNT_502" >> "$FILE"-parsed;
1416 | echo -e "$GREEN""Number of 503 responses:\\t$BLUE $COUNT_503" >> "$FILE"-parsed;
1417 |
1418 | if [[ "$TOTAL" -gt 1000 ]]; then
1419 | echo -e "$GREEN""False positives:\\t\\t$RED Likely! Total count is $TOTAL.""$NC" >> "$FILE"-parsed;
1420 | else
1421 | echo -e $"$GREEN""False positives:\\t\\t$BLUE Unlikely. Total count is $TOTAL.""$NC" >> "$FILE"-parsed;
1422 | fi
1423 | echo -e "\\n\\n\\n" >> "$FILE"-parsed;
1424 |
1425 | # Echo all parsed output to file
1426 | grep -v '::' "$1" | grep 'Status' >> "$FILE"-parsed;
1427 | }
1428 |
1429 | function run_ffuf() {
1430 | # Trap SIGINT so broken ffuf runs can be cancelled
1431 | trap cancel SIGINT;
1432 |
1433 | # Call with domain as $1, wordlist size as $2, and domain list as $3
1434 | if [[ $3 == $WORKING_DIR/$ALL_RESOLVED ]]; then
1435 | echo -e "$GREEN""[i]$BLUE Running ffuf against all $(wc -l "$3" | awk '{print $1}') unique discovered domains.""$NC";
1436 | echo -e "$GREEN""[i]$BLUE Command: ffuf -u $HTTP://$DOMAIN/FUZZ -w $2 -sf -se -fc 301,302,404,400,500 -k | tee $WORKING_DIR/ffuf.""$NC";
1437 | # Run ffuf
1438 | mkdir "$WORKING_DIR"/ffuf;
1439 | COUNT=$(wc -l "$3" | awk '{print $1}')
1440 | START=$(date +%s);
1441 | while read -r ADOMAIN; do
1442 | "$FFUF" -u "$HTTP"://"$ADOMAIN"/FUZZ -w "$2" -timeout 3 -sf -se -fc 301,302,404,400,500 -k -mc all | tee "$WORKING_DIR"/ffuf/"$ADOMAIN".txt;
1443 | COUNT=$((COUNT - 1));
1444 | if [[ "$COUNT" != 0 ]]; then
1445 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1446 | fi
1447 | done < "$3"
1448 | END=$(date +%s);
1449 | DIFF=$(( END - START ));
1450 | echo -e "$GREEN""[i]$BLUE ffuf took $DIFF seconds to run.""$NC";
1451 | else
1452 | echo -e "$GREEN""[i]$BLUE Running ffuf against all $(wc -l "$3" | awk '{print $1}') discovered interesting domains.""$NC";
1453 | echo -e "$GREEN""[i]$BLUE Command: ffuf -u $HTTP://$DOMAIN/FUZZ -w $2 -sf -se -fc 301,302,404,400,500 -k | tee $WORKING_DIR/ffuf.""$NC";
1454 | # Run ffuf
1455 | mkdir "$WORKING_DIR"/ffuf;
1456 | COUNT=$(wc -l "$3" | awk '{print $1}')
1457 | START=$(date +%s);
1458 | while read -r ADOMAIN; do
1459 | "$FFUF" -u "$HTTP"://"$ADOMAIN"/FUZZ -w "$2" -timeout 3 -sf -se -fc 301,302,404,400,500 -k -mc all | tee "$WORKING_DIR"/ffuf/"$ADOMAIN".txt;
1460 | COUNT=$((COUNT - 1));
1461 | if [[ "$COUNT" != 0 ]]; then
1462 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1463 | fi
1464 | done < "$3"
1465 | END=$(date +%s);
1466 | DIFF=$(( END - START ));
1467 | echo -e "$GREEN""[i]$BLUE ffuf took $DIFF seconds to run.""$NC";
1468 | fi
1469 |
1470 | # Parse results for better readability of the output
1471 | for file in "$WORKING_DIR"/ffuf/*; do
1472 | COUNT=$(wc -l "$file" | awk '{print $1}');
1473 | # No output files have 17 lines
1474 | if [[ $COUNT -gt 17 ]]; then
1475 | parse_ffuf "$file";
1476 | fi
1477 | done
1478 | }
1479 |
1480 | function run_dirsearch() {
1481 | # Trap SIGINT so broken dirsearch runs can be cancelled
1482 | trap cancel SIGINT;
1483 |
1484 | # Call with domain as $1, wordlist size as $2, and domain list as $3
1485 | if [[ $3 == $WORKING_DIR/$ALL_RESOLVED ]]; then
1486 | echo -e "$GREEN""[i]$BLUE Running dirsearch against all $(wc -l "$3" | awk '{print $1}') unique discovered domains.""$NC";
1487 | echo -e "$GREEN""[i]$BLUE Command: dirsearch -u $DOMAIN -e php,aspx,asp -t 20 -x 310,302,404 -F --plain-text-report=$WORKING_DIR/dirsearch/$DOMAIN.txt -w $2""$NC";
1488 | # Run dirsearch
1489 | mkdir "$WORKING_DIR"/dirsearch;
1490 | COUNT=$(wc -l "$3" | awk '{print $1}')
1491 | START=$(date +%s);
1492 | while read -r ADOMAIN; do
1493 | "$DIRSEARCH" -u "$HTTP"://"$ADOMAIN" -e php,aspx,asp -t 20 -x 301,302,404 -F --plain-text-report="$WORKING_DIR"/dirsearch/"$ADOMAIN".txt -w "$2";
1494 | COUNT=$((COUNT - 1));
1495 | if [[ "$COUNT" != 0 ]]; then
1496 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1497 | fi
1498 | done < "$3"
1499 | END=$(date +%s);
1500 | DIFF=$(( END - START ));
1501 | echo -e "$GREEN""[i]$BLUE Dirsearch took $DIFF seconds to run.""$NC";
1502 | else
1503 | echo -e "$GREEN""[i]$BLUE Running dirsearch against all $(wc -l "$3" | awk '{print $1}') discovered interesting domains.""$NC";
1504 | echo -e "$GREEN""[i]$BLUE Command: dirsearch -u $DOMAIN -e php,aspx,asp -t 20 -x 301,302,404 -F --plain-text-report=$WORKING_DIR/dirsearch/$DOMAIN.txt -w $2""$NC";
1505 | # Run dirsearch
1506 | mkdir "$WORKING_DIR"/dirsearch;
1507 | COUNT=$(wc -l "$3" | awk '{print $1}')
1508 | START=$(date +%s);
1509 | while read -r ADOMAIN; do
1510 | "$DIRSEARCH" -u "$HTTP"://"$ADOMAIN" -e php,aspx,asp -t 20 -x 301,302,404 -F --plain-text-report="$WORKING_DIR"/dirsearch/"$ADOMAIN".txt -w "$2";
1511 | COUNT=$((COUNT - 1));
1512 | if [[ "$COUNT" != 0 ]]; then
1513 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1514 | fi
1515 | done < "$3"
1516 | END=$(date +%s);
1517 | DIFF=$(( END - START ));
1518 | echo -e "$GREEN""[i]$BLUE Dirsearch took $DIFF seconds to run.""$NC";
1519 | fi
1520 | }
1521 |
1522 | function run_snallygaster() {
1523 | # Call with domain as $1, wordlist size as $2, and domain list as $3
1524 | if [[ $3 == $WORKING_DIR/$ALL_RESOLVED ]]; then
1525 | echo -e "$GREEN""[i]$BLUE Running snallygaster against all $(wc -l "$3" | awk '{print $1}') unique discovered domains.""$NC";
1526 | echo -e "$GREEN""[i]$BLUE Command: snallygaster $DOMAIN -d --nowww | tee $WORKING_DIR/snallygaster/$ADOMAIN""$NC";
1527 | # Run snallygaster
1528 | mkdir "$WORKING_DIR"/snallygaster;
1529 | COUNT=$(wc -l "$3" | awk '{print $1}')
1530 | START=$(date +%s);
1531 | while read -r ADOMAIN; do
1532 | "$SNALLY" "$ADOMAIN" -d --nowww # | tee "$WORKING_DIR"/snallygaster/"$ADOMAIN";
1533 | COUNT=$((COUNT - 1));
1534 | if [[ "$COUNT" != 0 ]]; then
1535 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1536 | fi
1537 | done < "$3"
1538 | END=$(date +%s);
1539 | DIFF=$(( END - START ));
1540 | echo -e "$GREEN""[i]$BLUE Snallygaster took $DIFF seconds to run.""$NC";
1541 | else
1542 | echo -e "$GREEN""[i]$BLUE Running dirsearch against all $(wc -l "$3" | awk '{print $1}') discovered interesting domains.""$NC";
1543 | echo -e "$GREEN""[i]$BLUE Command: snallygaster $DOMAIN -d --nowww | tee $WORKING_DIR/snallygaster/$ADOMAIN""$NC";
1544 | # Run snallygaster
1545 | mkdir "$WORKING_DIR"/snallygaster;
1546 | COUNT=$(wc -l "$3" | awk '{print $1}')
1547 | START=$(date +%s);
1548 | while read -r ADOMAIN; do
1549 | "$SNALLY" "$ADOMAIN" -d --nowww #| tee "$WORKING_DIR"/snallygaster/"$ADOMAIN";
1550 | COUNT=$((COUNT - 1));
1551 | if [[ "$COUNT" != 0 ]]; then
1552 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1553 | fi
1554 | done < "$3"
1555 | END=$(date +%s);
1556 | DIFF=$(( END - START ));
1557 | echo -e "$GREEN""[i]$BLUE Snallygaster took $DIFF seconds to run.""$NC";
1558 | fi
1559 | }
1560 |
1561 | function run_inception() {
1562 | # Trap SIGINT so broken inception runs can be cancelled
1563 | trap cancel SIGINT;
1564 |
1565 | # Call with domain as $1, wordlist size as $2, and domain list as $3
1566 | if [[ $3 == $WORKING_DIR/$ALL_RESOLVED ]]; then
1567 | echo -e "$GREEN""[i]$BLUE Running inception against all $(wc -l "$3" | awk '{print $1}') unique discovered domains.""$NC";
1568 | echo -e "$GREEN""[i]$BLUE Command: inception -d all_discovered_domains -v | tee $WORKING_DIR/inception""$NC";
1569 | # Run inception
1570 | mkdir "$WORKING_DIR"/inception;
1571 | START=$(date +%s);
1572 | "$INCEPTION" -d "$3" -v -provider wordlists/provider.json | tee "$WORKING_DIR"/inception/inception-output.txt;
1573 | END=$(date +%s);
1574 | DIFF=$(( END - START ));
1575 | echo -e "$GREEN""[i]$BLUE Inception took $DIFF seconds to run.""$NC";
1576 | else
1577 | echo -e "$GREEN""[i]$BLUE Running inception against all $(wc -l "$3" | awk '{print $1}') discovered interesting domains.""$NC";
1578 | echo -e "$GREEN""[i]$BLUE Command: inception -d interesting_domains.txt -v | tee $WORKING_DIR/inception""$NC";
1579 | # Run inception
1580 | mkdir "$WORKING_DIR"/inception;
1581 | START=$(date +%s);
1582 | "$INCEPTION" -d "$3" -v -provider wordlists/provider.json | tee "$WORKING_DIR"/inception/inception-output.txt;
1583 |
1584 | END=$(date +%s);
1585 | DIFF=$(( END - START ));
1586 | echo -e "$GREEN""[i]$BLUE Inception took $DIFF seconds to run.""$NC";
1587 | fi
1588 | }
1589 |
1590 | function run_waybackurls() {
1591 | # Call with domain as $1
1592 | echo -e "$GREEN""[i]$BLUE Running waybackurls against $DOMAIN.""$NC";
1593 | echo -e "$GREEN""[i]$BLUE Command: waybackurls $DOMAIN | tee $WORKING_DIR/waybackurls-output.txt""$NC";
1594 | # Run waybackurls
1595 | START=$(date +%s);
1596 | "$WAYBACKURLS" "$DOMAIN" | tee "$WORKING_DIR"/waybackurls-output.txt;
1597 | END=$(date +%s);
1598 | DIFF=$(( END - START ));
1599 | echo -e "$GREEN""[i]$BLUE Waybackurls took $DIFF seconds to run.""$NC";
1600 | }
1601 |
1602 | function run_content_discovery() {
1603 | # Ask user to do directory bruteforcing on discovered domains
1604 | while true; do
1605 | echo -e "$GREEN""[?] Do you want to begin content bruteforcing on [A]ll/[I]nteresting/[N]o discovered domains?";
1606 | echo -e "$ORANGE""[i] This will run inception, waybackurls, ffuf, gobuster, and dirsearch.";
1607 | read -rp "[?] Please enter A/a, I/i, or N/n. " ANSWER
1608 |
1609 | case $ANSWER in
1610 | [aA]* )
1611 | echo -e "[i] Beginning directory bruteforcing on all discovered resolvable domains.";
1612 | while true; do
1613 | echo -e "$GREEN""[?] Which wordlist do you want to use?""$NC";
1614 | echo -e "$BLUE"" Small: ~20k words""$NC";
1615 | echo -e "$BLUE"" Medium: ~167k words""$NC";
1616 | echo -e "$BLUE"" Large: ~215k words""$NC";
1617 | echo -e "$BLUE"" XL: ~373k words""$NC";
1618 | echo -e "$BLUE"" 2XL: ~486k words""$GREEN";
1619 | read -rp "[i] Enter S/M/L/X/2 " CHOICE;
1620 | case $CHOICE in
1621 | [sS]* )
1622 | run_inception "$DOMAIN" "$SMALL" "$WORKING_DIR"/"$ALL_RESOLVED";
1623 | run_waybackurls "$DOMAIN";
1624 | run_ffuf "$DOMAIN" "$SMALL" "$WORKING_DIR"/"$ALL_RESOLVED";
1625 | run_gobuster "$DOMAIN" "$SMALL" "$WORKING_DIR"/"$ALL_RESOLVED";
1626 | run_dirsearch "$DOMAIN" "$SMALL" "$WORKING_DIR"/"$ALL_RESOLVED";
1627 | break;
1628 | ;;
1629 | [mM]* )
1630 | run_inception "$DOMAIN" "$MEDIUM" "$WORKING_DIR"/"$ALL_RESOLVED";
1631 | run_waybackurls "$DOMAIN";
1632 | run_ffuf "$DOMAIN" "$MEDIUM" "$WORKING_DIR"/"$ALL_RESOLVED";
1633 | run_gobuster "$DOMAIN" "$MEDIUM" "$WORKING_DIR"/"$ALL_RESOLVED";
1634 | run_dirsearch "$DOMAIN" "$MEDIUM" "$WORKING_DIR"/"$ALL_RESOLVED";
1635 | break;
1636 | ;;
1637 | [lL]* )
1638 | run_inception "$DOMAIN" "$LARGE" "$WORKING_DIR"/"$ALL_RESOLVED";
1639 | run_waybackurls "$DOMAIN";
1640 | run_ffuf "$DOMAIN" "$LARGE" "$WORKING_DIR"/"$ALL_RESOLVED";
1641 | run_gobuster "$DOMAIN" "$LARGE" "$WORKING_DIR"/"$ALL_RESOLVED";
1642 | run_dirsearch "$DOMAIN" "$LARGE" "$WORKING_DIR"/"$ALL_RESOLVED";
1643 | break;
1644 | ;;
1645 | [xX]* )
1646 | run_inception "$DOMAIN" "$XL" "$WORKING_DIR"/"$ALL_RESOLVED";
1647 | run_waybackurls "$DOMAIN";
1648 | run_ffuf "$DOMAIN" "$XL" "$WORKING_DIR"/"$ALL_RESOLVED";
1649 | run_gobuster "$DOMAIN" "$XL" "$WORKING_DIR"/"$ALL_RESOLVED";
1650 | run_dirsearch "$DOMAIN" "$XL" "$WORKING_DIR"/"$ALL_RESOLVED";
1651 | break;
1652 | ;;
1653 | [2]* )
1654 | run_inception "$DOMAIN" "$XXL" "$WORKING_DIR"/"$ALL_RESOLVED";
1655 | run_waybackurls "$DOMAIN";
1656 | run_ffuf "$DOMAIN" "$XXL" "$WORKING_DIR"/"$ALL_RESOLVED";
1657 | run_gobuster "$DOMAIN" "$XXL" "$WORKING_DIR"/"$ALL_RESOLVED";
1658 | run_dirsearch "$DOMAIN" "$XXL" "$WORKING_DIR"/"$ALL_RESOLVED";
1659 | break;
1660 | ;;
1661 | * )
1662 | echo -e "$RED""Please enter S/M/L/X/2 .""$NC";
1663 | ;;
1664 | esac
1665 | done
1666 | break;
1667 | ;;
1668 | [nN]* )
1669 | echo -e "$RED""[!] Skipping directory bruteforcing on all domains.""$NC";
1670 | return;
1671 | ;;
1672 | [iI]* )
1673 | # Check if any interesting domains have been found.'
1674 | COUNT=$(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}');
1675 | if [[ "$COUNT" -lt 1 ]]; then
1676 | echo -e "$RED""[!] No interesting domains have been discovered.""$NC";
1677 | return;
1678 | fi
1679 |
1680 | echo -e "[i] Beginning directory bruteforcing on all interesting discovered domains.";
1681 | while true; do
1682 | echo -e "$GREEN""[?] Which wordlist do you want to use?""$NC";
1683 | echo -e "$BLUE"" Small: ~20k words""$NC";
1684 | echo -e "$BLUE"" Medium: ~167k words""$NC";
1685 | echo -e "$BLUE"" Large: ~215k words""$NC";
1686 | echo -e "$BLUE"" XL: ~373k words""$NC";
1687 | echo -e "$BLUE"" 2XL: ~486k words""$GREEN";
1688 | read -rp "[i] Enter S/M/L/X/2 " CHOICE;
1689 | case $CHOICE in
1690 | [sS]* )
1691 | run_inception "$DOMAIN" "$SMALL" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1692 | run_waybackurls "$DOMAIN";
1693 | run_ffuf "$DOMAIN" "$SMALL" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1694 | run_gobuster "$DOMAIN" "$SMALL" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1695 | run_dirsearch "$DOMAIN" "$SMALL" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1696 | break;
1697 | ;;
1698 | [mM]* )
1699 | run_inception "$DOMAIN" "$MEDIUM" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1700 | run_waybackurls "$DOMAIN";
1701 | run_ffuf "$DOMAIN" "$MEDIUM" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1702 | run_gobuster "$DOMAIN" "$MEDIUM" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1703 | run_dirsearch "$DOMAIN" "$MEDIUM" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1704 | break;
1705 | ;;
1706 | [lL]* )
1707 | run_inception "$DOMAIN" "$LARGE" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1708 | run_waybackurls "$DOMAIN";
1709 | run_ffuf "$DOMAIN" "$LARGE" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1710 | run_gobuster "$DOMAIN" "$LARGE" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1711 | run_dirsearch "$DOMAIN" "$LARGE" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1712 | break;
1713 | ;;
1714 | [xX]* )
1715 | run_inception "$DOMAIN" "$XL" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1716 | run_waybackurls "$DOMAIN";
1717 | run_ffuf "$DOMAIN" "$XL" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1718 | run_gobuster "$DOMAIN" "$XL" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1719 | run_dirsearch "$DOMAIN" "$XL" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1720 | break;
1721 | ;;
1722 | [2]* )
1723 | run_inception "$DOMAIN" "$XXL" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1724 | run_waybackurls "$DOMAIN";
1725 | run_ffuf "$DOMAIN" "$XXL" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1726 | run_gobuster "$DOMAIN" "$XXL" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1727 | run_dirsearch "$DOMAIN" "$XXL" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
1728 | break;
1729 | ;;
1730 | * )
1731 | echo -e "$RED""Please enter S/M/L/X/2 .""$NC";
1732 | ;;
1733 | esac
1734 | done
1735 | break;
1736 | ;;
1737 | * )
1738 | echo -e "$RED""Please enter Y/y, N/n, or A/a. ""$NC";
1739 | ;;
1740 | esac
1741 | done
1742 | }
1743 |
1744 | function run_bfac() {
1745 | # Call with domain list as $1
1746 | if [[ $1 == $WORKING_DIR/$ALL_RESOLVED ]]; then
1747 | echo -e "$GREEN""[i]$BLUE Running bfac against all $(wc -l "$1" | awk '{print $1}') unique discovered domains.""$NC";
1748 | echo -e "$GREEN""[i]$BLUE Command: bfac -u $DOMAIN -xsc 301,302,404 --threads 30 -o $WORKING_DIR/bfac.""$NC";
1749 | # Run bfac
1750 | mkdir "$WORKING_DIR"/bfac;
1751 | COUNT=$(wc -l "$1" | awk '{print $1}')
1752 | START=$(date +%s);
1753 | while read -r ADOMAIN; do
1754 | $BFAC -u "$ADOMAIN" -xsc 301,302,404 --threads 30 -o "$WORKING_DIR"/bfac/"$ADOMAIN";
1755 | COUNT=$((COUNT - 1));
1756 | if [[ "$COUNT" != 0 ]]; then
1757 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1758 | fi
1759 | done < "$1"
1760 | END=$(date +%s);
1761 | DIFF=$(( END - START ));
1762 | echo -e "$GREEN""[i]$BLUE bfac took $DIFF seconds to run.""$NC";
1763 | else
1764 | echo -e "$GREEN""[i]$BLUE Running bfac against all $(wc -l "$1" | awk '{print $1}') discovered interesting domains.""$NC";
1765 | echo -e "$GREEN""[i]$BLUE Command: bfac -u $DOMAIN -xsc 301,302,404 --threads 30 -o $WORKING_DIR/bfac.""$NC";
1766 | # Run bfac
1767 | mkdir "$WORKING_DIR"/bfac;
1768 | COUNT=$(wc -l "$1" | awk '{print $1}')
1769 | START=$(date +%s);
1770 | while read -r ADOMAIN; do
1771 | $BFAC -u "$ADOMAIN" -xsc 301,302,404 --threads 30 -o "$WORKING_DIR"/bfac/"$ADOMAIN";
1772 | COUNT=$((COUNT - 1));
1773 | if [[ "$COUNT" != 0 ]]; then
1774 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1775 | fi
1776 | done < "$1"
1777 | END=$(date +%s);
1778 | DIFF=$(( END - START ));
1779 | echo -e "$GREEN""[i]$BLUE bfac took $DIFF seconds to run.""$NC";
1780 | fi
1781 | }
1782 |
1783 | function run_nikto() {
1784 | # Call with domain list as $1
1785 | # If httprobe was enabled, use its results instead
1786 | if [[ "$ENABLE_HTTPROBE" == 1 ]]; then
1787 | if [[ -e "$WORKING_DIR"/httprobe-out.txt ]]; then
1788 | echo -e "$GREEN""[i]$BLUE Running nikto against all $(wc -l "$WORKING_DIR"/httprobe-out.txt | awk '{print $1}') httprobe discovered domains.""$NC";
1789 | echo -e "$GREEN""[i]$BLUE Command: nikto -h $HTTP://$DOMAIN -Format html -output $WORKING_DIR/nikto.""$NC";
1790 | # Run nikto
1791 | COUNT=$(wc -l "$WORKING_DIR"/httprobe-out.txt | awk '{print $1}')
1792 | mkdir "$WORKING_DIR"/nikto;
1793 | START=$(date +%s);
1794 | while read -r ADOMAIN; do
1795 | TRIMMED=$(echo "$ADOMAIN" | tr -d '/');
1796 | "$NIKTO" -h "$ADOMAIN" -Format html -output "$WORKING_DIR"/nikto/"$TRIMMED".html;
1797 | COUNT=$((COUNT - 1));
1798 | if [[ "$COUNT" != 0 ]]; then
1799 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1800 | fi
1801 | done < "$WORKING_DIR"/httprobe-out.txt
1802 | END=$(date +%s);
1803 | DIFF=$(( END - START ));
1804 | echo -e "$GREEN""[i]$BLUE Nikto took $DIFF seconds to run.""$NC";
1805 | return;
1806 | fi
1807 | elif [[ $1 == $WORKING_DIR/$ALL_RESOLVED ]]; then
1808 | echo -e "$GREEN""[i]$BLUE Running nikto against all $(wc -l "$1" | awk '{print $1}') unique discovered domains.""$NC";
1809 | echo -e "$GREEN""[i]$BLUE Command: nikto -h $HTTP://$DOMAIN -Format html -output $WORKING_DIR/nikto.""$NC";
1810 | # Run nikto
1811 | COUNT=$(wc -l "$1" | awk '{print $1}')
1812 | mkdir "$WORKING_DIR"/nikto;
1813 | START=$(date +%s);
1814 | while read -r ADOMAIN; do
1815 | "$NIKTO" -h "$HTTP"://"$ADOMAIN" -Format html -output "$WORKING_DIR"/nikto/"$ADOMAIN".html;
1816 | COUNT=$((COUNT - 1));
1817 | if [[ "$COUNT" != 0 ]]; then
1818 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1819 | fi
1820 | done < "$1"
1821 | END=$(date +%s);
1822 | DIFF=$(( END - START ));
1823 | echo -e "$GREEN""[i]$BLUE Nikto took $DIFF seconds to run.""$NC";
1824 | else
1825 | echo -e "$GREEN""[i]$BLUE Running nikto against all $(wc -l "$1" | awk '{print $1}') discovered interesting domains.""$NC";
1826 | echo -e "$GREEN""[i]$BLUE Command: nikto -h $HTTP://$DOMAIN -Format html -output $WORKING_DIR/nikto.""$NC";
1827 | # Run nikto
1828 | COUNT=$(wc -l "$1" | awk '{print $1}')
1829 | mkdir "$WORKING_DIR"/nikto;
1830 | START=$(date +%s);
1831 | while read -r ADOMAIN; do
1832 | "$NIKTO" -h "$HTTP"://"$ADOMAIN" -Format html -output "$WORKING_DIR"/nikto/"$ADOMAIN".html;
1833 | COUNT=$((COUNT - 1));
1834 | if [[ "$COUNT" != 0 ]]; then
1835 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1836 | fi
1837 | done < "$1"
1838 | END=$(date +%s);
1839 | DIFF=$(( END - START ));
1840 | echo -e "$GREEN""[i]$BLUE Nikto took $DIFF seconds to run.""$NC";
1841 | fi
1842 | }
1843 |
1844 | function run_whatweb() {
1845 | # Call with domain as $1 and domain list as $2
1846 | if [[ $2 == $WORKING_DIR/$ALL_RESOLVED ]]; then
1847 | echo -e "$GREEN""[i]$BLUE Running whatweb against all $(wc -l "$2" | awk '{print $1}') unique discovered domains.""$NC";
1848 | echo -e "$GREEN""[i]$BLUE Command: whatweb -v -a 3 -h $HTTP://$DOMAIN | tee $WORKING_DIR/whatweb.""$NC";
1849 | # Run whatweb
1850 | COUNT=$(wc -l "$2" | awk '{print $1}')
1851 | mkdir "$WORKING_DIR"/whatweb;
1852 | START=$(date +%s);
1853 | while read -r ADOMAIN; do
1854 | "$WHATWEB" -v -a 3 "$HTTP"://"$ADOMAIN" | tee "$WORKING_DIR"/whatweb/"$ADOMAIN";
1855 | COUNT=$((COUNT - 1));
1856 | if [[ "$COUNT" != 0 ]]; then
1857 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1858 | fi
1859 | done < "$2"
1860 | END=$(date +%s);
1861 | DIFF=$(( END - START ));
1862 | echo -e "$GREEN""[i]$BLUE whatweb took $DIFF seconds to run.""$NC";
1863 | else
1864 | echo -e "$GREEN""[i]$BLUE Running whatweb against all $(wc -l "$2" | awk '{print $1}') discovered interesting domains.""$NC";
1865 | echo -e "$GREEN""[i]$BLUE Command: whatweb -v -a 3 -h $HTTP://$DOMAIN | tee $WORKING_DIR/whatweb.""$NC";
1866 | # Run whatweb
1867 | COUNT=$(wc -l "$2" | awk '{print $1}')
1868 | mkdir "$WORKING_DIR"/whatweb;
1869 | START=$(date +%s);
1870 | while read -r ADOMAIN; do
1871 | "$WHATWEB" -v -a 3 "$HTTP"://"$ADOMAIN" | tee "$WORKING_DIR"/whatweb/"$ADOMAIN";
1872 | COUNT=$((COUNT - 1));
1873 | if [[ "$COUNT" != 0 ]]; then
1874 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1875 | fi
1876 | done < "$2"
1877 | END=$(date +%s);
1878 | DIFF=$(( END - START ));
1879 | echo -e "$GREEN""[i]$BLUE whatweb took $DIFF seconds to run.""$NC";
1880 | fi
1881 | }
1882 |
1883 | function run_wafw00f() {
1884 | # Call with domain as $1 and domain list as $2
1885 | if [[ $2 == $WORKING_DIR/$ALL_RESOLVED ]]; then
1886 | echo -e "$GREEN""[i]$BLUE Running wafw00f against all $(wc -l "$2" | awk '{print $1}') unique discovered domains.""$NC";
1887 | echo -e "$GREEN""[i]$BLUE Command: wafw00f $HTTP://$1 -a | tee $WORKING_DIR/wafw00f.""$NC";
1888 | # Run wafw00f
1889 | COUNT=$(wc -l "$2" | awk '{print $1}')
1890 | mkdir "$WORKING_DIR"/wafw00f;
1891 | START=$(date +%s);
1892 | while read -r ADOMAIN; do
1893 | "$WAFW00F" "$HTTP"://"$ADOMAIN" -a | tee "$WORKING_DIR"/wafw00f/"$ADOMAIN";
1894 | COUNT=$((COUNT - 1));
1895 | if [[ "$COUNT" != 0 ]]; then
1896 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1897 | fi
1898 | done < "$2"
1899 | END=$(date +%s);
1900 | DIFF=$(( END - START ));
1901 | echo -e "$GREEN""[i]$BLUE wafw00f took $DIFF seconds to run.""$NC";
1902 | else
1903 | echo -e "$GREEN""[i]$BLUE Running wafw00f against all $(wc -l "$2" | awk '{print $1}') discovered interesting domains.""$NC";
1904 | echo -e "$GREEN""[i]$BLUE Command: wafw00f $HTTP://$1 -a | tee $WORKING_DIR/wafw00f.""$NC";
1905 | # Run wafw00f
1906 | COUNT=$(wc -l "$2" | awk '{print $1}')
1907 | mkdir "$WORKING_DIR"/wafw00f;
1908 | START=$(date +%s);
1909 | while read -r ADOMAIN; do
1910 | "$WAFW00F" "$HTTP"://"$ADOMAIN" -a | tee "$WORKING_DIR"/wafw00f/"$ADOMAIN";
1911 | COUNT=$((COUNT - 1));
1912 | if [[ "$COUNT" != 0 ]]; then
1913 | echo -e "$GREEN""[i]$BLUE $COUNT domain(s) remaining.""$NC";
1914 | fi
1915 | done < "$2"
1916 | END=$(date +%s);
1917 | DIFF=$(( END - START ));
1918 | echo -e "$GREEN""[i]$BLUE wafw00f took $DIFF seconds to run.""$NC";
1919 | fi
1920 | }
1921 |
1922 | function run_subjack() {
1923 | # Call with domain as $1 and domain list as $2
1924 | if [[ $2 == $WORKING_DIR/$ALL_RESOLVED ]]; then
1925 | echo -e "$GREEN""[i]$BLUE Running subjack against all $(wc -l "$WORKING_DIR"/$ALL_RESOLVED | awk '{print $1}') unique discovered subdomains to check for subdomain takeover.""$NC";
1926 | echo -e "$GREEN""[i]$ORANGE It will run twice, once against HTTPS and once against HTTP.""$NC";
1927 | echo -e "$GREEN""[i]$ORANGE Command: subjack -d $1 -w $2 -v -t 20 -ssl -m -o $WORKING_DIR/subjack-output.txt""$NC";
1928 | START=$(date +%s);
1929 | "$SUBJACK" -d "$1" -w "$2" -v -t 20 -ssl -m -o "$WORKING_DIR"/subjack-https-output.txt -c "$HOME"/go/src/github.com/haccer/subjack/fingerprints.json;
1930 | "$SUBJACK" -d "$1" -w "$2" -v -t 20 -m -o "$WORKING_DIR"/subjack-http-output.txt -c "$HOME"/go/src/github.com/haccer/subjack/fingerprints.json;
1931 | END=$(date +%s);
1932 | DIFF=$(( END - START ));
1933 | else
1934 | echo -e "$GREEN""[i]$BLUE Running subjack against all $(wc -l "$WORKING_DIR"/$ALL_RESOLVED | awk '{print $1}') discovered interesting subdomains to check for subdomain takeover.""$NC";
1935 | echo -e "$GREEN""[i]$ORANGE It will run twice, once against HTTPS and once against HTTP.""$NC";
1936 | echo -e "$GREEN""[i]$ORANGE Command: subjack -d $1 -w $2 -v -t 20 -ssl -m -o $WORKING_DIR/subjack-output.txt""$NC";
1937 | START=$(date +%s);
1938 | "$SUBJACK" -d "$1" -w "$2" -v -t 20 -ssl -m -o "$WORKING_DIR"/subjack-https-output.txt -c "$HOME"/go/src/github.com/haccer/subjack/fingerprints.json;
1939 | "$SUBJACK" -d "$1" -w "$2" -v -t 20 -m -o "$WORKING_DIR"/subjack-http-output.txt -c "$HOME"/go/src/github.com/haccer/subjack/fingerprints.json;
1940 | END=$(date +%s);
1941 | DIFF=$(( END - START ));
1942 | fi
1943 |
1944 | echo -e "$GREEN""[i]$BLUE Subjack took $DIFF seconds to run.""$NC";
1945 | echo -e "$GREEN""[i]$ORANGE Full Subjack results are at $WORKING_DIR/subjack-output.txt.""$NC";
1946 | sleep 1;
1947 | }
1948 |
1949 | function run_corstest() {
1950 | # Call with domain as $1 and domain list as $2
1951 | if [[ $2 == $WORKING_DIR/$ALL_RESOLVED ]]; then
1952 | echo -e "$GREEN""[i]$BLUE Running CORStest against all $(wc -l "$2" | awk '{print $1}') unique discovered domains.""$NC";
1953 | echo -e "$GREEN""[i]$BLUE Command: corstest.py $2 -v -p 64 | tee $WORKING_DIR/CORStest-output.txt.""$NC";
1954 | # Run CORStest
1955 | START=$(date +%s);
1956 | "$CORSTEST" "$2" -v -p 64 | tee "$WORKING_DIR"/CORStest-output.txt;
1957 | END=$(date +%s);
1958 | DIFF=$(( END - START ));
1959 | echo -e "$GREEN""[i]$BLUE CORStest took $DIFF seconds to run.""$NC";
1960 | else
1961 | echo -e "$GREEN""[i]$BLUE Running CORStest against all $(wc -l "$2" | awk '{print $1}') discovered interesting domains.""$NC";
1962 | echo -e "$GREEN""[i]$BLUE Command: corstest.py $2 -v -p 64 | tee $WORKING_DIR/CORStest-output.txt.""$NC";
1963 | # Run CORStest
1964 | START=$(date +%s);
1965 | "$CORSTEST" "$2" -v -p 64 | tee "$WORKING_DIR"/CORStest-output.txt;
1966 | END=$(date +%s);
1967 | DIFF=$(( END - START ));
1968 | echo -e "$GREEN""[i]$BLUE CORStest took $DIFF seconds to run.""$NC";
1969 | fi
1970 | }
1971 |
1972 | function run_s3scanner() {
1973 | # Call with domain as $1 and domain list as $2
1974 | if [[ $2 == $WORKING_DIR/$ALL_RESOLVED ]]; then
1975 | echo -e "$GREEN""[i]$BLUE Running S3Scanner against all $(wc -l "$2" | awk '{print $1}') unique discovered domains.""$NC";
1976 | echo -e "$GREEN""[i]$BLUE Command: s3scanner.py ""$NC";
1977 | # Run S3Scanner
1978 | START=$(date +%s);
1979 | python "$S3SCANNER" "$2" -d -l -o "$WORKING_DIR"/s3scanner-output.txt;
1980 | END=$(date +%s);
1981 | DIFF=$(( END - START ));
1982 | echo -e "$GREEN""[i]$BLUE S3Scanner took $DIFF seconds to run.""$NC";
1983 | else
1984 | echo -e "$GREEN""[i]$BLUE Running S3Scanner against all $(wc -l "$2" | awk '{print $1}') discovered interesting domains.""$NC";
1985 | echo -e "$GREEN""[i]$BLUE Command: s3scanner.py ""$NC";
1986 | # Run S3Scanner
1987 | START=$(date +%s);
1988 | python "$S3SCANNER" "$2" -d -l -o "$WORKING_DIR"/s3scanner-output.txt;
1989 | END=$(date +%s);
1990 | DIFF=$(( END - START ));
1991 | echo -e "$GREEN""[i]$BLUE S3Scanner took $DIFF seconds to run.""$NC";
1992 | fi
1993 | }
1994 |
1995 | function run_information_gathering() {
1996 | # Ask user to do information gathering on discovered domains
1997 | while true; do
1998 | echo -e "$GREEN""[?] Do you want to begin information gathering on [A]ll/[I]nteresting/[N]o discovered domains?";
1999 | echo -e "$ORANGE""[i] This will run subjack, CORStest, S3Scanner, bfac, whatweb, wafw00f, and nikto.";
2000 | read -rp "[?] Please enter A/a, I/i, or N/n. " ANSWER
2001 |
2002 | case $ANSWER in
2003 | [aA]* )
2004 | echo -e "[i] Beginning information gathering on all discovered domains.";
2005 | while true; do
2006 | echo -e "$GREEN""[?] Which wordlist do you want to use?""$NC";
2007 | echo -e "$BLUE"" Small: ~20k words""$NC";
2008 | echo -e "$BLUE"" Medium: ~167k words""$NC";
2009 | echo -e "$BLUE"" Large: ~215k words""$NC";
2010 | echo -e "$BLUE"" XL: ~373k words""$NC";
2011 | echo -e "$BLUE"" 2XL: ~486k words""$GREEN";
2012 | read -rp "[i] Enter S/M/L/X/2 " CHOICE;
2013 | case $CHOICE in
2014 | [sS]* )
2015 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2016 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2017 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2018 | run_bfac "$WORKING_DIR"/"$ALL_RESOLVED";
2019 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2020 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2021 | run_httprobe;
2022 | run_nikto "$WORKING_DIR"/"$ALL_RESOLVED";
2023 | break;
2024 | ;;
2025 | [mM]* )
2026 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2027 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2028 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2029 | run_bfac "$WORKING_DIR"/"$ALL_RESOLVED";
2030 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2031 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2032 | run_httprobe;
2033 | run_nikto "$WORKING_DIR"/"$ALL_RESOLVED";
2034 | break;
2035 | ;;
2036 | [lL]* )
2037 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2038 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2039 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2040 | run_bfac "$WORKING_DIR"/"$ALL_RESOLVED";
2041 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2042 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2043 | run_httprobe;
2044 | run_nikto "$WORKING_DIR"/"$ALL_RESOLVED";
2045 | break;
2046 | ;;
2047 | [xX]* )
2048 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2049 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2050 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2051 | run_bfac "$WORKING_DIR"/"$ALL_RESOLVED";
2052 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2053 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2054 | run_httprobe;
2055 | run_nikto "$WORKING_DIR"/"$ALL_RESOLVED";
2056 | break;
2057 | ;;
2058 | [2]* )
2059 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2060 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2061 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2062 | run_bfac "$WORKING_DIR"/"$ALL_RESOLVED";
2063 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2064 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2065 | run_httprobe;
2066 | run_nikto "$WORKING_DIR"/"$ALL_RESOLVED";
2067 | break;
2068 | ;;
2069 | * )
2070 | echo -e "$RED""Please enter S/M/L/X/2. ""$NC";
2071 | ;;
2072 | esac
2073 | done
2074 | break;
2075 | ;;
2076 | [nN]* )
2077 | echo -e "$RED""[!] Skipping information gathering on all domains.""$NC";
2078 | return;
2079 | ;;
2080 | [iI]* )
2081 | # Check if any interesting domains have been found.'
2082 | COUNT=$(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}');
2083 | if [[ "$COUNT" -lt 1 ]]; then
2084 | echo -e "$RED""[!] No interesting domains have been discovered.""$NC";
2085 | return;
2086 | fi
2087 |
2088 | echo -e "[i] Beginning information gathering on all interesting discovered domains.";
2089 | while true; do
2090 | echo -e "$GREEN""[?] Which wordlist do you want to use?""$NC";
2091 | echo -e "$BLUE"" Small: ~20k words""$NC";
2092 | echo -e "$BLUE"" Medium: ~167k words""$NC";
2093 | echo -e "$BLUE"" Large: ~215k words""$NC";
2094 | echo -e "$BLUE"" XL: ~373k words""$NC";
2095 | echo -e "$BLUE"" 2XL: ~486k words""$GREEN";
2096 | read -rp "[i] Enter S/M/L/X/2 " CHOICE;
2097 | case $CHOICE in
2098 | [sS]* )
2099 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2100 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2101 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2102 | run_bfac "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2103 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2104 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2105 | run_httprobe;
2106 | run_nikto "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2107 | break;
2108 | ;;
2109 | [mM]* )
2110 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2111 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2112 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2113 | run_bfac "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2114 | run_whatweb "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2115 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2116 | run_httprobe;
2117 | run_nikto "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2118 | break;
2119 | ;;
2120 | [lL]* )
2121 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2122 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2123 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2124 | run_bfac "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2125 | run_whatweb "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2126 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2127 | run_httprobe;
2128 | run_nikto "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2129 | break;
2130 | ;;
2131 | [xX]* )
2132 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2133 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2134 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2135 | run_bfac "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2136 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2137 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2138 | run_httprobe;
2139 | run_nikto "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2140 | break;
2141 | ;;
2142 | [2]* )
2143 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2144 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2145 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2146 | run_bfac "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2147 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2148 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2149 | run_httprobe;
2150 | run_nikto "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2151 | break;
2152 | ;;
2153 | * )
2154 | echo -e "$RED""Please enter S/M/L/X/2. ""$NC";
2155 | ;;
2156 | esac
2157 | done
2158 | break;
2159 | ;;
2160 | * )
2161 | echo -e "$RED""Please enter Y/y, N/n, or A/a. ""$NC";
2162 | ;;
2163 | esac
2164 | done
2165 | }
2166 |
2167 | function run_notica() {
2168 | # Call Notica to signal end of script, $1 is for the domain
2169 | echo -e "$BLUE""Sending Notica notification.""$NC";
2170 | curl --data "d:Chomp Scan has finished scanning $1." "https://notica.us/?$NOTICA";
2171 | }
2172 |
2173 | function run_notica_sudo() {
2174 | # Call Notica to alert that sudo is needed for masscan
2175 | echo -e "$ORANGE""Sending Notica notification that sudo is needed.""$NC";
2176 | curl --data "d:Chomp Scan Notification: Your sudo password is needed for masscan." "https://notica.us/?$NOTICA";
2177 | }
2178 |
2179 | function run_rescope() {
2180 | echo -e "$BLUE""[i] Creating a Burp scope file with rescope.""$NC";
2181 |
2182 | # Make sure resolved domains exists
2183 | if [[ $(wc -l "$WORKING_DIR"/"$ALL_RESOLVED" | awk '{print $1}') -gt 0 ]]; then
2184 | "$RESCOPE" --burp -i "$WORKING_DIR"/"$ALL_RESOLVED" -o "$WORKING_DIR"/burp-scope.json -s;
2185 | fi
2186 | }
2187 |
2188 | #### Begin main script functions
2189 |
2190 | # Check tool paths are set
2191 | check_paths;
2192 |
2193 | # Check for config file and run options if it exists
2194 | if [[ "$CONFIG_FILE" != "" ]]; then
2195 | echo -e "$GREEN""Beginning scan with config file options.""$NC";
2196 | sleep 0.5;
2197 | if [[ "${#DOMAIN_ARRAY[@]}" -gt 1 ]]; then
2198 | for ARRAY_DOMAIN in "${DOMAIN_ARRAY[@]}"; do
2199 | # Create output dirs here
2200 | if [[ "$CUSTOM_WORKING_DIR" == "" ]]; then
2201 | WORKING_DIR="$ARRAY_DOMAIN"-$(date +%T);
2202 | mkdir "$WORKING_DIR";
2203 | touch "$WORKING_DIR"/interesting-domains.txt;
2204 | INTERESTING_DOMAINS=interesting-domains.txt;
2205 | touch "$WORKING_DIR"/"$ALL_DOMAIN";
2206 | touch "$WORKING_DIR"/"$ALL_IP";
2207 | touch "$WORKING_DIR"/"$ALL_RESOLVED";
2208 | else
2209 | WORKING_DIR="$CUSTOM_WORKING_DIR"/"$ARRAY_DOMAIN"-$(date +%T);
2210 | mkdir -p "$WORKING_DIR";
2211 | touch "$WORKING_DIR"/interesting-domains.txt;
2212 | INTERESTING_DOMAINS=interesting-domains.txt;
2213 | touch "$WORKING_DIR"/"$ALL_DOMAIN";
2214 | touch "$WORKING_DIR"/"$ALL_IP";
2215 | touch "$WORKING_DIR"/"$ALL_RESOLVED";
2216 | fi
2217 | SCAN_START=$(date +%s);
2218 | echo "$ARRAY_DOMAIN";
2219 | ## Subdomain enumeration
2220 | # Run dnscan
2221 | if [[ "$ENABLE_DNSCAN" -eq 1 ]]; then
2222 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2223 | if [[ "$SUBDOMAIN_WORDLIST" != "" ]]; then
2224 | run_dnscan "$ARRAY_DOMAIN" "$SUBDOMAIN_WORDLIST";
2225 | else
2226 | run_dnscan "$ARRAY_DOMAIN" "$SHORT";
2227 | fi
2228 | fi
2229 |
2230 | # Run subfinder
2231 | if [[ "$ENABLE_SUBFINDER" -eq 1 ]]; then
2232 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2233 | if [[ "$SUBDOMAIN_WORDLIST" != "" ]]; then
2234 | run_subfinder "$ARRAY_DOMAIN" "$SUBDOMAIN_WORDLIST";
2235 | else
2236 | run_subfinder "$ARRAY_DOMAIN" "$SHORT";
2237 | fi
2238 | fi
2239 |
2240 | # Run sublist3r
2241 | if [[ "$ENABLE_SUBLIST3R" -eq 1 ]]; then
2242 | run_sublist3r "$ARRAY_DOMAIN";
2243 | fi
2244 |
2245 | # Run knock
2246 | if [[ "$ENABLE_KNOCK" -eq 1 ]]; then
2247 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2248 | if [[ "$SUBDOMAIN_WORDLIST" != "" ]]; then
2249 | run_knock "$ARRAY_DOMAIN" "$SUBDOMAIN_WORDLIST";
2250 | else
2251 | run_knock "$ARRAY_DOMAIN" "$SHORT";
2252 | fi
2253 | fi
2254 |
2255 | # Run amass
2256 | if [[ "$ENABLE_AMASS" -eq 1 ]]; then
2257 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2258 | if [[ "$SUBDOMAIN_WORDLIST" != "" ]]; then
2259 | run_amass "$ARRAY_DOMAIN" "$SUBDOMAIN_WORDLIST";
2260 | else
2261 | run_amass "$ARRAY_DOMAIN" "$SHORT";
2262 | fi
2263 | fi
2264 |
2265 | # Run masscan and/or goaltdns
2266 | if [[ "$ENABLE_MASSDNS" -eq 1 ]]; then # Masscan will always run in order to get resolved domains
2267 | if [[ "$ENABLE_GOALTDNS" -eq 1 ]]; then
2268 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2269 | if [[ "$SUBDOMAIN_WORDLIST" != "" ]]; then
2270 | run_massdns "$ARRAY_DOMAIN" "$SUBDOMAIN_WORDLIST";
2271 | else
2272 | run_massdns "$ARRAY_DOMAIN" "$SHORT";
2273 | fi
2274 | else
2275 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2276 | if [[ "$SUBDOMAIN_WORDLIST" != "" ]]; then
2277 | run_massdns "$ARRAY_DOMAIN" "$SUBDOMAIN_WORDLIST" "alone";
2278 | else
2279 | run_massdns "$ARRAY_DOMAIN" "$SHORT" "alone";
2280 | fi
2281 | fi
2282 | fi
2283 |
2284 | get_interesting "silent";
2285 |
2286 | ## Screenshots
2287 | # Run aquatone
2288 | if [[ "$ENABLE_SCREENSHOTS" -eq 1 ]]; then
2289 | run_aquatone "default";
2290 | fi
2291 |
2292 | ## Information gathering
2293 | # Run subjack
2294 | if [[ "$ENABLE_SUBJACK" -eq 1 ]]; then
2295 | if [[ "$USE_ALL" -eq 1 ]]; then
2296 | run_subjack "$ARRAY_DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2297 | # Make sure there are interesting domains
2298 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2299 | run_subjack "$ARRAY_DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2300 | else
2301 | run_subjack "$ARRAY_DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2302 | fi
2303 | fi
2304 |
2305 | # Run CORStest
2306 | if [[ "$ENABLE_CORSTEST" -eq 1 ]]; then
2307 | if [[ "$USE_ALL" -eq 1 ]]; then
2308 | run_corstest "$ARRAY_DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2309 | # Make sure there are interesting domains
2310 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2311 | run_corstest "$ARRAY_DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2312 | else
2313 | run_corstest "$ARRAY_DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2314 | fi
2315 | fi
2316 |
2317 | # Run S3Scanner
2318 | if [[ "$ENABLE_S3SCANNER" -eq 1 ]]; then
2319 | if [[ "$USE_ALL" -eq 1 ]]; then
2320 | run_s3scanner "$ARRAY_DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2321 | # Make sure there are interesting domains
2322 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2323 | run_s3scanner "$ARRAY_DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2324 | else
2325 | run_s3scanner "$ARRAY_DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2326 | fi
2327 | fi
2328 |
2329 | # Run bfac
2330 | if [[ "$ENABLE_BFAC" -eq 1 ]]; then
2331 | if [[ "$USE_ALL" -eq 1 ]]; then
2332 | run_bfac "$WORKING_DIR"/"$ALL_RESOLVED";
2333 | # Make sure there are interesting domains
2334 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2335 | run_bfac "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2336 | else
2337 | run_bfac "$WORKING_DIR"/"$ALL_RESOLVED";
2338 | fi
2339 | fi
2340 |
2341 | # Run whatweb
2342 | if [[ "$ENABLE_WHATWEB" -eq 1 ]]; then
2343 | if [[ "$USE_ALL" -eq 1 ]]; then
2344 | run_whatweb "$ARRAY_DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2345 | # Make sure there are interesting domains
2346 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2347 | run_whatweb "$ARRAY_DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2348 | else
2349 | run_whatweb "$ARRAY_DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2350 | fi
2351 | fi
2352 |
2353 | # Run wafw00f
2354 | if [[ "$ENABLE_WAFW00F" -eq 1 ]]; then
2355 | if [[ "$USE_ALL" -eq 1 ]]; then
2356 | run_wafw00f "$ARRAY_DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2357 | # Make sure there are interesting domains
2358 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2359 | run_wafw00f "$ARRAY_DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2360 | else
2361 | run_wafw00f "$ARRAY_DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2362 | fi
2363 | fi
2364 |
2365 | # Run httprobe
2366 | if [[ "$ENABLE_HTTPROBE" -eq 1 ]]; then
2367 | run_httprobe;
2368 | fi
2369 |
2370 | # Run nikto
2371 | if [[ "$ENABLE_NIKTO" -eq 1 ]]; then
2372 | if [[ "$USE_ALL" -eq 1 ]]; then
2373 | run_nikto "$WORKING_DIR"/"$ALL_RESOLVED";
2374 | # Make sure there are interesting domains
2375 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2376 | run_nikto "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2377 | else
2378 | run_nikto "$WORKING_DIR"/"$ALL_RESOLVED";
2379 | fi
2380 | fi
2381 |
2382 | ## Content discovery
2383 | # Run inception
2384 | if [[ "$ENABLE_INCEPTION" -eq 1 ]]; then
2385 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2386 | if [[ "$CONTENT_WORDLIST" != "" ]]; then
2387 | if [[ "$USE_ALL" -eq 1 ]]; then
2388 | run_inception "$ARRAY_DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2389 | # Make sure there are interesting domains
2390 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2391 | run_inception "$ARRAY_DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2392 | else
2393 | run_inception "$ARRAY_DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2394 | fi
2395 | else
2396 | if [[ "$USE_ALL" -eq 1 ]]; then
2397 | run_inception "$ARRAY_DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2398 | # Make sure there are interesting domains
2399 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') != 0 ]]; then
2400 | run_inception "$ARRAY_DOMAIN" "$SHORT" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2401 | else
2402 | run_inception "$ARRAY_DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2403 | fi
2404 | fi
2405 | fi
2406 |
2407 | # Run waybackurls
2408 | if [[ "$ENABLE_WAYBACKURLS" -eq 1 ]]; then
2409 | run_waybackurls "$ARRAY_DOMAIN";
2410 | fi
2411 |
2412 | # Run ffuf
2413 | if [[ "$ENABLE_FFUF" -eq 1 ]]; then
2414 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2415 | if [[ "$CONTENT_WORDLIST" != "" ]]; then
2416 | if [[ "$USE_ALL" -eq 1 ]]; then
2417 | run_ffuf "$ARRAY_DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2418 | # Make sure there are interesting domains
2419 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2420 | run_ffuf "$ARRAY_DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2421 | else
2422 | run_ffuf "$ARRAY_DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2423 | fi
2424 | else
2425 | if [[ "$USE_ALL" -eq 1 ]]; then
2426 | run_ffuf "$ARRAY_DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2427 | # Make sure there are interesting domains
2428 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') != 0 ]]; then
2429 | run_ffuf "$ARRAY_DOMAIN" "$SHORT" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2430 | else
2431 | run_ffuf "$ARRAY_DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2432 | fi
2433 | fi
2434 | fi
2435 |
2436 | # Run gobuster
2437 | if [[ "$ENABLE_GOBUSTER" -eq 1 ]]; then
2438 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2439 | if [[ "$CONTENT_WORDLIST" != "" ]]; then
2440 | if [[ "$USE_ALL" -eq 1 ]]; then
2441 | run_gobuster "$ARRAY_DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2442 | # Make sure there are interesting domains
2443 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2444 | run_gobuster "$ARRAY_DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2445 | else
2446 | run_gobuster "$ARRAY_DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2447 | fi
2448 | else
2449 | if [[ "$USE_ALL" -eq 1 ]]; then
2450 | run_gobuster "$ARRAY_DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2451 | # Make sure there are interesting domains
2452 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') != 0 ]]; then
2453 | run_gobuster "$ARRAY_DOMAIN" "$SHORT" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2454 | else
2455 | run_gobuster "$ARRAY_DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2456 | fi
2457 | fi
2458 | fi
2459 |
2460 | # Run dirsearch
2461 | if [[ "$ENABLE_DIRSEARCH" -eq 1 ]]; then
2462 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2463 | if [[ "$CONTENT_WORDLIST" != "" ]]; then
2464 | if [[ "$USE_ALL" -eq 1 ]]; then
2465 | run_dirsearch "$ARRAY_DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2466 | # Make sure there are interesting domains
2467 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2468 | run_dirsearch "$ARRAY_DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2469 | else
2470 | run_dirsearch "$ARRAY_DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2471 | fi
2472 | else
2473 | if [[ "$USE_ALL" -eq 1 ]]; then
2474 | run_dirsearch "$ARRAY_DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2475 | # Make sure there are interesting domains
2476 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') != 0 ]]; then
2477 | run_dirsearch "$ARRAY_DOMAIN" "$SHORT" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2478 | else
2479 | run_dirsearch "$ARRAY_DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2480 | fi
2481 | fi
2482 | fi
2483 |
2484 | ## Port scanning
2485 | # Run masscan
2486 | if [[ "$ENABLE_MASSCAN" -eq 1 ]]; then
2487 | run_masscan;
2488 | fi
2489 |
2490 | # Run nmap
2491 | if [[ "$ENABLE_NMAP" -eq 1 ]]; then
2492 | run_nmap;
2493 | fi
2494 |
2495 | get_interesting;
2496 | list_found;
2497 |
2498 | # Run rescope
2499 | if [[ "$ENABLE_RESCOPE" -eq 1 ]]; then
2500 | run_rescope;
2501 | fi
2502 |
2503 | # Calculate scan runtime
2504 | SCAN_END=$(date +%s);
2505 | SCAN_DIFF=$(( SCAN_END - SCAN_START ));
2506 | if [[ "$NOTICA" != "" ]]; then
2507 | run_notica "$ARRAY_DOMAIN";
2508 | fi
2509 | echo -e "$BLUE""[i] Total script run time: $SCAN_DIFF seconds.""$NC";
2510 | WORKING_DIR="";
2511 | done
2512 | exit 0;
2513 | else
2514 | # Create output dir normally here
2515 | if [[ "$CUSTOM_WORKING_DIR" == "" ]]; then
2516 | WORKING_DIR="$DOMAIN"-$(date +%T);
2517 | echo "$WORKING_DIR";
2518 | mkdir "$WORKING_DIR";
2519 | touch "$WORKING_DIR"/interesting-domains.txt;
2520 | INTERESTING_DOMAINS=interesting-domains.txt;
2521 | touch "$WORKING_DIR"/"$ALL_DOMAIN";
2522 | touch "$WORKING_DIR"/"$ALL_IP";
2523 | touch "$WORKING_DIR"/"$ALL_RESOLVED";
2524 | else
2525 | WORKING_DIR="$CUSTOM_WORKING_DIR"/"$DOMAIN"-$(date +%T);
2526 | mkdir -p "$WORKING_DIR";
2527 | touch "$WORKING_DIR"/interesting-domains.txt;
2528 | INTERESTING_DOMAINS=interesting-domains.txt;
2529 | touch "$WORKING_DIR"/"$ALL_DOMAIN";
2530 | touch "$WORKING_DIR"/"$ALL_IP";
2531 | touch "$WORKING_DIR"/"$ALL_RESOLVED";
2532 | fi
2533 | ## Subdomain enumeration
2534 | # Run dnscan
2535 | if [[ "$ENABLE_DNSCAN" -eq 1 ]]; then
2536 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2537 | if [[ "$SUBDOMAIN_WORDLIST" != "" ]]; then
2538 | run_dnscan "$DOMAIN" "$SUBDOMAIN_WORDLIST";
2539 | else
2540 | run_dnscan "$DOMAIN" "$SHORT";
2541 | fi
2542 | fi
2543 |
2544 | # Run subfinder
2545 | if [[ "$ENABLE_SUBFINDER" -eq 1 ]]; then
2546 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2547 | if [[ "$SUBDOMAIN_WORDLIST" != "" ]]; then
2548 | run_subfinder "$DOMAIN" "$SUBDOMAIN_WORDLIST";
2549 | else
2550 | run_subfinder "$DOMAIN" "$SHORT";
2551 | fi
2552 | fi
2553 |
2554 | # Run sublist3r
2555 | if [[ "$ENABLE_SUBLIST3R" -eq 1 ]]; then
2556 | run_sublist3r "$DOMAIN";
2557 | fi
2558 |
2559 | # Run knock
2560 | if [[ "$ENABLE_KNOCK" -eq 1 ]]; then
2561 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2562 | if [[ "$SUBDOMAIN_WORDLIST" != "" ]]; then
2563 | run_knock "$DOMAIN" "$SUBDOMAIN_WORDLIST";
2564 | else
2565 | run_knock "$DOMAIN" "$SHORT";
2566 | fi
2567 | fi
2568 |
2569 | # Run amass
2570 | if [[ "$ENABLE_AMASS" -eq 1 ]]; then
2571 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2572 | if [[ "$SUBDOMAIN_WORDLIST" != "" ]]; then
2573 | run_amass "$DOMAIN" "$SUBDOMAIN_WORDLIST";
2574 | else
2575 | run_amass "$DOMAIN" "$SHORT";
2576 | fi
2577 | fi
2578 |
2579 | # Run masscan and/or goaltdns
2580 | if [[ "$ENABLE_MASSDNS" -eq 1 ]]; then # Masscan will always run in order to get resolved domains
2581 | if [[ "$ENABLE_GOALTDNS" -eq 1 ]]; then
2582 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2583 | if [[ "$SUBDOMAIN_WORDLIST" != "" ]]; then
2584 | run_massdns "$DOMAIN" "$SUBDOMAIN_WORDLIST";
2585 | else
2586 | run_massdns "$DOMAIN" "$SHORT";
2587 | fi
2588 | else
2589 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2590 | if [[ "$SUBDOMAIN_WORDLIST" != "" ]]; then
2591 | run_massdns "$DOMAIN" "$SUBDOMAIN_WORDLIST" "alone";
2592 | else
2593 | run_massdns "$DOMAIN" "$SHORT" "alone";
2594 | fi
2595 | fi
2596 | fi
2597 |
2598 | get_interesting "silent";
2599 |
2600 | ## Screenshots
2601 | # Run aquatone
2602 | if [[ "$ENABLE_SCREENSHOTS" -eq 1 ]]; then
2603 | run_aquatone "default";
2604 | fi
2605 |
2606 | ## Information gathering
2607 | # Run subjack
2608 | if [[ "$ENABLE_SUBJACK" -eq 1 ]]; then
2609 | if [[ "$USE_ALL" -eq 1 ]]; then
2610 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2611 | # Make sure there are interesting domains
2612 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2613 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2614 | else
2615 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2616 | fi
2617 | fi
2618 |
2619 | # Run CORStest
2620 | if [[ "$ENABLE_CORSTEST" -eq 1 ]]; then
2621 | if [[ "$USE_ALL" -eq 1 ]]; then
2622 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2623 | # Make sure there are interesting domains
2624 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2625 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2626 | else
2627 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2628 | fi
2629 | fi
2630 |
2631 | # Run S3Scanner
2632 | if [[ "$ENABLE_S3SCANNER" -eq 1 ]]; then
2633 | if [[ "$USE_ALL" -eq 1 ]]; then
2634 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2635 | # Make sure there are interesting domains
2636 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2637 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2638 | else
2639 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2640 | fi
2641 | fi
2642 |
2643 | # Run bfac
2644 | if [[ "$ENABLE_BFAC" -eq 1 ]]; then
2645 | if [[ "$USE_ALL" -eq 1 ]]; then
2646 | run_bfac "$WORKING_DIR"/"$ALL_RESOLVED";
2647 | # Make sure there are interesting domains
2648 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2649 | run_bfac "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2650 | else
2651 | run_bfac "$WORKING_DIR"/"$ALL_RESOLVED";
2652 | fi
2653 | fi
2654 |
2655 | # Run whatweb
2656 | if [[ "$ENABLE_WHATWEB" -eq 1 ]]; then
2657 | if [[ "$USE_ALL" -eq 1 ]]; then
2658 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2659 | # Make sure there are interesting domains
2660 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2661 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2662 | else
2663 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2664 | fi
2665 | fi
2666 |
2667 | # Run wafw00f
2668 | if [[ "$ENABLE_WAFW00F" -eq 1 ]]; then
2669 | if [[ "$USE_ALL" -eq 1 ]]; then
2670 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2671 | # Make sure there are interesting domains
2672 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2673 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2674 | else
2675 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2676 | fi
2677 | fi
2678 |
2679 | # Run httprobe
2680 | if [[ "$ENABLE_HTTPROBE" -eq 1 ]]; then
2681 | run_httprobe;
2682 | fi
2683 |
2684 | # Run nikto
2685 | if [[ "$ENABLE_NIKTO" -eq 1 ]]; then
2686 | if [[ "$USE_ALL" -eq 1 ]]; then
2687 | run_nikto "$WORKING_DIR"/"$ALL_RESOLVED";
2688 | # Make sure there are interesting domains
2689 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2690 | run_nikto "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2691 | else
2692 | run_nikto "$WORKING_DIR"/"$ALL_RESOLVED";
2693 | fi
2694 | fi
2695 |
2696 | ## Content discovery
2697 | # Run inception
2698 | if [[ "$ENABLE_INCEPTION" -eq 1 ]]; then
2699 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2700 | if [[ "$CONTENT_WORDLIST" != "" ]]; then
2701 | if [[ "$USE_ALL" -eq 1 ]]; then
2702 | run_inception "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2703 | # Make sure there are interesting domains
2704 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2705 | run_inception "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2706 | else
2707 | run_inception "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2708 | fi
2709 | else
2710 | if [[ "$USE_ALL" -eq 1 ]]; then
2711 | run_inception "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2712 | # Make sure there are interesting domains
2713 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') != 0 ]]; then
2714 | run_inception "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2715 | else
2716 | run_inception "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2717 | fi
2718 | fi
2719 | fi
2720 |
2721 | # Run waybackurls
2722 | if [[ "$ENABLE_WAYBACKURLS" -eq 1 ]]; then
2723 | run_waybackurls "$DOMAIN";
2724 | fi
2725 |
2726 | # Run ffuf
2727 | if [[ "$ENABLE_FFUF" -eq 1 ]]; then
2728 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2729 | if [[ "$CONTENT_WORDLIST" != "" ]]; then
2730 | if [[ "$USE_ALL" -eq 1 ]]; then
2731 | run_ffuf "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2732 | # Make sure there are interesting domains
2733 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2734 | run_ffuf "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2735 | else
2736 | run_ffuf "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2737 | fi
2738 | else
2739 | if [[ "$USE_ALL" -eq 1 ]]; then
2740 | run_ffuf "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2741 | # Make sure there are interesting domains
2742 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') != 0 ]]; then
2743 | run_ffuf "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2744 | else
2745 | run_ffuf "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2746 | fi
2747 | fi
2748 | fi
2749 |
2750 | # Run gobuster
2751 | if [[ "$ENABLE_GOBUSTER" -eq 1 ]]; then
2752 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2753 | if [[ "$CONTENT_WORDLIST" != "" ]]; then
2754 | if [[ "$USE_ALL" -eq 1 ]]; then
2755 | run_gobuster "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2756 | # Make sure there are interesting domains
2757 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2758 | run_gobuster "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2759 | else
2760 | run_gobuster "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2761 | fi
2762 | else
2763 | if [[ "$USE_ALL" -eq 1 ]]; then
2764 | run_gobuster "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2765 | # Make sure there are interesting domains
2766 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') != 0 ]]; then
2767 | run_gobuster "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2768 | else
2769 | run_gobuster "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2770 | fi
2771 | fi
2772 | fi
2773 |
2774 | # Run dirsearch
2775 | if [[ "$ENABLE_DIRSEARCH" -eq 1 ]]; then
2776 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2777 | if [[ "$CONTENT_WORDLIST" != "" ]]; then
2778 | if [[ "$USE_ALL" -eq 1 ]]; then
2779 | run_dirsearch "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2780 | # Make sure there are interesting domains
2781 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
2782 | run_dirsearch "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2783 | else
2784 | run_dirsearch "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
2785 | fi
2786 | else
2787 | if [[ "$USE_ALL" -eq 1 ]]; then
2788 | run_dirsearch "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2789 | # Make sure there are interesting domains
2790 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') != 0 ]]; then
2791 | run_dirsearch "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
2792 | else
2793 | run_dirsearch "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
2794 | fi
2795 | fi
2796 | fi
2797 |
2798 | ## Port scanning
2799 | # Run masscan
2800 | if [[ "$ENABLE_MASSCAN" -eq 1 ]]; then
2801 | run_masscan;
2802 | fi
2803 |
2804 | # Run nmap
2805 | if [[ "$ENABLE_NMAP" -eq 1 ]]; then
2806 | run_nmap;
2807 | fi
2808 |
2809 | get_interesting;
2810 | list_found;
2811 |
2812 | # Run rescope
2813 | if [[ "$ENABLE_RESCOPE" -eq 1 ]]; then
2814 | run_rescope;
2815 | fi
2816 |
2817 | # Calculate scan runtime
2818 | SCAN_END=$(date +%s);
2819 | SCAN_DIFF=$(( SCAN_END - SCAN_START ));
2820 | if [[ "$NOTICA" != "" ]]; then
2821 | run_notica "$DOMAIN";
2822 | fi
2823 | echo -e "$BLUE""[i] Total script run time: $SCAN_DIFF seconds.""$NC";
2824 | exit 0;
2825 | fi
2826 | fi
2827 |
2828 | # Check if -u domain was passed
2829 | if [[ "$DOMAIN" == "" ]]; then
2830 | echo -e "$RED""[!] A domain is required: -u example.com""$NC";
2831 | usage;
2832 | exit 1;
2833 | fi
2834 |
2835 | # Check for mutually exclusive interactive and non-interactive modes
2836 | if [[ "$INTERACTIVE" -eq 1 ]] && [[ "$DEFAULT_MODE" -eq 1 ]]; then
2837 | echo -e "$RED""[!] Both interactive mode (-I) and non-interactive mode (-D) cannot be run together. Exiting.""$NC";
2838 | usage;
2839 | exit 1;
2840 | fi
2841 |
2842 | # Create working directory, start script timer, and create interesting domains text file
2843 | # Check if -o output directory is already set
2844 | if [[ "$CUSTOM_WORKING_DIR" == "" ]]; then
2845 | WORKING_DIR="$DOMAIN"-$(date +%T);
2846 | mkdir "$WORKING_DIR";
2847 | else
2848 | WORKING_DIR=$CUSTOM_WORKING_DIR;
2849 | fi
2850 |
2851 | SCAN_START=$(date +%s);
2852 | touch "$WORKING_DIR"/interesting-domains.txt;
2853 | INTERESTING_DOMAINS=interesting-domains.txt;
2854 | touch "$WORKING_DIR"/"$ALL_DOMAIN";
2855 | touch "$WORKING_DIR"/"$ALL_IP";
2856 | touch "$WORKING_DIR"/"$ALL_RESOLVED";
2857 |
2858 | # Check for -D non-interactive default flag
2859 | # Defaults for non-interactive:
2860 | # Subdomain wordlist size: short
2861 | # Content discovery wordlist size: small
2862 | # Aquatone: yes
2863 | # Portscan: masscan and nmap
2864 | # Content discovery: ffuf, gobuster, and dirsearch
2865 | # Information gathering: all tools
2866 | # Domains to scan: all unique resolvable
2867 | if [[ "$DEFAULT_MODE" -eq 1 ]]; then
2868 | # Check if we're root since we're running masscan
2869 | check_root;
2870 |
2871 | # Run all phases with defaults
2872 | echo -e "$GREEN""Beginning non-interactive mode scan.""$NC";
2873 | sleep 0.5;
2874 |
2875 | run_dnscan "$DOMAIN" "$SHORT";
2876 | run_subfinder "$DOMAIN" "$SHORT";
2877 | run_sublist3r "$DOMAIN";
2878 | run_knock "$DOMAIN" "$SHORT";
2879 | run_amass "$DOMAIN" "$SHORT";
2880 | run_massdns "$DOMAIN" "$SHORT";
2881 | run_httprobe;
2882 |
2883 | # Call unique to make sure list is up to date for content discovery
2884 | unique;
2885 |
2886 | run_aquatone "default";
2887 | run_masscan;
2888 | run_nmap;
2889 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2890 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2891 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2892 | run_bfac "$WORKING_DIR"/"$ALL_RESOLVED";
2893 | run_httprobe;
2894 | run_nikto "$WORKING_DIR"/"$ALL_RESOLVED";
2895 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2896 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
2897 | run_inception "$DOMAIN" "$SMALL" "$WORKING_DIR"/"$ALL_RESOLVED";
2898 | run_waybackurls "$DOMAIN";
2899 | run_ffuf "$DOMAIN" "$SMALL" "$WORKING_DIR"/"$ALL_RESOLVED";
2900 | run_gobuster "$DOMAIN" "$SMALL" "$WORKING_DIR"/"$ALL_RESOLVED";
2901 | run_dirsearch "$DOMAIN" "$SMALL" "$WORKING_DIR"/"$ALL_RESOLVED";
2902 | get_interesting;
2903 | list_found;
2904 | run_rescope;
2905 |
2906 | # Calculate scan runtime
2907 | SCAN_END=$(date +%s);
2908 | SCAN_DIFF=$(( SCAN_END - SCAN_START ));
2909 | if [[ "$NOTICA" != "" ]]; then
2910 | run_notica "$DOMAIN";
2911 | fi
2912 | echo -e "$BLUE""[i] Total script run time: $SCAN_DIFF seconds.""$NC";
2913 |
2914 | exit;
2915 | fi
2916 |
2917 | # Run in interactive mode, ignoring other parameters
2918 | if [[ "$INTERACTIVE" -eq 1 ]]; then
2919 | # Check if we're root since we're running masscan
2920 | check_root;
2921 |
2922 | # Run phases interactively
2923 | echo -e "$GREEN""Beginning interactive mode scan.""$NC";
2924 | sleep 0.5;
2925 |
2926 | run_subdomain_brute;
2927 |
2928 | # Call unique to make sure list is up to date for content discovery
2929 | unique;
2930 |
2931 | run_aquatone;
2932 | get_interesting;
2933 | run_portscan;
2934 | run_information_gathering;
2935 | run_content_discovery;
2936 | get_interesting;
2937 | list_found;
2938 | run_rescope;
2939 |
2940 | # Calculate scan runtime
2941 | SCAN_END=$(date +%s);
2942 | SCAN_DIFF=$(( SCAN_END - SCAN_START ));
2943 | if [[ "$NOTICA" != "" ]]; then
2944 | run_notica "$DOMAIN";
2945 | fi
2946 | echo -e "$BLUE""[i] Total script run time: $SCAN_DIFF seconds.""$NC";
2947 |
2948 | exit;
2949 | fi
2950 |
2951 | # Preemptively check for -p portscanning
2952 | if [[ "$PORTSCANNING" -eq 1 ]]; then
2953 | # Check if we're root since we're running masscan
2954 | check_root;
2955 | fi
2956 |
2957 | # Always run subdomain bruteforce tools
2958 | if [[ "$SUBDOMAIN_BRUTE" -eq 1 ]]; then
2959 | echo -e "$BLUE""[i] Beginning subdomain enumeration dnscan, subfinder, sublist3r, knockpy, amass, and massdns+goaltdns.""$NC";
2960 | sleep 0.5;
2961 |
2962 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
2963 | if [[ "$SUBDOMAIN_WORDLIST" != "" ]]; then
2964 | run_dnscan "$DOMAIN" "$SUBDOMAIN_WORDLIST";
2965 | run_subfinder "$DOMAIN" "$SUBDOMAIN_WORDLIST";
2966 | run_sublist3r "$DOMAIN";
2967 | run_knock "$DOMAIN" "$SUBDOMAIN_WORDLIST";
2968 | run_amass "$DOMAIN" "$SUBDOMAIN_WORDLIST";
2969 | run_massdns "$DOMAIN" "$SUBDOMAIN_WORDLIST";
2970 | else
2971 | run_dnscan "$DOMAIN" "$SHORT";
2972 | run_subfinder "$DOMAIN" "$SHORT";
2973 | run_sublist3r "$DOMAIN";
2974 | run_knock "$DOMAIN" "$SHORT";
2975 | run_amass "$DOMAIN" "$SHORT";
2976 | run_massdns "$DOMAIN" "$SHORT";
2977 | fi
2978 | fi
2979 |
2980 | get_interesting "silent";
2981 |
2982 | # -s screenshot with aquatone
2983 | if [[ "$SCREENSHOTS" -eq 1 ]]; then
2984 | echo -e "$BLUE""[i] Taking screenshots with aquatone.""$NC";
2985 | sleep 0.5;
2986 |
2987 | # Call unique to make sure list is up to date for content discovery
2988 | unique;
2989 |
2990 | run_aquatone "default";
2991 | fi
2992 |
2993 | # -i information gathering
2994 | if [[ "$INFO_GATHERING" -eq 1 ]]; then
2995 | echo -e "$BLUE""[i] Beginning information gathering with subjack, CORStest, S3Scanner, bfac, whatweb, wafw00f, and nikto.""$NC";
2996 | sleep 0.5;
2997 |
2998 | # Call unique to make sure list is up to date for content discovery
2999 | unique;
3000 |
3001 | if [[ "$USE_ALL" -eq 1 ]]; then
3002 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
3003 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
3004 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
3005 | run_bfac "$WORKING_DIR"/"$ALL_RESOLVED";
3006 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
3007 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
3008 | run_httprobe;
3009 | run_nikto "$WORKING_DIR"/"$ALL_RESOLVED";
3010 | # Make sure there are interesting domains
3011 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
3012 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3013 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3014 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3015 | run_bfac "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3016 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3017 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3018 | run_httprobe;
3019 | run_nikto "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3020 | else
3021 | run_subjack "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
3022 | run_corstest "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
3023 | run_s3scanner "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
3024 | run_bfac "$WORKING_DIR"/"$ALL_RESOLVED";
3025 | run_whatweb "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
3026 | run_wafw00f "$DOMAIN" "$WORKING_DIR"/"$ALL_RESOLVED";
3027 | run_httprobe;
3028 | run_nikto "$WORKING_DIR"/"$ALL_RESOLVED";
3029 | fi
3030 | fi
3031 |
3032 | # -C run content discovery
3033 | if [[ "$CONTENT_DISCOVERY" -eq 1 ]]; then
3034 | echo -e "$BLUE""[i] Beginning content discovery with inception, waybackurls, ffuf, gobuster, and dirsearch.""$NC";
3035 | sleep 0.5;
3036 |
3037 | # Call unique to make sure list is up to date for content discovery
3038 | unique;
3039 |
3040 | # Check if $SUBDOMAIN_WORDLIST is set, else use short as default
3041 | if [[ "$CONTENT_WORDLIST" != "" ]]; then
3042 | if [[ "$USE_ALL" -eq 1 ]]; then
3043 | run_inception "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
3044 | run_waybackurls "$DOMAIN";
3045 | # run_snallygaster "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
3046 | run_ffuf "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
3047 | run_gobuster "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
3048 | run_dirsearch "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
3049 | # Make sure there are interesting domains
3050 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') -gt 0 ]]; then
3051 | run_inception "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3052 | run_waybackurls "$DOMAIN";
3053 | # run_snallygaster "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3054 | run_ffuf "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3055 | run_gobuster "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3056 | run_dirsearch "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3057 | else
3058 | run_inception "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
3059 | run_waybackurls "$DOMAIN";
3060 | # run_snallygaster "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
3061 | run_ffuf "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
3062 | run_gobuster "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
3063 | run_dirsearch "$DOMAIN" "$CONTENT_WORDLIST" "$WORKING_DIR"/"$ALL_RESOLVED";
3064 | fi
3065 | else
3066 | if [[ "$USE_ALL" -eq 1 ]]; then
3067 | run_inception "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
3068 | run_waybackurls "$DOMAIN";
3069 | # run_snallygaster "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
3070 | run_ffuf "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
3071 | run_gobuster "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
3072 | run_dirsearch "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
3073 | # Make sure there are interesting domains
3074 | elif [[ $(wc -l "$WORKING_DIR"/"$INTERESTING_DOMAINS" | awk '{print $1}') != 0 ]]; then
3075 | run_inception "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3076 | run_waybackurls "$DOMAIN";
3077 | # run_snallygaster "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3078 | run_ffuf "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3079 | run_gobuster "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3080 | run_dirsearch "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$INTERESTING_DOMAINS";
3081 | else
3082 | run_inception "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
3083 | run_waybackurls "$DOMAIN";
3084 | # run_snallygaster "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
3085 | run_ffuf "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
3086 | run_gobuster "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
3087 | run_dirsearch "$DOMAIN" "$SHORT" "$WORKING_DIR"/"$ALL_RESOLVED";
3088 | fi
3089 | fi
3090 | fi
3091 |
3092 | # -p portscanning
3093 | if [[ "$PORTSCANNING" -eq 1 ]]; then
3094 | echo -e "$GREEN""Beginning portscanning with masscan (if root) and nmap.""$NC";
3095 | sleep 0.5;
3096 |
3097 | run_masscan;
3098 | run_nmap;
3099 | fi
3100 |
3101 | get_interesting;
3102 | list_found;
3103 |
3104 | # -r rescope
3105 | if [[ "$ENABLE_RESCOPE" -eq 1 ]]; then
3106 | run_rescope;
3107 | fi
3108 |
3109 | # Calculate scan runtime
3110 | SCAN_END=$(date +%s);
3111 | SCAN_DIFF=$(( SCAN_END - SCAN_START ));
3112 |
3113 | if [[ "$NOTICA" != "" ]]; then
3114 | run_notica "$DOMAIN";
3115 | fi
3116 | echo -e "$BLUE""[i] Total script run time: $SCAN_DIFF seconds.""$NC";
3117 |
--------------------------------------------------------------------------------
/config:
--------------------------------------------------------------------------------
1 | # Possible values for tools are case-sensitive YES or blank.
2 | # Wordlist values are either blank, a built-in wordlist name, or a path to a file.
3 |
4 |
5 | [general]
6 | # Set comma separated list of domain(s) to scan (required).Do not end a list of domains with a comma. Do not include a scheme, e.g. https:// or http://. Chomp Scan will add the appropriate scheme as needed.
7 | DOMAIN=
8 | # Use HTTP instead of default HTTPS, values are YES or blank
9 | ENABLE_HTTP=
10 | # Set custom output directory. If multiple domains are used, this will contain each domain's output in a subdirectory.
11 | OUTPUT_DIR=
12 | # Use all discovered domains instead of default interesting discovered domains, values are YES or blank
13 | USE_ALL=
14 | # Set Notica URL parameter for notifications, values are a Notica URL parameter or blank. See notica.us for details.
15 | NOTICA=
16 | # Set custom domain blacklist file, values are a path to a file or blank
17 | BLACKLIST=
18 | # Set custom interesting word list, values are a path to a file or blank
19 | INTERESTING=
20 | # Set custom path to tools. This should be a fully qualified path to the directory that contains the downloaded tools from Github
21 | TOOL_PATH=
22 | # Enable parsing resolved domains into a Burp-formatted JSON file
23 | ENABLE_RESCOPE=YES
24 |
25 |
26 | [subdomain enumeration]
27 | # Set which tools run
28 | ENABLE_DNSCAN=YES
29 | ENABLE_SUBFINDER=YES
30 | ENABLE_SUBLIST3R=YES
31 | ENABLE_KNOCK=YES
32 | ENABLE_AMASS=YES
33 | ENABLE_GOALTDNS=YES
34 | # Set wordlist
35 | # Possible options are SHORT, lONG, HUGE, or the path to a custom wordlist
36 | SUBDOMAIN_WORDLIST=
37 |
38 |
39 | [content discovery]
40 | # Set which tools run
41 | ENABLE_INCEPTION=YES
42 | ENABLE_BFAC=YES
43 | ENABLE_WAYBACKURLS=YES
44 | ENABLE_FFUF=YES
45 | ENABLE_GOBUSTER=YES
46 | ENABLE_DIRSEARCH=YES
47 | # Set wordlist
48 | # Possible options are SMALL, MEDIUM, LARGE, XL, XXL, or the path to a custom wordlist
49 | CONTENT_WORDLIST=
50 |
51 |
52 | [information gathering]
53 | # Set which tools run
54 | ENABLE_SUBJACK=YES
55 | ENABLE_CORSTEST=YES
56 | ENABLE_S3SCANNER=YES
57 | ENABLE_WHATWEB=YES
58 | ENABLE_WAFW00F=YES
59 | ENABLE_HTTPROBE=YES
60 | ENABLE_NIKTO=YES
61 |
62 |
63 | [port scanning]
64 | # Set which tools run
65 | ENABLE_MASSCAN=YES
66 | ENABLE_NMAP=YES
67 |
68 |
69 | [screenshots]
70 | # Enable aquatone
71 | ENABLE_SCREENSHOTS=YES
72 |
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Colors
4 | NC='\033[0m';
5 | RED='\033[0;31m';
6 | GREEN='\033[0;32m';
7 | BLUE='\033[0;34m';
8 | ORANGE='\033[0;33m';
9 |
10 | UBUNTU=;
11 | DEBIAN=;
12 | KALI=;
13 | TOOLS="$HOME/bounty/tools";
14 |
15 | function install_kali() {
16 | echo -e "$GREEN""[+] Installing for Kali.""$NC";
17 | sudo apt-get update;
18 | sudo apt-get install git wget curl nmap masscan whatweb sublist3r gobuster nikto wafw00f chromium openssl libnet-ssleay-perl p7zip-full build-essential python-pip python3-pip unzip -y;
19 | install_pip;
20 | install_dnscan;
21 | install_bfac;
22 | install_massdns;
23 | install_aquatone;
24 | install_sublist3r;
25 | install_corstest;
26 | install_s3scanner;
27 | install_amass;
28 | install_dirsearch;
29 | install_knockpy;
30 | install_go;
31 | install_go_tools;
32 | }
33 | function install_parrot() {
34 | echo -e "$GREEN""[+] Installing for ParrotOS.""$NC";
35 | sudo apt-get update;
36 | sudo apt-get install git wget curl nmap masscan whatweb sublist3r gobuster nikto wafw00f chromium openssl libnet-ssleay-perl p7zip-full build-essential python-pip python3-pip unzip -y;
37 | install_pip;
38 | install_dnscan;
39 | install_bfac;
40 | install_massdns;
41 | install_aquatone;
42 | install_sublist3r;
43 | install_corstest;
44 | install_s3scanner;
45 | install_amass;
46 | install_dirsearch;
47 | install_knockpy;
48 | install_go;
49 | install_go_tools;
50 | }
51 | function install_debian() {
52 | echo -e "$GREEN""[+] Installing for Debian.""$NC";
53 | sudo apt-get update;
54 | sudo apt-get install git wget curl nmap masscan whatweb chromium openssl libnet-ssleay-perl p7zip-full build-essential python-pip python3-pip unzip -y;
55 | install_pip;
56 | sudo pip install wafw00f;
57 | install_dnscan;
58 | install_bfac;
59 | install_massdns;
60 | install_aquatone;
61 | install_sublist3r;
62 | install_corstest;
63 | install_s3scanner;
64 | install_nikto;
65 | install_amass;
66 | install_dirsearch;
67 | install_knockpy;
68 | install_go;
69 | install_go_tools;
70 | }
71 | function install_ubuntu() {
72 | echo -e "$GREEN""[+] Installing for Ubuntu.""$NC";
73 | sudo apt-get update;
74 | sudo apt-get install git wget curl nmap masscan nikto whatweb wafw00f chromium-browser python-pip python3-pip p7zip-full unzip -y;
75 | install_pip;
76 | install_dnscan;
77 | install_bfac;
78 | install_massdns;
79 | install_aquatone;
80 | install_sublist3r;
81 | install_corstest;
82 | install_s3scanner;
83 | install_amass;
84 | install_dirsearch;
85 | install_knockpy;
86 | install_go;
87 | install_go_tools;
88 | }
89 |
90 | function install_pip() {
91 | # Run both pip installs
92 | echo -e "$GREEN""[+] Installing requirements for Python 2 and Python 3.""$NC";
93 | sudo pip2 install -q -r requirements2.txt;
94 | sudo pip3 install -q -r requirements3.txt;
95 | }
96 |
97 | function install_dnscan() {
98 | if [[ -d "$TOOLS"/dnscan ]]; then
99 | echo -e "$GREEN""[+] Updating dnscan.""$NC";
100 | cd "$TOOLS"/dnscan;
101 | git pull;
102 | cd -;
103 | else
104 | echo -e "$GREEN""[+] Installing dnscan from Github.""$NC";
105 | git clone https://github.com/rbsec/dnscan.git "$TOOLS"/dnscan;
106 | fi
107 | }
108 |
109 | function install_bfac() {
110 | if [[ -d "$TOOLS"/bfac ]]; then
111 | echo -e "$GREEN""[+] Updating bfac.""$NC";
112 | cd "$TOOLS"/bfac;
113 | git pull;
114 | cd -;
115 | else
116 | echo -e "$GREEN""[+] Installing bfac from Github.""$NC";
117 | git clone https://github.com/mazen160/bfac.git "$TOOLS"/bfac;
118 | fi
119 | }
120 |
121 | function install_massdns() {
122 | if [[ -d "$TOOLS"/massdns ]]; then
123 | echo -e "$GREEN""[+] Updating massdns.""$NC";
124 | cd "$TOOLS"/massdns;
125 | git pull;
126 | cd -;
127 | else
128 | echo -e "$GREEN""[+] Installing massdns from Github.""$NC";
129 | git clone https://github.com/blechschmidt/massdns.git "$TOOLS"/massdns;
130 | fi
131 |
132 | # Compile massdns
133 | echo -e "$GREEN""[+] Compiling massdns from source.""$NC";
134 | cd "$TOOLS"/massdns;
135 | make;
136 | cd -;
137 | }
138 |
139 | function install_aquatone() {
140 | echo -e "$GREEN""[+] Installing aquatone 1.7.0 from Github.""$NC";
141 | mkdir -pv "$TOOLS"/aquatone;
142 | wget -nv https://github.com/michenriksen/aquatone/releases/download/v1.7.0/aquatone_linux_amd64_1.7.0.zip -O "$TOOLS"/aquatone.zip;
143 | unzip -o "$TOOLS"/aquatone.zip -d "$TOOLS"/aquatone;
144 | rm "$TOOLS"/aquatone.zip;
145 | }
146 |
147 | function install_sublist3r() {
148 | if [[ -d "$TOOLS"/Sublist3r ]]; then
149 | echo -e "$GREEN""[+] Updating sublist3r.""$NC";
150 | cd "$TOOLS"/Sublist3r;
151 | git pull;
152 | cd -;
153 | else
154 | echo -e "$GREEN""[+] Installing sublist3r from Github.""$NC";
155 | git clone https://github.com/aboul3la/Sublist3r.git "$TOOLS"/Sublist3r;
156 | fi
157 | }
158 |
159 | function install_nikto() {
160 | if [[ -d "$TOOLS"/nikto ]]; then
161 | echo -e "$GREEN""[+] Updating nikto.""$NC";
162 | cd "$TOOLS"/nikto;
163 | git pull;
164 | cd -;
165 | else
166 | echo -e "$GREEN""[+] Installing nikto from Github.""$NC";
167 | git clone https://github.com/sullo/nikto.git "$TOOLS"/nikto;
168 | fi
169 | }
170 |
171 | function install_dirsearch() {
172 | if [[ -d "$TOOLS"/dirsearch ]]; then
173 | echo -e "$GREEN""[+] Updating dirsearch.""$NC";
174 | cd "$TOOLS"/dirsearch;
175 | git pull;
176 | cd -;
177 | else
178 | echo -e "$GREEN""[+] Installing dirsearch from Github.""$NC";
179 | git clone https://github.com/maurosoria/dirsearch.git "$TOOLS"/dirsearch;
180 | fi
181 | }
182 |
183 | function install_corstest() {
184 | if [[ -d "$TOOLS"/CORStest ]]; then
185 | echo -e "$GREEN""[+] Updating CORStest.""$NC";
186 | cd "$TOOLS"/CORStest;
187 | git pull;
188 | cd -;
189 | else
190 | echo -e "$GREEN""[+] Installing CORStest from Github.""$NC";
191 | git clone https://github.com/RUB-NDS/CORStest.git "$TOOLS"/CORStest;
192 | fi
193 | }
194 |
195 | function install_s3scanner() {
196 | if [[ -d "$TOOLS"/S3Scanner ]]; then
197 | echo -e "$GREEN""[+] Updating S3Scanner.""$NC";
198 | cd "$TOOLS"/S3Scanner;
199 | git pull;
200 | cd -;
201 | else
202 | echo -e "$GREEN""[+] Installing S3Scanner from Github.""$NC";
203 | git clone https://github.com/sa7mon/S3Scanner.git "$TOOLS"/S3Scanner;
204 | fi
205 | }
206 |
207 | function install_knockpy() {
208 | if [[ -d "$TOOLS"/knock ]]; then
209 | echo -e "$GREEN""[+] Updating Knockpy.""$NC";
210 | cd "$TOOLS"/knock;
211 | git pull;
212 | cd -;
213 | else
214 | echo -e "$GREEN""[+] Installing Knockpy from Github.""$NC";
215 | git clone https://github.com/SolomonSklash/knock.git "$TOOLS"/knock;
216 | cd "$TOOLS"/knock;
217 | sudo python setup.py install;
218 | cd -;
219 | fi
220 | }
221 |
222 | function install_go_tools() {
223 | source $HOME/.profile;
224 | echo -e "$GREEN""[+] Installing Go tools from Github.""$NC";
225 | sleep 1;
226 | echo -e "$GREEN""[+] Installing subfinder from Github.""$NC";
227 | go get -u github.com/subfinder/subfinder;
228 | echo -e "$GREEN""[+] Installing subjack from Github.""$NC";
229 | go get -u github.com/haccer/subjack;
230 | echo -e "$GREEN""[+] Installing ffuf from Github.""$NC";
231 | go get -u github.com/ffuf/ffuf;
232 | echo -e "$GREEN""[+] Installing gobuster from Github.""$NC";
233 | go get -u github.com/OJ/gobuster;
234 | # echo -e "$GREEN""[+] Installing inception from Github.""$NC";
235 | # go get -u github.com/proabiral/inception;
236 | echo -e "$GREEN""[+] Installing waybackurls from Github.""$NC";
237 | go get -u github.com/tomnomnom/waybackurls;
238 | echo -e "$GREEN""[+] Installing goaltdns from Github.""$NC";
239 | go get -u github.com/subfinder/goaltdns;
240 | echo -e "$GREEN""[+] Installing rescope from Github.""$NC";
241 | go get -u github.com/root4loot/rescope;
242 | echo -e "$GREEN""[+] Installing httprobe from Github.""$NC";
243 | go get -u github.com/tomnomnom/httprobe;
244 | }
245 |
246 | function install_go() {
247 | if [[ -e /usr/local/go/bin/go ]]; then
248 | echo -e "$GREEN""[i] Go is already installed, skipping installation.""$NC";
249 | return;
250 | fi
251 | echo -e "$GREEN""[+] Installing Go 1.12 from golang.org.""$NC";
252 | wget -nv https://dl.google.com/go/go1.12.linux-amd64.tar.gz;
253 | sudo tar -C /usr/local -xzf go1.12.linux-amd64.tar.gz;
254 | echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin:" >> "$HOME"/.profile;
255 | echo "export GOPATH=$HOME/go" >> "$HOME"/.profile;
256 | source "$HOME"/.profile;
257 | rm -rf go1.12.linux-amd64.tar.gz;
258 | }
259 |
260 | function install_amass() {
261 | if [[ -d "$TOOLS"/amass ]]; then
262 | rm -rf "$TOOLS"/amass;
263 | fi
264 | echo -e "$GREEN""[+] Installing amass 3.5.4 from Github.""$NC";
265 | wget -nv https://github.com/OWASP/Amass/releases/download/v3.5.4/amass_v3.5.4_linux_amd64.zip -O "$TOOLS"/amass.zip;
266 | unzip -j "$TOOLS"/amass.zip -d "$TOOLS"/amass;
267 | rm "$TOOLS"/amass.zip;
268 | }
269 |
270 | # Check for custom path
271 | CUSTOM_PATH=$1;
272 | if [[ "$CUSTOM_PATH" != "" ]]; then
273 | if [[ -e "$1" ]]; then
274 | TOOLS="$CUSTOM_PATH";
275 | else
276 | echo -e "$RED""The path provided does not exist or can't be opened""$NC";
277 | exit 1;
278 | fi
279 | fi
280 |
281 | # Create install directory
282 | mkdir -pv "$HOME"/bounty/tools;
283 |
284 | grep 'Ubuntu' /etc/issue 1>/dev/null;
285 | UBUNTU="$?";
286 | grep 'Debian' /etc/issue 1>/dev/null;
287 | DEBIAN="$?";
288 | grep 'Kali' /etc/issue 1>/dev/null;
289 | KALI="$?";
290 | grep 'Parrot' /etc/issue 1>/dev/null;
291 | PARROT="$?";
292 | if [[ "$UBUNTU" == 0 ]]; then
293 | install_ubuntu;
294 | elif [[ "$DEBIAN" == 0 ]]; then
295 | install_debian;
296 | elif [[ "$KALI" == 0 ]]; then
297 | install_kali;
298 | elif [[ "$PARROT" == 0 ]]; then
299 | install_parrot;
300 | else
301 | echo -e "$RED""Unsupported distro detected. Exiting...""$NC";
302 | exit 1;
303 | fi
304 |
305 | echo -e "$BLUE""[i] Please run 'source ~/.profile' to add the Go binary path to your \$PATH variable, then run Chomp Scan.""$NC";
306 | echo -e "$ORANGE""[i] Note: In order to use S3Scanner, you must configure your personal AWS credentials in the aws CLI tool.""$NC";
307 | echo -e "$ORANGE""[i] See https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html for details.""$NC";
308 |
--------------------------------------------------------------------------------
/interesting.txt:
--------------------------------------------------------------------------------
1 | admin
2 | administrator
3 | alpha
4 | api
5 | auth
6 | backend
7 | bastion
8 | beta
9 | code
10 | console
11 | debug
12 | default
13 | demo
14 | deploy
15 | dev
16 | development
17 | elastic
18 | git
19 | inf
20 | internal
21 | logging
22 | login
23 | logs
24 | mfa
25 | openvpn
26 | private
27 | qa
28 | readiness
29 | repo
30 | repository
31 | root
32 | sandbox
33 | sso
34 | staff
35 | staging
36 | stg
37 | svn
38 | test
39 | testing
40 | tools
41 | trial
42 | uat
43 | upload
44 | vpn
45 |
--------------------------------------------------------------------------------
/requirements2.txt:
--------------------------------------------------------------------------------
1 | tldextract
2 | argparse
3 | termcolor
4 | dnspython
5 | requests
6 | colorama
7 | awscli
8 | sh
9 | pytest-xdist
10 | coloredlogs
11 | boto3
12 |
--------------------------------------------------------------------------------
/requirements3.txt:
--------------------------------------------------------------------------------
1 | dnspython
2 | colorama
3 | requests
4 | requests[socks]
5 | argparse
6 | awscli
7 | sh
8 | pytest-xdist
9 | coloredlogs
10 | boto3
11 | soupsieve
12 |
--------------------------------------------------------------------------------
/resolvers.txt:
--------------------------------------------------------------------------------
1 | 8.8.8.8
2 | 1.1.1.1
3 | 9.9.9.9
4 | 8.8.4.4
5 | 1.0.0.1
6 | 149.112.112.112
7 | 208.67.220.220
8 | 208.67.222.222
9 | 64.6.64.6
10 | 64.6.65.6
11 | 198.206.14.241
12 | 172.98.193.42
13 | 216.146.35.35
14 | 216.146.36.36
15 |
--------------------------------------------------------------------------------
/screenshots/screenshot01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SolomonSklash/chomp-scan/d366cea3ece0ef5e2da3d17429973ef8f042eec1/screenshots/screenshot01.png
--------------------------------------------------------------------------------
/screenshots/screenshot02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SolomonSklash/chomp-scan/d366cea3ece0ef5e2da3d17429973ef8f042eec1/screenshots/screenshot02.png
--------------------------------------------------------------------------------
/screenshots/screenshot03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SolomonSklash/chomp-scan/d366cea3ece0ef5e2da3d17429973ef8f042eec1/screenshots/screenshot03.png
--------------------------------------------------------------------------------
/screenshots/screenshot04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SolomonSklash/chomp-scan/d366cea3ece0ef5e2da3d17429973ef8f042eec1/screenshots/screenshot04.png
--------------------------------------------------------------------------------
/screenshots/screenshot05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SolomonSklash/chomp-scan/d366cea3ece0ef5e2da3d17429973ef8f042eec1/screenshots/screenshot05.png
--------------------------------------------------------------------------------
/screenshots/screenshot06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SolomonSklash/chomp-scan/d366cea3ece0ef5e2da3d17429973ef8f042eec1/screenshots/screenshot06.png
--------------------------------------------------------------------------------
/screenshots/screenshot07.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SolomonSklash/chomp-scan/d366cea3ece0ef5e2da3d17429973ef8f042eec1/screenshots/screenshot07.png
--------------------------------------------------------------------------------
/wordlists/altdns-words.txt:
--------------------------------------------------------------------------------
1 | 1
2 | 10
3 | 11
4 | 12
5 | 13
6 | 14
7 | 15
8 | 16
9 | 17
10 | 18
11 | 19
12 | 2
13 | 20
14 | 2009
15 | 2010
16 | 2011
17 | 2012
18 | 2013
19 | 2014
20 | 2015
21 | 2016
22 | 3
23 | 4
24 | 5
25 | 6
26 | 7
27 | 8
28 | 9
29 | a
30 | acc
31 | accounts
32 | admin
33 | admin1
34 | administrator
35 | akali
36 | akamai
37 | alpha
38 | alt
39 | america
40 | analytics
41 | api
42 | api1
43 | api-docs
44 | apollo
45 | april
46 | auth
47 | aws
48 | b
49 | backend
50 | beta
51 | billing
52 | boards
53 | box
54 | brand
55 | brasil
56 | brazil
57 | bucket
58 | bucky
59 | c
60 | cdn
61 | cf
62 | chef
63 | ci
64 | client
65 | cloudfront
66 | cms
67 | cms1
68 | cn
69 | code
70 | com
71 | confluence
72 | console
73 | container
74 | control
75 | data
76 | debug
77 | dec
78 | default
79 | demo
80 | deploy
81 | dev
82 | dev1
83 | developer
84 | development
85 | devops
86 | docker
87 | docs
88 | drop
89 | edge
90 | elastic
91 | elasticbeanstalk
92 | elb
93 | email
94 | eng
95 | engima
96 | engine
97 | engineering
98 | eu
99 | europe
100 | europewest
101 | euw
102 | euwe
103 | evelynn
104 | events
105 | feb
106 | firewall
107 | forms
108 | forum
109 | frontpage
110 | fw
111 | games
112 | germany
113 | gh
114 | ghcpi
115 | git
116 | github
117 | global
118 | hkg
119 | hw
120 | hwcdn
121 | i
122 | ids
123 | int
124 | internal
125 | jenkins
126 | jinx
127 | july
128 | june
129 | kor
130 | korea
131 | kr
132 | lan
133 | las
134 | latin
135 | latinamerica
136 | lax
137 | lax1
138 | lb
139 | loadbalancer
140 | login
141 | machine
142 | mail
143 | march
144 | merch
145 | mirror
146 | na
147 | nautilus
148 | net
149 | netherlands
150 | nginx
151 | nl
152 | node
153 | northamerica
154 | nov
155 | oceania
156 | oct
157 | openvpn
158 | ops
159 | org
160 | origin
161 | page
162 | pantheon
163 | pass
164 | pay
165 | payment
166 | pc
167 | php
168 | pl
169 | poland
170 | preferences
171 | priv
172 | private
173 | prod
174 | production
175 | profile
176 | profiles
177 | promo
178 | promotion
179 | proxy
180 | qa
181 | readiness
182 | redirector
183 | region
184 | repo
185 | repository
186 | reset
187 | restrict
188 | restricted
189 | reviews
190 | root
191 | s
192 | s3
193 | sandbox
194 | search
195 | secure
196 | security
197 | sept
198 | server
199 | service
200 | singed
201 | skins
202 | spring
203 | ssl
204 | sso
205 | staff
206 | stage
207 | stage1
208 | staging
209 | static
210 | support
211 | svn
212 | swagger
213 | system
214 | t
215 | team
216 | test
217 | test1
218 | testbed
219 | testing
220 | testing1
221 | tomcat
222 | tools
223 | tpe
224 | tr
225 | trial
226 | tur
227 | turk
228 | turkey
229 | twitch
230 | uat
231 | us-east-1
232 | us-east-10
233 | us-east-11
234 | us-east-12
235 | us-east-13
236 | us-east-14
237 | us-east-15
238 | us-east-16
239 | us-east-2
240 | us-east-3
241 | us-east-4
242 | us-east-5
243 | us-east-6
244 | us-east-7
245 | us-east-8
246 | us-east-9
247 | us-west-1
248 | v1
249 | v2
250 | vi
251 | vpn
252 | w3
253 | web
254 | web1
255 | webapp
256 | westeurope
257 | z
258 |
--------------------------------------------------------------------------------
/wordlists/big.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SolomonSklash/chomp-scan/d366cea3ece0ef5e2da3d17429973ef8f042eec1/wordlists/big.txt
--------------------------------------------------------------------------------
/wordlists/haddix-seclists-combined.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SolomonSklash/chomp-scan/d366cea3ece0ef5e2da3d17429973ef8f042eec1/wordlists/haddix-seclists-combined.txt
--------------------------------------------------------------------------------
/wordlists/provider.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "vulnerability":"PHP info is publicly viewable",
4 | "sendIn":"url",
5 | "payload":["/php.php","/phpinfo.php","/info.php","/_profiler/phpinfo"],
6 | "checkIn":"responseBody",
7 | "checkFor":"PHP Extension&&&&PHP API&&&&PHP Version",
8 | "color":"red"
9 | },
10 | {
11 | "vulnerability":"Server status is publicly viewable",
12 | "sendIn":"url",
13 | "payload":["/server-status"],
14 | "checkIn":"responseBody",
15 | "checkFor":"Apache Server Status&&&&Server Version&&&&CPU Usage:",
16 | "color":"yellow"
17 | },
18 | {
19 | "vulnerability":"Tomcat Server status is publicly viewable",
20 | "sendIn":"url",
21 | "payload":["/status?full=true"],
22 | "checkIn":"responseBody",
23 | "checkFor":"Current thread count",
24 | "color":"yellow"
25 | },
26 | {
27 | "vulnerability":"Git Exposed publicly",
28 | "sendIn":"url",
29 | "payload":["/.git/config"],
30 | "checkIn":"responseBody",
31 | "checkFor":"[core]",
32 | "color":"red"
33 | },
34 | {
35 | "vulnerability": "Lazy File Manager",
36 | "sendIn": "url",
37 | "payload": [
38 | "/lfm.php"
39 | ],
40 | "checkIn": "responseBody",
41 | "checkFor": "Lazy File Manager",
42 | "color": "blue"
43 | },
44 | {
45 | "vulnerability": "IntelliJ IDEA WebServer config file",
46 | "sendIn": "url",
47 | "payload": [
48 | "/.idea/WebServers.xml"
49 | ],
50 | "checkIn": "responseBody",
51 | "checkFor": "name=\"WebServers\"",
52 | "color": "red"
53 | },
54 | {
55 | "vulnerability": "Symfony Database Config File",
56 | "sendIn": "url",
57 | "payload": [
58 | "/config/databases.yml"
59 | ],
60 | "checkIn": "responseBody",
61 | "checkFor": "param:&&&&class:",
62 | "color": "red"
63 | },
64 | {
65 | "vulnerability": "Rails Database Config file",
66 | "sendIn": "url",
67 | "payload": [
68 | "/config/database.yml"
69 | ],
70 | "checkIn": "responseBody",
71 | "checkFor": "database:&&&&adapter:",
72 | "color": "red"
73 | },
74 | {
75 | "vulnerability": "wsFTP ini File",
76 | "sendIn": "url",
77 | "payload": [
78 | "/WS_FTP.ini",
79 | "/ws_ftp.ini",
80 | "/WS_FTP.INI"
81 | ],
82 | "checkIn": "responseBody",
83 | "checkFor": "[_config_]",
84 | "color": "red"
85 | },
86 | {
87 | "vulnerability": "Filezilla config file",
88 | "sendIn": "url",
89 | "payload": [
90 | "/filezilla.xml",
91 | "/sitemanager.xml",
92 | "/FileZilla.xml"
93 | ],
94 | "checkIn": "responseBody",
95 | "checkFor": ">