<?php
// http_methods.php
// RJM Programming
// May, 2024
// exec calls curl
// eg. curl -X OPTIONS https://www.rjmprogramming.com.au -i

$res="";

if (isset($_POST['incont']) && isset($_POST['inhi'])) {
  file_put_contents(str_replace('+',' ',urldecode($_POST['inhi'])), explode('##',str_replace('`','#',str_replace("~~","\n",str_replace('+',' ',urldecode($_POST['incont'])))))[0]);
  file_put_contents(str_replace('+',' ',urldecode($_POST['inhi'])) . 'x', str_replace('`','#',str_replace("~~","\n",str_replace('+',' ',urldecode($_POST['incont'])))));
         while (file_exists("/home/rjmprogr/public_html/ITblog/payloadv.dot")) {
          sleep(5);
         }
  echo "<html><body onload=\" parent.document.getElementById('myvenn').src='/ITblog/renderv.png?rand=" . rand(567,26789056) . "'; \"></body></html>";
  exit;
}

if (isset($_GET['url'])) {
 $theurl=str_replace('+',' ',urldecode($_GET['url']));
 if (strlen(trim($theurl)) > 0) {
    if (strpos(strtolower($theurl), 'http') !== false) {
     $res=shell_exec('curl -X OPTIONS ' . $theurl . ' -i');
    } else if (strpos(strtolower($theurl), '//') === false) {
     $res=shell_exec('curl -X OPTIONS http:' . $theurl . ' -i');
    } else if (strpos(strtolower($theurl), '//') !== false) {
     $res=shell_exec('curl -X OPTIONS http://' . $theurl . ' -i');
    }
 }
 if ($res != '') {
   echo '<p>' . str_replace("\n", "<br>", $res) . '</p>';
 }
 exit;
} else {
 echo "<html>
<body> 
<h1>HTTP Methods for Website via Curl</h1>
<h3>RJM Programming - May, 2024</h3>
<form target=ifcurl action=./http_methods.php method=GET>
<input style=width:90%; type=url name=url value='' placeholder='Place website URL here eg. http://www.rjmprogramming.com.au'></input><br><br>
<input type=submit value=Show></input>
</form>
<iframe style=width:90%;height:300px; name=ifcurl id=ifcurl src='./http_methods.php?url=http%3A%2F%2Fwww.rjmprogramming.com.au'></iframe>
</body>
</html>";
}

?>
