[C#] 纯文本查看 复制代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Web;
using CsharpHttpHelper;
using CsharpHttpHelper.Enum;
using System.Text.RegularExpressions;
using System.Threading;
using System.Net;
using System.Runtime.InteropServices;
namespace phpwindPost
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
      
      
        private void button1_Click(object sender, EventArgs e)
        {
            string url = textBox1.Text.Trim();
            string u1 = url.Replace("http://","").Replace("/login.php","");
            
            HttpHelper http = new HttpHelper();
             HttpItem item = new HttpItem()
             {
                 URL = url,
                 Method = "get",
           
                 ContentType = "application/x-www-form-urlencoded",
                 UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",
               
                 Allowautoredirect = true,
                ResultCookieType = ResultCookieType.CookieCollection
                  //Cookie=result.Cookie
                
             };
             HttpResult result = http.GetHtml(item);
             string html = result.Html;
            string hash= HttpHelper.GetBetweenHtml(html,"name=\"verify\" value=\"","\" />");
            string cook = HttpHelper.GetBetweenHtml(result.Cookie, "PHPSESSID=",";");
            textBox4.AppendText("未登陆的verity:" + hash + "\r\n" + "未登陆的PHPSESSID:" + cook + "\r\n");
            
            // textBox4.Text = result.Html;
         
                item = new HttpItem()
                {
                    URL = url,
                    Method = "POST",
                    
                    Postdata = "verify=" + hash + "&forward=&jumpurl=http%3A%2F%2F" + u1 + "%2Findex.php&step=2&lgt=0&pwuser=" + textBox2.Text.Trim() + "&pwpwd=" + textBox3.Text.Trim() + "&hideid=0&submit=",
                    ContentType = "application/x-www-form-urlencoded",
                    UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",
                    
                    Cookie = "36f7f_cloudClientUid=50519953; 36f7f_wap_scr=a%3A1%3A%7Bs%3A4%3A%22page%22%3Bs%3A5%3A%22index%22%3B%7D; 36f7f_cloudcksessionid=d0f121fdbbd36846dcd75b621a05ed1b; 36f7f_threadlog=%2C10%2C; 36f7f_clearm_20485=2; PHPSESSID=" + cook + "; 36f7f_clearm_9806=7; 36f7f_readlog=%2C518299%2C530427%2C; td_cookie=118221962; 36f7f_jobpop=0; 36f7f_ol_offset=103790; 36f7f_lastpos=other; 36f7f_lastvisit=5%091439951805%09%2Flogin.php; CNZZDATA431337=cnzz_eid%3D1417483821-1439459127-http%253A%252F%252F" + u1 + "%252F%26ntime%3D1439947603"
                };
             
                result = http.GetHtml(item);
                html = result.Html;
                string winduser = HttpHelper.GetBetweenHtml(result.Cookie, "winduser=", ";");
                textBox4.AppendText(HttpHelper.GetBetweenHtml(html, "<p class=\"f14 mb10\">", "</p>") + "\r\n" + "登陆后ID:" + winduser + "\r\n");
            
     
              
             item = new HttpItem()
               {
               
                   URL = "http://"+u1+"/u.php",
                  Method = "get",
                   ContentType = "application/x-www-form-urlencoded",
                   UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",
                 
                   Allowautoredirect = true,
                   Cookie = "36f7f_cloudClientUid=50519953; 36f7f_wap_scr=a%3A1%3A%7Bs%3A4%3A%22page%22%3Bs%3A5%3A%22index%22%3B%7D; 36f7f_readlog=%2C518299%2C; 36f7f_cloudcksessionid=d0f121fdbbd36846dcd75b621a05ed1b; 36f7f_threadlog=%2C10%2C; 36f7f_clearm_20485=2; PHPSESSID="+cook+"; 36f7f_clearm_9806=7; 36f7f_jobpop=0; 36f7f_winduser="+winduser+"; 36f7f_ck_info=%2F%09; 36f7f_ol_offset=16587; 36f7f_lastpos=other; td_cookie=117834890; 36f7f_lastvisit=3000%091439947928%09%2Fu.php; CNZZDATA431337=cnzz_eid%3D1417483821-1439459127-http%253A%252F%252F"+u1+"%252F%26ntime%3D1439944040"
                 
                
               };
               result = http.GetHtml(item);
               string title = HttpHelper.GetHtmlTitle(result.Html);
               string verity = HttpHelper.GetBetweenHtml(result.Html, "verifyhash = '", "';");
               textBox4.AppendText("登陆后的用户名:" + HttpHelper.GetHtmlTitle(result.Html) + "\r\n" + "登陆后的verity:" + verity);
              item = new HttpItem()
               {
                   URL = "http://"+u1+"/pw_ajax.php?action=addattention&touid=" + 2 + "&nowtime=1439863790953&verify=" + verity,
                   Method = "get",
                   ContentType = "application/x-www-form-urlencoded",
                   UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",
                   Allowautoredirect = true,
                   Cookie = "36f7f_cloudClientUid=50519953; 36f7f_wap_scr=a%3A1%3A%7Bs%3A4%3A%22page%22%3Bs%3A5%3A%22index%22%3B%7D; 36f7f_readlog=%2C518299%2C; 36f7f_cloudcksessionid=d0f121fdbbd36846dcd75b621a05ed1b; 36f7f_threadlog=%2C10%2C; 36f7f_clearm_20485=2; PHPSESSID="+cook+"; 36f7f_clearm_9806=7; 36f7f_jobpop=0; 36f7f_winduser="+winduser+"; 36f7f_ck_info=%2F%09; 36f7f_ol_offset=16587; 36f7f_lastpos=other; td_cookie=117769421; 36f7f_lastvisit=2353%091439947281%09%2Fu.php%3Fuid142146; CNZZDATA431337=cnzz_eid%3D1417483821-1439459127-http%253A%252F%252F"+u1+"%252F%26ntime%3D1439942182"
               };
              result = http.GetHtml(item);
              textBox4.AppendText("\r\n" + HttpHelper.GetBetweenHtml(result.Html, "<ajax>", "</ajax>"));
              item = new HttpItem()
              {
                  URL = "http://"+u1+"/u.php?uid=2",
                  Method = "get",
                  ContentType = "application/x-www-form-urlencoded",
                  UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",
                  Allowautoredirect = true,
               
              };
              result = http.GetHtml(item);
              textBox4.AppendText("用户名:" + HttpHelper.GetBetweenHtml(result.Html, "h2 id=\"spaceName\">", "的个人主页"));
              
       }
     
    }
}