Skip to content

Commit

Permalink
refactoring and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
evyatarmeged committed Aug 2, 2018
1 parent 5500dfd commit 6f7f5a2
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![Build Status](https://travis-ci.org/evyatarmeged/Raccoon.svg?branch=master)
![license](https://img.shields.io/github/license/mashape/apistatus.svg)
![pythonver](https://img.shields.io/badge/python-3.5%2B-blue.svg)
![raccoonver](https://img.shields.io/badge/Raccoon%20version-0.0.74-lightgrey.svg)
![raccoonver](https://img.shields.io/badge/Raccoon%20version-0.0.75-lightgrey.svg)

##### Features
- [x] DNS details
Expand Down Expand Up @@ -109,10 +109,11 @@ Options:
the default
--tls-port INTEGER Use this port for TLS queries. Default: 443
--skip-health-check Do not test for target host availability
-fr, --follow-redirects Follow redirects when fuzzing. Default: True
--follow-redirects Follow redirects when fuzzing. Default: False
(will not follow redirects)
--no-url-fuzzing Do not fuzz URLs
--no-sub-enum Do not bruteforce subdomains
--skip-nmap-scan Do not scan with Nmap
--skip-nmap-scan Do not perform an Nmap scan
-q, --quiet Do not output to stdout
-o, --outdir TEXT Directory destination for scan output
--help Show this message and exit.
Expand Down
2 changes: 1 addition & 1 deletion raccoon_src/lib/dns_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def grab_whois(cls, host):
logger.debug(line)

@classmethod
def generate_dns_dumpster_mapping(cls, host, sout_logger):
async def generate_dns_dumpster_mapping(cls, host, sout_logger):
sout_logger.info("{} Trying to fetch DNS Mapping for {} from DNS dumpster".format(
COLORED_COMBOS.INFO, host))
try:
Expand Down
2 changes: 1 addition & 1 deletion raccoon_src/lib/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _generate_fake_requests(self, sub_domain):
response_codes.append(res.status_code)
except RequestHandlerException as e:
if sub_domain: # If should-not-work.example.com doesn't resolve, no wildcard subdomain is present
return
return [0]
else:
raise FuzzerException("Could not get a response from {}."
" Maybe target is down ?".format(self.target))
Expand Down
15 changes: 6 additions & 9 deletions raccoon_src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def intro(logger):


@click.command()
@click.version_option("0.0.74")
@click.version_option("0.0.75")
@click.option("-t", "--target", required=True, help="Target to scan")
@click.option("-d", "--dns-records", default="A,MX,NS,CNAME,SOA,TXT",
help="Comma separated DNS records to query. Defaults to: A,MX,NS,CNAME,SOA,TXT")
Expand All @@ -68,8 +68,8 @@ def intro(logger):
@click.option("-p", "--port", help="Use this port range for Nmap scan instead of the default")
@click.option("--tls-port", default=443, help="Use this port for TLS queries. Default: 443")
@click.option("--skip-health-check", is_flag=True, help="Do not test for target host availability")
@click.option("--no-redirects", is_flag=True,
help="Do not follow redirects when fuzzing. Default: False (will follow redirects)")
@click.option("--follow-redirects", is_flag=True, default=False,
help="Follow redirects when fuzzing. Default: False (will not follow redirects)")
@click.option("--no-url-fuzzing", is_flag=True, help="Do not fuzz URLs")
@click.option("--no-sub-enum", is_flag=True, help="Do not bruteforce subdomains")
@click.option("--skip-nmap-scan", is_flag=True, help="Do not perform an Nmap scan")
Expand All @@ -94,7 +94,7 @@ def main(target,
port,
tls_port,
skip_health_check,
no_redirects,
follow_redirects,
no_url_fuzzing,
no_sub_enum,
skip_nmap_scan,
Expand Down Expand Up @@ -134,7 +134,6 @@ def main(target,

dns_records = tuple(dns_records.split(","))
ignored_response_codes = tuple(int(code) for code in ignored_response_codes.split(","))
follow_redirects = not no_redirects

if port:
HelpUtilities.validate_port_range(port)
Expand Down Expand Up @@ -187,14 +186,12 @@ def main(target,
asyncio.ensure_future(tls_info_scanner.run()),
asyncio.ensure_future(waf.detect()),
asyncio.ensure_future(DNSHandler.grab_whois(host)),
asyncio.ensure_future(web_app_scanner.run_scan())
asyncio.ensure_future(web_app_scanner.run_scan()),
asyncio.ensure_future(DNSHandler.generate_dns_dumpster_mapping(host, logger))
)

main_loop.run_until_complete(asyncio.wait(tasks))

# DNS dumpster visualization
DNSHandler.generate_dns_dumpster_mapping(host, logger)

# Second set of checks - URL fuzzing, Subdomain enumeration
if not no_url_fuzzing:
fuzzer = URLFuzzer(host, ignored_response_codes, threads, wordlist, follow_redirects)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
name='raccoon-scanner',
packages=find_packages(exclude="tests"),
license="MIT",
version='0.0.74',
version='0.0.75',
description='Offensive Security Tool for Reconnaissance and Information Gathering',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def setUp(self):

def test_bad_wordlist(self):
host = self.TestHost("127.0.0.1", ())
fuzzer = self.TestFuzzer(host, (), wordlist="no/such/path", num_threads=1)
fuzzer = self.TestFuzzer(host, (), path_to_wordlist="no/such/path", num_threads=1)
with self.assertRaises(FuzzerException):
self.loop.run_until_complete(fuzzer.fuzz_all())

0 comments on commit 6f7f5a2

Please sign in to comment.