使用ASP+Access的安全隐患及对策
ASP+Access解决方案的主要 安全 隐患 来自Access数据库的 安全 性,其次在于ASP网页设计过程中的 安全 漏洞。 1.Access数据库的存储 隐患 在ASP+Access应用系统中,如果获得或者猜到Access数据库的存储路径和数据库名,则该数据库就可以被下载到本地。例如
ASP+Access解决方案的主要安全隐患来自Access数据库的安全性,其次在于ASP网页设计过程中的安全漏洞。1.Access数据库的存储隐患
在ASP+Access应用系统中,如果获得或者猜到Access数据库的存储路径和数据库名,则该数据库就可以被下载到本地。例如:对于网上书店的Access数据库,人们一般命名为book.mdb、store.mdb等,而存储的路径一般为“URL/database”或干脆放在根目录(“URL/”)下。这样,只要在浏览器地址栏中敲入地址:“URL/database/store.mdb”,就可以轻易地把store.mdb下载到本地的机器中。
2.Access数据库的解密隐患
由于Access数据库的加密机制非常简单,所以即使数据库设置了密码,解密也很容易。该数据库系统通过将用户输入的密码与某一固定密钥进行异或来形成一个加密串,并将其存储在*.mdb文件中从地址“&H42”开始的区域内。由于异或操作的特点是“经过两次异或就恢复原值”,因此,用这一密钥与*.mdb文件中的加密串进行第二次异或操作,就可以轻松地得到Access数据库的密码。基于这种原理,可以很容易地编制出解密程序。
由此可见,无论是否设置了数据库密码,只要数据库被下载,其信息就没有任何安全性可言了。
3.源代码的安全隐患
由于ASP程序采用的是非编译性语言,这大大降低了程序源代码的安全性。任何人只要进入站点,就可以获得源代码,从而造成ASP应用程序源代码的泄露。
4.程序设计中的安全隐患
ASP代码利用表单(form)实现与用户交互的功能,而相应的内容会反映在浏览器的地址栏中,如果不采用适当的安全措施,只要记下这些内容,就可以绕过验证直接进入某一页面。例如在浏览器中敲入“……page.asp?x=1”,即可不经过表单页面直接进入满足“x=1”条件的页面。因此,在设计验证或注册页面时,必须采取特殊措施来避免此类问题的发生。
提高数据库的安全性
由于Access数据库加密机制过于简单,因此,如何有效地防止Access数据库被下载,就成了提高ASP+Access解决方案安全性的重中之重。
1.非常规命名法
防止数据库被找到的简便方法是为Access数据库文件起一个复杂的非常规名字,并把它存放在多层目录下。例如,对于网上书店的数据库文件,不要简单地命名为“book.mdb”或“store.mdb”,而是要起个非常规的名字,例如:faq19jhsvzbal.mdb,再把它放在如./akkjj16t/kjhgb661/acd/avccx55 之类的深层目录下。这样,对于一些通过猜的方式得到Access数据库文件名的非法访问方法起到了有效的阻止作用。
2.使用ODBC数据源
在ASP程序设计中,应尽量使用ODBC数据源,不要把数据库名直接写在程序中,否则,数据库名将随ASP源代码的失密而一同失密。例如:
DBPath = Server.MapPath(“./akkjj16t/
kjhgb661/acd/avccx55/faq19jhsvzbal.mdb ”)
conn.Open “driver={Microsoft Access Driver (*.mdb)};dbq=” & DBPath
可见,即使数据库名字起得再怪异,隐藏的目录再深,ASP源代码失密后,数据库也很容易被下载下来。如果使用ODBC数据源,就不会存在这样的问题了:
conn.open “ODBC-DSN名”
对ASP页面进行加密
为有效地防止ASP源代码泄露,可以对ASP页面进行加密。一般有两种方法对ASP页面进行加密。一种是使用组件技术将编程逻辑封装入DLL之中;另一种是使用微软的Script Encoder对ASP页面进行加密。笔者认为,使用组件技术存在的主要问题是每段代码均需组件化,操作比较烦琐,工作量较大;而使用Script Encoder对ASP页面进行加密,操作简单、收效良好。Script Encoder方法具有许多优点:
1.HTML仍具有很好的可编辑性。Script Encoder只加密在HTML页面中嵌入的ASP代码,其他部分仍保持不变,这就使得我们仍然可以使用FrontPage或Dreamweaver等常用网页编辑工具对HTML部分进行修改、完善,只是不能对ASP加密部分进行修改,否则将导致文件失效。
2.操作简单。只要掌握几个命令行参数即可。Script Encoder的运行程序是screnc.exe,其使用方法如下:
screnc [/s] [/f] [/xl] [/l defLanguage ] [/e defExtension] inputfile outputfile
其中的参数含义如下:
s:屏蔽屏幕输出;
f:指定输出文件是否覆盖同名输入文件;
xl:是否在.asp文件的顶部添加@Language指令;
l:defLanguag指定缺省的脚本语言;
e:defExtension 指定待加密文件的扩展名。
3.可以批量加密文件。使用Script Encoder可以对当前目录中的所有的ASP 文件进行加密,并把加密后的文件统一输出到相应的目录中。例如:
screnc *.asp c:\temp
4. Script Encoder是免费软件。该加密软件可以从微软网站下载:http://msdn.microsoft.com/scripting/vbscript/download/x86/sce10en.exe。下载后,运行安装即可。
利用Session对象进行注册验证
为防止未经注册的用户绕过注册界面直接进入应用系统,可以采用Session对象进行注册验证。Session对象最大的优点是可以把某用户的信息保留下来,让后续的网页读取。
设计要求用户注册成功后系统启动hrmis.asp?page=1页面。如果不采用Session对象进行注册验证,则用户在浏览器中敲入“URL/hrmis.asp?page=1”即可绕过注册界面,直接进入系统。利用Session对象可以有效阻止这一情况的发生。相关的程序代码如下:
<%
' 读取用户输入的账号和密码
UserID = Request(“UserID”)
Password = Request(“Password”)
' 检查UserID 及Password 是否正确(实际程序可能会比较复杂)
If UserID <>“hrmis” Or Password <>
“password” Then
Response.Write “账号错误!”
Response.End
End If
'将Session 对象设置为通过验证状态
Session(“Passed”) = True
%>
进入应用程序后,首先进行验证:
<%
'如果未通过验证,返回Login状态
If Not Session(“Passed”) Then
Response.Redirect “Login.asp”
End If
%>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Cloud storage has become an indispensable part of our daily life and work nowadays. As one of the leading cloud storage services in China, Baidu Netdisk has won the favor of a large number of users with its powerful storage functions, efficient transmission speed and convenient operation experience. And whether you want to back up important files, share information, watch videos online, or listen to music, Baidu Cloud Disk can meet your needs. However, many users may not understand the specific use method of Baidu Netdisk app, so this tutorial will introduce in detail how to use Baidu Netdisk app. Users who are still confused can follow this article to learn more. ! How to use Baidu Cloud Network Disk: 1. Installation First, when downloading and installing Baidu Cloud software, please select the custom installation option.

NetEase Mailbox, as an email address widely used by Chinese netizens, has always won the trust of users with its stable and efficient services. NetEase Mailbox Master is an email software specially created for mobile phone users. It greatly simplifies the process of sending and receiving emails and makes our email processing more convenient. So how to use NetEase Mailbox Master, and what specific functions it has. Below, the editor of this site will give you a detailed introduction, hoping to help you! First, you can search and download the NetEase Mailbox Master app in the mobile app store. Search for "NetEase Mailbox Master" in App Store or Baidu Mobile Assistant, and then follow the prompts to install it. After the download and installation is completed, we open the NetEase email account and log in. The login interface is as shown below

MetaMask (also called Little Fox Wallet in Chinese) is a free and well-received encryption wallet software. Currently, BTCC supports binding to the MetaMask wallet. After binding, you can use the MetaMask wallet to quickly log in, store value, buy coins, etc., and you can also get 20 USDT trial bonus for the first time binding. In the BTCCMetaMask wallet tutorial, we will introduce in detail how to register and use MetaMask, and how to bind and use the Little Fox wallet in BTCC. What is MetaMask wallet? With over 30 million users, MetaMask Little Fox Wallet is one of the most popular cryptocurrency wallets today. It is free to use and can be installed on the network as an extension

Xiaomi car software provides remote car control functions, allowing users to remotely control the vehicle through mobile phones or computers, such as opening and closing the vehicle's doors and windows, starting the engine, controlling the vehicle's air conditioner and audio, etc. The following is the use and content of this software, let's learn about it together . Comprehensive list of Xiaomi Auto app functions and usage methods 1. The Xiaomi Auto app was launched on the Apple AppStore on March 25, and can now be downloaded from the app store on Android phones; Car purchase: Learn about the core highlights and technical parameters of Xiaomi Auto, and make an appointment for a test drive. Configure and order your Xiaomi car, and support online processing of car pickup to-do items. 3. Community: Understand Xiaomi Auto brand information, exchange car experience, and share wonderful car life; 4. Car control: The mobile phone is the remote control, remote control, real-time security, easy

Java framework design enables security by balancing security needs with business needs: identifying key business needs and prioritizing relevant security requirements. Develop flexible security strategies, respond to threats in layers, and make regular adjustments. Consider architectural flexibility, support business evolution, and abstract security functions. Prioritize efficiency and availability, optimize security measures, and improve visibility.

BitgetLaunchpool is a dynamic platform designed for all cryptocurrency enthusiasts. BitgetLaunchpool stands out with its unique offering. Here, you can stake your tokens to unlock more rewards, including airdrops, high returns, and a generous prize pool exclusive to early participants. What is BitgetLaunchpool? BitgetLaunchpool is a cryptocurrency platform where tokens can be staked and earned with user-friendly terms and conditions. By investing BGB or other tokens in Launchpool, users have the opportunity to receive free airdrops, earnings and participate in generous bonus pools. The income from pledged assets is calculated within T+1 hours, and the rewards are based on

The rapid development of generative AI has created unprecedented challenges in privacy and security, triggering urgent calls for regulatory intervention. Last week, I had the opportunity to discuss the security-related impacts of AI with some members of Congress and their staff in Washington, D.C. Today's generative AI reminds me of the Internet in the late 1980s, with basic research, latent potential, and academic uses, but it's not yet ready for the public. This time, unchecked vendor ambition, fueled by minor league venture capital and inspired by Twitter echo chambers, is rapidly advancing AI’s “brave new world.” The "public" base model is flawed and unsuitable for consumer and commercial use; privacy abstractions, if present, leak like a sieve; security structures are important because of the attack surface

Go language is a simple, efficient, and highly concurrency programming language. It is an open source language developed by Google. In the Go language, the use of spaces is very important, it can improve the readability and maintainability of the code. This article will introduce how to use spaces correctly in Go language and provide specific code examples. Why you need to use spaces correctly In the programming process, the use of spaces is very important for the readability and beauty of the code. Appropriate use of spaces can make code clearer and easier to read, thus reducing
