LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-29-2012, 11:10 AM   #1
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Rep: Reputation: 32
how can i find the url for my mysql server


I am doing some work with SQL injection and in order for it to work you need the "url" for the database, how can i find the url for the database or is the url the same across the board? If it is similar across the what does it look like.
 
Old 06-29-2012, 12:39 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Unless they are exposed to the public (or LAN), which from a security standpoint is a poor idea, the database does not have a URL in the same manner that a web page does (e.g. http://somesite.com/webstuff/index.html). Typically, and in order to be useful, the database will accept "connections". These connections can be on a TCP port, such as MySQL which listens on port 3306, or it can be a UNIX inter-process communication port. Now, if the server has exposed its listening SQL port, you would be able to access it via the address or domain name. The dynamic web language being used, such as PHP, will have functions that allow it to connect to the database and pass information to the database in the query and receive the result set from the database, again as an example, the PDO library from PHP.

SQL Injection tries to create user input that when passed to the database changes the statements that are sent to the database to create a query different from the one the user intended. This recent LQ thread demonstrates an example of this: http://www.linuxquestions.org/questi...on-4175412976/

As you can see in the example, the SQL injection adds an apostrophe (') to short circuit the intended statement and convert into one that returns the list of user names and passwords. It does not require the URL of the database.

If this explanation doesn't help or address your question, would you please try to elaborate on what you are trying to do, perhaps with an example?
 
Old 06-29-2012, 12:42 PM   #3
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Well, I don't really understand your question, perhaps you can explain a bit more in order to get help.

What I understand is that you want to make a MySQL connection to a database ?
Or do you want to connect to database on a remote server (near bottom)

Mysql connecting to database

Out there is really a lot of examples, but if you don't know what you're looking for, you have less chance to find it.

Ed.: Noway2 was faster !


Last edited by lithos; 06-29-2012 at 12:44 PM. Reason: Noway2 was faster !
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Find URL in Debian package index via awk/sed (=find a line, then search from there) maddes.b Linux - Software 11 06-28-2013 07:37 AM
[SOLVED] How to find URL for xampp website on my server anon091 Linux - Newbie 2 03-02-2010 09:01 AM
Update part of a URL to another URL in MySQL guest Linux - Software 2 02-15-2009 09:02 PM
JDBC mysql url parameter for tomcat's server.xml gschrade Linux - Software 1 03-01-2004 05:07 PM
JDBC mysql url parameter for tomcat's server.xml gschrade Linux - Software 4 02-29-2004 12:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration