XPATH injection
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Join HackenProof Discord server to communicate with experienced hackers and bug bounty hunters!
Hacking Insights Engage with content that delves into the thrill and challenges of hacking
Real-Time Hack News Keep up-to-date with fast-paced hacking world through real-time news and insights
Latest Announcements Stay informed with the newest bug bounties launching and crucial platform updates
Join us on Discord and start collaborating with top hackers today!
Basic Syntax
Una tecnica di attacco nota come XPath Injection viene utilizzata per sfruttare le applicazioni che formano query XPath (XML Path Language) basate sull'input dell'utente per interrogare o navigare nei documenti XML.
Nodes Described
Le espressioni vengono utilizzate per selezionare vari nodi in un documento XML. Queste espressioni e le loro descrizioni sono riassunte di seguito:
nodename: Vengono selezionati tutti i nodi con il nome "nodename".
/: La selezione avviene dal nodo radice.
//: Vengono selezionati i nodi che corrispondono alla selezione dal nodo corrente, indipendentemente dalla loro posizione nel documento.
.: Viene selezionato il nodo corrente.
..: Viene selezionato il genitore del nodo corrente.
@: Vengono selezionati gli attributi.
XPath Examples
Esempi di espressioni di percorso e i loro risultati includono:
bookstore: Vengono selezionati tutti i nodi chiamati "bookstore".
/bookstore: Viene selezionato l'elemento radice bookstore. Si nota che un percorso assoluto verso un elemento è rappresentato da un percorso che inizia con una barra (/).
bookstore/book: Vengono selezionati tutti gli elementi book che sono figli di bookstore.
//book: Vengono selezionati tutti gli elementi book nel documento, indipendentemente dalla loro posizione.
bookstore//book: Vengono selezionati tutti gli elementi book che sono discendenti dell'elemento bookstore, indipendentemente dalla loro posizione sotto l'elemento bookstore.
//@lang: Vengono selezionati tutti gli attributi chiamati lang.
Utilization of Predicates
I predicati vengono utilizzati per affinare le selezioni:
/bookstore/book[1]: Viene selezionato il primo elemento book figlio dell'elemento bookstore. Una soluzione per le versioni di IE da 5 a 9, che indicizzano il primo nodo come [0], è impostare il SelectionLanguage su XPath tramite JavaScript.
/bookstore/book[last()]: Viene selezionato l'ultimo elemento book figlio dell'elemento bookstore.
/bookstore/book[last()-1]: Viene selezionato il penultimo elemento book figlio dell'elemento bookstore.
/bookstore/book[position()<3]: Vengono selezionati i primi due elementi book figli dell'elemento bookstore.
//title[@lang]: Vengono selezionati tutti gli elementi title con un attributo lang.
//title[@lang='en']: Vengono selezionati tutti gli elementi title con un valore di attributo "lang" pari a "en".
/bookstore/book[price>35.00]: Vengono selezionati tutti gli elementi book della bookstore con un prezzo superiore a 35.00.
/bookstore/book[price>35.00]/title: Vengono selezionati tutti gli elementi title degli elementi book della bookstore con un prezzo superiore a 35.00.
Handling of Unknown Nodes
I caratteri jolly vengono impiegati per abbinare nodi sconosciuti:
*: Corrisponde a qualsiasi nodo elemento.
@*: Corrisponde a qualsiasi nodo attributo.
node(): Corrisponde a qualsiasi nodo di qualsiasi tipo.
Ulteriori esempi includono:
/bookstore/*: Seleziona tutti i nodi elemento figlio dell'elemento bookstore.
//*: Seleziona tutti gli elementi nel documento.
//title[@*]: Seleziona tutti gli elementi title con almeno un attributo di qualsiasi tipo.
Example
Accedere alle informazioni
Identificare e rubare lo schema
Bypass dell'autenticazione
Esempio di query:
OR bypass in user e password (stesso valore in entrambi)
Abusare dell'iniezione null
Doppio OR nel nome utente o nella password (è valido con solo 1 campo vulnerabile)
IMPORTANTE: Nota che "and" è la prima operazione effettuata.
Estrazione di stringhe
L'output contiene stringhe e l'utente può manipolare i valori per cercare:
Blind Explotation
Ottieni la lunghezza di un valore ed estrailo tramite confronti:
Esempio di Python
Leggi file
Sfruttamento OOB
Strumento automatico
Riferimenti
Unisciti al HackenProof Discord server per comunicare con hacker esperti e cacciatori di bug bounty!
Approfondimenti sul hacking Interagisci con contenuti che approfondiscono l'emozione e le sfide dell'hacking
Notizie di hacking in tempo reale Rimani aggiornato con il mondo frenetico dell'hacking attraverso notizie e approfondimenti in tempo reale
Ultimi annunci Rimani informato sulle nuove bug bounty in arrivo e sugli aggiornamenti cruciali delle piattaforme
Unisciti a noi su Discord e inizia a collaborare con i migliori hacker oggi stesso!
Impara e pratica AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Impara e pratica GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Last updated