-
Notifications
You must be signed in to change notification settings - Fork 341
C#插件EXE源码 批量Base64
k8gege edited this page Sep 24, 2019
·
7 revisions
前言
今天抽空更新了Cscan,新增对C#编译的EXE动态调用,新增对PowerShell脚本动态调用(无论是否安装PowerShell)
增加一个字符串列表str.txt,用于存放任意字符串,比如帐号密码、路径、后台字典等等,关键看你编写的插件功能。
本文以Base64和Hex加解密为例,演示4.0版本对C# EXE的调用以及对PowerShell的调用,让大家更好的定制功能
C#编译的exe插件名称为netscan.exe,加载优先级次于netscan.dll,PowerShell插件名称为psscan.ps1,优先级次于exe
示例二、C#编译的EXE插件
0x003 C# EXE插件之Base64加密
代码
namespace netscan { class Program { public static void Main(string[] args) { if (args.Length < 0) Console.WriteLine("args is null"); else //Console.WriteLine("ExeDemo "+args[0]); { string str=args[0]; Console.WriteLine(str+"\t"+Base64_encode(str)); }} private static string Base64_encode(string str) { byte[] bytes = Encoding.UTF8.GetBytes(str); string Base64_encode = Convert.ToBase64String(bytes); return Base64_encode; //return Convert.ToBase64String(System.Text.Encoding.Default.GetBytes("K8拉登哥哥")); } }
}
结果
0x004 C# EXE插件之Base64解密
代码
namespace netscan { class Program { public static void Main(string[] args) { if (args.Length < 0) Console.WriteLine("args is null"); else //Console.WriteLine("ExeDemo "+args[0]); { string str=args[0]; //Console.WriteLine(str+"\t"+Base64_encode(str)); Console.WriteLine(str + "\t" + Base64_decode(str));} } private static string Base64_encode(string str) { byte[] bytes = Encoding.UTF8.GetBytes(str); string Base64_encode = Convert.ToBase64String(bytes); return Base64_encode; //return Convert.ToBase64String(System.Text.Encoding.Default.GetBytes("K8哥哥")); } private static string Base64_decode(string str) { try { byte[] bytes = Convert.FromBase64String(str); return System.Text.Encoding.UTF8.GetString(bytes); } catch { return "Base64 Decode Fail"; } } }
结果
Cscan5.0已集成