Code Monkey home page Code Monkey logo

jsrpc's People

Contributors

azwpayne avatar heartfilia avatar jxhczhl avatar lonelypoker avatar yida506 avatar zxerqw 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

jsrpc's Issues

undefined

连接通信undefined

Chrome for Mac M1
已重制浏览器

image

websocket连接失败?

在douyin网页运行
var demo = new Hlclient("ws://127.0.0.1:12080/ws?group=test2&name=test2")
报错
VM38833:16 Refused to connect to 'ws://127.0.0.1:12080/ws?group=test2&name=test2' because it violates the following Content Security Policy directive: "connect-src 'self' *.douyin.com *.snssdk.com *.pstatp.com *.bytednsdoc.com api.feelgood.cn *.bytedance.com *.douyinvod.com *.bytescm.com *.douyincdn.com *.huoshanstatic.com".

api那边提示
注入了ws?没有找到当前组和名字

安卓webvivew报错

Uncaught ReferenceError: blob is not defined
at WebSocket.socket.ySocket.onmessage (:37:38)

对应代码如下 _this.handlerRequest(blob)

Hlclient.prototype.connect = function () {
console.log('begin of connect to wsURL: ' + this.wsURL);
var _this = this;
try {
this.socket["ySocket"] = new WebSocket(this.wsURL);
this.socket["ySocket"].onmessage = function (e) {
try {
let blob = e.data
blob.text().then(data => {
_this.handlerRequest(data);
})
} catch {
console.log("not blob")
_this.handlerRequest(blob)
}

    }

请问在打断点的时候如何使用呢?

有的函数的调用必须要在打断点的情况下才能使用,不打断点的时候调用函数会提示undefined,但是打了断电js_rpc就好像不灵了,请求接口一直不返回数据,请问这种情况该如何处理呢?

data:object object

{'data': '[object Object]', 'group': 'test', 'name': 'leigege', 'status': 200}

这种办法已经被禁用?

chrome

error: EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'wasm-unsafe-eval' 'inline-speculation-rules' http://localhost:* http://127.0.0.1:*".

跑的时间长了会报错

write tcp 192.168.2.87:12080->192.168.2.87:57343: wsasend: An established connection was aborted by the software in your host machine.
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/render/json.go:56 (0x5633be)
JSON.Render: panic(err)
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:913 (0x565837)
(*Context).Render: if err := r.Render(c.Writer); err != nil {
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:956 (0x57b8e5)
(*Context).JSON: c.Render(code, render.JSON{Data: obj})
E:/JsRpc-main/main.go:151 (0x57b6cf)
ResultSet: c.JSON(200, gin.H{"status": "200", "group": client.clientGroup, "name": client.clientName, "data": <-c2})
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x56a001)
(*Context).Next: c.handlersc.index
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:99 (0x569fec)
CustomRecoveryWithWriter.func1: c.Next()
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x569146)
(*Context).Next: c.handlersc.index
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241 (0x569129)
LoggerWithConfig.func1: c.Next()
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x56823d)
(*Context).Next: c.handlersc.index
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:489 (0x567ec5)
(*Engine).handleHTTPRequest: c.Next()
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:445 (0x567b84)
(*Engine).ServeHTTP: engine.handleHTTPRequest(c)
C:/Program Files/Go/src/net/http/server.go:2947 (0x48246b)
serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
C:/Program Files/Go/src/net/http/server.go:1991 (0x47eb46)
(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
C:/Program Files/Go/src/runtime/asm_amd64.s:1594 (0x2a5fc0)
goexit: BYTE $0x90 // NOP

接口调用超时

如图注册函数,调用接口,JS正常执行,接口返回超时;这是什么原因?
图片
图片

mac intel 执行报错

INFO[2024-06-21 08:46:49] 当前监听地址: ssl启用状态:false
ERRO[2024-06-21 08:46:49] 服务启动失败..

如何配合断点使用呢

一、问题描述

大佬你好,如果网页上生成的加密数据是在某个函数里面,并且有一些参数是在这个函数栈里面才有的。我想在断点的时候,注入websocket的脚本,但是我发现只要页面存在断点,那js引擎线程都会被阻塞住,我的脚本里面的事件(onopen)都无法执行。如果我放开断点,那又没法使用函数栈里面的参数了。如何保留函数的上下文,又能让注入顺利运行呢?求教

二、场景

这个场景就是这种情况,登录里面有一个公钥,是动态生成的,我想就断在这个函数里面,注入websocket,但是没法正常响应事件。

    <button type="submit" class="btn btn-primary block full-width m-b" onclick="doLogin();return false;">登录</button>
    <script>
    function encryptLoginPassword(password, rsaPublicKey){
        var jsencrypt = new JSEncrypt(); //加密对象
        jsencrypt.setPublicKey(rsaPublicKey); // 设置密钥
        return jsencrypt.encrypt(password); //加密
    }
    function doLogin() {
        //公钥加密
        var rsaPublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNAD"
        var password =$('#password').val(); //明文密码
        var passwordEncrypted = encryptLoginPassword(password, rsaPublicKey)
        $('#password').val(passwordEncrypted); //返回给密码输入input
        $('#form').submit();//post提交
    }
    </script>

通过hook的方法注入js时产生错误

为了方便,我将JsEnv_Dev.js通过油猴hook,并且在后面添加了
window.demo = new Hlclient("ws://127.0.0.1:12080/ws?group=hello&name=search");

然后打开本地带有script的html文件
并且script中添加了远程调用3

demo.regAction("hello3", function (resolve,param) {
    //这里还是param参数 param里面的key 是先这里写,但到时候传接口就必须对应的上
    res=hlg(param["user"],param["status"])
    resolve(res);
})

但是console区域出现了报错,远程调用3失败了
Uncaught ReferenceError: demo is not defined

我试了将window.demo改成demo也不行

请问大佬window.demo = new Hlclient("ws://127.0.0.1:12080/ws?group=hello&name=search");
这个是不能hook吗,或者有什么办法可以解决这个问题

js代码兼容问题

image

复制jsenv.js在目标网站控制台运行后报上图

让把这里的this改成let。请问这里是否存js兼容或者语法问题

function Hlclient(wsURL) {
    this.wsURL = wsURL;
    this.handlers = {};
    this.socket = {};

    if (!wsURL) {
        throw new Error('wsURL can not be empty!!')
    }
    this.connect()
}

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.