options.py 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-"
  3. """
  4. This file is part of the orb project, https://orb.03c8.net
  5. Orb - 2016/2017/2018 - by psy (epsylon@riseup.net))
  6. You should have received a copy of the GNU General Public License along
  7. with RedSquat; 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: footprinting tool - by psy',
  15. prog='Orb.py',
  16. version='\nVersion: v0.2 - "Green Orb"\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: Yahoo)")
  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-financial", action="store_true", dest="financial", help="disable financial records")
  38. group2.add_option("--no-social", action="store_true", dest="social", help="disable social records")
  39. group2.add_option("--social-f", action="store", dest="socialf", help="set a list of social sources from file")
  40. group2.add_option("--no-news", action="store_true", dest="news", help="disable news records")
  41. group2.add_option("--news-f", action="store", dest="newsf", help="set a list of news sources from file")
  42. self.add_option_group(group2)
  43. group3 = optparse.OptionGroup(self, "*Domains*",
  44. "Orb will search on different databases for registered domains using IANA supported by default. You only can set one:")
  45. group3.add_option("--ext", action="store", dest="ext", help="set extensions manually (ex: --ext='.com,.net,.es')")
  46. group3.add_option("--ext-f", action="store", dest="extfile", help="set a list of extensions from file")
  47. self.add_option_group(group3)
  48. group4 = optparse.OptionGroup(self, "*Whois*",
  49. "Orb will search on 'Whois' records for registrant information:")
  50. group4.add_option("--no-whois", action="store_true", dest="whois", help="disable extract whois information")
  51. self.add_option_group(group4)
  52. group5 = optparse.OptionGroup(self, "*Subdomains*",
  53. "Orb will try to discover info about subdomains:")
  54. group5.add_option("--no-subs", action="store_true", dest="subs", help="disable try to discover subdomains")
  55. self.add_option_group(group5)
  56. group6 = optparse.OptionGroup(self, "*DNS*",
  57. "Orb will try to discover info about DNS records and machines running them. You can choose multiple:")
  58. group6.add_option("--no-dns", action="store_true", dest="dns", help="disable try to discover DNS records")
  59. group6.add_option("--resolver", action="store", dest="resolv", help="specify custom DNS servers (ex: '8.8.8.8,8.8.8.4')")
  60. self.add_option_group(group6)
  61. group7 = optparse.OptionGroup(self, "*Port Scanning*",
  62. "These options can be used to specify how to perfom port scanning tasks. You can choose multiple:")
  63. group7.add_option("--no-scanner", action="store_true", dest="scanner", help="disable scanner")
  64. group7.add_option("--no-scan-dns", action="store_true", dest="scandns", help="disable scan DNS machines")
  65. group7.add_option("--no-scan-ns", action="store_true", dest="scanns", help="disable scan NS records")
  66. group7.add_option("--no-scan-mx", action="store_true", dest="scanmx", help="disable scan MX records")
  67. group7.add_option("--scan-tcp", action="store_true", dest="proto", help="set scanning protocol to only TCP (default TCP+UDP)")
  68. group7.add_option("--scan-ports", action="store", dest="ports", help="set range of ports to scan (default 1-65535)")
  69. group7.add_option("--show-filtered", action="store_true", dest="filtered", help="show 'filtered' ports on results")
  70. self.add_option_group(group7)
  71. group8 = optparse.OptionGroup(self, "*Banner grabbing*",
  72. "Orb will try to extract interesting information about services running on machines discovered (ex: OS, vendor, version, cpe, cvs):")
  73. group8.add_option("--no-banner", action="store_true", dest="banner", help="disable extract banners from services")
  74. group8.add_option("--no-cve", action="store_true", dest="cve", help="disable extract vulnerabilities from CVE")
  75. group8.add_option("--no-cvs", action="store_true", dest="cvs", help="disable extract CVS description")
  76. self.add_option_group(group8)
  77. group9 = optparse.OptionGroup(self, "*Reporting*",
  78. "These options can be used to specify exporting methods for your results. You can choose multiple:")
  79. group9.add_option("--no-log", action="store_true", dest="nolog", help="disable generate reports")
  80. group9.add_option("--json", action="store", dest="json", help="generate json report (ex: --json='foo.json')")
  81. self.add_option_group(group9)
  82. def get_options(self, user_args=None):
  83. (options, args) = self.parse_args(user_args)
  84. if (not options.checktor and not options.target and not options.gui and not options.update):
  85. print '='*75, "\n"
  86. print " _|_| _| "
  87. print "_| _| _| _|_| _|_|_| "
  88. print "_| _| _|_| _| _| "
  89. print "_| _| _| _| _| "
  90. print " _|_| _| _|_|_| "
  91. print self.description, "\n"
  92. print '='*75, "\n"
  93. return False
  94. return options