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

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

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

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

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

查看: 6036|回复: 5

[求助] 请教站长:一个“电子考勤”功能的自动实现、

[复制链接]
发表于 2013-5-3 19:42:28 | 显示全部楼层 |阅读模式
电子考勤是内网OA起始页的一个按钮,每天需要点击这个鬼东西才能算考勤,够变态吧。这个自动考勤的东东我试了很多次,总是搞不定,其他网站一切OK
废话不说了,直入主题吧,请站长赐教,大家顶起来啊,论坛需要人气的说

首次点击电子考勤,会绑定本机的物理地址。首先跳个小窗口,然后点击确定完成绑定。
点击“电子考勤”跳小窗口的时候,抓包分析如下:
POST http://188.77.0.50:8080/snerdiInner/command/ajax/com.snpit.top.portal.kaoqin.cmd.kaoqinCommand/kaoqin HTTP/1.1
Accept: */*
Accept-Language: zh-sg
Referer: http://188.77.0.50:8080/snerdiInner/jsp/portal/index.jsp
x-requested-with: XMLHttpRequest
Content-Type: application/json
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Host: 188.77.0.50:8080
Content-Length: 147
Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=3B7950CA2528B689C93889320F24193E

{"params":{"javaClass":"ParameterSet","map":{"ip":"188.77.7.7","gonghao":"1428"},"length":2},"context":{"javaClass":"HashMap","map":{},"length":0}}

GET如下:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/plain;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 25 Apr 2013 09:29:43 GMT

4f
{"javaClass":"ParameterSet","map":{"flag":"confirm","mac":"40-61-86-53-65-CA"}}
0

点击跳出来的小窗口的“确定”,抓包如下:
POST http://188.77.0.50:8080/snerdiInner/command/ajax/com.snpit.top.portal.kaoqin.cmd.kaoqinCommand/confirmMac HTTP/1.1
Accept: */*
Accept-Language: zh-sg
Referer: http://188.77.0.50:8080/snerdiInner/jsp/com/snpit/top/portal/kaoqin/dzkq_confirm.jsp?gonghao=1428&mac=40-61-86-53-65-CA
x-requested-with: XMLHttpRequest
Content-Type: application/json
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Host: 188.77.0.50:8080
Content-Length: 155
Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=3B7950CA2528B689C93889320F24193E

{"params":{"javaClass":"ParameterSet","map":{"gonghao":"1428","mac":"40-61-86-53-65-CA"},"length":2},"context":{"javaClass":"HashMap","map":{},"length":0}}

GET结果:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/plain;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 25 Apr 2013 09:30:01 GMT

25
{"javaClass":"ParameterSet","map":{}}
0

以上可以不用管,我要实现的是绑定之后的电子考勤功能。绑定之后,以后每次点击“电子考勤”,就直接实现了考勤了。也会跳窗,告诉你现在的时间,问你是否确定。抓包:
POST http://188.77.0.50:8080/snerdiInner/command/ajax/com.snpit.top.portal.kaoqin.cmd.kaoqinCommand/kaoqin HTTP/1.1
Accept: */*
Accept-Language: zh-sg
Referer: http://188.77.0.50:8080/snerdiInner/jsp/portal/index.jsp
x-requested-with: XMLHttpRequest
Content-Type: application/json
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Host: 188.77.0.50:8080
Content-Length: 147
Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=3B7950CA2528B689C93889320F24193E

{"params":{"javaClass":"ParameterSet","map":{"ip":"188.77.7.7","gonghao":"1428"},"length":2},"context":{"javaClass":"HashMap","map":{},"length":0}}

GET结果:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/plain;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 25 Apr 2013 09:31:47 GMT

63
{"javaClass":"ParameterSet","map":{"flag":"success","userbm":"1428","curTime":"20130425173147015"}}
0

点击确定就完成了考勤。点击确定时的分析结果:
POST http://188.77.0.50:8080/snerdiInner/command/ajax/com.snpit.top.portal.kaoqin.cmd.kaoqinCommand/confirmKaoqinTime HTTP/1.1
Accept: */*
Accept-Language: zh-sg
Referer: http://188.77.0.50:8080/snerdiInner/jsp/com/snpit/top/portal/kaoqin/dzkq_success.jsp?curTime=20130425173147015&gonghao=1428
x-requested-with: XMLHttpRequest
Content-Type: application/json
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Host: 188.77.0.50:8080
Content-Length: 159
Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=3B7950CA2528B689C93889320F24193E

{"params":{"javaClass":"ParameterSet","map":{"gonghao":"1428","curTime":"20130425173147015"},"length":2},"context":{"javaClass":"HashMap","map":{},"length":0}}

GET结果:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/plain;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 25 Apr 2013 09:31:49 GMT

25
{"javaClass":"ParameterSet","map":{}}
0


好了,以上应该够详细了。内网是与外网隔绝的,所以也不好上代码了。求站长指点一二,最好直接上源码,用不用HttpHelper都行,我想知道我到底是忽略了那里,为啥实现不了呢


1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
发表于 2013-5-4 13:53:13 | 显示全部楼层
你就按以上使用httphelper发送两个数据包就行了啊。
 楼主| 发表于 2013-5-6 17:31:56 | 显示全部楼层
关键是每次发送第二个包过去,结果错误:“org.loushang.bsp.security.author.AuthenticationCredentialsNotFoundException”
是不是有啥过滤器?
发表于 2013-8-24 10:37:02 | 显示全部楼层
联系我qq,我帮你看看 6481894
发表于 2013-8-24 10:37:40 | 显示全部楼层
联系我qq:6481894 我帮你看下,你写的太乱了
发表于 2013-8-24 10:38:13 | 显示全部楼层
haiwen5668 发表于 2013-5-6 17:31
关键是每次发送第二个包过去,结果错误:“org.loushang.bsp.security.author.AuthenticationCredentialsNo ...

联系我qq:6481894 我帮你看看,你写的太乱了
您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

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

GMT+8, 2024-11-22 14:03

© 2014-2021

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