So I wrote a simple PHP script which uses a form. The form submits fine if there is less than 113 characters, however, if I submit 113 or more characters in the field, I keep getting a 403 - forbidden message.
If it's of any help, here is the actual code:
Code:
<?php
$script_file = basename($_SERVER['SCRIPT_NAME']);
$script_path = str_replace("/".$script_file, "",$_SERVER['SCRIPT_FILENAME']);
if (isset($_POST['codedMsg'])) $codedMsg = $_POST['codedMsg'];
else $codedMsg = "";
echo '<html>
<head>
<title>
Binary Decoder
</title>
</head>
<body>
<form method="post" action="'.$script_file.'">
<b>Binary:</b><br>
<textarea name="codedMsg" cols="80" rows="5" style="border: #000000 1px solid;"></textarea>
<br><input type="submit" value="Decode">
</form>'."\r\n";
// Strip entry to bare 0s and 1s.
for ($i = 0; $i < 48; $i++) $codedMsg = str_replace(chr($i), '', "$codedMsg");
for ($i = 50; $i < 256; $i++) $codedMsg = str_replace(chr($i), '', "$codedMsg");
if (is_numeric($codedMsg)) {
$len = strlen($codedMsg);
$fraLen = $len / 8;
$totChars = floor($fraLen);
for($i = 0; $i < $totChars; $i++) {
$num = $i * 8;
$binChar[] = bindec(substr("$codedMsg", $num, 8));
}
// substr
echo "<b>Decoded:</b><p>";
for ($i = 0; $i < count($binChar); $i++) echo chr($binChar[$i]);
echo "</p>
</body>
</html>\r\n";
}
?>
I think the issue is with the server itself though.
I've even tried to lookup this problem on Google, and the results are from messages posted about mod_secure issues over a couple years ago, which is different than this problem.