合并注入工具和解密工具

This commit is contained in:
hugy committed 2023-03-29 09:30:03 +08:00
1 parent 4a3ef64467
commit c590a95425
6 files changed
+2288 -1

No files matched your search

+595
View File
@@ -0,0 +1,595 @@
import requests
import json
def check_login():
"""
0.检查是否登录
:return:
"""
url = "127.0.0.1:19088/api/?type=0"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def user_info():
"""
登录用户信息
:return:
"""
url = "127.0.0.1:19088/api/?type=8"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def send_text():
"""
发送文本
:return:
"""
url = "127.0.0.1:19088/api/?type=2"
payload = json.dumps({
"wxid": "filehelper",
"msg": "123"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def send_at():
"""
发送@消息
:return:
"""
url = "127.0.0.1:19088/api/?type=3"
payload = json.dumps({
"chatRoomId": "12333@chatroom",
"wxids": "notify@all",
"msg": "12333"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def send_img():
"""
发送图片
:return:
"""
url = "127.0.0.1:19088/api/?type=5"
payload = json.dumps({
"wxid": "filehelper",
"imagePath": "C:/123.png"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def send_file():
"""
发送文件
:return:
"""
url = "127.0.0.1:19088/api/?type=6"
payload = json.dumps({
"wxid": "filehelper",
"filePath": "C:/test.txt"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def hook_msg():
"""
hook 消息
:return:
"""
url = "127.0.0.1:19088/api/?type=9"
payload = json.dumps({
"port": "19099",
"ip": "127.0.0.1"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def unhook_msg():
"""
取消消息hook
:return:
"""
url = "127.0.0.1:19088/api/?type=10"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def hook_img():
"""
hook 图片
:return:
"""
url = "127.0.0.1:19088/api/?type=11"
payload = json.dumps({
"imgDir": "C:\\img"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def unhook_img():
"""
取消hook 图片
:return:
"""
url = "127.0.0.1:19088/api/?type=12"
payload = json.dumps({
"imgDir": "C:\\img"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def hook_voice():
"""
hook 语音
:return:
"""
url = "127.0.0.1:19088/api/?type=56"
payload = json.dumps({
"msgId": 322456091115784000
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def unhook_voice():
"""
取消hook 语音
:return:
"""
url = "127.0.0.1:19088/api/?type=14"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def del_friend():
"""
删除好友
:return:
"""
url = "127.0.0.1:19088/api/?type=17"
payload = json.dumps({
"wxid": "wxid_1124423322"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def search_friend():
"""
网络搜素用户
:return:
"""
url = "127.0.0.1:19088/api/?type=19"
payload = json.dumps({
"keyword": "13812345678"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def add_friend():
"""
添加好友
:return:
"""
url = "127.0.0.1:19088/api/?type=20"
payload = json.dumps({
"wxid": "wxid_o11222334422"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def fetch_chat_room_members():
"""
群成员
:return:
"""
url = "127.0.0.1:19088/api/?type=25"
payload = json.dumps({
"chatRoomId": "2112222004@chatroom"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def get_member_nickname():
"""
群成员昵称
:return:
"""
url = "127.0.0.1:19088/api/?type=26"
payload = json.dumps({
"chatRoomId": "322333384@chatroom",
"memberId": "wxid_4m1112222u22"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def del_member():
"""
删除群成员
:return:
"""
url = "127.0.0.1:19088/api/?type=27"
payload = json.dumps({
"chatRoomId": "31122263384@chatroom",
"memberIds": "wxid_12223334422"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def add_member():
"""
增加群成员
:return:
"""
url = "127.0.0.1:19088/api/?type=28"
payload = json.dumps({
"chatRoomId": "1111163384@chatroom",
"memberIds": "wxid_o12222222"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def modify_room_name():
"""
修改群昵称
:return:
"""
url = "127.0.0.1:19088/api/?type=31"
payload = json.dumps({
"chatRoomId": "222285428@chatroom",
"wxid": "wxid_222222512",
"nickName": "qqq"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def get_db_handlers():
"""
获取sqlite3的操作句柄
:return:
"""
url = "127.0.0.1:19088/api/?type=32"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def query_db_by_sql():
"""
查询数据库
:return:
"""
url = "127.0.0.1:19088/api/?type=34"
payload = json.dumps({
"dbHandle": 116201928,
"sql": "select localId from MSG where MsgSvrID= 7533111101686156"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def hook_log():
"""
hook 日志
:return:
"""
url = "127.0.0.1:19088/api/?type=36"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def unhook_log():
"""
取消hook日志
:return:
"""
url = "127.0.0.1:19088/api/?type=37"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def forward():
"""
转发消息
:return:
"""
url = "127.0.0.1:19088/api/?type=40"
payload = json.dumps({
"wxid": "filehelper",
"msgid": "705117679011122708"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def logout():
"""
退出登录
:return:
"""
url = "127.0.0.1:19088/api/?type=44"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def confirm_receipt():
"""
确认收款
:return:
"""
url = "127.0.0.1:19088/api/?type=45"
payload = json.dumps({
"wxid": "wxid_1111112622",
"transcationId": "10000500012312222212243388865912",
"transferId": "100005000120212222173123036"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def contact_list():
"""
好友列表
:return:
"""
url = "127.0.0.1:19088/api/?type=46"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def room_detail():
"""
群详情
:return:
"""
url = "127.0.0.1:19088/api/?type=47"
payload = json.dumps({
"chatRoomId": "199134446111@chatroom"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def ocr():
"""
ocr提取文字
:return:
"""
url = "127.0.0.1:19088/api/?type=49"
payload = json.dumps({
"imagePath": "C:\\WeChat Files\\b23e84997144dd12f21554b0.dat"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def pat():
"""
拍一拍
:return:
"""
url = "127.0.0.1:19088/api/?type=50"
payload = json.dumps({
"chatRoomId": "211111121004@chatroom",
"wxid": "wxid_111111111422"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def top_msg():
"""
消息置顶
:return:
"""
url = "127.0.0.1:19088/api/?type=51"
payload = json.dumps({
"wxid": "wxid_o11114422",
"msgid": 3728307145189195000
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def close_top_msg():
"""
取消置顶
:return:
"""
url = "127.0.0.1:19088/api/?type=52"
payload = json.dumps({
"chatRoomId": "213222231004@chatroom",
"msgid": 3728307145189195000
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def sns_first():
"""
朋友圈首页
:return:
"""
url = "127.0.0.1:19088/api/?type=53"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def sns_next():
"""
朋友圈下一页
:return:
"""
url = "127.0.0.1:19088/api/?type=54"
payload = json.dumps({
"snsId": "14091988153735844377"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def query_nickname():
"""
查询联系人或群名称
:return:
"""
url = "127.0.0.1:19088/api/?type=55"
payload = json.dumps({
"id": "wxid_1112p4422"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def download_msg_attach():
"""
下载消息附件
:return:
"""
url = "127.0.0.1:19088/api/?type=56"
payload = json.dumps({
"msgId": 6080100336053626000
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
def get_member_info():
"""
获取群/群成员信息
:return:
"""
url = "127.0.0.1:19088/api/?type=57"
payload = json.dumps({
"wxid": "wxid_tx8k6tu21112"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
if __name__ == '__main__':
check_login()
user_info()
send_text()
+51
View File
@@ -0,0 +1,51 @@
import ctypes
import hashlib
import hmac
# pip install pycryptodome
from Crypto.Cipher import AES
def decrypt(password, input_file, out_file):
password = bytes.fromhex(password.replace(' ', ''))
with open(input_file, 'rb') as (f):
blist = f.read()
print(len(blist))
salt = blist[:16]
key = hashlib.pbkdf2_hmac('sha1', password, salt, DEFAULT_ITER, KEY_SIZE)
first = blist[16:DEFAULT_PAGESIZE]
mac_salt = bytes([x ^ 58 for x in salt])
mac_key = hashlib.pbkdf2_hmac('sha1', key, mac_salt, 2, KEY_SIZE)
hash_mac = hmac.new(mac_key, digestmod='sha1')
hash_mac.update(first[:-32])
hash_mac.update(bytes(ctypes.c_int(1)))
if hash_mac.digest() == first[-32:-12]:
print('decrypt success')
else:
print('password error')
return
blist = [blist[i:i + DEFAULT_PAGESIZE] for i in range(DEFAULT_PAGESIZE, len(blist), DEFAULT_PAGESIZE)]
with open(out_file, 'wb') as (f):
f.write(SQLITE_FILE_HEADER)
t = AES.new(key, AES.MODE_CBC, first[-48:-32])
f.write(t.decrypt(first[:-48]))
f.write(first[-48:])
for i in blist:
t = AES.new(key, AES.MODE_CBC, i[-48:-32])
f.write(t.decrypt(i[:-48]))
f.write(i[-48:])
def main():
password = '565735E30E474DA09250CB5AA047E3940FFA1C6F767C4263B13ABB512933DA49'
input_file = 'C:/var/Applet.db'
out_file = 'c:/var/out/Applet.db'
decrypt(password, input_file, out_file)
if __name__ == '__main__':
SQLITE_FILE_HEADER = bytes('SQLite format 3', encoding='ASCII') + bytes(1)
KEY_SIZE = 32
DEFAULT_PAGESIZE = 4096
DEFAULT_ITER = 64000
main()