# baifdz/windows-tests architecture

> Architecture diagram of the GitHub repository baifdz/windows-tests, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/baifdz/windows-tests
- Repository: https://github.com/baifdz/windows-tests

## Overview

#### Purpose

Windows-TESTS is a flat collection of Windows batch and PowerShell scripts, plus Markdown command notes, apparently intended for Windows administration, discovery, auditing, and security-impact testing. There is no application framework, package manifest, service, or central orchestrator.

#### Entry Points

Scripts are executed directly by an operator in a Windows shell:

- PowerShell scripts: `audit.ps1`, `dns_sweep.ps1`, `ADfind.ps1`
- Batch launcher: `chropen.bat`
- Operational/security test scripts: `keylogg.ps1`, `screenshot.ps1`, `syscrash.ps1`

The README only points to PowerShell Gallery, suggesting PowerShell modules may be expected to be obtained externally, but it does not specify dependencies.

#### Discovery and Environment Enumeration

Several scripts form the discovery layer, collecting information about network, DNS, Active Directory, shares, and files:

- `dns_sweep.ps1`
- `ADfind.ps1`
- `netshares.ps1`
- `share_discover.ps1`
- `share_file_discovery.ps1`

These are likely independent operator-selected probes rather than stages in an automated pipeline. Their boundary is the local Windows host and accessible network/domain resources.

#### Audit and Hardening Guidance

The repository includes assessment and remediation-oriented material:

- `audit.ps1`
- `hardening.md`
- `powershell_commands.md`

`audit.ps1` is the primary executable audit entry point. The Markdown files provide operational knowledge rather than an integrated policy engine or reporting workflow.

#### System Modification and Cleanup

Scripts with potentially persistent or destructive system effects are isolated as direct commands:

- `regerase.ps1`
- `net_program_del.ps1`
- `cleanup.md`

These operate at the Windows registry, installed-program, or local-artifact boundary. They should be treated as privileged operator actions; the repository provides no evident transaction, rollback, authorization, or state-management layer.

#### Security-Impact Test Payloads

A distinct set of scripts appears intended to exercise endpoint controls or demonstrate high-risk behaviors:

- `keylogg.ps1`
- `screenshot.ps1`
- `syscrash.ps1`
- `forkbomb.md`

These are not integrated with audit/discovery scripts. They likely require elevated permissions or endpoint-security exceptions depending on implementation and host policy.

#### Runtime and External Boundaries

The material runtime is Windows PowerShell and Windows command execution, with `.bat` support through `chropen.bat`. Important external boundaries include Windows registry/services, local filesystem, Active Directory, DNS, SMB/network shares, and potentially PowerShell Gallery for module acquisition. No cloud service, database, API server, CI pipeline, or persistent storage architecture is represented in the repository.

Main entry points: [`audit.ps1`](https://github.com/baifdz/windows-tests/blob/main/audit.ps1) (audit.ps1), [`regerase.ps1`](https://github.com/baifdz/windows-tests/blob/main/regerase.ps1) (regerase.ps1), [`dns_sweep.ps1`](https://github.com/baifdz/windows-tests/blob/main/dns_sweep.ps1) (dns_sweep.ps1), [`ADfind.ps1`](https://github.com/baifdz/windows-tests/blob/main/ADfind.ps1) (ADfind.ps1)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery probes"]
  node_dns_sweep["dns_sweep.ps1<br/>DNS probe<br/>[dns_sweep.ps1]"]
  node_adfind["ADfind.ps1<br/>AD probe<br/>[ADfind.ps1]"]
  node_netshares["netshares.ps1<br/>share probe<br/>[netshares.ps1]"]
  node_share_discover["share_discover.ps1<br/>share probe<br/>[share_discover.ps1]"]
  node_share_files["share_file_discovery.ps1<br/>file probe"]
end

subgraph group_guidance["Audit guidance"]
  node_audit["audit.ps1<br/>audit script<br/>[audit.ps1]"]
  node_hardening["hardening.md<br/>guidance notes<br/>[hardening.md]"]
  node_ps_commands["powershell_commands.md<br/>command notes"]
end

subgraph group_modification["System modification"]
  node_registry_cleanup["regerase.ps1<br/>registry action<br/>[regerase.ps1]"]
  node_program_removal["net_program_del.ps1<br/>program removal"]
  node_cleanup["cleanup.md<br/>cleanup notes<br/>[cleanup.md]"]
end

subgraph group_payloads["Security-impact tests"]
  node_impact_scripts["Endpoint test scripts<br/>test payloads"]
  node_forkbomb["forkbomb.md<br/>test notes<br/>[forkbomb.md]"]
end

node_operator(("Windows operator<br/>user"))
node_shells{{"PowerShell and CMD<br/>Windows runtime"}}
node_windows_host["Windows host<br/>system boundary"]
node_network{{"Domain and network<br/>external boundary"}}
node_ps_gallery["PowerShell Gallery<br/>module source"]

node_operator -->|"runs"| node_shells
node_shells -->|"executes"| node_audit
node_shells -->|"executes"| node_dns_sweep
node_shells -->|"executes"| node_adfind
node_shells -->|"executes"| node_netshares
node_shells -->|"executes"| node_share_discover
node_shells -->|"executes"| node_share_files
node_shells -->|"executes"| node_registry_cleanup
node_shells -->|"executes"| node_program_removal
node_shells -->|"executes"| node_impact_scripts
node_hardening -.->|"guides"| node_audit
node_ps_commands -.->|"documents"| node_shells
node_cleanup -.->|"guides"| node_registry_cleanup
node_forkbomb -.->|"documents"| node_impact_scripts
node_audit -->|"assesses"| node_windows_host
node_dns_sweep -->|"queries DNS"| node_network
node_adfind -->|"queries AD"| node_network
node_netshares -->|"enumerates shares"| node_network
node_share_discover -->|"discovers shares"| node_network
node_share_files -->|"enumerates files"| node_network
node_registry_cleanup -->|"modifies registry"| node_windows_host
node_program_removal -->|"removes programs"| node_windows_host
node_impact_scripts -->|"affects endpoint"| node_windows_host
node_shells -.->|"may obtain modules"| node_ps_gallery

click node_audit "https://github.com/baifdz/windows-tests/blob/main/audit.ps1"
click node_hardening "https://github.com/baifdz/windows-tests/blob/main/hardening.md"
click node_ps_commands "https://github.com/baifdz/windows-tests/blob/main/powershell_commands.md"
click node_dns_sweep "https://github.com/baifdz/windows-tests/blob/main/dns_sweep.ps1"
click node_adfind "https://github.com/baifdz/windows-tests/blob/main/ADfind.ps1"
click node_netshares "https://github.com/baifdz/windows-tests/blob/main/netshares.ps1"
click node_share_discover "https://github.com/baifdz/windows-tests/blob/main/share_discover.ps1"
click node_share_files "https://github.com/baifdz/windows-tests/blob/main/share_file_discovery.ps1"
click node_registry_cleanup "https://github.com/baifdz/windows-tests/blob/main/regerase.ps1"
click node_program_removal "https://github.com/baifdz/windows-tests/blob/main/net_program_del.ps1"
click node_cleanup "https://github.com/baifdz/windows-tests/blob/main/cleanup.md"
click node_forkbomb "https://github.com/baifdz/windows-tests/blob/main/forkbomb.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dns_sweep,node_adfind,node_netshares,node_share_discover,node_share_files toneBlue
class node_audit,node_hardening,node_ps_commands toneAmber
class node_registry_cleanup,node_program_removal,node_cleanup toneMint
class node_impact_scripts,node_forkbomb toneRose
class node_operator,node_shells,node_windows_host,node_network,node_ps_gallery toneNeutral
```

## Components

### Discovery probes

Independent operator-selected enumeration scripts.

- [dns_sweep.ps1](https://github.com/baifdz/windows-tests/blob/main/dns_sweep.ps1): DNS probe · `dns_sweep.ps1`
- [ADfind.ps1](https://github.com/baifdz/windows-tests/blob/main/ADfind.ps1): AD probe · `ADfind.ps1`
- [netshares.ps1](https://github.com/baifdz/windows-tests/blob/main/netshares.ps1): share probe · `netshares.ps1`
- [share_discover.ps1](https://github.com/baifdz/windows-tests/blob/main/share_discover.ps1): share probe · `share_discover.ps1`
- [share_file_discovery.ps1](https://github.com/baifdz/windows-tests/blob/main/share_file_discovery.ps1): file probe · `share_file_discovery.ps1`

### Audit guidance

- [audit.ps1](https://github.com/baifdz/windows-tests/blob/main/audit.ps1): audit script · Primary executable audit entry point. · `audit.ps1`
- [hardening.md](https://github.com/baifdz/windows-tests/blob/main/hardening.md): guidance notes · `hardening.md`
- [powershell_commands.md](https://github.com/baifdz/windows-tests/blob/main/powershell_commands.md): command notes · `powershell_commands.md`

### System modification

Privileged actions without rollback or state management.

- [regerase.ps1](https://github.com/baifdz/windows-tests/blob/main/regerase.ps1): registry action · `regerase.ps1`
- [net_program_del.ps1](https://github.com/baifdz/windows-tests/blob/main/net_program_del.ps1): program removal · `net_program_del.ps1`
- [cleanup.md](https://github.com/baifdz/windows-tests/blob/main/cleanup.md): cleanup notes · `cleanup.md`

### Security-impact tests

- **Endpoint test scripts**: test payloads · keylogg.ps1, screenshot.ps1, and syscrash.ps1 are independent direct commands.
- [forkbomb.md](https://github.com/baifdz/windows-tests/blob/main/forkbomb.md): test notes · `forkbomb.md`

### Other components

- **Windows operator**: user · Directly selects and runs scripts.
- **PowerShell and CMD**: Windows runtime
- **Windows host**: system boundary · Local registry, programs, services, and filesystem.
- **Domain and network**: external boundary · DNS, Active Directory, and SMB shares accessible to the host.
- **PowerShell Gallery**: module source · Potential external module acquisition source.

## Connections

- Windows operator → PowerShell and CMD: runs
- PowerShell and CMD → audit.ps1: executes
- PowerShell and CMD → dns_sweep.ps1: executes
- PowerShell and CMD → ADfind.ps1: executes
- PowerShell and CMD → netshares.ps1: executes
- PowerShell and CMD → share_discover.ps1: executes
- PowerShell and CMD → share_file_discovery.ps1: executes
- PowerShell and CMD → regerase.ps1: executes
- PowerShell and CMD → net_program_del.ps1: executes
- PowerShell and CMD → Endpoint test scripts: executes
- hardening.md → audit.ps1: guides
- powershell_commands.md → PowerShell and CMD: documents
- cleanup.md → regerase.ps1: guides
- forkbomb.md → Endpoint test scripts: documents
- audit.ps1 → Windows host: assesses
- dns_sweep.ps1 → Domain and network: queries DNS
- ADfind.ps1 → Domain and network: queries AD
- netshares.ps1 → Domain and network: enumerates shares
- share_discover.ps1 → Domain and network: discovers shares
- share_file_discovery.ps1 → Domain and network: enumerates files
- regerase.ps1 → Windows host: modifies registry
- net_program_del.ps1 → Windows host: removes programs
- Endpoint test scripts → Windows host: affects endpoint
- PowerShell and CMD → PowerShell Gallery: may obtain modules
