Giter VIP home page Giter VIP logo

ruijieportalloginshellscript's Introduction

简介

此项目是在 SCU网络必坑指南RuijiePortalLoginTool 这两个已有的项目进行了一些微小的修改后得来的。

本脚本实现了锐捷 ePortal Web 认证的登录,需要 curl 指令的支持,通过 curl 发送认证所需的 POST 数据包来实现 Web 认证。

如果你所在的学校也是使用锐捷进行校园网认证,并且开启了 Web 的认证方式(如下图),那么应该是可以使用本脚本进行认证的。

项目中的脚本文件以 _jmu 结尾命名的仅适用于集美大学,SCU版本的以 _scu 结尾, SHU版本的以 _shu 结尾。

关于该脚本更加详细的使用说明请参考 SCU网络避坑指南连网脚本的内容:

脚本依赖于 curl,所以使用之前请确保系统中已经安装了 curl。

脚本工作原理

这个 Shell script 主要工作原理如下:

  1. Captive Portal Server 发送 GET 请求,检查返回的 HTTP 状态码是否为 204:
    1. 如果为 204 则说明当前已经能正常联网,退出脚本,停止后续认证流程;
    2. 如果不是 204 则说明当前未进行锐捷认证(一般来说,在未认证的情况下请求任意页面,认证服务器都会返回一个 HTTP 302 或者 301 状态码,用于将你重定向到 ePortal 认证页面),则将 HTTP 重定向所转向的页面的 URL 作为认证页面 URL。
  2. 构造进行锐捷 ePortal 认证所需的 HTTP 请求,并通过 curl 发送该请求。
  3. 认证成功。

基本用法

./ruijie_general.sh <username> <password>
  • username 参数为认证用户名。
  • password 参数为认证密码。

局限性

如果多次认证失败(例如用户名或密码错误)或者多次重复刷新认证页面,则认证过程需要输入页面上显示的验证码。此脚本并没有识别验证码的功能。

如果你所在的学校需要在认证过程中输入验证码,则不适合使用这个 shell script 进行认证,需要使用 Python 等脚本语言实现验证码识别功能再进行认证。

ruijieportalloginshellscript's People

Contributors

lgiki avatar syaoranwe avatar irorange27 avatar

Stargazers

Yuan Hao avatar SiTinc avatar  avatar Milin avatar

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.