Giter VIP home page Giter VIP logo

nwu-ncov-auto-report's Introduction

西北大学nCov自动填报脚本(支持Github Actions)

如果项目对你有帮助记得Star一下哦~
欢迎PR、Issue 或者面基

网页版(NEW!)

鉴于部分同学反应Github Action版本不太会使用,觉得麻烦的同学可以点击此处跳转网页版,输入账号密码即可自动填报,支持参数自定义。
链接地址: http://nwu-auto-report.stdin.info/
Note:不希望填写账号密码或者对稳定性要求较高的同学依然建议使用Github Actions版本。

Featurs

  • 支持多种运行方式:
    • Github Actions:无需服务器即可免开机定时执行
    • CLI:支持命令行参数调用
    • Server(须配置crontab)
  • 可定制填报内容、时间
  • 单文件实现
  • 支持用户名密码或应用Cookies两种登陆方式

Security

  • Github action方式运行(推荐)
    • 所有登陆参数(密码或Cookies)均以秘钥形式加密存储在自己的Github账户中,无法被任何人查看
    • 使用Cookies方式登陆无需上传用户名密码,该Cookies仅对nCov填报应用生效,安全性更高。但Cookies过期后需要重新上传建议谨慎使用。
  • CLI/Server方式运行
    • 代码不会连接任何第三方服务器
    • 代码默认以明文方式读取认证参数,请自行做好加密工作

Usage

CLI

--help 参数可以查看可用参数及说明 详细内容可用参考程序文件头部注释

Github Action 运行方法

  • Fork本项目

  • 在项目中打开Settings->Secrets页面

  • 点击“New Secret”,分别创建如下五个新的密码(名称均大写):

    • AUTH_MODE:认证模式,账号密码方式填写"PASSWORD",cookies方式填写"COOKIES"(不带引号)
    • USERNAME:用户名,"PASSWORD"模式需要
    • PASSWORD:密码,"PASSWORD"模式需要
    • EAI_SESS:Cookies之一,"COOKIES"模式需要
    • UUKEY:Cookies之一,"COOKIES"模式需要

    其中,AUTH_MODE为认证模式,即密码(PASSWORD)或cookies(COOKIES)两种方式,依照所选的填写 USERNAME/PASSWORD 或者 EAI_SESS/UUKEY ,不需要的留空即可(写个空格或者随意填写)。两种认证方式只需要选择一种。 各个参数的意义可以参考前文或代码开头的注释。 此处配置的信息即便仓库为公开仓库其他人也看不到,日志部分也不会包含任何个人相关信息。上传的Secret会被Github加密保存,只能更新无法查看。

    UPDATE:
    目前经过测试,仅创建使用到的Secret已经不会导致错误,即:
    - PASSWORD模式:必须包含AUTH_MODE、USERNAME、PASSWORD三个Secret - COOKIES模式:必须包含AUTH_MODE、EAI_SESS、UUKEY三个Secret

  • 启动定时打卡 进入Actions标签(页面上方),点击该工作流(Auto_Attendance_GitHub_Action),点击Run workflow按钮 此外,push代码同样会触发该Workflow(只用触发一次即可)

  • 之后在Action标签中可以查看每一次执行的情况,每次执行点击左侧Build,然后下拉展开“Run app”这个步骤可以查看具体执行结果

Github Action 关闭方法

  • 打开Action标签,点击左侧填报的工作流(Auto_Attendance_GitHub_Action)
  • 之后页面中上放搜索框旁的三个点,即可见Disable按钮

内置参数运行

程序开头Settings aera部分包括各类定义,可直接在此处配置并直接运行程序(默认方式,无需显示添加--cli=False参数)

Notice

  • Github Action对公开仓库免费使用,私有仓库有一定免费额度,建议不要将仓库设为私有(虽然配额应该不可能用完)。
  • 部分内容正在完善,可以在Issue提意见或者问问题。

Github-Actions部分配置参考仓库 中南大学nCov健康打卡定时自动脚本, 特此感谢

nwu-ncov-auto-report's People

Contributors

stdinfo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

nwu-ncov-auto-report's Issues

提示需要验证码

Run python3 auto.py --cli=True --auth_mode=$auth_mode --username=$username --*** --eai-sess=$eai_sess --UUkey=$UUkey
python3 auto.py --cli=True --auth_mode=$auth_mode --username=$username --*** --eai-sess=$eai_sess --UUkey=$UUkey
shell: /usr/bin/bash -e {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.8.9/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.9/x64/lib
auth_mode:
username:
password:
eai_sess:
UUkey:
USE PASSWORD MODE
登陆失败: 请输入验证码
Error: Terminated...

SQL injection

The vulnerability affects https://nwu-auto-report.stdin.info/change_password.php , id

Attack Details
arrow_drop_up
URL encoded POST input password_new was set to 1'"

Error message found:
You have an error in your SQL syntax
HTTP Request
arrow_drop_up
POST /change_password.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Referer: https://nwu-auto-report.stdin.info/
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Encoding: gzip,deflate
Content-Length: 47
Host: nwu-auto-report.stdin.info
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21
Connection: Keep-alive

id=1&password=g00dPa%24%24w0rD&password_new=1'"
HTTP Response
arrow_drop_up
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 07 May 2022 08:26:14 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/7.3.0
Strict-Transport-Security: max-age=31536000
Original-Content-Encoding: gzip
Content-Length: 2758

<!doctype html>

<!-- MDUI CSS -->
<link
        rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/mdui.min.css"
        integrity="sha384-cLRrMq39HOZdvE0j6yBojO4+1PrHfB7a9l5qLcmRm/fiWXYY+CndJPmyu5FV/9Tw"
        crossorigin="anonymous"
/>
<title>西北大学晨午检自动填报</title>

Error: UPDATE auto_report_account_list SET password = '1'"' where id = '1'
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"' where id = '1'' at line 1
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/mdui.min.js" integrity="sha384-gCMZcshYKOGRX9r6wbDrvF+TcCCswSHFucUzUPwka+Gr+uHgjlYvkABr95TCOz3A" crossorigin="anonymous" ></script> <script> var main_menu = new mdui.Drawer('#main_menu'); mdui.mutation() </script>

nb

好家伙,我记得之前fork过,今天搞了一下午终于搞出来,结果你更新了!!!nb!!!面基hhhhhh

Cross site scripting

The vulnerability affects https://nwu-auto-report.stdin.info/reg.php , id

Attack Details

URL encoded POST input id was set to 1'"()&%<ScRiPt >g4y4(9098)</ScRiPt>
HTTP Request

POST /reg.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Referer: https://nwu-auto-report.stdin.info/
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Encoding: gzip,deflate
Content-Length: 164
Host: nwu-auto-report.stdin.info
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21
Connection: Keep-alive

city=San%20Francisco&district=1&id=1'"()%26%25<ScRiPt%20>g4y4(9098)</ScRiPt>&info_1=555&info_2=555&info_3=555&password=g00dPa%24%24w0rD&province=NY&sfzx=0&tw=1
HTTP Response

HTTP/1.1 200 OK
Server: nginx
Date: Sat, 07 May 2022 08:27:10 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/7.3.0
Strict-Transport-Security: max-age=31536000
Original-Content-Encoding: gzip
Content-Length: 5707


Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, bool given in /www/wwwroot/nwu-auto-report.stdin.info/web/reg.php on line 42
Error: INSERT INTO auto_report_account_list (id, password, sfzx, tw, area, city, province, address, geo_api_info, is_active) VALUES ('1'"()&%<ScRiPt >g4y4(9098)</ScRiPt>', 'g00dPa$$w0rD', '0', '1', 'NY San Francisco 1', 'San Francisco', 'NY', '', '555', 1) ON DUPLICATE KEY UPDATE sfzx = values(sfzx), tw = values(tw), area = values(area), city = values(city), province = values(province), address = values(address), geo_api_info = values(geo_api_info), is_active = values(is_active)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"()&%<ScRiPt >g4y4(9098)</ScRiPt>', 'g00dPa$$w0rD', '0', '1', 'NY San Franc' at line 2

<!doctype html>

<!-- MDUI CSS -->
<link
    rel="stylesheet"
    href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/mdui.min.css"
    integrity="sha384-cLRrMq39HOZdvE0j6yBojO4+1PrHfB7a9l5qLcmRm/fiWXYY+CndJPmyu5FV/9Tw"
    crossorigin="anonymous"
/>
<title>西北大学晨午检自动填报</title>

<div class="mdui-row mdui-color-teal-100 mdui-hidden">
    <br/>
    <div class="mdui-col-xs-12">
        <div class="mdui-typo-title mdui-center mdui-text-center">认证成功</div>
    </div>
    <br/>
    <br/>
</div>
<br/>
<div class="mdui-row mdui-color-pink-100 mdui-hidden">
    <br/>
    <div class="mdui-col-xs-12">
        <div class="mdui-typo-title mdui-center mdui-text-center">认证失败,请检查学号及统一身份认证密码!</div>
    </div>
    <br/>
    <br/>
</div>
<br/>
<div class="mdui-row mdui-color-teal-100 mdui-hidden">
    <br/>
    <div class="mdui-col-xs-12">
        <div class="mdui-typo-title mdui-center mdui-text-center">更新成功</div>
    </div>
    <br/>
    <br/>
</div>
<br/>
<div class="mdui-row mdui-color-teal-100 mdui-hidden">
    <br/>
    <div class="mdui-col-xs-12">
        <div class="mdui-typo-title mdui-center mdui-text-center">注册成功</div>
    </div>
    <br/>
    <br/>
</div>
<br/>
<div class="mdui-row mdui-color-pink-100 mdui-hidden">
    <br/>
    <div class="mdui-col-xs-12">
        <div class="mdui-typo-title mdui-center mdui-text-center">更新失败:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"()&%<acx><ScRiPt >g4y4(9098)</ScRiPt>', 'g00dPa$$w0rD', '0', '1', 'NY San Franc' at line 2</div>
    </div>
    <br/>
    <br/>
</div>
<br/>

<div class="mdui-divider"></div>
<br/>

<div class="mdui-row">
    <div class="mdui-col-xs-12">
        <div class="mdui-typo-title-opacity">相关功能</div>
        <br/>
        <a class="mdui-btn mdui-btn-raised" href="/more/report_status.html">查看当前填报状态</a>
        <a class="mdui-btn mdui-btn-raised" href="/more/report_status.html">暂停自动填报</a>
        <a class="mdui-btn mdui-btn-raised" href="/check.html">查看近期填报日志</a>
    </div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/mdui.min.js" integrity="sha384-gCMZcshYKOGRX9r6wbDrvF+TcCCswSHFucUzUPwka+Gr+uHgjlYvkABr95TCOz3A" crossorigin="anonymous" ></script> <script> var main_menu = new mdui.Drawer('#main_menu'); mdui.mutation() </script>

The impact of this vulnerability

Malicious JavaScript has access to all the same objects as the rest of the web page, including access to cookies and local storage, which are often used to store session tokens. If an attacker can obtain a user's session cookie, they can then impersonate that user.

Furthermore, JavaScript can read and make arbitrary modifications to the contents of a page being displayed to a user. Therefore, XSS in conjunction with some clever social engineering opens up a lot of possibilities for an attacker.

问题反馈

同学你好,每日上报好像更新界面了,和之前的不太一样,还能有效上报吗,如果不能,是否能抽空更新一下代码呢Thanks♪(・ω・)ノ

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.