VAPT_Methodology
VAPT_Methodology
VAPT_Methodology
External Testing
Domain Enumeration
Find DNS Host Records (Subdomains) Enumeration - DNS Enumeration
IP block search
Active IPV4 Addresses Identification
Certificate Fingerprinting
Websites Enumeration (Technology Stack Enumeration)
CMS & Framwork Identification
Pulling Headers
Web Application Vulnerability Scanner
Web Application Firewall identification
Web Crawlers & Directory Brute Force
EMAIL Ecosystem Enumeration
Spoofing Tests
Good Reads
Email Collection
Dark web Reconnaissance
Password Spraying Attacks
VPN detection
Mobile Application
Name Tags
Untitled
Untitled
Untitled
External Testing
Sites Used
hackthissite.org
zonetransfer.me
Domain Enumeration
Give the organization name, say, Hack this Site, the initial point is to get an idea of the domains associated with the
organization from google search engine or any other search engines. Its all about mapping the attack surface and this is a
starting point.
VAPT Methodologies 1
3. what are the subdomains ?
4. what are the DNS records [ TXT, A, NS, MX, SRV] associated with the domain ?
6. What is historically available about the domains, subdomains and IPs For example, what was running on IP X last year ?
SOA Records - Indicates the server that has authority for the domain.
A Records - An address record that allows a computer name to be translated to an IP address. Each computer has to
have this record for its IP address to be located via DNS.
PTR Records - Lists a host’s domain name, host identified by its IP address.
HINFO Records - Host information record with CPU type and operating system.
CNAME - A host’s canonical name allows additional names/ aliases to be used to locate a computer.
Once you have the domain, enumerate subdomains using the following websites, tools and scripts as you see fit;
Dnsdumpster - com - dns recon and research, find and lookup dns records
VAPT Methodologies 2
Hacker Target - Find DNS Host Records | Subdomain Finder | HackerTarget.com
VAPT Methodologies 3
Host.io
Alternative to the website is its python implementation , vt-py . This is the official Python client library for VirusTotal. With
this library you can interact with the VirusTotal REST API v3 and automate your workflow quickly and efficiently.
Documentation - https://virustotal.github.io/vt-py/
VAPT Methodologies 4
Dnsrecon - DNS Enumeration and Scanning Tool
dnsenum
Nmap
└─$ nmap --script dns-brute zonetransfer.me
└─$ nmap -T4 -p 53 --script dns-brute hackthissite.org
Phonebook.cz
Phonebook lists all domains, email addresses, or URLs for the given input domain.
VAPT Methodologies 5
Sublist3r
Sublist3r is a python tool designed to enumerate subdomains of websites using OSINT. It helps penetration testers and
bug hunters collect and gather subdomains for the domain they are targeting. Sublist3r enumerates subdomains using
many search engines such as Google, Yahoo, Bing, Baidu, and Ask. Sublist3r also enumerates subdomains using
Netcraft, Virustotal, ThreatCrowd, DNSdumpster, and ReverseDNS.
Examples
To list all the basic options and switches use -h switch:
python sublist3r.py -h
To enumerate subdomains of specific domain and show only subdomains which have open ports 80 and 443 :
python sublist3r.py -d example.com -p 80,443
VAPT Methodologies 6
python sublist3r.py -b -d example.com
To enumerate subdomains and use specific engines such Google, Yahoo and Virustotal engines
python sublist3r.py -e google,yahoo,virustotal -d example.co
Fierce is another great DNS reconnaissance tool. Written in Perl, Fierce offers numerous options for performing DNS
enumeration by scanning domains in just minutes. Its syntax is pretty easy, as you can see:
IP block search
Perform IP block search so as to discover the entirety of the attack surface.
$ habu.ip.asn 8.8.8.8
{
"asn": "15169",
"net": "8.8.8.0/24",
"cc": "US",
"rir": "ARIN",
"asname": "GOOGLE - Google LLC, US",
"country": "United States"
}
Options:
--help Show this message and exit.
VAPT Methodologies 7
1. How Many IP are active?
Censys
Censys is a public search engine that enables researchers to quickly ask questions about the hosts and networks that
compose the Internet.
Zoomeye
ZoomEye is the leader of global cyberspace mapping, China's first and world-renowned cyberspace search engine
driven by 404 Laboratory of Knownsec, and also a world-famous cyberspace search engine.
Through a large number of global surveying and mapping nodes, according to the global IPv4, IPv6 address and
website domain name databases it can continuously scan and identify multiple service port and protocols 24 hours a
day, and finally map the whole or local cyberspace.
VAPT Methodologies 8
DNSdumpster
Certificate Fingerprinting
This is another effective way of enumerating subdomains. As long as a subdomain/domain has at one point in time have had
an SSL certificate its fingerprint is pubicly available
VAPT Methodologies 9
Cenys Certificate Search- Censys
14. What are the entry points [Login, form search Form] ?
17. What are the client side technologies [ @Javascript] and Client-Side Scripting Frameworks [Jquery, Bootsrap,] ?
Whatweb
WhatWeb identifies websites. Its goal is to answer the question, “What is that Website?”. WhatWeb recognises web
technologies including content management systems (CMS), blogging platforms, statistic/analytics packages,
JavaScript libraries, web servers, and embedded devices. WhatWeb has over 1700 plugins, each to recognise
something different. WhatWeb also identifies version numbers, email addresses, account IDs, web framework
modules, SQL errors, and more.
VAPT Methodologies 10
Wappalyzer
Wappalyzer identifies technologies on websites, such as CMS, web frameworks, ecommerce platforms, JavaScript
libraries, analytics tools and more.
Nikto
CMSeeK - CMS Detection and Exploitation suite - Scan WordPress, Joomla, Drupal and over 180 other CMSs
Pulling Headers
curl -v -I --user-agent "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106
Safari/537.36" <domain/subdomain>
VAPT Methodologies 11
W3af - Web application attack and audit framework, the open source web vulnerability scanner
w3af is a web application attack and audit framework. It has three types of plugins; discovery, audit and attack that
communicate with each other for any vulnerabilities in site, for example a discovery plugin in w3af looks for different
url’s to test for vulnerabilities and forward it to the audit plugin which then uses these URL’s to search for vulnerabilities.
It can also be configured to run as a MITM proxy. The request intercepted could be sent to the request generator and
then manual web application testing can be performed using variable parameters. It also has features to exploit the
vulnerabilities that it finds.
W3af features
Proxy support
DNS cache
Cookie handling
Openvas - The world's most advanced Open Source vulnerability scanner and manager
Openvas Docker
Archery - Open Source Vulnerability Assessment and Management helps developers and pentesters to perform scans and
manage vulnerabilities
wapiti - Wapiti allows you to audit the security of your websites or web applications. It performs "black-box" scans (it does
not study the source code) of the web application by crawling the webpages of the deployed webapp, looking for scripts
and forms where it can inject data. Once it gets the list of URLs, forms and their inputs, Wapiti acts like a fuzzer, injecting
payloads to see if a script is vulnerable.
Good Reads
https://pentestit.medium.com/wapiti-free-web-application-vulnerability-scanner-ce7712adf644
https://github.com/wapiti-scanner/wapiti
https://owasp.org/www-community/Automated_Audit_using_WAPITI
OWASP ZAP
Burpsuite
Examples
dir Mode
VAPT Methodologies 12
Command line might look like this:
dns Mode
vhost Mode
s3 Mode
gobuster s3 -w bucket-names.txt
fuzzing Mode
Dirbuster - DirBuster is a multi threaded java application designed to brute force directories and files names on
web/application servers
1. What is the Mail server technology [Outlook, Google, Microsoft Exchange etc...] ?
2. What are the IPs [On premise, Oncloud] of the Mail servers?
6. what kind of attacks [Email Spoofing, Open Relaying, Password spraying, phishing, Eicar Tests] can be done ?
MX Records - An MX (mail exchange) record is an entry in your DNS. zone file which specifies a mail server to handle a
domain's email.
The priority MX preference = 20 is used to determine which MX server to connect to first, in order to get to your inbox. If
there are multiple addresses with the same priority, it simply connects to one at random.
VAPT Methodologies 13
SPF Records
SPF determines which email servers are allowed to send email on your behalf. In doing so, SPF prevents spoofing and
phishing attacks against the email domain. SPF is added as a TXT record used by DNS to determine which email servers
can send email on behalf of the custom domain. Recipient email systems consult the SPF TXT record to determine if a
message from the custom domain originated from an authorized message server.
The SPF checker searches for an SPF record, displays the SPF record present, and validates the record, highlighting any
errors found within it.
Non-authoritative answer:
hackthissite.org text = "v=spf1 a mx ip4:137.74.187.96 ip4:137.74.187.97
ip4:137.74.187.98 a:hackthissite.org a:mail.hackthissite.org include:aspmx.googlemail.com ~all"
Good Reads
https://support.mailessentials.gfi.com/hc/en-us/articles/360015116520-How-to-check-and-read-a-Sender-Policy-
Framework-record-for-a-domain
VAPT Methodologies 14
DMARC Records
VAPT Methodologies 15
Using DIG
DKIM Records
Spoofing Tests
Email spoofing is alive and well. Many organisations' SPF and DMARC records do not provide the necessary guidance for
recipients to validate the authenticity of emails bearing their domain names.
Email spoofing may be successful against recipients that manage their filtering themselves. Large email providers like GMail
have the big data and the heuristics to efficiently handle spam. For example, GMail will likely forward a spoofed email from a
common domain directly to the spam folder, even if the email doesn't fail validation due to lax policies.
Swaks
Example
Telnet
VAPT Methodologies 16
1. Open your command prompt and type: telnet mx4.mailServer.com 25 (if you don’t know what the ’25’ stands for,
you should definitely read this). Alternatively you can start by typing telnet, hit Enter, and then open
mx4.Server.com 25.
3. Type helo and hit Enter. You should see the following output:
4. Next type MAIL FROM: you@fakeemailaddress.com, hit Enter. You should get the message, ‘Sender ok’.
5. Next type RCPT TO: you@realemailaddress.com, hit Enter. You should get the message, ‘Recipient ok’.
6. You can optionally include an email subject with: SUBJECT: Testing spoofed email with telnet.
8. Lastly you type . (a single period) and then hit Enter. You should get the message, ‘250 Mail accepted’. Now
type QUIT and hit Enter.
9. Check your inbox for the spoofed email you just sent.
telnet MAIL.SERVER.COM 25
(mail server says hello)
HELO spoofingdomain.com
(mail server acknowledges)
MAIL FROM: <spoofed@spoofingdomain.com>
(server says OK)
RCPT TO: <victim@address.com>
(server says OK)
DATA
(server says go)
From: Display Name <spoofed@spoofingdomain.com>
To: Victim Name <victim@address.com>
Subject: Hacking you
Date: Wed, 26 Sep 2018 14:21:26 -0400
Hello,
This is the email body
.
Netcat
nc -C MAIL.SERVER.COM 25
(mail server says hello)
HELO spoofingdomain.com
(mail server acknowledges)
MAIL FROM: <spoofed@spoofingdomain.com>
(server says OK)
RCPT TO: <victim@address.com>
(server says OK)
DATA
(server says go)
From: Display Name <spoofed@spoofingdomain.com>
To: Victim Name <victim@address.com>
Subject: Hacking you
Date: Wed, 26 Sep 2018 14:21:26 -0400
Hello,
This is the email body.
Goodbye
.
mailspoof
Python package that scans SPF and DMARC records for issues that could allow email spoofing.
installation
Example
VAPT Methodologies 17
mailspoof -d github.com -d reddit.com -iL /tmp/list
Good Reads
Email Collection
Harvest Email using the following sites;
Phonebook.cz. Phonebook lists all domains, email addresses, or URLs for the given input domain.
VAPT Methodologies 18
TheHarvester
theHarvester is a tool for gathering e-mail accounts, subdomain names, virtual hosts, open ports/ banners, and
employee names from different public sources (search engines, pgp key servers)
Pawndb - pwndb
http://pwndb2am4tzkvold.onion/
usage: pwndb.py [-h] [--target TARGET] [--list LIST] [--output OUTPUT] [--proxy PROXY]
VAPT Methodologies 19
optional arguments:
-h, --help show this help message and exit
--target TARGET Target email/domain to search for leaks.
--list LIST A list of emails in a file to search for leaks.
--output OUTPUT Return results as json/txt
--proxy PROXY Set Tor proxy (default: 127.0.0.1:9150)
Password spraying is a type of brute force attack. In this attack, an attacker will brute force logins based on list of
usernames with default passwords on the application. For example, an attacker will use one password (say, Secure@123)
against many different accounts on the application to avoid account lockouts that would normally occur when brute forcing a
single account with many passwords. This attack can be found commonly where the application or admin sets a default
password for the new users.
Attacking Outlook
CredMaster
Launch a password spray / brute force attach via Amazon AWS passthrough proxies, shifting the requesting IP
address for every authentication attempt. This dynamically creates FireProx APIs for more evasive password
sprays.
O365 - Office365
Examples
python3 credmaster.py --plugin {pluginname} --access_key {key} --secret_access_key {key} -u userfile -p passwordfile -a
useragentfile {otherargs}
Using Metasploit
This module attempts to log in to the Exchange Web Services, often exposed at https://example.com/ews/,
using NTLM authentication. This method is faster and simpler than traditional form-based logins. In most
cases, all you need to set is RHOSTS and some combination of user/pass files; the autodiscovery should find
the location of the NTLM authentication point as well as the AD domain, and use them accordingly.
VAPT Methodologies 20
Outlook Web App (OWA) Brute Force Utility
This module tests credentials on OWA 2003, 2007, 2010, 2013, and 2016 servers.
Using Spraying Toolkit (atomizer) atomizer is a blazing fast password sprayer for Lync/Skype For Business and OWA,
built on Asyncio and Python 3.7
Usage:
atomizer (lync|owa|imap) <target> <password> <userfile> [--targetPort PORT] [--threads THREADS] [--debug]
atomizer (lync|owa|imap) <target> <passwordfile> <userfile> --interval <TIME> [--gchat <URL>] [--slack <URL>] [--target
Port PORT][--threads THREADS] [--debug]
atomizer (lync|owa|imap) <target> --csvfile CSVFILE [--user-row-name NAME] [--pass-row-name NAME] [--targetPort PORT]
[--threads THREADS] [--debug]
atomizer (lync|owa|imap) <target> --user-as-pass USERFILE [--targetPort PORT] [--threads THREADS] [--debug]
atomizer (lync|owa|imap) <target> --recon [--debug]
atomizer -h | --help
atomizer -v | --version
Arguments:
target target domain or url
password password to spray
userfile file containing usernames (one per line)
passwordfile file containing passwords (one per line)
Options:
-h, --help show this screen
-v, --version show version
-c, --csvfile CSVFILE csv file containing usernames and passwords
-i, --interval TIME spray at the specified interval [format: "H:M:S"]
-t, --threads THREADS number of concurrent threads to use [default: 3]
-d, --debug enable debug output
-p, --targetPort PORT target port of the IMAP server (IMAP only) [default: 993]
--recon only collect info, don't password spray
--gchat URL gchat webhook url for notification
--slack URL slack webhook url for notification
--user-row-name NAME username row title in CSV file [default: Email Address]
--pass-row-name NAME password row title in CSV file [default: Password]
--user-as-pass USERFILE use the usernames in the specified file as the password (one per line)
MailSniper is a penetration testing tool for searching through email in a Microsoft Exchange environment for
specific terms (passwords, insider intel, network architecture information, etc.). It can be used as a non-
administrative user to search their own email or by an Exchange administrator to search the mailboxes of every
user in a domain.
MailSniper also includes additional modules for password spraying, enumerating users and domains, gathering the
Global Address List (GAL) from OWA and EWS and checking mailbox permissions for every Exchange user at an
organization.
Invoke-PasswordSprayOWA will attempt to connect to an OWA portal and perform a password spraying attack
using a userlist and a single password.
OutFile owa-sprayed-creds.txt
VAPT Methodologies 21
Invoke-PasswordSprayEWS will attempt to connect to an EWS portal and perform a password spraying attack
using a userlist and a single password.
Using Ruler
Attacking Office365
o365spray - o365spray a username enumeration and password spraying tool aimed at Microsoft Office 365 (O365).
This tool reimplements a collection of enumeration and spray techniques researched and identified by those mentioned
in Acknowledgments.
Attacking GMail
Use Burpsuite
Mitigations
Brute force prevention should be on both field, i.e., Username and Password.
Set account lockout policies after a certain number of failed login attempts to prevent credentials from being guessed.
Implement CAPTCHA, if lockout is not a viable option.
The admin managed application should force users to change their password on first login with default password.
Use multi-factor authentication. Where possible, also enable multi-factor authentication on externally facing services.
Good Read
VAPT Methodologies 22
Brute Force: Password Spraying
Adversaries may use a single or small list of commonly used passwords against many different accounts to
attempt to acquire valid account credentials. Password spraying uses one password (e.g. 'Password01'), or
a small list of commonly used passwords, that may match the complexity policy of the domain.
https://attack.mitre.org/techniques/T1110/003/
GitHub - byt3bl33d3r/SprayingToolkit: Scripts to make password spraying attacks against Lync/S4B, OWA & O365 a lot quicker, less painful and mo
Scripts to make password spraying attacks against Lync/S4B, OWA & O365 a lot quicker, less painful and more efficient - GitHub - byt3bl33d3r/SprayingToolkit: Scripts
password spraying attacks against Lync/S4B, OWA & O365 a lot quicker, less painful and more efficient
https://github.com/byt3bl33d3r/SprayingToolkit
GitHub - dafthack/MailSniper: MailSniper is a penetration testing tool for searching through email in a Microsoft Exchange environment for specific te
MailSniper is a penetration testing tool for searching through email in a Microsoft Exchange environment for specific terms (passwords, insider intel, network architectur
https://github.com/dafthack/MailSniper
VPN detection
VPN Hunter (http://www.vpnhunter.com) discovers and classifies SSL VPNs from top vendors including Juniper, Cisco, Palo
Alto, Citrix, Fortinet, F5, SonicWALL, Barracuda, Microsoft, and Array. VPN Hunter will also attempt to detect whether two-
factor authentication is enabled on the target SSL VPNs.
.
Set a domain for your public links in
Mobile Application
Use Mobsf to perform both dynamic and static analysis of the application
VAPT Methodologies 23