XPATH injection
Dołącz do HackenProof Discord serwera, aby komunikować się z doświadczonymi hackerami i łowcami bugów!
Wgląd w hacking Zaangażuj się w treści, które zagłębiają się w emocje i wyzwania związane z hackingiem
Aktualności o hackingu w czasie rzeczywistym Bądź na bieżąco z dynamicznym światem hackingu dzięki aktualnym wiadomościom i wglądom
Najnowsze ogłoszenia Bądź informowany o najnowszych programach bug bounty oraz istotnych aktualizacjach platform
Dołącz do nas na Discordzie i zacznij współpracować z najlepszymi hackerami już dziś!
Podstawowa składnia
Technika ataku znana jako XPath Injection jest wykorzystywana do wykorzystania aplikacji, które tworzą zapytania XPath (XML Path Language) na podstawie danych wejściowych użytkownika, aby zapytać lub nawigować po dokumentach XML.
Opis węzłów
Wyrażenia są używane do wybierania różnych węzłów w dokumencie XML. Te wyrażenia i ich opisy są podsumowane poniżej:
nodename: Wybierane są wszystkie węzły o nazwie "nodename".
/: Wybór dokonywany jest z węzła głównego.
//: Wybierane są węzły pasujące do wyboru z bieżącego węzła, niezależnie od ich lokalizacji w dokumencie.
.: Wybierany jest bieżący węzeł.
..: Wybierany jest rodzic bieżącego węzła.
@: Wybierane są atrybuty.
Przykłady XPath
Przykłady wyrażeń ścieżkowych i ich wyniki obejmują:
bookstore: Wybierane są wszystkie węzły o nazwie "bookstore".
/bookstore: Wybierany jest element główny bookstore. Zauważono, że absolutna ścieżka do elementu jest reprezentowana przez ścieżkę zaczynającą się od ukośnika (/).
bookstore/book: Wybierane są wszystkie elementy book, które są dziećmi bookstore.
//book: Wybierane są wszystkie elementy book w dokumencie, niezależnie od ich lokalizacji.
bookstore//book: Wybierane są wszystkie elementy book, które są potomkami elementu bookstore, niezależnie od ich pozycji pod elementem bookstore.
//@lang: Wybierane są wszystkie atrybuty o nazwie lang.
Wykorzystanie predykatów
Predykaty są używane do precyzowania wyborów:
/bookstore/book[1]: Wybierany jest pierwszy element book będący dzieckiem elementu bookstore. Obejście dla wersji IE od 5 do 9, które indeksują pierwszy węzeł jako [0], polega na ustawieniu SelectionLanguage na XPath za pomocą JavaScript.
/bookstore/book[last()]: Wybierany jest ostatni element book będący dzieckiem elementu bookstore.
/bookstore/book[last()-1]: Wybierany jest przedostatni element book będący dzieckiem elementu bookstore.
/bookstore/book[position()<3]: Wybierane są dwa pierwsze elementy book będące dziećmi elementu bookstore.
//title[@lang]: Wybierane są wszystkie elementy title z atrybutem lang.
//title[@lang='en']: Wybierane są wszystkie elementy title z wartością atrybutu "lang" równą "en".
/bookstore/book[price>35.00]: Wybierane są wszystkie elementy book w bookstore z ceną większą niż 35.00.
/bookstore/book[price>35.00]/title: Wybierane są wszystkie elementy title elementów book w bookstore z ceną większą niż 35.00.
Obsługa nieznanych węzłów
Znaki wieloznaczne są używane do dopasowywania nieznanych węzłów:
*: Pasuje do dowolnego węzła elementu.
@*: Pasuje do dowolnego węzła atrybutu.
node(): Pasuje do dowolnego węzła dowolnego rodzaju.
Dalsze przykłady obejmują:
/bookstore/*: Wybiera wszystkie węzły elementów dzieci elementu bookstore.
//*: Wybiera wszystkie elementy w dokumencie.
//title[@*]: Wybiera wszystkie elementy title z co najmniej jednym atrybutem dowolnego rodzaju.
Przykład
Uzyskaj dostęp do informacji
Identyfikacja i kradzież schematu
Ominięcie uwierzytelniania
Przykład zapytań:
OR obejście w użytkowniku i haśle (ta sama wartość w obu)
Wykorzystywanie wstrzyknięcia null
Podwójne OR w nazwie użytkownika lub haśle (jest ważne tylko z 1 podatnym polem)
WAŻNE: Zauważ, że "i" jest pierwszą operacją wykonaną.
Ekstrakcja ciągów
Wynik zawiera ciągi, a użytkownik może manipulować wartościami, aby wyszukiwać:
Blind Explotation
Uzyskaj długość wartości i wyodrębnij ją przez porównania:
Przykład Pythona
Odczytaj plik
OOB Wykorzystanie
Automatyczne narzędzie
Odniesienia
Dołącz do HackenProof Discord, aby komunikować się z doświadczonymi hackerami i łowcami bugów!
Wgląd w Hacking Zaangażuj się w treści, które zagłębiają się w emocje i wyzwania związane z hackingiem
Aktualności Hackingowe w Czasie Rzeczywistym Bądź na bieżąco z dynamicznym światem hackingu dzięki aktualnym wiadomościom i wglądom
Najnowsze Ogłoszenia Bądź informowany o najnowszych programach bug bounty oraz istotnych aktualizacjach platform
Dołącz do nas na Discord i zacznij współpracować z najlepszymi hackerami już dziś!
Last updated