drvaghela

Pentester help needed

Jul 20th, 2014
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.52 KB | None | 0 0
  1. Penetration Tester help needed this is the code and I've found vulnerability from joomscan for Kali what to do next ?????
  2.  
  3.  
  4.  
  5.  
  6.  
  7. <?php
  8. /**
  9. * @version $Id: admin.admin.html.php 12694 2009-09-11 21:03:02Z ian $
  10. * @package Joomla
  11. * @subpackage Admin
  12. * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
  13. * @license GNU/GPL, see LICENSE.php
  14. * Joomla! is free software. This version may have been modified pursuant
  15. * to the GNU General Public License, and as distributed it includes or
  16. * is derivative of works licensed under the GNU General Public License or
  17. * other free or open source software licenses.
  18. * See COPYRIGHT.php for copyright notices and details.
  19. */
  20.  
  21. // no direct access
  22. defined( '_JEXEC' ) or die( 'Restricted access' );
  23.  
  24. /**
  25. * @package Joomla
  26. * @subpackage Admin
  27. */
  28. class HTML_admin_misc
  29. {
  30. function get_php_setting($val)
  31. {
  32. $r = (ini_get($val) == '1' ? 1 : 0);
  33. return $r ? JText::_( 'ON' ) : JText::_( 'OFF' ) ;
  34. }
  35.  
  36. function get_server_software()
  37. {
  38. if (isset($_SERVER['SERVER_SOFTWARE'])) {
  39. return $_SERVER['SERVER_SOFTWARE'];
  40. } else if (($sf = getenv('SERVER_SOFTWARE'))) {
  41. return $sf;
  42. } else {
  43. return JText::_( 'n/a' );
  44. }
  45. }
  46.  
  47. function system_info( )
  48. {
  49. global $mainframe;
  50.  
  51. //Load switcher behavior
  52. JHTML::_('behavior.switcher');
  53.  
  54. $db =& JFactory::getDBO();
  55.  
  56. $contents = '';
  57. ob_start();
  58. require_once(JPATH_COMPONENT.DS.'tmpl'.DS.'navigation.php');
  59. $contents = ob_get_contents();
  60. ob_clean();
  61.  
  62. $document =& JFactory::getDocument();
  63. $document->setBuffer($contents, 'modules', 'submenu');
  64. ?>
  65. <form action="index.php" method="post" name="adminForm">
  66.  
  67. <div id="config-document">
  68. <div id="page-site">
  69. <table class="noshow">
  70. <tr>
  71. <td>
  72. <?php require_once(JPATH_COMPONENT.DS.'tmpl'.DS.'sysinfo_system.php'); ?>
  73. </td>
  74. </tr>
  75. </table>
  76. </div>
  77.  
  78. <div id="page-phpsettings">
  79. <table class="noshow">
  80. <tr>
  81. <td>
  82. <?php require_once(JPATH_COMPONENT.DS.'tmpl'.DS.'sysinfo_phpsettings.php'); ?>
  83. </td>
  84. </tr>
  85. </table>
  86. </div>
  87.  
  88. <div id="page-config">
  89. <table class="noshow">
  90. <tr>
  91. <td>
  92. <?php require_once(JPATH_COMPONENT.DS.'tmpl'.DS.'sysinfo_config.php'); ?>
  93. </td>
  94. </tr>
  95. </table>
  96. </div>
  97.  
  98. <div id="page-directory">
  99. <table class="noshow">
  100. <tr>
  101. <td>
  102. <?php require_once(JPATH_COMPONENT.DS.'tmpl'.DS.'sysinfo_directory.php'); ?>
  103. </td>
  104. </tr>
  105. </table>
  106. </div>
  107.  
  108. <div id="page-phpinfo">
  109. <table class="noshow">
  110. <tr>
  111. <td>
  112. <?php require_once(JPATH_COMPONENT.DS.'tmpl'.DS.'sysinfo_phpinfo.php'); ?>
  113. </td>
  114. </tr>
  115. </table>
  116. </div>
  117. </div>
  118.  
  119. <div class="clr"></div>
  120. <?php
  121. }
  122.  
  123. /**
  124. * Display Help Page
  125. *
  126. * For this method the important two scenarios are local or remote help files.
  127. * In the case of local help files the language tag will be added in order to
  128. * allow different languages of help.<br />
  129. * In case of the remote server it is assumed that this server provide one specific
  130. * help set of files in one particular language.
  131. */
  132. function help()
  133. {
  134. global $mainframe;
  135. jimport( 'joomla.filesystem.folder' );
  136. jimport( 'joomla.language.help' );
  137.  
  138. // Get Help URL - an empty helpurl is interpreted as local help files!
  139. $helpurl = $mainframe->getCfg('helpurl');
  140. if ( $helpurl == 'http://help.mamboserver.com' ) {
  141. $helpurl = 'http://help.joomla.org';
  142. }
  143. $fullhelpurl = $helpurl . '/index2.php?option=com_content&amp;task=findkey&amp;pop=1&amp;keyref=';
  144.  
  145. $helpsearch = JRequest::getString('helpsearch');
  146. $page = JRequest::getCmd('page', 'joomla.whatsnew15.html');
  147. $toc = getHelpToc( $helpsearch );
  148. $lang =& JFactory::getLanguage();
  149. $langTag = $lang->getTag();
  150. if( !JFolder::exists( JPATH_BASE.DS.'help'.DS.$langTag ) ) {
  151. $langTag = 'en-GB'; // use english as fallback
  152. }
  153.  
  154. if (!preg_match( '#\.html$#i', $page )) {
  155. $page .= '.xml';
  156. }
  157. ?>
  158. <form action="index.php?option=com_admin&amp;task=help" method="post" name="adminForm">
  159.  
  160. <table class="adminform" border="1">
  161. <tr>
  162. <td colspan="2">
  163. <table width="100%">
  164. <tr>
  165. <td>
  166. <strong><?php echo JText::_( 'Search' ); ?>:</strong>
  167. <input class="text_area" type="hidden" name="option" value="com_admin" />
  168. <input type="text" name="helpsearch" value="<?php echo $helpsearch;?>" class="inputbox" />
  169. <input type="submit" value="<?php echo JText::_( 'Go' ); ?>" class="button" />
  170. <input type="button" value="<?php echo JText::_( 'Clear Results' ); ?>" class="button" onclick="f=document.adminForm;f.helpsearch.value='';f.submit()" />
  171. </td>
  172. <td class="helpMenu">
  173. <?php
  174. if ($helpurl) {
  175. ?>
  176. <?php echo JHTML::_('link', JHelp::createUrl( 'joomla.glossary' ), JText::_( 'Glossary' ), array('target' => 'helpFrame')) ?>
  177. |
  178. <?php echo JHTML::_('link', JHelp::createUrl( 'joomla.credits' ), JText::_( 'Credits' ), array('target' => 'helpFrame')) ?>
  179. |
  180. <?php echo JHTML::_('link', JHelp::createUrl( 'joomla.support' ), JText::_( 'Support' ), array('target' => 'helpFrame')) ?>
  181. <?php
  182. } else {
  183. ?>
  184. <?php echo JHTML::_('link', 'http://docs.joomla.org/index.php?title=Glossary&printable=true', JText::_( 'Glossary' ), array('target' => 'helpFrame')) ?> |
  185. <?php echo JHTML::_('link', 'http://docs.joomla.org/index.php?title=Joomla.credits.15&printable=true', JText::_( 'Credits' ), array('target' => 'helpFrame')) ?> |
  186. <?php echo JHTML::_('link', 'http://docs.joomla.org/index.php?title=Joomla.support.15&printable=true', JText::_( 'Support' ), array('target' => 'helpFrame')) ?>
  187. <?php } ?>
  188. |
  189. <?php echo JHTML::_('link', 'http://www.gnu.org/licenses/gpl-2.0.html', JText::_( 'License' ), array('target' => 'helpFrame')) ?>
  190. |
  191. <?php echo JHTML::_('link', 'http://docs.joomla.org', 'docs.joomla.org', array('target' => 'helpFrame')) ?>
  192. |
  193. <?php echo JHTML::_('link', 'index.php?option=com_admin&amp;task=changelog&amp;tmpl=component', JText::_( 'Changelog' ), array('target' => 'helpFrame')) ?>
  194. |
  195. <?php echo JHTML::_('link', 'http://docs.joomla.org/index.php?title=Joomla_1.5_version_history&printable=true', JText::_( 'Latest Version Check' ), array('target' => 'helpFrame')) ?>
  196. </td>
  197. </tr>
  198. </table>
  199. </td>
  200. </tr>
  201. </table>
  202.  
  203. <div id="treecellhelp">
  204. <fieldset title="<?php echo JText::_( 'Alphabetical Index' ); ?>">
  205. <legend>
  206. <?php echo JText::_( 'Alphabetical Index' ); ?>
  207. </legend>
  208.  
  209. <div class="helpIndex">
  210. <ul class="subext">
  211. <?php
  212. foreach ($toc as $k=>$v) {
  213. if ($helpurl) {
  214. echo '<li>';
  215. echo JHTML::_('link', JHelp::createUrl( $k ), $v, array('target' => 'helpFrame'));
  216. echo '</li>';
  217. } else {
  218. echo '<li>';
  219. echo JHTML::_('link', JURI::base() .'help/'.$langTag.'/'.$k, $v, array('target' => 'helpFrame'));
  220. echo '</li>';
  221. }
  222. }
  223. ?>
  224. </ul>
  225. </div>
  226. </fieldset>
  227. </div>
  228.  
  229. <div id="datacellhelp">
  230. <fieldset title="<?php echo JText::_( 'View' ); ?>">
  231. <legend>
  232. <?php echo JText::_( 'View' ); ?>
  233. </legend>
  234. <?php
  235. if ($helpurl && $page != 'joomla.whatsnew15.html') {
  236. ?>
  237. <iframe name="helpFrame" src="<?php echo $fullhelpurl .preg_replace( '#\.xml$|\.html$#', '', $page );?>" class="helpFrame" frameborder="0"></iframe>
  238. <?php
  239. } else {
  240. ?>
  241. <iframe name="helpFrame" src="<?php echo JURI::base() .'help/' .$langTag. '/' . $page;?>" class="helpFrame" frameborder="0"></iframe>
  242. <?php
  243. }
  244. ?>
  245. </fieldset>
  246. </div>
  247.  
  248. <input type="hidden" name="task" value="help" />
  249. </form>
  250. <?php
  251. }
  252.  
  253. /*
  254. * Displays contents of Changelog.php file
  255. */
  256. function changelog()
  257. {
  258. ?>
  259. <pre>
  260. <?php
  261. ob_start();
  262. readfile( JPATH_SITE.DS.'CHANGELOG.php' );
  263. $changelog = ob_get_contents();
  264. ob_clean();
  265.  
  266. // Strip php tag
  267. $changelog = preg_replace('/\<\?php[^\?]*\?\>/','',$changelog);
  268.  
  269. // Convert all other HTML entities
  270. echo htmlentities($changelog);
  271. ?>
  272. </pre>
  273. <?php
  274. }
  275. }
  276.  
  277. function writableCell( $folder, $relative=1, $text='', $visible=1 )
  278. {
  279. $writeable = '<b><font color="green">'. JText::_( 'Writable' ) .'</font></b>';
  280. $unwriteable = '<b><font color="red">'. JText::_( 'Unwritable' ) .'</font></b>';
  281.  
  282. echo '<tr>';
  283. echo '<td class="item">';
  284. echo $text;
  285. if ( $visible ) {
  286. echo $folder . '/';
  287. }
  288. echo '</td>';
  289. echo '<td >';
  290. if ( $relative ) {
  291. echo is_writable( "../$folder" ) ? $writeable : $unwriteable;
  292. } else {
  293. echo is_writable( "$folder" ) ? $writeable : $unwriteable;
  294. }
  295. echo '</td>';
  296. echo '</tr>';
  297. }
  298.  
  299. /**
  300. * Compiles the help table of contents
  301. * @param string A specific keyword on which to filter the resulting list
  302. */
  303. function getHelpTOC( $helpsearch )
  304. {
  305. global $mainframe;
  306.  
  307. $lang =& JFactory::getLanguage();
  308. jimport( 'joomla.filesystem.folder' );
  309.  
  310. $helpurl = $mainframe->getCfg('helpurl');
  311.  
  312. // Check for files in the actual language
  313. $langTag = $lang->getTag();
  314. if( !JFolder::exists( JPATH_BASE.DS.'help'.DS.$langTag ) ) {
  315. $langTag = 'en-GB'; // use english as fallback
  316. }
  317. $files = JFolder::files( JPATH_BASE.DS.'help'.DS.$langTag, '\.xml$|\.html$' );
  318.  
  319. $toc = array();
  320. foreach ($files as $file) {
  321. $buffer = file_get_contents( JPATH_BASE.DS.'help'.DS.$langTag.DS.$file );
  322. if (preg_match( '#<title>(.*?)</title>#', $buffer, $m )) {
  323. $title = trim( $m[1] );
  324. if ($title) {
  325. if ($helpurl) {
  326. // strip the extension
  327. $file = preg_replace( '#\.xml$|\.html$#', '', $file );
  328. }
  329. if ($helpsearch) {
  330. if (JString::strpos( strip_tags( $buffer ), $helpsearch ) !== false) {
  331. $toc[$file] = $title;
  332. }
  333. } else {
  334. $toc[$file] = $title;
  335. }
  336. }
  337. }
  338. }
  339. asort( $toc );
  340. return $toc;
  341. }
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355. joomscan
  356.  
  357.  
  358. ..|''|| '|| '||' '|' | .|'''.| '||''|.
  359. .|' || '|. '|. .' ||| ||.. ' || ||
  360. || || || || | | || ''|||. ||...|'
  361. '|. || ||| ||| .''''|. . '|| ||
  362. ''|...|' | | .|. .||. |'....|' .||.
  363.  
  364.  
  365. =================================================================
  366. OWASP Joomla! Vulnerability Scanner v0.0.4
  367. (c) Aung Khant, aungkhant]at[yehg.net
  368. YGN Ethical Hacker Group, Myanmar, http://yehg.net/lab
  369. Update by: Web-Center, http://web-center.si (2011)
  370. =================================================================
  371.  
  372. Vulnerability Entries: 611
  373. Last update: February 2, 2012
  374.  
  375. Usage: ./joomscan.pl -u <string> -x proxy:port
  376. -u <string> = joomla Url
  377.  
  378. ==Optional==
  379.  
  380. -x <string:int> = proXy to tunnel
  381. -c <string> = Cookie (name=value;)
  382. -g "<string>" = desired useraGent string(within ")
  383. -nv = No Version fingerprinting check
  384. -nf = No Firewall detection check
  385. -nvf/-nfv = No version+firewall check
  386. -pe = Poke version only and Exit
  387. -ot = Output to Text file (target-joexploit.txt)
  388. -oh = Output to Html file (target-joexploit.htm)
  389. -vu = Verbose (output every Url scan)
  390. -sp = Show completed Percentage
  391.  
  392. ~Press ENTER key to continue chmod 0777 /usr/bin/joomscan
  393.  
  394.  
  395. Example: ./joomscan.pl -u victim.com -x localhost:8080
  396.  
  397. Check: ./joomscan.pl check
  398. - Check if the scanner update is available or not.
  399.  
  400. Update: ./joomscan.pl update
  401. - Check and update the local database if newer version is available.
  402.  
  403. Download: ./joomscan.pl download
  404. - Download the scanner latest version as a single zip file - joomscan-latest.zip.
  405.  
  406. Defense: ./joomscan.pl defense
  407. - Give a defensive note.
  408.  
  409. About: ./joomscan.pl story
  410. - A short story about joomscan.
  411.  
  412. Read: ./joomscan.pl read DOCFILE
  413. DOCFILE - changelog,release_note,readme,credits,faq,owasp_project
  414.  
  415. root@Voidvamp:~# chmod 0777 /usr/bin/joomscan
  416. root@Voidvamp:~# joomscan -u http://svn.openfoundry.org/
  417.  
  418.  
  419. ..|''|| '|| '||' '|' | .|'''.| '||''|.
  420. .|' || '|. '|. .' ||| ||.. ' || ||
  421. || || || || | | || ''|||. ||...|'
  422. '|. || ||| ||| .''''|. . '|| ||
  423. ''|...|' | | .|. .||. |'....|' .||.
  424.  
  425.  
  426. =================================================================
  427. OWASP Joomla! Vulnerability Scanner v0.0.4
  428. (c) Aung Khant, aungkhant]at[yehg.net
  429. YGN Ethical Hacker Group, Myanmar, http://yehg.net/lab
  430. Update by: Web-Center, http://web-center.si (2011)
  431. =================================================================
  432.  
  433.  
  434. Vulnerability Entries: 611
  435. Last update: February 2, 2012
  436.  
  437. Use "update" option to update the database
  438. Use "check" option to check the scanner update
  439. Use "download" option to download the scanner latest version package
  440. Use svn co to update the scanner and the database
  441. svn co https://joomscan.svn.sourceforge.net/svnroot/joomscan joomscan
  442.  
  443.  
  444. Target: http://svn.openfoundry.org
  445.  
  446. [x] Unable to process any more. I get - 401 Authorization Required
  447.  
  448.  
  449. ~[*] Time Taken: 5 sec
  450. ~[*] Send bugs, suggestions, contributions to [email protected]
  451. root@Voidvamp:~# joomscan -u http://svn.openfoundry.org/ossf/trunk/1.5.15/administrator/components/com_admin/admin.admin.html.php?mosConfig_absolute_path=shell
  452.  
  453.  
  454. ..|''|| '|| '||' '|' | .|'''.| '||''|.
  455. .|' || '|. '|. .' ||| ||.. ' || ||
  456. || || || || | | || ''|||. ||...|'
  457. '|. || ||| ||| .''''|. . '|| ||
  458. ''|...|' | | .|. .||. |'....|' .||.
  459.  
  460.  
  461. =================================================================
  462. OWASP Joomla! Vulnerability Scanner v0.0.4
  463. (c) Aung Khant, aungkhant]at[yehg.net
  464. YGN Ethical Hacker Group, Myanmar, http://yehg.net/lab
  465. Update by: Web-Center, http://web-center.si (2011)
  466. =================================================================
  467.  
  468.  
  469. Vulnerability Entries: 611
  470. Last update: February 2, 2012
  471.  
  472. Use "update" option to update the database
  473. Use "check" option to check the scanner update
  474. Use "download" option to download the scanner latest version package
  475. Use svn co to update the scanner and the database
  476. svn co https://joomscan.svn.sourceforge.net/svnroot/joomscan joomscan
  477.  
  478.  
  479. Target: http://svn.openfoundry.org/ossf/trunk/1.5.15/administrator/components/com_admin/admin.admin.html.php
  480.  
  481. Server: Apache/2.2.17 (FreeBSD) mod_ssl/2.2.17 OpenSSL/0.9.8k DAV/2 SVN/1.6.6 PHP/5.3.6 with Suhosin-Patch mod_python/3.3.1 Python/2.6.4
  482.  
  483.  
  484. ## NOTE: The Administrator URL was renamed. Bruteforce it. ##
  485. ## None of /administrator, /admin, /manage ##
  486.  
  487.  
  488. ## Checking if the target has deployed an Anti-Scanner measure
  489.  
  490. [!] Scanning Passed ..... OK
  491.  
  492.  
  493. ## Detecting Joomla! based Firewall ...
  494.  
  495. [!] .htaccess shipped with Joomla! is being deployed for SEO purpose
  496. [!] It contains some defensive mod_rewrite rules
  497. [!] Payloads that contain strings (mosConfig,base64_encode,<script>
  498. GLOBALS,_REQUEST) wil be responsed with 403.
  499.  
  500.  
  501. ## Fingerprinting in progress ...
  502.  
  503. ~Unable to detect the version. Is it sure a Joomla?
  504.  
  505. ## Fingerprinting done.
  506.  
  507.  
  508. ## 2 Components Found in front page ##
  509.  
  510. com_content com_admin
  511.  
  512.  
  513.  
  514.  
  515. Vulnerabilities Discovered
  516. ==========================
  517.  
  518. # 1
  519. Info -> Core: Multiple XSS/CSRF Vulnerability
  520. Versions Affected: 1.5.9 <=
  521. Check: /?1.5.9-x
  522. Exploit: A series of XSS and CSRF faults exist in the administrator application. Affected administrator components include com_admin, com_media, com_search. Both com_admin and com_search contain XSS vulnerabilities, and com_media contains 2 CSRF vulnerabilities.
  523. Vulnerable? N/A
  524.  
  525. # 2
  526. Info -> Core: JSession SSL Session Disclosure Vulnerability
  527. Versions effected: Joomla! 1.5.8 <=
  528. Check: /?1.5.8-x
  529. Exploit: When running a site under SSL (the entire site is forced to be under ssl), Joomla! does not set the SSL flag on the cookie. This can allow someone monitoring the network to find the cookie related to the session.
  530. Vulnerable? N/A
  531.  
  532. # 3
  533. Info -> Core: Frontend XSS Vulnerability
  534. Versions effected: 1.5.10 <=
  535. Check: /?1.5.10-x
  536. Exploit: Some values were output from the database without being properly escaped. Most strings in question were sourced from the administrator panel. Malicious normal admin can leverage it to gain access to super admin.
  537. Vulnerable? N/A
  538.  
  539. # 4
  540. Info -> Core: Frontend XSS - HTTP_REFERER not properly filtered Vulnerability
  541. Versions effected: 1.5.11 <=
  542. Check: /?1.5.11-x-http_ref
  543. Exploit: An attacker can inject JavaScript or DHTML code that will be executed in the context of targeted user browser, allowing the attacker to steal cookies. HTTP_REFERER variable is not properly parsed.
  544. Vulnerable? N/A
  545.  
  546. # 5
  547. Info -> Core: Frontend XSS - PHP_SELF not properly filtered Vulnerability
  548. Versions effected: 1.5.11 <=
  549. Check: /?1.5.11-x-php-s3lf
  550. Exploit: An attacker can inject JavaScript code in a URL that will be executed in the context of targeted user browser.
  551. Vulnerable? N/A
  552.  
  553. # 6
  554. Info -> Core: Path Disclosure Vulnerability
  555. Versions effected: Joomla! 1.5.3 <=
  556. Check: /?1.5.3-path-disclose
  557. Exploit: Crafted URL can disclose absolute path
  558. Vulnerable? N/A
  559.  
  560. # 7
  561. Info -> Core: User redirected Spamming Vulnerability
  562. Versions effected: Joomla! 1.5.3 <=
  563. Check: /?1.5.3-spam
  564. Exploit: User redirect spam
  565. Vulnerable? N/A
Add Comment
Please, Sign In to add comment