Advertisement
Guest User

Untitled

a guest
Aug 31st, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. <html><body><?php
  2. header('Content-Type: text/html; charset=utf-8');
  3. ini_set('display_errors', 1);
  4. ini_set('log_errors',1);
  5. ini_set('display_startup_errors', 1);
  6. ini_set('error_reporting', E_ALL);
  7. error_reporting(E_ALL);
  8. mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
  9. function start_session() {
  10. if(version_compare(phpversion(), "5.4.0") != -1){
  11. if (session_status() == PHP_SESSION_NONE) {
  12. session_start();
  13. }
  14. } else {
  15. if(session_id() == '') {
  16. session_start();
  17. }
  18. }
  19. }
  20. start_session();
  21. if (!isset($_SESSION['js']) && !isset($_REQUEST['sessionstart']) && !isset($_REQUEST['setjsoff']) && !isset($_SESSION['jsoff'])) {
  22. echo '<script src="./js/jquery.js"></script><script type="text/javascript">$(document).ready(function(){$.get(document.URL.substring() + "?sessionstart=1");});</script>';
  23. }
  24. if (isset($_REQUEST['sessionstart'])) {
  25. $_SESSION['js'] = 1;
  26. exit("in sessionstart mode");
  27. } else {
  28. if (isset($_REQUEST['setjsoff'])) {
  29. $_SESSION['jsoff'] = 1;
  30. if ($_SESSION['jsoff'] == 1) {
  31. exit("in setjsoff mode (success)");
  32. } else {
  33. exit("jsoff unsuccessful");
  34. }
  35. } else {
  36. session_destroy();
  37. }
  38. }
  39. if (!isset($_SESSION['js'])) {
  40. if (!isset($_SESSION['jsoff'])) {
  41. if (!isset($_REQUEST['sessionstart'])) {
  42. $ch = curl_init();
  43. $username = "***";
  44. $password = "***";
  45. curl_setopt($ch, CURLOPT_URL, "***/test.php?setjsoff=1");
  46. curl_setopt($ch, CURLOPT_HEADER, true);
  47. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  48. curl_setopt($ch, CURLOPT_FORBID_REUSE, true);
  49. curl_setopt($ch, CURLOPT_HTTPGET, true);
  50. curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
  51. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  52. $chout = curl_exec($ch);
  53. curl_close($ch);
  54. echo "curl init - ".$chout." - ";
  55. }
  56. header("Refresh: 1");
  57. exit("301 Redirect");
  58. }
  59. echo "Javascript is not enabled";
  60. } else {
  61. echo "Javascript is enabled";
  62. }
  63. ?></body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement