The rpc server api of https://github.com/cyal1/BcryptMontoya
Project description
BcryptRpcServer
The rpc server of https://github.com/cyal1/BcryptMontoya
install
pip install BcryptRpcServer
Basic
import BcryptRpcServer
def test(a,b,c,d,e):
print(a,type(a),b,type(b),c,type(c),d,type(d),e,type(e))
return b'asdf'
@BcryptRpcServer.expose # some thing wrong. not always work
def test2():
return 'xxx'
BcryptRpcServer.expose(test) # recommend
BcryptRpcServer.run("127.0.0.1:30051")
Frida
import BcryptRpcServer
import time
import frida
def my_message_handler(message, payload):
print(message)
print(payload)
def decrypt(arg):
print(f"decrypt {arg}")
return script.exports.calldecryptfunction(arg)
def encrypt(arg):
print(f"encrypt {arg}")
return script.exports.callencryptfunction(arg)
# device = frida.get_usb_device()
device = frida.get_device_manager().add_remote_device('127.0.0.1:27042')
# pid = device.spawn(["com.example.www"])
# device.resume(pid)
# time.sleep(1) # Without it Java.perform silently fails
# session = device.attach(pid)
session = device.attach(17982)
with open("python_to_call_function.js") as f:
script = session.create_script(f.read())
script.on("message", my_message_handler)
script.load()
print(encrypt("test"))
print(decrypt(encrypt("test")))
BcryptRpcServer.expose(decrypt)
BcryptRpcServer.expose(encrypt)
BcryptRpcServer.run("127.0.0.1:30051")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
BcryptRpcServer-0.0.2.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for BcryptRpcServer-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae9ffd4394c8358a3e159e5ba3009e6ef76aa2bf7b4ae34bd1a96faccb3f10f4 |
|
MD5 | 178597d35226fa278c9f272909d5336c |
|
BLAKE2b-256 | 872bd35d8c086bf70f440fe48c72d85287582d8c1e3df8cb2693476f64fd4905 |