Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if (isset($_SESSION['u'])){
  4. ?>
  5. <html>
  6. <body>
  7. <h1>Welcome to admin panel</h1>
  8. <h2>Please provide XML file to interpret command</h2>
  9. <form method="POST">
  10. <textarea name="t" rows="25" cols="40">
  11. <?xml version="1.0" encoding="UTF-8"?>
  12. <commands>
  13. <command>ping</command>
  14. </commands>
  15.  
  16. </textarea>
  17. <input type="submit" name="submit">
  18. <?php
  19. }else{
  20.  
  21. ?>
  22. <html>
  23. <body>
  24. <h1> Admin panel v.0.1 </h1>
  25. <form method="POST">
  26. <p>User: <input type="name" name="login"></p>
  27. <p>Password: <input type="password" name="pass"></p>
  28. <input type="submit" name="Submit">
  29. </form>
  30. <a href="register.php">Register</a>
  31. </body>
  32. </html>
  33.  
  34.  
  35.  
  36. <?php
  37. }
  38.  
  39. if (isset($_POST['t'])){
  40. if (strlen($_POST['t']) > 100){
  41. echo "You naughty haxxxor";
  42. session_unset();
  43. header("refresh:5;url=https://google.com");
  44.  
  45. }
  46. libxml_disable_entity_loader (false);
  47. $dom = new DOMDocument();
  48. $dom->loadXML($_POST['t'], LIBXML_NOENT | LIBXML_DTDLOAD);
  49. $creds = simplexml_import_dom($dom);
  50. #$sites = new SimpleXMLElement($_POST['t']);
  51. echo '<pre>';
  52. foreach ($creds->command as $c){
  53. echo($c);
  54. }
  55. echo "\n Command not implemented";
  56. }
  57. login.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement