This repository was archived by the owner on Apr 16, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathnotes.txt
More file actions
59 lines (38 loc) · 2.29 KB
/
Copy pathnotes.txt
File metadata and controls
59 lines (38 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
$Targets = 'Win7','Win2k8R2','win7-32-1'
$cred = Get-Credential infocyte
Set-Item WSMan:\localhost\Client\TrustedHosts –Value "Ip address"
Set-Item WSMan:\localhost\Client\TrustedHosts –Value *
# -------------------------------------------------------------
# Testing
# schtasks /create /ru system /tn dcc_task /tr "powershell -executionpolicy bypass C:\windows\temp\Survey.ps1" /sc once /st 23:59 /F
# schtasks /run /tn pshunttask
# Schtasks /create /tn "pshunttask" /sc daily /st 08:00 /tr "PowerShell -command {Get-childitem -path c:\users\username\desktop | out-file C:\yay.txt}"
# $Targets = 'Win7','Win2k8R2','win7-32-1'
# $Script = "C:\Windows\Temp\test.ps1"
# $TaskToRun = "cmd.exe /c PowerShell.exe -Exec ByPass -NonInteractive -File $Script"
# $cred = Get-Credential infocyte
# $Targets | % { Invoke-PSExec -ComputerName $_ -Credential $cred -Command $TaskToRun -Verbose }
# $Targets | % { Start-RemoteProcess -ComputerName $_ -PSScript $task -Credential $cred -ExecutionType PSexec -Debug
# $TaskToRun = 'C:\Users\Chris\Documents\GitHub\PSHunt\Surveys\test.ps1'
# $Targets | % { Invoke-HuntSurvey -ComputerName $_ -Credential $cred -ScriptPath $TaskToRun -Verbose }
# $Targets = 'Win7','Win2k8R2','win7-32-1'
# $Script = "C:\Windows\Temp\test.ps1"
# $TaskToRun = "Powershell.exe -ExecutionPolicy bypass -NoProfile -NonInteractive -File $Script"
# $TaskToRun = "cmd.exe /c PowerShell.exe -Exec ByPass -NonInteractive -File $Script"
# $cred = Get-Credential infocyte
# $Targets | % { Invoke-PsExec -ComputerName $_ -Credential $cred -Command $TaskToRun -Verbose }
### Setup DHCP Server:
$DNSServerIP="192.168.8.5"
$DHCPServerIP="192.168.8.5"
$StartRange="192.168.8.110"
$EndRange="192.168.8.150"
$Subnet="255.255.255.0"
$Router="192.168.8.1"
Install-WindowsFeature -Name 'DHCP' –IncludeManagementTools
cmd.exe /c "netsh dhcp add securitygroups"
Restart-service dhcpserver
Add-DhcpServerInDC -DnsName $Env:COMPUTERNAME
Set-ItemProperty –Path registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\Roles\12 –Name ConfigurationState –Value 2
Add-DhcpServerV4Scope -Name "DHCP Scope" -StartRange $StartRange -EndRange $EndRange -SubnetMask $Subnet
Set-DhcpServerV4OptionValue -DnsDomain $DNSDomain -DnsServer $DNSServerIP -Router $Router
Set-DhcpServerv4Scope -ScopeId $DHCPServerIP -LeaseDuration 1.00:00:00