1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
|
#
# Copyright 2000 by Noam Rathaus <noamr@securiteam.com>
#
# See the Nessus Scripts License for details
#
#
desc = "We detected a vulnerable version of the DCShop CGI.
This version does not properly protect user and credit card information.
It is possible to access files that contain administrative passwords,
current and pending transactions and credit card information (along with name,
address, etc).
Solution:
1. Rename following directories to something hard to guess:
- Data
- User_carts
- Orders
- Auth_data
2. Make these changes to dcshop.setup and dcshop_admin.setup.
- In dcshop.setup, modify:
$datadir = '$cgidir/Data'
$cart_dir = '$cgidir/User_carts'
$order_dir = '$cgidir/Orders'
- In dcshop_admin.setup, modify:
$password_file_dir = '$path/Auth_data'
3. Rename dcshop.setup and dcshop_admin.setup to something difficult to guess.
For example, dcshop_4314312.setup and dcshop_admin_3124214.setup
4. Edit dcshop.cgi, dcshop_admin.cgi, and dcshop_checkout.cgi and modify the
require statement for dcshop.setup and dcshop_admin.setup. That is:
- In dcshop.cgi, modify
require '$path/dcshop.setup'
so that it uses new setup file. For example,
require '$path/dcshop_4314312.setup'
- In dcshop_admin.cgi, modify
require '$path/dcshop.setup'
require '$path/dcshop_admin.setup'
so that it uses new setup file. For example,
require '$path/dcshop_4314312.setup'
require '$path/dcshop_admin_3124214.setup'
- In dcshop_checkout.cgi, modify
require '$path/dcshop.setup'
so that it uses new setup file. For example,
require '$path/dcshop_4314312.setup'
5. Save following file as index.html and upload it to your
/cgi-bin/dcshop directory, thereby hiding directory listing. On
NT servers, you may have to rename this file to default.htm.
http://www.dcscripts.com/FAQ/
This page show 'Internal Server Error' so it is not an error page...
it's just an index.html file to HIDE directories.
6. Replace your current files with above files
Risk factor : High
Additional information:
http://www.securiteam.com/unixfocus/5RP0N2K4KE.html
";
if(description)
{
script_id(10718);
script_bugtraq_id(2889);
script_cve_id("CAN-2001-0821");
script_version ("$Revision: 1.23 $");
name["english"] = "DCShop exposes sensitive files";
script_name(english:name["english"]);
script_description(english:desc);
summary["english"] = "DCShop exposes sensitive files";
script_summary(english:summary["english"]);
script_category(ACT_GATHER_INFO);
script_copyright(english:"This script is Copyright (C) 2001 SecuriTeam");
family["english"] = "General";
script_family(english:family["english"]);
script_dependencie("find_service.nes", "no404.nasl");
script_require_ports("Services/www", 80);
exit(0);
}
#
# The script code starts here
#
include("http_func.inc");
include("http_keepalive.inc");
port = get_http_port(default:80);
if(!get_port_state(port))exit(0);
gdirs = make_list(cgi_dirs(), "/dcshop", "/DCshop");
program[0] = "/dcshop.pl";
program[1] = "/dcshop.cgi";
orders[0] = "/Orders/orders.txt";
orders[1] = "/orders/orders.txt";
Auth[0] = "/Auth_data/auth_user_file.txt";
Auth[1] = "/auth_data/auth_user_file.txt";
unsafe_url_count = 0;
foreach dir (gdirs)
{
for (j = 0; program[j] ; j = j + 1)
{
url = string(dir, program[j]);
if (is_cgi_installed_ka(item:url, port:port))
{
unsafe_url_count = 0;
#display("Found dcshop at: ", url, "\n");
for (k = 0; orders[k] ; k = k + 1)
{
orders_url = string(dir, orders[k]);
success = is_cgi_installed_ka(item:orders_url, port:port);
if (success)
{
unsafe_urls[unsafe_url_count] = string("DCShop orders file: ", orders_url);
unsafe_url_count = unsafe_url_count + 1;
}
}
flag = 0;
for (k = 0; Auth[k]; k = k + 1)
{
auth_url = string(dir, Auth[k]);
success = is_cgi_installed_ka(item:auth_url, port:port);
if (success)
{
flag = 1;
unsafe_urls[unsafe_url_count] = string("DCShop authentication file: ", auth_url);
unsafe_url_count = unsafe_url_count + 1;
}
}
}
}
}
if(unsafe_url_count > 0)
{
data = string("\n\n\nThe following files are affected:\n\n");
data = desc + data;
for(i = 0; i < unsafe_url_count; i = i + 1)
data = string(data, unsafe_urls[i], "\n");
security_hole(port:port, data:data);
}
|