options.py 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-"
  3. """
  4. This file is part of the orb project, https://orb.03c8.net
  5. Orb - 2016/2020 - by psy (epsylon@riseup.net)
  6. You should have received a copy of the GNU General Public License along
  7. with Orb; if not, write to the Free Software Foundation, Inc., 51
  8. Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  9. """
  10. import optparse
  11. class OrbOptions(optparse.OptionParser):
  12. def __init__(self, *args):
  13. optparse.OptionParser.__init__(self,
  14. description='\nOrb: massive footprinting tool - by psy (https://03c8.net)',
  15. prog='Orb.py',
  16. version='\nVersion: v0.3 (2020) - "Red Orb! - https://orb.03c8.net"\n')
  17. self.add_option("-v", "--verbose", action="store_true", dest="verbose", help="active verbose on requests")
  18. self.add_option("--check-tor", action="store_true", dest="checktor", help="check to see if Tor is used properly")
  19. self.add_option("--update", action="store_true", dest="update", help="check for latest stable version")
  20. self.add_option("--spell", action="store", dest="target", help="start complete footprinting on this target")
  21. self.add_option("--gui", action="store_true", dest="gui", help="run GUI (Orb Web Interface)")
  22. group10 = optparse.OptionGroup(self, "*Methods*",
  23. "These options can be used to set some footprinting interaction restrictions with target(s). You only can set one:")
  24. group10.add_option("--passive", action="store_true", dest="passive", help="use only -passive- methods")
  25. group10.add_option("--active", action="store_true", dest="active", help="use only -active- methods")
  26. self.add_option_group(group10)
  27. group1 = optparse.OptionGroup(self, "*Search Engines*",
  28. "These options can be used to specify which search engines use to extract information:")
  29. group1.add_option("--se", action="store", dest="engine", help="set search engine (default: DuckDuckGo)")
  30. group1.add_option("--se-ext", action="store", dest="engineloc", help="set location for search engine (ex: 'fr')")
  31. group1.add_option("--sa", action="store_true", dest="allengines", help="search massively using all search engines")
  32. self.add_option_group(group1)
  33. group2 = optparse.OptionGroup(self, "*Public*",
  34. "Orb will search for interesting public records. You can choose multiple:")
  35. group2.add_option("--no-public", action="store_true", dest="public", help="disable search for public records")
  36. group2.add_option("--no-deep", action="store_true", dest="deep", help="disable deep web records")
  37. group2.add_option("--no-social", action="store_true", dest="social", help="disable social records")
  38. group2.add_option("--social-f", action="store", dest="socialf", help="set a list of social sources from file")
  39. group2.add_option("--no-news", action="store_true", dest="news", help="disable news records")
  40. group2.add_option("--news-f", action="store", dest="newsf", help="set a list of news sources from file")
  41. self.add_option_group(group2)
  42. group3 = optparse.OptionGroup(self, "*Domains*",
  43. "Orb will search on different databases for registered domains using IANA supported by default. You only can set one:")
  44. group3.add_option("--ext", action="store", dest="ext", help="set extensions manually (ex: --ext='.com,.net,.es')")
  45. group3.add_option("--ext-f", action="store", dest="extfile", help="set a list of extensions from file")
  46. self.add_option_group(group3)
  47. group4 = optparse.OptionGroup(self, "*Whois*",
  48. "Orb will search on 'Whois' records for registrant information:")
  49. group4.add_option("--no-whois", action="store_true", dest="whois", help="disable extract whois information")
  50. self.add_option_group(group4)
  51. group5 = optparse.OptionGroup(self, "*Subdomains*",
  52. "Orb will try to discover info about subdomains:")
  53. group5.add_option("--no-subs", action="store_true", dest="subs", help="disable try to discover subdomains")
  54. self.add_option_group(group5)
  55. group6 = optparse.OptionGroup(self, "*DNS*",
  56. "Orb will try to discover info about DNS records and machines running them. You can choose multiple:")
  57. group6.add_option("--no-dns", action="store_true", dest="dns", help="disable try to discover DNS records")
  58. group6.add_option("--resolver", action="store", dest="resolv", help="specify custom DNS servers (ex: '8.8.8.8,8.8.8.4')")
  59. self.add_option_group(group6)
  60. group7 = optparse.OptionGroup(self, "*Port Scanning*",
  61. "These options can be used to specify how to perfom port scanning tasks. You can choose multiple:")
  62. group7.add_option("--no-scanner", action="store_true", dest="scanner", help="disable scanner")
  63. group7.add_option("--no-scan-dns", action="store_true", dest="scandns", help="disable scan DNS machines")
  64. group7.add_option("--no-scan-ns", action="store_true", dest="scanns", help="disable scan NS records")
  65. group7.add_option("--no-scan-mx", action="store_true", dest="scanmx", help="disable scan MX records")
  66. group7.add_option("--scan-tcp", action="store_true", dest="proto", help="set scanning protocol to only TCP (default TCP+UDP)")
  67. group7.add_option("--scan-ports", action="store", dest="ports", help="set range of ports to scan (default 1-65535)")
  68. group7.add_option("--show-filtered", action="store_true", dest="filtered", help="show 'filtered' ports on results")
  69. self.add_option_group(group7)
  70. group8 = optparse.OptionGroup(self, "*Banner grabbing*",
  71. "Orb will try to extract interesting information about services running on machines discovered (ex: OS, vendor, version, cpe, cvs):")
  72. group8.add_option("--no-banner", action="store_true", dest="banner", help="disable extract banners from services")
  73. group8.add_option("--no-cve", action="store_true", dest="cve", help="disable extract vulnerabilities from CVE")
  74. group8.add_option("--no-cvs", action="store_true", dest="cvs", help="disable extract CVS description")
  75. self.add_option_group(group8)
  76. group9 = optparse.OptionGroup(self, "*Reporting*",
  77. "These options can be used to specify exporting methods for your results. You can choose multiple:")
  78. group9.add_option("--no-log", action="store_true", dest="nolog", help="disable generate reports")
  79. group9.add_option("--json", action="store", dest="json", help="generate json report (ex: --json='foo.json')")
  80. self.add_option_group(group9)
  81. def get_options(self, user_args=None):
  82. (options, args) = self.parse_args(user_args)
  83. if (not options.checktor and not options.target and not options.gui and not options.update):
  84. print("\n"+'='*75, "\n")
  85. print(" _|_| _| ")
  86. print("_| _| _| _|_| _|_|_| ")
  87. print("_| _| _|_| _| _| ")
  88. print("_| _| _| _| _| ")
  89. print(" _|_| _| _|_|_| ")
  90. print(self.description, "\n")
  91. print('='*75, "\n")
  92. return False
  93. return options