http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 11772|回复: 17

[HttpHelper] 飞哥 POST登录论坛 总是提示 您当前的访问请求当中含有非法字符,已经被系统拒绝

[复制链接]
发表于 2016-10-17 16:01:03 | 显示全部楼层 |阅读模式
飞哥  先原谅我用的咱们论坛做的测试哈  


我这个怀疑是formHash的问题 但是捣鼓了2天 也不知道怎么处理 就是返回值不正确

登录取得的返回值都没问题:
<?xml version="1.0" encoding="gbk"?>
<root><![CDATA[<script type="text/javascript" reload="1">if($('succeedmessage')) {$('succeedmessage').innerHTML = '';}if(typeof succeedhandle_=='function') {succeedhandle_('http://www.sufeinet.com/./', '', {});}</script><script type="text/javascript">setTimeout("window.location.href ='http://www.sufeinet.com/./';", 3000);$('succeedmessage_href').href = 'http://www.sufeinet.com/./';$('main_message').style.display = 'none';$('main_succeed').style.display = '';$('succeedlocation').innerHTML = '欢迎您回来,<font color="#FF0000">正式会员</font> 908811288,现在将转入登录前页面';</script>]]></root>







//////////////下面是C# Post代码
[C#] 纯文本查看 复制代码
 private void button1_Click(object sender, EventArgs e)
        {
            HttpHelper help = new HttpHelper();
            HttpItem item = new HttpItem()
            {
                URL = "http://www.sufeinet.com/member.php?mod=logging&action=login",
                Method = "get",
                ContentType = "text/html; charset=gbk",
                 
            };

            HttpResult result = help.GetHtml(item);
            string html = result.Html;
            string sss1 = "<input type=\"hidden\" name=\"formhash\" value=\"";
            string sss2 = "\" />";
            string formhash = HttpHelper.GetBetweenHtml(html, sss1, sss2);
            //string loginHash = HttpHelper.GetBetweenHtml(html, "loginhash=", "\"");

            Random r = new Random();
            int sx = r.Next(1111111, 5555555);
            HttpItem item2 = new HttpItem()
            {
                URL = "http://www.sufeinet.com/member.php?mod=logging&action=login",
                Method = "post",
                ContentType = "application/x-www-form-urlencoded",
                Postdata = "formhash="+formhash+"&referer=http%3A%2F%2Fwww.sufeinet.com%2F.%2F&loginfield=username&username=908811288&password=rwef46b&questionid=0&answer=",
            };
            HttpResult html222= help.GetHtml(item2);
            string xxxx= html222.Html;
            string cookies= item2.Cookie;
            HttpItem item3 = new HttpItem()
            {
                URL = @"http://www.sufeinet.com/member.php?mod=logging&action=login&loginsubmit=yes&loginhash=LXBiz&inajax=1\",
                Method = "get",
                ContentType = "text/html; charset=gbk",
            };

            HttpResult result33 = help.GetHtml(item3);
            string result3 = result33.Html;
            //获取请求的Cookie
            string cookie = result.Cookie;
            if (result3.Contains("欢迎您"))
            {
                MessageBox.Show("登录成功");
            }
            else
            {
                MessageBox.Show("登录失败");
            }

        }


1.jpg


1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
 楼主| 发表于 2016-10-17 16:01:53 | 显示全部楼层
在线等哈
回复

使用道具 举报

发表于 2016-10-17 16:18:11 | 显示全部楼层
你破解我论坛的登录还发出来帖子,我不封你的号就是很开明了,还让我帮你解决?真不知道你是怎么想的。

不能登录很正常,我做的有安全验证
 楼主| 发表于 2016-10-17 16:32:10 | 显示全部楼层
站长苏飞 发表于 2016-10-17 16:18
你破解我论坛的登录还发出来帖子,我不封你的号就是很开明了,还让我帮你解决?真不知道你是怎么想的。

...

不是不是 飞哥 你别误会!
我不是破解的咱们的论坛的
我是学Post然后不就一直在咱们论坛吗
没有其他的论坛账号 就在在们论坛试试Post登录
觉得没有任何破解的意思 ! 飞哥别误会!
 楼主| 发表于 2016-10-17 16:33:13 | 显示全部楼层
站长苏飞 发表于 2016-10-17 16:18
你破解我论坛的登录还发出来帖子,我不封你的号就是很开明了,还让我帮你解决?真不知道你是怎么想的。

...

我要是真的破解咱们论坛的话 我还敢提问吗  对吧


那飞哥你的意思是 登录不上是论坛的问题?
发表于 2016-10-17 16:39:28 | 显示全部楼层
就是因为知道你没有这个意思所以才不做处理的,换一个网站吧,也不想想我是做什么的。  不能登录太正常了。具体原因不方便多解释。
发表于 2016-10-17 16:40:27 | 显示全部楼层
公开论坛的自动登录必要会有一大群广告党来捣乱的
 楼主| 发表于 2016-10-17 17:09:50 | 显示全部楼层
站长苏飞 发表于 2016-10-17 16:39
就是因为知道你没有这个意思所以才不做处理的,换一个网站吧,也不想想我是做什么的。  不能登录太正常 ...

嗯啊 嗯啊  飞哥 我换了一个论坛  
这个地方倒是过了 但是我用后面的语句执行就是错误的
 楼主| 发表于 2016-10-17 17:11:01 | 显示全部楼层
[C#] 纯文本查看 复制代码
  private void button1_Click(object sender, EventArgs e)
        {
            HttpHelper help = new HttpHelper();
            HttpItem item = new HttpItem()
            {
                URL = "http://www.tb58.net/member.php?mod=logging&action=login",
                Method = "get",
                ContentType = "text/html; charset=gbk",
                 
            };

            HttpResult result = help.GetHtml(item);
            string html = result.Html;
            string sss1 = "<input type=\"hidden\" name=\"formhash\" value=\"";
            string sss2 = "\" />";
            string formhash = HttpHelper.GetBetweenHtml(html, sss1, sss2);
            string loginHash = HttpHelper.GetBetweenHtml(html, "loginhash=", "\"");

            Random r = new Random();
            int sx = r.Next(1111111, 5555555);
            HttpItem item2 = new HttpItem()
            {
                URL = "http://www.tb58.net/member.php?mod=logging&action=login",
                Method = "post",
                ContentType = "application/x-www-form-urlencoded",
                Postdata = "formhash="+formhash+"&referer=http%3A%2F%2Fwww.tb58.net%2F.%2F&loginfield=username&username=90882288&password=19437kk&questionid=0&answer=",
            };
            string cookies= item2.Cookie;
            string cookie = result.Cookie;
            HttpItem item3 = new HttpItem()
            {
                URL = "http://www.tb58.net/member.php?mod=logging&action=login&loginsubmit=yes&loginhash=" + loginHash + "&inajax=1",
                Method = "get",
                ContentType = "application/x-www-form-urlencoded",
            };
            HttpResult result333444 = help.GetHtml(item3);
            string sssswd = result333444.Html;
            if (sssswd.Contains("欢迎您"))
            {
                MessageBox.Show("登录成功");
            }
            else
            {
                MessageBox.Show("登录失败");
            }

        }


错误提示是 :
1111.jpg

谢谢飞哥

发表于 2016-10-17 17:15:00 | 显示全部楼层
换简单点的密码试试
您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-3-29 22:18

© 2014-2021

快速回复 返回顶部 返回列表