Skip to content

Commit b39bfd1

Browse files
committed
添加一些clr实现的基本命令
``` clr_pwd - print current directory by clr clr_ls {directory} - list files by clr clr_cd {directory} - change directory by clr clr_ps - list process by clr clr_netstat - netstat by clr clr_ping {host} - ping by clr clr_cat {file} - view file contents by clr clr_rm {file} - delete file by clr ```
1 parent dee285a commit b39bfd1

3 files changed

Lines changed: 115 additions & 9 deletions

File tree

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66

77
### 更新日志
88

9+
- 2021-08-04
10+
- 添加一些clr实现的基本命令:pwd,ls,netstat,ps等等
11+
- 致谢[KevinJClark@csharptoolbox](https://gitlab.com/KevinJClark/csharptoolbox/-/tree/master/WindowsBinaryReplacements) & [rabbittb](https://github.com/rabbittb)
12+
913
- 2021-08-03
1014
- 添加clr_potato
11-
致谢[zcgonvh@EfsPotato](https://github.com/zcgonvh/EfsPotato) & [hl0rey](https://github.com/hl0rey)
15+
- 致谢[zcgonvh@EfsPotato](https://github.com/zcgonvh/EfsPotato) & [hl0rey](https://github.com/hl0rey)
1216

1317
- 2021-07-10
1418
- 修复上传bug
@@ -60,6 +64,14 @@ enable_clr - you know what it means
6064
disable_clr - you know what it means
6165
install_clr - create assembly and procedure
6266
uninstall_clr - drop clr
67+
clr_pwd - print current directory by clr
68+
clr_ls {directory} - list files by clr
69+
clr_cd {directory} - change directory by clr
70+
clr_ps - list process by clr
71+
clr_netstat - netstat by clr
72+
clr_ping {host} - ping by clr
73+
clr_cat {file} - view file contents by clr
74+
clr_rm {file} - delete file by clr
6375
clr_exec {cmd} - for example: clr_exec whoami;clr_exec -p c:\a.exe;clr_exec -p c:\cmd.exe -a /c whoami
6476
clr_potato {cmd} - exec by EfsPotato like clr_exec
6577
clr_combine {remotefile} - When the upload module cannot call CMD to perform copy to merge files
@@ -341,4 +353,6 @@ https://github.com/GhostPack/SharpDump
341353

342354
https://gist.github.com/jfmaes/944991c40fb34625cf72fd33df1682c0
343355

344-
https://github.com/zcgonvh/EfsPotato
356+
https://github.com/zcgonvh/EfsPotato
357+
358+
https://gitlab.com/KevinJClark/csharptoolbox

SharpSQLTools/Program.cs

Lines changed: 98 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ private static void Help()
3030
disable_clr - you know what it means
3131
install_clr - create assembly and procedure
3232
uninstall_clr - drop clr
33+
clr_pwd - print current directory by clr
34+
clr_ls {directory} - list files by clr
35+
clr_cd {directory} - change directory by clr
36+
clr_ps - list process by clr
37+
clr_netstat - netstat by clr
38+
clr_ping {host} - ping by clr
39+
clr_cat {file} - view file contents by clr
40+
clr_rm {file} - delete file by clr
3341
clr_exec {cmd} - for example: clr_exec whoami;clr_exec -p c:\a.exe;clr_exec -p c:\cmd.exe -a /c whoami
3442
clr_potato {cmd} - exec by EfsPotato like clr_exec
3543
clr_combine {remotefile} - When the upload module cannot call CMD to perform copy to merge files
@@ -376,14 +384,56 @@ static void interactive(string[] args)
376384
clr_exec(s);
377385
break;
378386
}
379-
// clr_exec("clr_dumplsass");
380-
// break;
387+
case "clr_ls":
388+
{
389+
String s = String.Empty;
390+
for (int i = 0; i < cmdline.Length; i++) { s += cmdline[i] + " "; }
391+
clr_exec(s);
392+
break;
393+
}
394+
case "clr_cat":
395+
{
396+
String s = String.Empty;
397+
for (int i = 0; i < cmdline.Length; i++) { s += cmdline[i] + " "; }
398+
clr_exec(s);
399+
break;
400+
}
401+
case "clr_cd":
402+
{
403+
String s = String.Empty;
404+
for (int i = 0; i < cmdline.Length; i++) { s += cmdline[i] + " "; }
405+
clr_exec(s);
406+
break;
407+
}
408+
case "clr_rm":
409+
{
410+
String s = String.Empty;
411+
for (int i = 0; i < cmdline.Length; i++) { s += cmdline[i] + " "; }
412+
clr_exec(s);
413+
break;
414+
}
415+
case "clr_ping":
416+
{
417+
String s = String.Empty;
418+
for (int i = 0; i < cmdline.Length; i++) { s += cmdline[i] + " "; }
419+
clr_exec(s);
420+
break;
421+
}
422+
case "clr_netstat":
423+
clr_exec("clr_netstat");
424+
break;
381425
case "clr_rdp":
382426
clr_exec("clr_rdp");
383427
break;
384428
case "clr_getav":
385429
clr_exec("clr_getav");
386430
break;
431+
case "clr_ps":
432+
clr_exec("clr_ps");
433+
break;
434+
case "clr_pwd":
435+
clr_exec("clr_pwd");
436+
break;
387437
case "clr_adduser":
388438
{
389439
String s = String.Empty;
@@ -567,8 +617,50 @@ static void Noninteractive(string[] args)
567617
clr_exec(s);
568618
break;
569619
}
570-
//clr_exec("clr_dumplsass");
571-
//break;
620+
case "clr_ping":
621+
{
622+
String s = String.Empty;
623+
for (int i = 4; i < args.Length; i++) { s += args[i] + " "; }
624+
clr_exec(s);
625+
break;
626+
}
627+
case "clr_cat":
628+
{
629+
String s = String.Empty;
630+
for (int i = 4; i < args.Length; i++) { s += args[i] + " "; }
631+
clr_exec(s);
632+
break;
633+
}
634+
case "clr_ls":
635+
{
636+
String s = String.Empty;
637+
for (int i = 4; i < args.Length; i++) { s += args[i] + " "; }
638+
clr_exec(s);
639+
break;
640+
}
641+
case "clr_cd":
642+
{
643+
String s = String.Empty;
644+
for (int i = 4; i < args.Length; i++) { s += args[i] + " "; }
645+
clr_exec(s);
646+
break;
647+
}
648+
case "clr_rm":
649+
{
650+
String s = String.Empty;
651+
for (int i = 4; i < args.Length; i++) { s += args[i] + " "; }
652+
clr_exec(s);
653+
break;
654+
}
655+
case "clr_pwd":
656+
clr_exec("clr_pwd");
657+
break;
658+
case "clr_netstat":
659+
clr_exec("clr_netstat");
660+
break;
661+
case "clr_ps":
662+
clr_exec("clr_ps");
663+
break;
572664
case "clr_rdp":
573665
clr_exec("clr_rdp");
574666
break;
@@ -677,8 +769,8 @@ static void Main(string[] args)
677769
logo();
678770
Console.WriteLine("Usage:");
679771
Console.WriteLine(@"
680-
SharpSQLTools target username password database - interactive console
681-
SharpSQLTools target username password database module command - non-interactive console");
772+
SharpSQLTools target:port username password database - interactive console
773+
SharpSQLTools target:port username password database module command - non-interactive console");
682774
Console.WriteLine("\nModule:");
683775
Help();
684776
return;

SharpSQLTools/Setting.cs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)