Skip to content

Commit

Permalink
添加一些clr实现的基本命令
Browse files Browse the repository at this point in the history
```
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
```
  • Loading branch information
uknowsec committed Aug 4, 2021
1 parent dee285a commit b39bfd1
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 9 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@

### 更新日志

- 2021-08-04
- 添加一些clr实现的基本命令:pwd,ls,netstat,ps等等
- 致谢[KevinJClark@csharptoolbox](https://gitlab.com/KevinJClark/csharptoolbox/-/tree/master/WindowsBinaryReplacements) & [rabbittb](https://github.com/rabbittb)

- 2021-08-03
- 添加clr_potato
致谢[zcgonvh@EfsPotato](https://github.com/zcgonvh/EfsPotato) & [hl0rey](https://github.com/hl0rey)
- 致谢[zcgonvh@EfsPotato](https://github.com/zcgonvh/EfsPotato) & [hl0rey](https://github.com/hl0rey)

- 2021-07-10
- 修复上传bug
Expand Down Expand Up @@ -60,6 +64,14 @@ enable_clr - you know what it means
disable_clr - you know what it means
install_clr - create assembly and procedure
uninstall_clr - drop 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
clr_exec {cmd} - for example: clr_exec whoami;clr_exec -p c:\a.exe;clr_exec -p c:\cmd.exe -a /c whoami
clr_potato {cmd} - exec by EfsPotato like clr_exec
clr_combine {remotefile} - When the upload module cannot call CMD to perform copy to merge files
Expand Down Expand Up @@ -341,4 +353,6 @@ https://github.com/GhostPack/SharpDump

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

https://github.com/zcgonvh/EfsPotato
https://github.com/zcgonvh/EfsPotato

https://gitlab.com/KevinJClark/csharptoolbox
104 changes: 98 additions & 6 deletions SharpSQLTools/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ private static void Help()
disable_clr - you know what it means
install_clr - create assembly and procedure
uninstall_clr - drop 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
clr_exec {cmd} - for example: clr_exec whoami;clr_exec -p c:\a.exe;clr_exec -p c:\cmd.exe -a /c whoami
clr_potato {cmd} - exec by EfsPotato like clr_exec
clr_combine {remotefile} - When the upload module cannot call CMD to perform copy to merge files
Expand Down Expand Up @@ -376,14 +384,56 @@ static void interactive(string[] args)
clr_exec(s);
break;
}
// clr_exec("clr_dumplsass");
// break;
case "clr_ls":
{
String s = String.Empty;
for (int i = 0; i < cmdline.Length; i++) { s += cmdline[i] + " "; }
clr_exec(s);
break;
}
case "clr_cat":
{
String s = String.Empty;
for (int i = 0; i < cmdline.Length; i++) { s += cmdline[i] + " "; }
clr_exec(s);
break;
}
case "clr_cd":
{
String s = String.Empty;
for (int i = 0; i < cmdline.Length; i++) { s += cmdline[i] + " "; }
clr_exec(s);
break;
}
case "clr_rm":
{
String s = String.Empty;
for (int i = 0; i < cmdline.Length; i++) { s += cmdline[i] + " "; }
clr_exec(s);
break;
}
case "clr_ping":
{
String s = String.Empty;
for (int i = 0; i < cmdline.Length; i++) { s += cmdline[i] + " "; }
clr_exec(s);
break;
}
case "clr_netstat":
clr_exec("clr_netstat");
break;
case "clr_rdp":
clr_exec("clr_rdp");
break;
case "clr_getav":
clr_exec("clr_getav");
break;
case "clr_ps":
clr_exec("clr_ps");
break;
case "clr_pwd":
clr_exec("clr_pwd");
break;
case "clr_adduser":
{
String s = String.Empty;
Expand Down Expand Up @@ -567,8 +617,50 @@ static void Noninteractive(string[] args)
clr_exec(s);
break;
}
//clr_exec("clr_dumplsass");
//break;
case "clr_ping":
{
String s = String.Empty;
for (int i = 4; i < args.Length; i++) { s += args[i] + " "; }
clr_exec(s);
break;
}
case "clr_cat":
{
String s = String.Empty;
for (int i = 4; i < args.Length; i++) { s += args[i] + " "; }
clr_exec(s);
break;
}
case "clr_ls":
{
String s = String.Empty;
for (int i = 4; i < args.Length; i++) { s += args[i] + " "; }
clr_exec(s);
break;
}
case "clr_cd":
{
String s = String.Empty;
for (int i = 4; i < args.Length; i++) { s += args[i] + " "; }
clr_exec(s);
break;
}
case "clr_rm":
{
String s = String.Empty;
for (int i = 4; i < args.Length; i++) { s += args[i] + " "; }
clr_exec(s);
break;
}
case "clr_pwd":
clr_exec("clr_pwd");
break;
case "clr_netstat":
clr_exec("clr_netstat");
break;
case "clr_ps":
clr_exec("clr_ps");
break;
case "clr_rdp":
clr_exec("clr_rdp");
break;
Expand Down Expand Up @@ -677,8 +769,8 @@ static void Main(string[] args)
logo();
Console.WriteLine("Usage:");
Console.WriteLine(@"
SharpSQLTools target username password database - interactive console
SharpSQLTools target username password database module command - non-interactive console");
SharpSQLTools target:port username password database - interactive console
SharpSQLTools target:port username password database module command - non-interactive console");
Console.WriteLine("\nModule:");
Help();
return;
Expand Down
2 changes: 1 addition & 1 deletion SharpSQLTools/Setting.cs

Large diffs are not rendered by default.

0 comments on commit b39bfd1

Please sign in to comment.