1
+ FROM windowsservercore
2
+ MAINTAINER xied75@gmail.com
3
+
4
+ RUN powershell -Command \
5
+ Invoke-WebRequest https://coderobin.blob.core.windows.net/public/fakenet/x64/FakeNet.exe -OutFile $env:temp\f akenet64.exe; \
6
+ Invoke-WebRequest https://coderobin.blob.core.windows.net/public/fakenet/x86/FakeNet.exe -OutFile $env:temp\f akenet.exe; \
7
+ Copy C:\W indows\S ystem32\n et.exe C:\W indows\S ystem32\n et.exe.bak; \
8
+ Copy C:\W indows\S ysWOW64\n et.exe C:\W indows\S ysWOW64\n et.exe.bak; \
9
+ $acl1 = Get-Acl C:\W indows\S ystem32\n et.exe; \
10
+ $acl11 = Get-Acl C:\W indows\S ystem32\n et.exe; \
11
+ $acl2 = Get-Acl C:\W indows\S ysWOW64\n et.exe; \
12
+ $acl21 = Get-Acl C:\W indows\S ysWOW64\n et.exe; \
13
+ $permission = 'BUILTIN\A dministrators' ,'FullControl' ,'Allow' ; \
14
+ $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission; \
15
+ $acl11.SetAccessRule($accessRule); \
16
+ Set-Acl C:\W indows\S ystem32\n et.exe -AclObject $acl11; \
17
+ $acl21.SetAccessRule($accessRule); \
18
+ Set-Acl C:\W indows\S ysWOW64\n et.exe -AclObject $acl21; \
19
+ Copy $env:temp\f akenet64.exe C:\W indows\S ystem32\n et.exe; \
20
+ Copy $env:temp\f akenet.exe C:\W indows\S ysWOW64\n et.exe; \
21
+ Install-PackageProvider -Name Chocolatey -Force; \
22
+ Install-Package -Name windows-sdk-10.1 -ProviderName Chocolatey -Force; \
23
+ Remove-Item C:\W indows\S ystem32\n et.exe; \
24
+ Remove-Item C:\W indows\S ysWOW64\n et.exe; \
25
+ Rename-Item C:\W indows\S ystem32\n et.exe.bak C:\W indows\S ystem32\n et.exe; \
26
+ Rename-Item C:\W indows\S ysWOW64\n et.exe.bak C:\W indows\S ysWOW64\n et.exe; \
27
+ Set-Acl C:\W indows\S ystem32\n et.exe -AclObject $acl1; \
28
+ Set-Acl C:\W indows\S ysWOW64\n et.exe -AclObject $acl2;
29
+
30
+
31
+ CMD ["powershell" ]
0 commit comments