Skip to content

Commit a30b3d1

Browse files
authored
Merge pull request #1262 from splunk/fix_issue_rdp
fix rdp issue when bad blood is installed
2 parents e687ffa + 04997e6 commit a30b3d1

1 file changed

Lines changed: 76 additions & 1 deletion

File tree

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,79 @@
11
---
22

33
- name: Run BadBlood
4-
win_shell: C:\BadBlood\Invoke-BadBlood.ps1 -NonInteractive
4+
win_shell: C:\BadBlood\Invoke-BadBlood.ps1 -NonInteractive
5+
6+
- name: Add Administrator to Remote Desktop Users group
7+
win_group_membership:
8+
name: "Remote Desktop Users"
9+
members:
10+
- Administrator
11+
state: present
12+
ignore_errors: yes
13+
14+
- name: Add Administrator to Administrators group
15+
win_group_membership:
16+
name: "Administrators"
17+
members:
18+
- Administrator
19+
state: present
20+
ignore_errors: yes
21+
22+
- name: Check if domain controller exists
23+
win_shell: |
24+
try {
25+
Get-ADDomain -ErrorAction Stop
26+
Write-Output "domain"
27+
} catch {
28+
Write-Output "workgroup"
29+
}
30+
register: domain_status
31+
ignore_errors: yes
32+
33+
- name: Add Administrator to Domain Admins group
34+
win_shell: Add-ADGroupMember -Identity "Domain Admins" -Members Administrator -ErrorAction SilentlyContinue
35+
when: domain_status.stdout_lines[0] == "domain"
36+
ignore_errors: yes
37+
38+
- name: Add Administrator to Enterprise Admins group
39+
win_shell: Add-ADGroupMember -Identity "Enterprise Admins" -Members Administrator -ErrorAction SilentlyContinue
40+
when: domain_status.stdout_lines[0] == "domain"
41+
ignore_errors: yes
42+
43+
- name: Add Administrator to Schema Admins group
44+
win_shell: Add-ADGroupMember -Identity "Schema Admins" -Members Administrator -ErrorAction SilentlyContinue
45+
when: domain_status.stdout_lines[0] == "domain"
46+
ignore_errors: yes
47+
48+
- name: Enable RDP (Terminal Services)
49+
win_regedit:
50+
path: HKLM:\System\CurrentControlSet\Control\Terminal Server
51+
name: fDenyTSConnections
52+
data: 0
53+
type: dword
54+
ignore_errors: yes
55+
56+
- name: Enable RDP through Windows Firewall
57+
win_firewall_rule:
58+
name: "Remote Desktop - User Mode (TCP-In)"
59+
enabled: yes
60+
state: present
61+
action: allow
62+
ignore_errors: yes
63+
64+
- name: Enable RDP through Windows Firewall (Shadow)
65+
win_firewall_rule:
66+
name: "Remote Desktop - Shadow (TCP-In)"
67+
enabled: yes
68+
state: present
69+
action: allow
70+
ignore_errors: yes
71+
72+
- name: Grant Administrator "Log on through Remote Desktop Services" right
73+
win_user_right:
74+
name: SeRemoteInteractiveLogonRight
75+
users:
76+
- Administrator
77+
action: add
78+
ignore_errors: yes
79+

0 commit comments

Comments
 (0)