
cacert=/home/user/tools/tls-scan/ca-bundle.crt \ $ cat ssl-alive.in | tls-scan -port=443 -concurrency=150 \ After downloading the binary package for tls-scan, ca-bundle.crt is included, the location of which should be passed as the -cacert= option for certificate validation. We specify port 443 with a higher concurrency of 150 (I randomly chose that number, so adjust this to your system) and discard standard errors to /dev/null. Let’s run tls-scan on all the SSL-enabled IPs. Tls-scan is capable of concurrently scanning thousands of hosts to collect their SSL certificates and outputs that data in json format. We now have a list of the IPs ready to provide us with their SSL certificates over port 443. Then clean up the masscan results by trimming fields with awk and sorting with sort -u: $ cat masscan.out | awk | awk NF | sort -u > ssl-alive.in Next, we scan port 443 on all these IPs with masscan: $ sudo masscan ‐p443 ––rate 100000 -iL aws_ips.in -oL masscan.out We can use nmap’s “host discovery” feature -sL with the “skip reverse DNS resolution” flag -n to quickly expand the list of CIDRs to individual IPs. Optionally, before running masscan, since this list is in IP CIDR notation, it would be a good idea to count how many actual IPs we have ready for input. If we find any vulnerabilities on DoD-specific assets, we’ll submit a report at HackerOne. These other IP addresses will be out-of-scope for further testing.

Note that only a fraction of these AWS GovCloud IPs are DoD-related since many federal and state-level assets are hosted on AWS GovCloud as well. Also, we can now play within the scope of the DoD vulnerability disclosure program managed by HackerOne. This allows us to significantly narrow down the number of AWS IP addresses upfront - 458,754 versus 10M+ - since we can cherrypick the AWS GovCloud network blocks in regions us-gov-east-1 and us-gov-west-1. Department of Defense) on AWS GovCloud to discover active hosts. There are now 10,130,200 IP addresses in the EC2 range.įor the sake of the rest of this example, let’s target the DoD (U.S. For deeper scans later, we could expand fuzziness by probing alternate HTTPS ports such as 8443.

Without this step, our SSL certificate checks in the next step will hang or take longer than necessary because we’ll attempt TLS handshakes with dead ports. Once we have gathered all the AWS IPs, we need to filter the list down to only IPs that have SSL enabled, which by default would have port 443 open. If we are interested in only AWS EC2 (cloud computing) infrastructure, Amazon provides an EC2 Reachability Test status page listing all the IP ranges in a table.įor the most complete data, Amazon also provides all of AWS IP address ranges in JSON format which makes for easier command-line parsing (group by region or service).įilter Only SSL-Enabled IPs on AWS (masscan) Collect Amazon AWS’s IP Rangesįirst, we begin by gathering all of AWS’s IP addresses.
Zenmap scan ip range how to#
Here’s how to hypothetically scan AWS’s IP range and SSL certificates - chaining together off-the-shelf tooling - to identify your target’s cloud assets. Masscan claims it can “ scan the entire Internet in under 6 minutes, transmitting 10 million packets per second.” That’s sick. Both tools are written in C and optimized to be blazing fast. With public cloud infrastructure fast becoming the norm, your reconnaissance will miss out on many assets just by scanning an organization’s private network ranges using tools like Nmap or Shodan.Īfter testing several different open source tools, combining masscan with tls-scan yielded the quickest and cleanest results. Many companies and governments, rather than spinning up assets on their assigned IP blocks (ASNs), increasingly rely on cloud services like Amazon AWS and Microsoft Azure to host their production and development assets.

Scan Amazon AWS’s entire IPv4 network space, and match the SSL certificates back to hostnames of your target. Naffy ( nnwakelam) shared in his recent nahamsec interview a creative approach to extend a target’s attack surface.

How To Scan AWS's Entire IP Range to Recon SSL Certificates
