Questions about Syntax

SQLi 2

ayylmao [anniesboobs]
8 years ago

0

When you see something like, Username=‘"

Should the quote marks after the = sign be a single quote ( ‘ ) followed by a double quote ( “ ) ?
How are quotes supposed to be handled within the syntax? ’ ” , “ ‘, ” ’ “, ‘ ” ’, or does it not even matter?

6replies
3voices
222views
? [bolofecal]
8 years ago | edited 8 years ago

1

wrong sysntax:

Username='"

If you want a empty value use this

user=''

or

user=""

to escape use [s]bar[/s] backslash before the quote

string='I\'m Batman'

or

string="He say \"I'm not anti-social; I'm just not user friendly\""

ayylmao [anniesboobs]
8 years ago

0

right on, thank you for clearing that up

? [bolofecal]
8 years ago

0

You’re welcome.

dloser
8 years ago

2

In almost all languages (if not all), the quotes have to be the same. What is allowed in between does vary, so it is usually best to look things up yourself. For example, http://dev.mysql.com/doc/refman/5.7/en/string-literals.html or https://www.sqlite.org/lang_expr.html (although the latter seems to be incomplete; “ is also allowed).

The only reason why you should encounter both quotes like you showed is when Username=‘ is part of a string itself. For example:
$inject_str = "' or Username='"; inject_sql($db,$inject_str);

@bolofecal**: “\” is not a “bar” but a backslash; “|” is called a (vertical) bar (or pipe). Also, the backslash escape is not allowed everywhere, including this challenge. Instead, one can use a double single/double quote (e.g.: ‘a’‘b’ or “a”“b”).

ayylmao [anniesboobs]
8 years ago

0

dloser,

thanks for the post! that definitely makes it clear to me how the quotations are handled!

? [bolofecal]
8 years ago

0

Thanks @dloser for correction, sorry about my bad english.

In my country this is bar /
this is inverted bar \

You must be logged in to reply to this discussion. Login
1 of 7

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss