Active Information Gathering Flashcards
What is DNS?
The Domain Name System (DNS) is one of the most critical systems on the Internet and is a distributed database responsible for translating user-friendly domain names into IP addresses.
Example of TLD?
.com
How to control how long a server or client caches a DNS record?
Via TTL field of DNS record.
What is NS?
NS - Nameserver records contain the name of the authoritative servers hosting the DNS records for a domain.
What is A?
A - Also known as a host record, the “a record” contains the IP address of a hostname (such as www.megacorpone.com).
What is MX?
MX - Mail Exchange records contain the names of the servers responsible for handling email for the domain. A domain can contain multiple MX records.
What is PTR?
PTR - Pointer Records are used in reverse lookup zones and are used to find the records associated with an IP address.
What is CNAME?
CNAME - Canonical Name Records are used to create aliases for other host records.
What is TXT?
TXT - Text records can contain any arbitrary data and can be used for various purposes, such as domain ownership verification.
How to to find the A host record for www.megacorpone.com?
host www.megacorpone.com
How to find the MX records for megacorpone.com?
host -t mx megacorpone.com
How to find the TXT records for megacorpone.com?
host -t txt megacorpone.com
How to look up a valid host for megacorpone.com?
host www.megacorpone.com
How to use host to look up an invalid host?
host idontexist.megacorpone.com
What NXDOMAIN means?
Public DNS record does not exist for that hostname.
How to use bash to brute force forward DNS name lookups for megacorpone.com? You have a wordlist called “list.txt”.
kali@kali:~$ for ip in $(cat list.txt); do host $ip.megacorpone.com; done
How to use bash to bruteforce reverse DNS names? Let’s use a loop to scan IP addresses 38.100.193.50 through 38.100.193.100. We will filter out invalid results by showing only entries that do not contain “not found” (with grep -v).
for ip in $(seq 50 100); do host 38.100.193.$ip; done | grep -v “not found”
What “grep -v” do?
Select non-matching lines.
What is DNS zone transfer?
A zone transfer is basically a database replication between related DNS servers in which the zone file is copied from a master DNS server to a slave server. The zone file contains a list of all the DNS names configured for that zone. Zone transfers should only be allowed to authorized slave DNS servers but many administrators misconfigure their DNS servers, and in these cases, anyone asking for a copy of the DNS server zone will usually receive one.
How to use host to perform a DNS zone transfer?
host -l domain_name dns_server_address
How to attempt zone transfer on “megacorpone.com” and on ns1 subdomain?
kali@kali:~$ host -l megacorpone.com ns1.megacorpone.com
How to use host to do a DNS zone transfer on www.megacorpone.com and ns2 subdomain?
kali@kali:~$ host -l megacorpone.com ns2.megacorpone.com
How to use host to obtain DNS servers for a given domain name?
host -t ns megacorpone.com | cut -d “ “ -f 4
What ‘-t’ do in host command?
-t specifies the query type
What is DNSRecon?
DNSRecon is an advanced, modern DNS enumeration script written in Python.
What is ‘-d’ for in dnsrecon?
To specify a domain name.
What is ‘-t’ for in dnsrecon?
To specify the type of enumeration to perform.
How to use dnsrecon to perform a zone transfer on megacorpone.com?
kali@kali:~$ dnsrecon -d megacorpone.com -t axfr
What is ‘-D’ for in dnsrecon?
To specify a file name containing potential subdomain strings.
What is ‘-t’ for in dnsrecon?
To specify the type of enumeration to perform.
How to brute force hostnames using dnsrecon and list.txt?
kali@kali:~$ dnsrecon -d megacorpone.com -D ~/list.txt -t brt
What is DNSenum?
DNSEnum is another popular DNS enumeration tool.
How to find a website’s DNS address?
host -t ns domain-name-com-here
How to attempt a Zone transfer using dnsrecon on megacorpone.com?
dnsrecon -d megacorpone.com
What is port scanning?
Port scanning is the process of inspecting TCP or UDP ports on a remote machine with the intention of detecting what services are running on the target and what potential attack vectors may exist.
How to use netcat to perform a TCP port scan on ports 3388-3390? On address IP 10.11.1.220.
nc -nvv -w 1 -z 10.11.1.220 3388-3390
What ‘-w’ option do in netcat?
Specifies connection timeout in seconds.
What ‘-z’ option do in netcat?
Is used to specify zero-I/O mode, which will send no data.
How to use netcat to perform a UDP port scan on ports 160-162, destination IP 10.11.1.115?
kali@kali:~$ nc -nv -u -z -w 1 10.11.1.115 160-162
What ‘-u’ option do in netcat?
Indicate UDP port scan.
What is nmap?
Is one of the most popular, versatile, and robust port scanners available.
What is ‘-I’ option for in iptables?
To insert a new rule into a given chain which in this case includes both the INPUT (Inbound) and OUTPUT (Outbound) chains followed by the rule number.
What is ‘-s’ option for in iptables?
Specify a source IP address.
What is ‘-d’ option for in iptables?
Specify a destination IP address.
What is ‘-j’ option for in iptables?
ACCEPT the traffic.
What is ‘-z’ option for in iptables?
Zero the packet and byte counters in all chains.
How to configure iptables rules for the scan on IP 10.11.1.220?
kali@kali:~$ sudo iptables -I INPUT 1 -s 10.11.1.220 -j ACCEPT
kali@kali:~$ sudo iptables -I OUTPUT 1 -d 10.11.1.220 -j ACCEPT
kali@kali:~$ sudo iptables -Z
How to scan an IP 10.11.1.220 for the 1000 most popular TCP ports?
nmap 10.11.1.220
What ‘-v’ option in iptables do?
Add some verbosity.
What ‘-n’ option in iptables do?
Enable numeric output.