Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

choroba is correct.

Though if this were some sort of riddle, I'd respond with this:

cat << EOF | sh
> echo 'visit:$site'
> EOF

As jander points out this is wide open for an injection attack. It wasn't a serious answer, so if anyone was considering using something like this, don't use it with untrusted input. For example, validate the $site string as being a valid URL before blindly executing the content. Something like thisthis could help (but the expression provided isn't perfect because it still allows injection, but use that sort of mechanic to test it).

choroba is correct.

Though if this were some sort of riddle, I'd respond with this:

cat << EOF | sh
> echo 'visit:$site'
> EOF

As jander points out this is wide open for an injection attack. It wasn't a serious answer, so if anyone was considering using something like this, don't use it with untrusted input. For example, validate the $site string as being a valid URL before blindly executing the content. Something like this could help (but the expression provided isn't perfect because it still allows injection, but use that sort of mechanic to test it).

choroba is correct.

Though if this were some sort of riddle, I'd respond with this:

cat << EOF | sh
> echo 'visit:$site'
> EOF

As jander points out this is wide open for an injection attack. It wasn't a serious answer, so if anyone was considering using something like this, don't use it with untrusted input. For example, validate the $site string as being a valid URL before blindly executing the content. Something like this could help (but the expression provided isn't perfect because it still allows injection, but use that sort of mechanic to test it).

acknowledging Jander's comment about injection
Source Link
Stephen
  • 155
  • 2

choroba is correct.

Though if this were some sort of riddle, I'd respond with this:

cat << EOF | sh
> echo 'visit:$site'
> EOF

As jander points out this is wide open for an injection attack. It wasn't a serious answer, so if anyone was considering using something like this, don't use it with untrusted input. For example, validate the $site string as being a valid URL before blindly executing the content. Something like this could help (but the expression provided isn't perfect because it still allows injection, but use that sort of mechanic to test it).

choroba is correct.

Though if this were some sort of riddle, I'd respond with this:

cat << EOF | sh
> echo 'visit:$site'
> EOF

choroba is correct.

Though if this were some sort of riddle, I'd respond with this:

cat << EOF | sh
> echo 'visit:$site'
> EOF

As jander points out this is wide open for an injection attack. It wasn't a serious answer, so if anyone was considering using something like this, don't use it with untrusted input. For example, validate the $site string as being a valid URL before blindly executing the content. Something like this could help (but the expression provided isn't perfect because it still allows injection, but use that sort of mechanic to test it).

Source Link
Stephen
  • 155
  • 2

choroba is correct.

Though if this were some sort of riddle, I'd respond with this:

cat << EOF | sh
> echo 'visit:$site'
> EOF