代码审计实战—DWVA-xss-high(存储)
0x00 前言
如饥似渴的学习ing。
你可能需要看看这个:
0x01 start
1.黑盒
使用exp
<img src=1 onerror=alert(/du/)>
详细请看:
https://blog.****.net/qq_36869808/article/details/83341443
2. 白盒
关键代码
$message = strip_tags( addslashes( $message ) );
$message = ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $message ) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : ""));
$message = htmlspecialchars( $message );
// Sanitize name input
$name = preg_replace( '/<(.*)s(.*)c(.*)r(.*)i(.*)p(.*)t/i', '', $name );
$name = ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $name ) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : ""));
message这里就不看了。详细可以看看看这个。
https://blog.****.net/qq_36869808/article/details/83341443
然后我们来看看name字段。
过滤<script>
字符,还是在这个字符,所以我们的exp还是可以使用的。
<img src=1 onerror=alert(/du/)>