Git Product home page Git Product logo

xwqy-geetest's Introduction

小微企业查询系统

破解geetest offline的尝试

简介

最近因为有需要对爬取的非上市公司进行一个验证,而绝大多数的非上市公司又都是小微企业,比起爬企业征信系统来说,还是小微企业名录更方便一点

特点

基于node.js axios全程破解 无需下载图片 无需模拟轨迹,offline模式就是任性

觉得不错帮忙Star一下啦~

破解流程

首先我们跟着正常获取数据的流程走一遍

  1. 打开小微企业名录并且打开控制台

可以看到大概有这几个请求

http://xwqy.gsxt.gov.cn/security/verify_ip
http://xwqy.gsxt.gov.cn/security/verify_keyword
http://xwqy.gsxt.gov.cn/pc-geetest/register?t=1516872325770

查看一下response(当然你熟悉geetest也行)就会发现register就是geetest的初始化请求啦

返回值如下

challenge:"a1d0c6e83f027327d8461063f4ac58a61c"
gt:"6146190e4171da316dbb5bcc076e2607"
success:0

其中你可以发现success基本都是0 也就是说离线模式

什么是离线模式?

基本就是geetest不参与判断的一个状态,验证部分都在前台和中间服务器完成

回去看之前系统下载的js 会发现两个geetest提供的js

  • geetest.0.0.0.js
  • offline.6.0.0.js

这几个源文件也提供在项目中了

  1. 滑块拼合

发送了一个新的验证请求

http://xwqy.gsxt.gov.cn/pc-geetest/validate

request如下:  

geetest_challenge:a1d0c6e83f027327d8461063f4ac58a61c
geetest_validate:010886ec_0084e_10100077776e
geetest_seccode:010886ec_0084e_10100077776e|jordan

challenge在第一步我们已经获取了,问题是validate怎么获取? 同时seccode就是validate加了一个|jordan而已

既然是offline 那就分析offline.js呗

查看代码就能看到这句

return c >= f - 3 && c <= f + 3 ? {
            success: !0,
            message: "success",
            validate: b.A(c, e.d.challenge) + "_" + b.A(a.b("rand0", e.c), e.d.challenge) + "_" + b.A(a.b("rand1", e.c), e.d.challenge),
            score: Math.round(d / 200)
        } : {success: 0, message: "fail"}

这不就是我们要的么!

validate: b.A(c, e.d.challenge) + "_" + b.A(a.b("rand0", e.c), e.d.challenge) + "_" + b.A(a.b("rand1", e.c), e.d.challenge),

offline.6.0.0.js和offline.5.0.0.js可以看出一样是通过密钥 rand rand1进行加密获取一个值,一半来说这种方案就是得依靠收集案例倒推,但是我们是不会重复造轮子的

github关键词一搜就能发现已经有人整理好了'https://github.com/9468305/python-script/blob/master/geetest_offline/util.py'

所以那就用呗

后续就只是涉及到爬虫以及页面跳转的问题了,具体可以看util内的代码

而且在micro_lib内也可以直接搜索 发送验证的地址改为http://xwqy.gsxt.gov.cn/mirco/micro_lib

并相应修改传入的值即可

organId:100000
textfield:encode后的关键词
fwId:1400
searchOrganId:
channelId:99
captcha:
geetest_challenge:3ef815416f775098fe977004015c619332
geetest_validate:010886ec_0084e_10100077776e
geetest_seccode:010886ec_0084e_10100077776e|jordan

restful-api

已经做了一个api形式的 直接在url内打入关键词即可爬取

运行步骤

npm install
npm run start
curl http://127.0.0.1:4001/公司关键词

xwqy-geetest's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

xwqy-geetest's Issues

python2.7 请指教!!!

因为手工收集资料太慢了,所以希望用python2.7能做一些事情。
我要在特定网站( http://**.gsxt.gov.cn ) 指定搜集"特定关键词"。然后获取搜索结果的某些资料保存到Excle
表格或txt文本。

我要的资料很简单(企业名称,法人,年报中的邮箱,电话,住址。)

因为我是python2.7的新手,所以请教高手,要学习哪些python2.7库?或知识?

------------------------------------网站分析F12浏览器记录----------------------------
http://gd.gsxt.gov.cn

search_form searchForm post /corp-query-search-1.html
search keyword searchword

查询按钮 btn_query

http://gd.gsxt.gov.cn/js/subpubsys_homepage.js ( 这个JS 控制输入? )
http://gd.gsxt.gov.cn/js/geetest/gt.js ( 这个JS 验证? )

省份 province 440000/450000,460000,470000.....

地区选择 ads-sci-list area selected
data-value="0" /默认0是全部 data-value="440100" , 后面440100会增长 440200,440300...

状态选择 ads-sci-title cStatus selected data-value="0" /默认0是全部, 增长1,2,3....

搜索结果列表页面 search_list_item db
(每页10个结果)
( 点击链接,进入详细页 href= )

公司名字 f20

法人 div-user2 fa fa-user2 ml20 g3

odd even

搜索结果页数选择 pagination

首页 href="javascript:turnOverPage(0)"
当前页 current
href="javascript:turnOverPage(*)" /*号,1,2,3....

年报 annual_menu_table
查看 jumpToAnnualDetail(this) clickToDetail
地址 addrForColor1 addr
电话 telForColor1 tel
邮件 emailForColor1 email
-------------------------------------------网站分析结束------------------------------------

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.