|
电子考勤是内网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都行,我想知道我到底是忽略了那里,为啥实现不了呢
|
|