VulnableOne
  • 🧘‍♂️About Me
  • Offensive Treasure
    • 🧌Penetration Testing
      • Reconnaissance
        • Identify Ports/Hosts/Data
      • Enumeration
        • Service Ports
          • FTP (21)
          • SSH (22)
          • SMTP (25)
          • DNS (53)
          • TFTP (69/udp)
          • Finger (79)
          • SaMBa (139/445)
          • RPC/NFS (111/135)
          • SNMP (161/udp)
          • LDAP (389)
          • isakmp (500/udp)
          • Java (1099)
          • MS-SQL (1433)
          • MySQL (3306)
          • Distcc (3622)
          • PostgreSQL (5437)
          • Redis (6379)
      • Password Attack
        • Wordlist
        • Brute-Force
        • Crack Hash
      • File Transfer
        • Linux
        • Window
      • Misc
      • Theory
        • Nmap
        • Wireless
        • OSI Model - TCP/IP
        • R* Service
        • Hash
        • Solaris
        • SIP
        • Cisco Password Encryption
        • Time to Live
        • Windows
          • WMIC
          • IIS Version
          • Windows Version
          • Active Directory
        • Linux
        • Database
          • Page 7
          • MSSQL
          • PostgreSQL
          • MySQL
        • Asymmetric Encryption
        • Symmetric Encryption
        • Tools
        • ICMP
        • IP Address
        • VLAN
        • Acronyms
        • HTTP Status
        • HTTP Method
        • Protocol
        • Common Ports
    • 🧙‍♂️AD Attack
      • Domain Enumeration
        • PowerView
        • AD-Module
        • Bloodhound
      • Abuse ACLs
        • GenericAll
        • GenericWrite
        • WriteDACL
        • ForceChangePassword
      • Kerberos Attack
        • Kerberoasting
        • ASREPRoasting
        • Unconstrained Delegation
        • Constrained Delegation
        • Resource Based Constrained Delegation
      • LAPs
      • MS SQL Servers
        • PowerUpSQL
        • SQL Server Management
        • Impacket-MSSQL
    • 🥷Red Team
      • Reconnaissance
        • Active Scanning
          • Scanning IP Blocks
          • Vulnerability Scanning
          • Wordlist Scanning
        • Gather Victim Host Information
          • Software
        • Gather Victim Identity Information
          • Credentials
          • Email Addresses
        • Search Open Websites/Domains
          • Social Media
          • Search Engines
          • Code Repositories
        • Search Victim-Owned Websites
      • Resource Development
        • C2 Infrastructure
        • Metasploit
      • Execution
        • Bash - Reverse Shell
        • HTA
        • JScript Dropper
        • Macro
        • Metasploit
        • Network Tools
        • Powershell
        • Python
        • VBA
        • Web Shell
        • WSH
      • Persistence
        • Logon Script
        • Startup Folder
        • WinLogon (Elevated)
        • Run / RunOnce (Elevated)
        • Scheduled Tasks (Elevated )
      • Privilege Escalation
        • Windows
          • SeBackup / SeRestore
          • SeTakeOwnership
          • SeImpersonate / SeAssignPrimaryToken
          • UAC Bypass
          • AutoInstall Elevate
          • Unquoted Service Paths
          • Weak Service Permissions
          • Weak Service Binary Permissions
        • Linux
          • Escalation
      • Defense Evasion
        • Bypassing AV
          • Pack Shellcode
        • Security Control
          • CLM
          • AppLocker
        • Use Alternate Authentication Material
          • Pass The Hash
          • Over Pass The Hash
          • Extract Tickets
          • Pass The Ticket
        • Impersonate
      • Credential Access
        • Adversary-in-the-Middle
          • LLMNR/NBT-NS/MDNS Poisoning
          • Evil SSDP
        • OS Credential Dumping
          • Protected LSASS
          • Invoke-Mimikatz
          • Mimikatz.exe
          • Secretsdump
          • Meterpreter Kiwi
          • Registry
          • Shadow Copy
          • DCSync
        • Steal or Forge Kerberos Tickets
          • Silver Ticket
          • Golden Ticket
        • Steal Web Session Cookie
      • Lateral Movement
        • Remote Access
        • Pivoting
          • Linux
          • Window
    • Web Application
      • Basic Recon
  • Blog
    • 📝Empty!!!
  • Course Review
    • 👨‍🎓Cyber Security Courses Journey
      • PNPT Journey
      • OSCP Journey
        • 🚩CTF
          • Hack The Box
            • Linux Boxes
              • ✅Admirer (Easy)
              • ✅Bashed (Easy)
              • ✅Beep (Easy)
              • ✅Blocky (Easy)
              • ✅FriendZone (Easy)
              • ✅Irked (Easy)
              • ✅Lame (Easy)
              • ✅Mirai (Easy)
              • ✅Networked (Easy)
              • ✅Nibbles (Easy)
              • ✅OpenAdmin (Easy)
              • ✅Sense (Easy)
              • ✅Shocker (Easy)
              • ✅Sunday (Easy)
              • ✅Tabby (Easy)
              • ✅Traverxec (Easy)
              • ✅Valentine (Easy)
              • ✅Cronos (Medium)
              • ✅Haircut (Medium)
              • ✅Jarvis (Medium)
              • ✅Magic (Medium)
              • ✅Nineveh (Medium)
              • ✅Node (Medium)
              • ✅Poison (Medium)
              • ✅SolidState (Medium)
              • ✅TartarSauce (Medium)
            • Window Boxes
              • ✅Arctic (Easy)
              • ✅Active (Easy)
              • ✅Blue (Easy)
              • ✅Bounty (Easy)
              • ✅Devel (Easy)
              • ✅Forest (Easy)
              • ✅Granny (Easy)
              • ✅Granpa (Easy)
              • ✅Jerry (Easy)
              • ✅Legacy (Easy)
              • ✅Optimum (Easy)
              • ✅Bastard (Medium)
              • ✅Silo (Medium)
          • Buffer Overflow
            • BOF - Tib3rius
            • BOF - TCM
              • 1- Spiking
              • 2- Fuzzing
              • 3- Finding Offset
              • 4- Overwriting EIP
              • 5- Finding Bad Characters
              • 6- Finding the Right Module
              • 7- Generating Shellcode
Powered by GitBook
On this page
  • Full TCP Scan
  • UDP Scan
  • Grep Port Open with Powershell
  • Nmap Script
  • Host Discover with Fping
  • Ping Sweep in Window
  • Ping Sweep with Bash
  • Ping Sweep with Nmap
  • Generate IP in Window
  • Generate list of IP by bash
  • Ipv6 Discovery
  1. Offensive Treasure
  2. Penetration Testing
  3. Reconnaissance

Identify Ports/Hosts/Data

Full TCP Scan

# Nmap_Scan_TCP
nmap -Pn -n -v $ip -p- --min-rate 5000 -oA $ip

# Grep_PortOpen
cat nmap.txt | grep open | awk -F / '{print $1}' | sed -z "s/\n/,/g" | head -c-1
grep -oP '\d{1,5}/open' $ip.gnmap | awk -F/ '{print $1}' | sed -z 's/\n/,/g' | head -c-1

# Enumerate_Service
nmap -Pn -n -v -pxxx $ip -T4 -sC -sV -oX $ip.xml; xsltproc $ip.xml -o $ip.html

UDP Scan

# Nmap_Scan_UDP
sudo nmap -Pn -n -v $ip -sU -p- --min-rate 5000 -oA $ip

# Grep_PortOpen
grep -oP '\d{1,5}/open' $ip.gnmap | awk -F/ '{print $1}' | sed -z 's/\n/,/g' | head -c-1

# Enumerate_Service
sudo nmap -Pn -n -v -sU -p137 $ip -T4 -sC -sV -oX $ip.xml

Grep Port Open with Powershell

#Save nmap open port into > nmap.txt file

$file = "C:\test.txt"
$filecontent = Get-Content $file
$newfile = Foreach($line in $filecontent){
	($line.split('/'))[0]
}
$newfile | Set-Content $file
(Get-content $file) -join ","

PS C:\> .\split.ps1
135,139,445,3389

Nmap Script

# List down all the nmap script
grep -r categories /usr/share/nmap/scripts/*.nse 
# Search base on category
grep -r categories /usr/share/nmap/scripts/*.nse | grep safe | awk -F: '{print $1}'

# Scan with Safe Script Only
sudo nmap --script safe -Pn -n -v -pxxx $ip -oX $ip-safe.xml

# Scan with "Safe and Default" Script
# Search for anything in the between quote 
grep -r categories /usr/share/nmap/scripts/*.nse | grep -oP '".*?"' | sort -u 

Host Discover with Fping

fping -q -a -r 1 < subnet1.txt
fping -a -g 10.10.10.0/24 2>/dev/null

Ping Sweep in Window

# Powershell
for ($i = 1; $i -lt 255; $i++) {
    Test-Connection "10.10.10.$i" -Count 1 -ErrorAction SilentlyContinue
}

# CMD
for /L %i in (1,1,255) do @ping -n 1 -w 200 10.10.10.%i > nul && echo 10.10.10.%i is up.

Ping Sweep with Bash

for i in {1..255}; do (ping -c 1 192.168.1.${i} | grep "bytes from" &); done

Ping Sweep with Nmap

sudo nmap -sP -PE 10.10.10.0/24
sudo nmap -PR -sn 10.10.10.0/24    #Arp
sudo nmap -PE -sn 10.10.10.0/24    #ICMP

Generate IP in Window

# CMD
for /L %x in (1, 1, 10) do echo 192.168.1.%x >> ip.txt

# Bat File
@echo OFF
for /L %%x in (1, 1, 10) do echo 192.168.1.%%x >> ip.txt

Generate list of IP by bash

#!/bin/bash

echo "1- Generate Sample IPs [10.10.10.x] "
echo "2- Generate Sample IPs [10.10.x.1] "
echo "3- Generate Sample IPs [10.x.10.1] "
read choice

if [ "$choice" == "1" ];
then
 echo "Enter your IP Range: "
 read IP
	for i in {1..254};
	do
		echo $IP.$i >> $IP.txt;
	done
fi

if [ "$choice" == "2" ];
then
 echo "Enter your first block: "
 read IP
 echo "Enter your fourth block: "
 read IP1
	for i in {1..254};
	do
		echo $IP.$i.$IP1 >> $IP.x.$IP1.txt;
	done
fi

if [ "$choice" == "3" ];
then
 echo "Enter your first block: "
 read IP
 echo "Enter your third block: "
 read IP1
 echo "Enter your Fourth block: "
 read IP2
	for i in {1..254};
	do
		echo $IP.$i.$IP1.$IP2 >> $IP.x.$IP1.$IP2.txt;
	done
fi
└─$ ./gen.sh
1- Generate Sample IPs [10.10.10.x] 
2- Generate Sample IPs [10.10.x.1] 
3- Generate Sample IPs [10.x.10.1] 
1
Enter your IP Range: 
10.10.10

Ipv6 Discovery

sudo atk6-alive eth0
PreviousReconnaissanceNextEnumeration

Last updated 1 year ago

🧌