/// <summary> /// Main routine for testing and connecting to a proxy /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void buttonConnect_Click(object sender, EventArgs e) { buttonConnect.Enabled = false; if (!string.IsNullOrEmpty(txtBoxProxyUrl.Text)) { if (int.TryParse(txtBoxProxyPort.Text, out int port)) { if (comboBoxProxyType.Text == "http") { WebRequestHelper.AddHttpProxy(txtBoxProxyUrl.Text, txtBoxProxyPort.Text); } else if (comboBoxProxyType.Text == "socks") { WebRequestHelper.AddSocksProxy(txtBoxProxyUrl.Text, port); } try { var task = WebRequestHelper.GetRequest("http://ipv4.icanhazip.com/"); if (await Task.WhenAny(task, Task.Delay(Config.TimeoutMS)) == task) { if (string.IsNullOrEmpty(task.Result)) { MessageBox.Show("Unable to connect to proxy try again...", "Connection Failed"); WebRequestHelper.ResetHttpClient(); } else { MessageBox.Show("Your IP Is : " + task.Result, "Connection Success"); buttonConnect.Enabled = true; buttonResetProxy.Enabled = true; this.Close(); } } else { MessageBox.Show("Unable to connect to proxy try again..."); WebRequestHelper.ResetHttpClient(); buttonResetProxy.Enabled = false; } } catch (Exception) { MessageBox.Show("Unable to connect to proxy try again..."); WebRequestHelper.ResetHttpClient(); buttonResetProxy.Enabled = false; } } } buttonConnect.Enabled = true; }
/// <summary> /// Gets your IPv4 address for you /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void buttonGetIpv4_Click(object sender, EventArgs e) { var task = WebRequestHelper.GetRequest("http://ipv4bot.whatismyipaddress.com/"); if (await Task.WhenAny(task, Task.Delay(Config.TimeoutMS)) == task) { if (string.IsNullOrEmpty(task.Result)) { MessageBox.Show("Unable to get IP Address", "Connection Failed"); } else { textBoxIP.Text = task.Result; } } }
private async void linuxPrivCheckerpyToolStripMenuItem_Click(object sender, EventArgs e) { richTextBox1.Text = await WebRequestHelper.GetRequest("https://www.securitysift.com/download/linuxprivchecker.py"); }
//todo store this URL elsewhere? private async void linEnumToolStripMenuItem_Click(object sender, EventArgs e) { richTextBox1.Text = await WebRequestHelper.GetRequest("https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh"); }