Note that there are some explanatory texts on larger screens.

plurals
  1. POWebsite Link Injection
    primarykey
    data
    text
    <p>I have a website that is fairly static. It has some forms on it to send in contact information, mailing list submissions, etc. Perhaps hours/days after an upload to the site I found that the main index page had new code in it that I had not placed there that contained a hidden bunch of links in a invisible div.</p> <p>I have the following code the handles the variables sent in from the form.</p> <pre><code>&lt;?php // PHP Mail Order to email@email.com w/ some error detection. $jamemail = "email@email.com"; function check_input($data, $problem='') { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); if ($problem &amp;&amp; strlen($data) == 0) { die($problem); } return $data; } $email = check_input($_POST['email'], "Please input email address."); $name = check_input($_POST['name'], "Please input name."); mail($jamemail, "Mailing List Submission", "Name: " . $name . " Email: " .$email); header('Location: index.php'); ?&gt; </code></pre> <p>I have the following code within the index page to present the form with some Javascript to do error detection on the content of the submission prior to submission.</p> <pre><code> &lt;form action="sendlist.php" method="post" onSubmit="return checkmaill(this);"&gt; &lt;label for="name"&gt;&lt;strong&gt;Name: &lt;/strong&gt;&lt;/label&gt; &lt;input type="text" name="name"/&gt;&lt;br /&gt; &lt;label for="email"&gt;&lt;strong&gt;Email: &lt;/strong&gt;&lt;/label&gt; &lt;input type="text" name="email"/&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;input type="submit" value="Subscribe" style="width: 100px;"/&gt; &lt;/form&gt; </code></pre> <p>At the end of the day, the source code where the injected hyperlinks is as follows:</p> <pre><code>&lt;/body&gt; &lt;/html&gt;&lt;!-- google --&gt;&lt;font style="position: absolute;overflow: hidden;height: 0;width: 0"&gt; xeex172901 &lt;a href=http://menorca.caeb.com/od9c2/xjdmy/onondaga.php&gt;onondaga&lt;/a&gt; &lt;a href=http://menorca.caeb.com/od9c2/xjdmy/tami.php&gt;tami&lt;/a&gt; &lt;a href=http://menorca.caeb.com/od9c2/xjdmy/shotguns.php&gt;shotguns&lt;/a&gt; &lt;a href=http://menorca.caeb.com/od9c2/xjdmy/weir.php&gt;weir&lt;/a&gt; &lt;a href=http://menorca.caeb.com/od9c2/xjdmy/copperhead.php&gt;copperhead&lt;/a&gt; &lt;a href=http://menorca.caeb.com/od9c2/xjdmy/mpv.php&gt;mpv&lt;/a&gt; &lt;a href=http://menorca.caeb.com/od9c2/xjdmy/brunei.php&gt;brunei&lt;/a&gt; &lt;a href=http://menorca.caeb.com/od9c2/xjdmy/doreen.php&gt;doreen&lt;/a&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload