Skip to content

Initial batch script#14

Open
workentin wants to merge 13 commits intomasterfrom
cmd-bat-refactor
Open

Initial batch script#14
workentin wants to merge 13 commits intomasterfrom
cmd-bat-refactor

Conversation

@workentin
Copy link
Collaborator

Only report formatting and some system info checks are ported from PSv3 script so far.

Only report formatting and some system info checks are ported from PSv3 script so far.
Made check more robust for checking networking information.
Verified working on Windows XP and Windows 7 SP1.
Added local administrators group check and AlwaysInstallElevated checks.
@cutaway
Copy link
Collaborator

cutaway commented May 18, 2025

Setting TESTING to false does not turn everything off.

C:\Users\student\Downloads>.\chaps.bat
##########################
# Saving output to: C:\Users\student\AppData\Local\Temp\SANS-CORE-VM_20251805_195329\SANS-CORE-VM_chaps.txt
##########################
[*] Collecting systeminfo to: C:\Users\student\AppData\Local\Temp\SANS-CORE-VM_20251805_195329\SANS-CORE-VM_sysinfo.txt
[DEBUG] Setting IPv4_ADDR to: " 192.168.85.140"
[DEBUG] Set IPv4_ADDR: 192.168.85.140
[DEBUG] Finished checking for "IPv4 Address" - IPv4_ADDR: 192.168.85.140
# Report saved to: C:\Users\student\AppData\Local\Temp\SANS-CORE-VM_20251805_195329\SANS-CORE-VM_chaps.txt

@cutaway
Copy link
Collaborator

cutaway commented May 18, 2025

WMIC outputs appear to remove the starting [ from some outputs. I could not find the issue.

[DEBUG] Called GetWMICValue
[DEBUG] WMIC_CLASS: os
[DEBUG] WMIC_PROPERTY: OSArchitecture
[DEBUG] WMIC_EXE: C:\Windows\system32\wbem\wmic.exe
[DEBUG] Attempting: wmic os get OSArchitecture
[DEBUG] WMIC Result: 64-bit
"DEBUG] Returning RESULT: "64-bit
[DEBUG] Setting OS_ARCH: 64-bit
[DEBUG] Attempting to get Domain/Workgroup
[DEBUG] Calling GetWMICValue computersystem Domain
[DEBUG] Called GetWMICValue
[DEBUG] WMIC_CLASS: computersystem
[DEBUG] WMIC_PROPERTY: Domain
[DEBUG] WMIC_EXE: C:\Windows\system32\wbem\wmic.exe
[DEBUG] Attempting: wmic computersystem get Domain
[DEBUG] WMIC Result: WORKGROUP
"DEBUG] Returning RESULT: "WORKGROUP
[DEBUG] Setting DOMAIN: WORKGROUP
[*] Windows Product: Microsoft Windows 10 Enterprise
[*] OS Version: 10.0.19045
[*] OS Architecture: 64-bit
[*] System Type: x64-based PC
[*] Domain/Workgroup: WORKGROUP

@cutaway
Copy link
Collaborator

cutaway commented May 18, 2025

I want to move the outputs to the local directory instead of AppData. It'll just get lost there.

# Report saved to: C:\Users\student\AppData\Local\Temp\SANS-CORE-VM_20251805_195329\SANS-CORE-VM_chaps.txt

Added flags for enable/disable checks
Put WMIC queries into function call
Put Admin Rights check to function call
Put check time into funciton call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants