Sekiro

作者: 是东东 | 来源:发表于2023-04-02 16:42 被阅读0次

    一、下载及运行

    1. 下载
      https://oss.iinti.cn/sekiro/sekiro-demo
    2. 运行
    ./bin/sekiro.bat
    
    配置

    conf/config.properties 配置定制参数,目前只支持配置服务端口 sekiro.port=5612
    conf/logback.xml可以用来配置日志输出规则

    二、插入JS代码

    if(!window._makeRequest){window._makeRequest = makeRequest};
    

    三、通过油猴加载sekiro_web_client及SekiroClient相关代码

    1. 下载油猴插件


    2. google安装油猴插件


    3. 注入代码


    // ==UserScript==
    // @name         dong
    // @namespace    http://tampermonkey.net/
    // @version      0.1
    // @description  try to take over the world!
    // @author       You
    // @match        https://weibo.com/*
    // @icon         https://www.google.com/s2/favicons?sz=64&domain=jianshu.com
    // @grant        none
    // ==/UserScript==
    
    (function() {
        'use strict';
    
        // Your code here...
        var _mscript=document.createElement("script")
        _mscript.src="https://sekiro.virjar.com/sekiro-doc/assets/sekiro_web_client.js"
        document.body.appendChild(_mscript);
        function sek_start(){
            function guid() {
                function S4() {
                    return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
                }
                return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
            }
            var client = new SekiroClient("ws://127.0.0.1:5612/business-demo/register?group=test&clientId=" + guid());
            client.registerAction("makeRequest", function (request, resolve, reject) {
                try {
                    var _user=request['user']
                    var _psw=request['psw']
                    var result=JSON.stringify(window._makeRequest(_user,_psw,7,false))
                    resolve(result);
                } catch (e) {
                    reject("error: " + e);
                }
            });
        }
        setTimeout(sek_start,2000)
    })();
    

    四、RPC调用(python示例)

    # -*- coding: utf-8 -*-
    
    import requests
    
    r=requests.Session()
    pdata={
        'group':'test',
        'action':'makeRequest',
        'user':'12345678910',
        'psw':'123456'
    }
    
    response=requests.get("http://127.0.0.1:5612/business-demo/invoke",params=pdata)
    print(response.text)
    

    相关文章

      网友评论

          本文标题:Sekiro

          本文链接:https://www.haomeiwen.com/subject/hkjrddtx.html