Join us at IRC!
Become the change you seek in the world. - Gandhi
Friday, May 25, 2012
Navigation
Members Online
Total Online: 34
Web Spiders: 14
Guests Online: 34
Members Online: 0

Registered Members: 70220
Newest Member: borsche_1110
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

XMLHttpRequest() or GM_XMLHttpRequest help

elmiguel
Member



Posts: 132
Location: Your Computer
Joined: 12.12.07
Rank:
God
Posted on 29-07-09 13:30
OK I am having issues with both these functions and cannot seem to know why it is not working.

XMLHttpRequest():
var req = new XMLHttpRequest();
req.open('GET', 'https://developer.mozilla.org/En/Using_XMLHttpRequest', false);
req.send(null);
if(req.status == 200){
alert(req.responseText);
}



GM_XMLHttpRequest():
GM_xmlhttpRequest({
method: "POST",
url: "http://www.site.com",
headers: {"Content-Type": "WHAT IS THE MIME TYPE TO POST JUST TO A URL NOT A FORM!"},
data: "key" + encodeURI('stringToEncode')
}
});


I have been messing around with both GET and POST methods with both of functions (not in the same code of course). For some reason I get back null or nothing at all, and others I get the error feedback I put in. Does anyone have a working code for me to review and see what I am doing wrong?. I have looked over a lot of material on the web and all seems to be correct, but I can not perform this simple action.

Thanks in advance.

-elmiguel


The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor


<script>alert('XSS');</script>
Author

RE: XMLHttpRequest() or GM_XMLHttpRequest help

elmiguel
Member



Posts: 132
Location: Your Computer
Joined: 12.12.07
Rank:
God
Posted on 29-07-09 13:38
Figured it out, it was my incorrect use of the headers and MIME Type

ex:


GM_xmlhttpRequest({
method: 'GET',
url: 'http://www.google.com',
headers: {
'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
'Accept': 'application/xhtml+xml',
},
onblockedload: function(responseDetails) {
alert('Request for Google feed returned ' + responseDetails.status +
' ' + responseDetails.statusText + '\n\n' +
'Feed data:\n' + responseDetails.responseText);
}
});



The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor


<script>alert('XSS');</script>
Author

RE: XMLHttpRequest() or GM_XMLHttpRequest help

elmiguel
Member



Posts: 132
Location: Your Computer
Joined: 12.12.07
Rank:
God
Posted on 29-07-09 13:49
OK, maybe not, works on google but when I try to request a page here it doesn't work:



var elements = ''; // whether null, blank or empty data is not being stored here.
GM_xmlhttpRequest({
method: 'GET',
url: 'http://www.hellboundhackers.org/challenges/timed/timed8/index.php',
headers: {
'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
'Accept': 'text/plain',
},
onblockedload: function(responseDetails) {
elements = (responseDetails.responseText);// gets the data.
}
});
alert (elements); // if tried to store the data is lost.


[EDIT]: Changed MIME Type to: text/plain. It does get the data, but for some reason it will not store the data into a variable


The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor




Edited by elmiguel on 29-07-09 13:58
<script>alert('XSS');</script>
Author

RE: XMLHttpRequest() or GM_XMLHttpRequest help

SySTeM
-=[TheOutlaw]=-

Posts: 1524
Location: England, UK
Joined: 27.07.05
Rank:
The Overlord
Posted on 29-07-09 19:37
How does GM_xmlhttpRequest handle cookies?




http://www.elites0ft.com/
Author

RE: XMLHttpRequest() or GM_XMLHttpRequest help

spyware
Member



Posts: 4190
Location: The Netherlands
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 29-07-09 19:46
You need to send your HBH cookies with the request.




"The chowner of property." - Zeph
“Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.”
- Carl Sagan
“Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?” - Ebert
http://bitsofspy.net
Author

RE: XMLHttpRequest() or GM_XMLHttpRequest help

elmiguel
Member



Posts: 132
Location: Your Computer
Joined: 12.12.07
Rank:
God
Posted on 29-07-09 20:31

function post(url, data) {
GM_xmlhttpRequest({
method: "POST",
url: url,
headers:{'Content-type':'application/x-www-form-urlencoded',
'Cookie' : 'PHPSESSID=<DATA>;fusion_user=<DATA>'},
data: "ans=" +encodeURI(data),
});
}
post('http://www.hellboundhackers.org/challenges/timed/timed8/index.php', a});





I am sending the Cookies but its not working


The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor


<script>alert('XSS');</script>
Author

RE: XMLHttpRequest() or GM_XMLHttpRequest help

COM
Banned



Posts: 800
Location:
Joined: 31.08.07
Rank:
God
Posted on 29-07-09 23:17
If it doesn't automatically add it, you are going to have to add "Content-Length:" to that header.


K'aem'nhi kh'rn, K'aem'nhi kh'r, K'aem'nhi kh'rmnu.
I'a Y'gs-Othoth!
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links

Anime Wallpaper Site

Error processing request
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.