windows.base_objects
This Model Component provides some base objects that are often needed for Windows Model Components.
Notably, this provides PowershellScheduleEntry which helps run PowerShell scripts on a VM.
The following VM resources are provided with this model component:
add_remote_desktop_user.bat - Adds a user to the Remote Desktop Users group.
autologon.ps1 - Configures autologon for a specified user.
change_password.ps1 - Changes the password for a specified user.
check_email.ps1 - Checks email using the EWS Managed API.
cleanup.ps1 - Cleans up files in the
C:\\launchdirectory (which are put there by FIREWHEEL).configure_ips.ps1 - Configures IP addresses on the Windows host.
create_smb_share.ps1 - Creates an SMB share on the Windows host.
disable_smbv1.ps1 - Disables SMBv1 on the Windows host.
enable_file_sharing.ps1 - Enables file sharing on the Windows host.
enable_rdp.ps1 - Enables Remote Desktop Protocol (RDP) on the Windows host.
grant_smb_access.ps1 - Grants access to an SMB share on the Windows host.
manage_network_share.ps1 - Manages a network share on the Windows host.
rearm_windows.ps1 - Rearms the Windows activation.
remove_autologon.ps1 - Removes autologon configuration from the Windows host.
run_smb_gen.ps1 - Registers and modifies a scheduled task to generate SMB traffic.
run_task.ps1 - Starts a scheduled task.
set_hostname.ps1 - Sets the hostname of the Windows host.
smb_traffic_gen.ps1 - Generates SMB traffic on the Windows host.
wget.ps1 - Downloads a file using wget on the Windows host.
- Model Component Dependencies:
Available Objects
- class windows.base_objects.PowershellScheduleEntry(start_time, powershell_script, arguments=None, batch=False)[source]
Bases:
ScheduleEntryThis class creates a Powershell Schedule Entry. This helps run Powershell scripts on various versions of Windows.
- __annotate_func__ = None
- __annotations_cache__ = {}
- __firstlineno__ = 381
- __init__(start_time, powershell_script, arguments=None, batch=False)[source]
Initialization for a PowershellScheduleEntry.
- Parameters:
start_time (int) – The time at which to run the script.
powershell_script (str) – The name of the PowerShell script to run.
arguments (str or list, optional) – Any arguments to provide to the script. Default is
None.batch (bool) – Whether or not the default shell is batch and needs to be wrapped to run as PowerShell. Default is
False.
- Raises:
TypeError – If the arguments are not a string nor a list.
- __static_attributes__ = ()
- class windows.base_objects.WindowsHost(*args, **kwargs)[source]
Bases:
objectThis class provides functionality that is common to most Windows hosts, regardless of the version.
- __annotate_func__ = None
- __annotations_cache__ = {}
- __firstlineno__ = 8
- __init__(*args, **kwargs)
- __static_attributes__ = ('name', 'type', 'windows_domain')
- add_remote_desktop_user(start_time, username)[source]
Adds a user to the Remote Desktop Users group on the Windows host.
- add_sysinternals(start_time)[source]
Adds Sysinternals tools to the Windows host.
- Parameters:
start_time (int) – The time at which to run the script.
- autologon(start_time, username, password, domain=None)[source]
Configures autologon for the Windows host.
- change_password(start_time, username, password)[source]
Changes the password for a user on the Windows host.
- check_email(username, password, domain, mailbox, smtp, click_rate, trusted_sender)[source]
Checks email using the Exchange Web Service (EWS) Managed API.
- Parameters:
username (str) – The username for email access.
password (str) – The password for email access.
domain (str) – The domain for email access.
mailbox (str) – The mailbox to check.
smtp (str) – The SMTP server address.
click_rate (int) – The click rate for email checking.
trusted_sender (str) – The trusted sender address.
- cleanup(start_time=1)[source]
Cleans up the Windows host.
- Parameters:
start_time (int) – The time at which to run the script. Default is 1.
Creates a Server Message Block (SMB) share on the Windows host.
- Parameters:
start_time (int) – The time at which to run the script.
name (str) – The name of the SMB share.
path (str) – The path of the SMB share.
caching_mode (str) – The caching mode for the SMB share.
folder_enumeration_mode (str) – The folder enumeration mode for the SMB share.
full_access (str) – The full access permissions for the SMB share.
- disable_smbv1(start_time=-99)[source]
Disables SMBv1 on the Windows host.
- Parameters:
start_time (int) – The time at which to run the script. Default is -99.
- enable_file_sharing(start_time=-10)[source]
Enables file sharing on the Windows host.
- Parameters:
start_time (int) – The time at which to run the script. Default is -10.
- enable_rdp(start_time)[source]
Enables Remote Desktop Protocol (RDP) on the Windows host.
- Parameters:
start_time (int) – The time at which to run the script.
- grant_smb_access(start_time, name, account)[source]
Grants access to an SMB share on the Windows host.
Manages a network share on the Windows host.
- rearm_windows(start_time=-1000)[source]
Rearms the Windows activation.
- Parameters:
start_time (int) – The time at which to run the script. Default is -1000.
- remove_autologon(start_time)[source]
Removes autologon configuration from the Windows host.
- Parameters:
start_time (int) – The time at which to run the script.
- run_powershell(start_time, script_name, arguments=None)[source]
Creates a
PowershellScheduleEntry.- Parameters:
- Returns:
The created PowerShell schedule entry.
- Return type:
- set_hostname(start_time=-250)[source]
Sets the hostname of the Windows host.
- Parameters:
start_time (int) – The time at which to run the script. Default is -250.
- smb_traffic_gen(start_time, share, username, password)[source]
Generates SMB traffic on the Windows host.