General solution for webpage (web authentication) authentication: capture curl through the browser, and make a bash script that the router can run to realize automatic login [non-anti-detection]

foreword

Many college students are obsessed with automatically logging into the campus network and cannot extricate themselves, but they are forced to find a suitable method for their school. In order to solve this problem, the router webpage networking authentication plug-in comes. Don't talk nonsense, go straight to work

Need to prepare: a router with oepnwrt brushed, a pair of hands that can move, a mouth that can ask questions, and a brain that can be used

1. Packet capture

The following are general packet capture instructions:

Open the school certification webpage, press F12 in the browser to open the development tool:

 The next window on the right will display the packet capture information:

 add down right click

Choose to copy as curl (cmd) must not copy wrong, this step is critical:

 This is the curl we need

Usually looks like this:

curl "http://219.222.95.38/eportal/InterFace.do?method=login" ^
  -H "Accept: */*" ^
  -H "Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6" ^
  -H "Connection: keep-alive" ^
  -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" ^
  -H "Cookie: EPORTAL_COOKIE_OPERATORPWD=; EPORTAL_COOKIE_SERVER=; EPORTAL_COOKIE_DOMAIN=; EPORTAL_AUTO_LAND=; EPORTAL_COOKIE_SERVER_NAME=; EPORTAL_COOKIE_USERNAME=; EPORTAL_COOKIE_PASSWORD=; EPORTAL_COOKIE_SAVEPASSWORD=false; EPORTAL_COOKIE_NEWV=; EPORTAL_USER_GROUP=^%^E7^%^BC^%^B4^%^E8^%^B4^%^B9^%^E5^%^AD^%^A6^%^E7^%^94^%^9F; JSESSIONID=343DBD3127B618FD8F09E6DB9C2E4A04" ^
  -H "Origin: http://219.222.95.38" ^
  -H "Referer: http://219.222.95.38/eportal/index.jsp?wlanuserip=4e8521c5e95cc2512f4d7b2337e9187a&wlanacname=8d9f959a8ec82bda924698d872983201&ssid=&nasip=cf8d35e3fecd023ed8b30f713318e973&snmpagentip=&mac=de4bae6add748a15b2f1dded263ff9e1&t=wireless-v2&url=f5f108611801fe6441be2152ce18944a60a6b2af0d40f2f3&apmac=&nasid=8d9f959a8ec82bda924698d872983201&vid=ab62dcce0d51d421&port=3e81c125bb4cc9e1&nasportid=84472955d9ccce45508d03904ef81a3a4e183af274460d68fb64b909cbdc80db72027c310c478268" ^
  -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67" ^
  --data-raw "userId=*********&password=********&service=&queryString=wlanuserip^%^253D4e8521c5e95cc2512f4d7b2337e9187a^%^2526wlanacname^%^253D8d9f959a8ec82bda924698d872983201^%^2526ssid^%^253D^%^2526nasip^%^253Dcf8d35e3fecd023ed8b30f713318e973^%^2526snmpagentip^%^253D^%^2526mac^%^253Dde4bae6add748a15b2f1dded263ff9e1^%^2526t^%^253Dwireless-v2^%^2526url^%^253Df5f108611801fe6441be2152ce18944a60a6b2af0d40f2f3^%^2526apmac^%^253D^%^2526nasid^%^253D8d9f959a8ec82bda924698d872983201^%^2526vid^%^253Dab62dcce0d51d421^%^2526port^%^253D3e81c125bb4cc9e1^%^2526nasportid^%^253D84472955d9ccce45508d03904ef81a3a4e183af274460d68fb64b909cbdc80db72027c310c478268&operatorPwd=&operatorUserId=&validcode=&passwordEncrypt=false" ^
  --compressed ^
  --insecure                        

Next, you need to flash openwrt into the router. Since you found this, you should know what openwrt is. I won't waste time here.

Install the router luci-app-autoshell plug-in, which is a relatively easy-to-use plug-in made by me. The warehouse on github is : Jump to the warehouse https://github.com/lucikap/luci-app-brukamen.git
 

Download the ipk package luci-app-autoshell_1.2.3-1_mipsel_24kc.ipk and install it to the openwrt router

Restart the router to see the relevant interface, and there will be relevant instructions. At this time, paste curl into the plug-in to generate a script and enjoy the joy of automatic authentication. .

If you have any questions, please join the QQ group chat discussion: 555201601

Guess you like

Origin blog.csdn.net/Brukamen/article/details/131539403