Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Meddler;
- import System;
- import System.Net.Sockets;
- import System.Windows.Forms;
- class Handlers
- {
- static function OnConnection(oSession: Session)
- {
- if (oSession.ReadRequest()){
- var oHeaders: ResponseHeaders = new ResponseHeaders();
- oHeaders.Status = "200 OK";
- oHeaders["Connection"] = "close";
- if (oSession.urlContains("filedownload")){
- oHeaders["Content-Type"] = "application/pdf";
- oHeaders["Set-Cookie"] = "filedownload=" + oSession.id.ToString();
- oHeaders["Content-Disposition"] = "attachment; filename=download#"+ oSession.id.ToString() +".dat";
- oSession.WriteString(oHeaders);
- for (var x=0;x<200; x++)
- {
- oSession.WriteBytes(Fuzz.NewByteArray(1024));
- System.Threading.Thread.Sleep(100);
- }
- }
- else
- {
- oHeaders["Content-Type"] = "text/html";
- oSession.WriteString(oHeaders);
- oSession.WriteString("<HTML><head><script>");
- oSession.WriteString("window.setInterval(function() {document.getElementById('divCookie').textContent = document.cookie;}, 200);");
- oSession.WriteString("</script></head><BODY><div id='divCookie'></div>");
- //for (var x = 0; x<15; x++){
- oSession.WriteString("<iframe src='filedownload'></iframe>");
- //}
- oSession.WriteString("</body></html>");
- }
- }
- oSession.CloseSocket();
- }
- static function Main()
- {
- var today: Date = new Date();
- MeddlerObject.StatusText = " Rules.js was loaded at: " + today;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement