Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if (isset($_SESSION['u'])){
- ?>
- <html>
- <body>
- <h1>Welcome to admin panel</h1>
- <h2>Please provide XML file to interpret command</h2>
- <form method="POST">
- <textarea name="t" rows="25" cols="40">
- <?xml version="1.0" encoding="UTF-8"?>
- <commands>
- <command>ping</command>
- </commands>
- </textarea>
- <input type="submit" name="submit">
- <?php
- }else{
- ?>
- <html>
- <body>
- <h1> Admin panel v.0.1 </h1>
- <form method="POST">
- <p>User: <input type="name" name="login"></p>
- <p>Password: <input type="password" name="pass"></p>
- <input type="submit" name="Submit">
- </form>
- <a href="register.php">Register</a>
- </body>
- </html>
- <?php
- }
- if (isset($_POST['t'])){
- if (strlen($_POST['t']) > 100){
- echo "You naughty haxxxor";
- session_unset();
- header("refresh:5;url=https://google.com");
- }
- libxml_disable_entity_loader (false);
- $dom = new DOMDocument();
- $dom->loadXML($_POST['t'], LIBXML_NOENT | LIBXML_DTDLOAD);
- $creds = simplexml_import_dom($dom);
- #$sites = new SimpleXMLElement($_POST['t']);
- echo '<pre>';
- foreach ($creds->command as $c){
- echo($c);
- }
- echo "\n Command not implemented";
- }
- login.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement