Security Notes
  • Whoami
  • Pentesting
    • WEP-Pen
      • Reconnaissance
      • Enumeration
      • OWSAP TOP 10
        • Injection
          • Cross Site Scripting
            • Cross Site Scripting
            • Exploitation
            • Protections
          • SQL Injection
            • SQL Injection Overview
          • NoSQL Injection
          • CRLF Injection
          • XML Injection
        • Broken Access Control
          • Path Traversal
          • Sensitive Cookie with Improper SameSite Attribute
          • Link Following
          • Incorrect Default Permissions
          • Information disclosure
          • CSRF
            • csrf checklist
          • 403 bypass
          • Exposure of WSDL File Containing Sensitive Information
          • bussiness logic checklist
          • 2FA bypass checklist
          • admin panal checklist
          • idor checklist
          • Authentication checklist
          • reset_password_checklist
          • ATO
        • Cryptographic Failures
          • Cryptographic Failure
          • Weak Encoding for Password
          • Improper Following of a Certificate's Chain of Trust
            • Understanding Digital Certificates : Self-Signed and CA-Signed Certificate **
            • Transport Layer Security (TLS) and SSL **
          • Clear Text Transmission Of Sensitive Data
            • SSLStripping **
        • Insecure Design
        • Security Misconfiguration
          • CORS Miscofigration
          • Mail Server Misconfiguration
        • Vulnerable and Outdated Components
          • Using Components with Known Vulnerabilities
        • Identification and Authentication Failures
          • JWT Hacking
          • SAML Authentication bypass
        • Software and Data Integrity Failures
          • mass assignment
          • PostMessage Vulnerabilities
            • PostMessage Vulnerabilities
            • Blocking main page to steal postmessage
            • Bypassing SOP with Iframes - part 1
            • Bypassing SOP with Iframes - part 2
            • Steal postmessage modifying iframe location
        • Security Logging and Monitoring Failures
        • Server-Side Request Forgery (SSRF)
          • SSRF
      • Checklists
        • aem misconfiguration
        • exif_geo
        • xss
        • Session Management
        • Authorization
        • cookie
        • Django
        • Symfony
        • json
        • bypass rate limit
        • Rce
        • Register Page
      • eWPTXv2 Preparation
        • Encoding & Filtering
        • Evasion Basics
        • Cross-site scripting (XSS)
        • XSS Filter Evasion
        • Cross-site request forgery (CSRF
        • HTML5
      • API-Pen
        • API Discovry
        • Reverse Engineering API Documentation
        • Excessive Data Exposure
        • Vulnerability Scanning
        • API Authentication Attacks
          • Classic Authentication Attacks
          • API Token Attacks
        • API Authorization Attacks
          • Broken Object Level Authorization (BOLA)
          • Broken Function Level Authorization
        • Improper Assets Management
        • Mass Assignment
        • SSRF
        • Injection Attacks in API
        • Evasive Maneuvers
        • GraphQL Vulnerabilities
    • NET-Pen
      • Active Directory Pentesting
        • Active Directory Components
        • Initial Attack Vectors
          • LLMNR Poisoning
          • SMB Relay Attacks
          • IPv6 Attacks ( IPv6 DNS Takeover )
          • Printer Hacking
          • Methodology
          • Some Other Attacks
            • Zerologon (CVE-2020-1472)
            • PrintNightmare (CVE-2021-1675)
        • Post-Compromise Attacks
          • Pass Attacks
          • Kerberoasting Attack
          • Token Impersonation Attack
          • LNK File Attack
          • GPP / cPassword Attacks
          • Mimikatz
          • Methodology
        • We've Compromised the Domain
          • Dumping the NTDS.dit
          • Golden Ticket Attacks
          • Methodology
        • Case Study
        • Password Attacks
      • Attack Vectors by Port
        • FTP 21
        • SSH 22
        • Telnet 23 - 2323
        • SMTP 25
        • DNS 53
        • Kerberos 88
        • POP 110-995
        • RPC 111
        • Ident 113
        • NNTP 119
        • NetBIOS 137-138
        • SMB / Samba 135-139, 445
        • MSRPC 135
        • SNMP 161
        • LDAP 389,636
        • Modbus 502
        • OpenSSL 1337
        • Ms-SQL 1433
        • Oracle Listener 1521 1522 1529
        • NFS 2049
        • MySql 3306
        • RDP 3389
        • ADB Android Debug Bridge 5555
        • WinRM 5985 5986
        • VNC 5800 5900
        • Redis 6379
        • Unreal IRC 6667
        • Tomcat 8080
        • MongoDB 27017
        • http 80
      • Network basics
      • Information Gathering
      • Privilege Escalation
        • Windows Privilege Escalation
        • Linux Privilege Escalation
    • write-ups
      • How i found a Privilege Escalation via Impersonation Features feature
      • How I was able to discover ATO Via IDOR vulnerability
      • Easy full Account Takeover via Facebook OAuth Misconfiguration
Powered by GitBook
On this page
  • Passive Information Gathering
  • Active Information Gathering
  1. Pentesting
  2. NET-Pen

Information Gathering

Passive Information Gathering

##Whois Enumeration
whois megacorpone.com 
whois megacorpone.com -h 192.168.50.251    #Here -h parameter is the whois server database which can provide details
#we can do reverse lookups as well
whois 38.100.193.70
whois 38.100.193.70 -h 192.168.50.251 

##Google Hacking
site:megacorpone.com
site:megacorpone.com filetype:txt
site:megacorpone.com -filetype:html
intitle:“index of” “parent directory”
#This website has lot of docks as well: https://www.exploit-db.com/google-hacking-database

##Netcraft
#We can use netcraft website as well for information gathering: https://searchdns.netcraft.com/

##Open-Source Code
#git hub is great source to find open-source code
#some usefull searches in github: https://github.com/megacorpone
filename:users
user:megacorpone filename:users
#We can use automated tools like Gitrob and Gitleaks as well

##Shodan
hostname:megacorpone.com
hostname:megacorpone.com port:"22"

##Security Headers and SSL/TLS
#https://securityheaders.com/
#https://www.ssllabs.com/ssltest/

Active Information Gathering

##DNS Enumeration
host www.megacorpone.com
host -t mx megacorpone.com
host -t txt megacorpone.com
host www.megacorpone.com 
host idontexist.megacorpone.com
#the list.txt contains below subdoamins
#www
#ftp
#mail
#owa
#proxy
#router
for ip in $(cat list.txt); do host $ip.megacorpone.com; done
for ip in $(seq 200 254); do host 51.222.169.$ip; done | grep -v "not found"
#with dnsrecon
dnsrecon -d megacorpone.com -t std
dnsrecon -d megacorpone.com -D ~/list.txt -t brt
dnsenum megacorpone.com
#with nslookup
nslookup mail.megacorptwo.com
nslookup -type=TXT info.megacorptwo.com 192.168.50.151

##SMB Enumeration
nmap -v -p 139,445 -oG smb.txt 192.168.50.1-254
sudo nbtscan -r 192.168.50.0/24
ls -1 /usr/share/nmap/scripts/smb*
nmap -v -p 139,445 --script smb-os-discovery 192.168.50.152
net view \\dc01 /all

##SMTP Enumeration
nc -nv 192.168.50.8 25
#smtp.py
#------script start-----
#!/usr/bin/python
import socket
import sys
if len(sys.argv) != 3:
 print("Usage: vrfy.py <username> <target_ip>")
 sys.exit(0)
# Create a Socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Connect to the Server
ip = sys.argv[2]
connect = s.connect((ip,25))
# Receive the banner
banner = s.recv(1024)
print(banner)
# VRFY a user
user = (sys.argv[1]).encode()
s.send(b'VRFY ' + user + b'\r\n')
result = s.recv(1024)
print(result)
# Close the socket
s.close()
#---------script ends-------
python3 smtp.py root 192.168.50.8
python3 smtp.py johndoe 192.168.50.8
Test-NetConnection -Port 25 192.168.50.8
#installing telnet in windows
dism /online /Enable-Feature /FeatureName:TelnetClient
telnet 192.168.50.8 25

##SNMP Enumeration
#MIB values correspond to specific Microsoft Windows SNMP parameters and contain much more than network-based information
1.3.6.1.2.1.25.1.6.0 System Processes
1.3.6.1.2.1.25.4.2.1.2 Running Programs
1.3.6.1.2.1.25.4.2.1.4 Processes Path
1.3.6.1.2.1.25.2.3.1.4 Storage Units
1.3.6.1.2.1.25.6.3.1.2 Software Name
1.3.6.1.4.1.77.1.2.25 User Accounts
1.3.6.1.2.1.6.13.1.3 TCP Local Ports

sudo nmap -sU --open -p 161 192.168.50.1-254 -oG open-snmp.txt
echo public > community
echo private >> community
echo manager >> community
for ip in $(seq 1 254); do echo 192.168.50.$ip; done > ips
onesixtyone -c community -i ips
snmpwalk -c public -v1 -t 10 192.168.50.151
snmpwalk -c public -v1 192.168.50.151 1.3.6.1.4.1.77.1.2.25
snmpwalk -c public -v1 192.168.50.151 1.3.6.1.2.1.25.4.2.1.2
snmpwalk -c public -v1 192.168.50.151 1.3.6.1.2.1.25.6.3.1.2
snmpwalk -c public -v1 192.168.50.151 1.3.6.1.2.1.6.13.1.3

##Port Scanning with Nmap
nmap 192.168.50.149
sudo nmap -sS 192.168.50.149 #synk attack
nmap -sT 192.168.50.149 #connect scan
sudo nmap -sU 192.168.50.149 #UDP scan
sudo nmap -sU -sS 192.168.50.149 #combined UDP and SYN scan
nmap -sn 192.168.50.1-253 #network sweep
nmap -v -sn 192.168.50.1-253 -oG ping-sweep.txt #save output
grep Up ping-sweep.txt | cut -d " " -f 2 # grep to find live hosts
nmap -p 80 192.168.50.1-253 -oG web-sweep.txt 
grep open web-sweep.txt | cut -d" " -f2
nmap -sT -A --top-ports=20 192.168.50.1-253 -oG top-port-sweep.txt
cat /usr/share/nmap/nmap-services
sudo nmap -O 192.168.50.14 --osscan-guess
nmap -sT -A 192.168.50.14
nmap --script http-headers 192.168.50.6
PreviousNetwork basicsNextPrivilege Escalation

Last updated 6 months ago