Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

[ask] is it possible inserting data with sqli ?

hello guys,
i wanna ask, is it possible inserting data with sqli ?
like adding new user in admin table through sqli.
thanks before.
yes lol, its just a sql query after all :c

“I wish I could say everything in one word. I hate all the things that can happen between the beginning of a sentence and the end.” ~ Leonard Cohen
Yes, you can, just use this query:
INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);
The beauty of SQLi is that in theory you can perform just about every SQL command because your code is being 'injected' into an already-existing query. So as the others said yes you can.
(Mar 19, 2017 07:47 AM)vaiperboy Wrote:  yes lol, its just a sql query after all :c

(Mar 19, 2017 07:49 AM)Web_Development Wrote:  Yes, you can, just use this query:
INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);

(Mar 19, 2017 11:19 AM)Disparity Wrote:  The beauty of SQLi is that in theory you can perform just about every SQL command because your code is being 'injected' into an already-existing query. So as the others said yes you can.

Thanks all.
In short, if permissions are fucked in the file server of the website, you can even create text/php files with an SQL Query, create an upload.php mini file and through that upload a shell or even deface the website by simply overwriting existing index file.


Newbie here, did some research, here's more info:

When you already tried injecting some queries and it worked, try this one out:
pastebin.com/PSTPethW

If this ends up saying root@localhost:YES (or smthmsth@smth:YES), that means CHMOD allows ANYONE to upload/delete/write files to and from the server.

and thaaaat means........ that putting into outfile 'directory/filename.extension' at the end of the query. For ex:
pastebin.com/8m2EegYX
Will create a file in that directory called 'r3cidis.txt' with contents "~ database_name ~" (or what you echoed out/printed out by that query)

Soo that means group_concating('a php script to upload files') into outfile with .php extension will create an upload page from where you could easily upload a shell AND FUCK THE LIVING SHIT OUT OF THAT WORTHLESS WEBSITE THAT STILL IS SQL INJECTABLE IN 2017
(Mar 21, 2017 03:54 AM)R3cidis Wrote:  In short, if permissions are fucked in the file server of the website, you can even create text/php files with an SQL Query, create an upload.php mini file and through that upload a shell or even deface the website by simply overwriting existing index file.


Newbie here, did some research, here's more info:

When you already tried injecting some queries and it worked, try this one out:
pastebin.com/PSTPethW

If this ends up saying root@localhost:YES (or smthmsth@smth:YES), that means CHMOD allows ANYONE to upload/delete/write files to and from the server.

and thaaaat means........ that putting into outfile 'directory/filename.extension' at the end of the query. For ex:
pastebin.com/8m2EegYX
Will create a file in that directory called 'r3cidis.txt' with contents "~ database_name ~" (or what you echoed out/printed out by that query)

Soo that means group_concating('a php script to upload files') into outfile with .php extension will create an upload page from where you could easily upload a shell AND FUCK THE LIVING SHIT OUT OF THAT WORTHLESS WEBSITE THAT STILL IS SQL INJECTABLE IN 2017

thanks for explain 👍
You can't insert data by injecting a select query... You need stacked queries for that.

Only some databases (MSSQL, PostgreSQL) allow stacked queries. MySQL/PHP, Oracle... don't support them.
Janus - SQLi challenges for advanced injectors


Possibly Related Threads...
Thread / Author Replies Views Last Post
by aviertismentApr 29, 2023 06:05 PM 0 183 Apr 29, 2023 06:05 PM
Last Post: aviertisment
by faxxgridApr 17, 2020 12:51 PM 1 117 Apr 17, 2020 12:51 PM
Last Post: aneWra
by 13uNkNoWnMay 3, 2017 04:30 PM 0 121 May 3, 2017 04:30 PM
Last Post: 13uNkNoWn