Skip to content
Open
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: 10 additions & 5 deletions sccmwtf.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,16 @@ def sendCCMPostRequest(self, data, auth=False, username="", password=""):
r = requests.request("CCM_POST", f"{self._serverURI}/ccm_system_windowsauth/request", headers=headers, data=data, auth=HttpNtlmAuth(username, password))
else:
r = requests.request("CCM_POST", f"{self._serverURI}/ccm_system/request", headers=headers, data=data)

multipart_data = decoder.MultipartDecoder.from_response(r)
for part in multipart_data.parts:
if part.headers[b'content-type'] == b'application/octet-stream':
return zlib.decompress(part.content).decode('utf-16')

if r.status_code == 200:
multipart_data = decoder.MultipartDecoder.from_response(r)
for part in multipart_data.parts:
if part.headers[b'content-type'] == b'application/octet-stream':
return zlib.decompress(part.content).decode('utf-16')
elif r.status_code == 403:
print(f"[!] Unauthorized!")
else:
print(f"[!] Unexpected Error code from SCCM Server: {r.status_code}")

def requestPolicy(self, url, clientID="", authHeaders=False, retcontent=False):
headers = {
Expand Down