ASP work protection program

zhaozj2021-02-16  49

Since the advent of ASP (Active Server Pages), due to its ability to create healthy and easy maintenance, the ASP technology has received more and more network programmers, and the use of ASP is increasingly involved in Web development. many. However, ASP is just a non-compilation, the scripting language running in the server, using the plain text) method, even if the ASP encryption is encrypted, it is not necessarily guaranteed to the operation environment The ASP application is not illegally copied. For administrators of high-level, you can easily copy the ASP program to other unauthorized websites from the server side. This brings certain difficulties to ASP app commercialization. How to effectively protect the developed ASP program, this article is based on the randomness generated by the disk serial number, combined with the Microsoft's official free ASP script encryption program Screnc.exe, which is well solved this problem.

Disk serial number, referred to as disk ID, is a disc identification information generated randomly generated when it is formatted, is a volume sequence number. The same machine is formatted twice. The same chance is almost zero. The late version of DOS is almost zero. The later version and Windows, WinNT use this disk identification mode, so the disk serial number is often used for commercial software to encrypt. use. Switch from Windows9.x to the MS-DOS mode, type the Dir command and enter, the current volume sequence number information appears in the screen, the serial number similar to "0A48-1CD7" is a 16-based number. Some software used within a limited time, after use, will require the user to apply for a new authorization serial number online (license). This kind of authorization serial number is considerably generated by a static disk serial number combining time. After installation, the program cannot be used even if it is illegally copied into an in-place installation environment.

The above ideas are easy to implement in VC, VB, and Deliphi programming languages, then how do you implement in ASP? VBScript As a robust, secure user language, is limited by the client system, cannot handle the call of the API on the client, and cannot directly manipulate the controls other than the files outside the client. Therefore, this paper uses VBScript and combined with the ASP built-in component FileSystem to achieve the above ideas. The following procedures can be applied to the actual ASP application system based on the specific situation.

As an example of explanation, this article uses the Access database security mechanism, in practical applications, you can store data in other formats. For the convenience, we first build an Access database id.mdb (password "kxj"), build a DriveInfo table, the data structure is as follows:

ID (Auto Number); Serno (Text, 12, Disk Serial Number (10)); Wrimark (Number, 1, Wrike Sign,).

Description

The WRIMARK value is 0 represents the legal user is not installed, the value is 1 means that the system is installed. When the value is 1 and the serial number does not match the current disk, it is determined as illegal copying users.

When initialization, first define a new record, each field initial value is 1,12345678,0, respectively.

Under the same directory, such as C: / Interpub / wwwroot, place the home page default.asp, legal user home Success.asp, illegally install User Tips page fail.htm and id.mdb serial number storage library.

The writing operations of each ASP file are as follows:

1. Use FrontPage (or NOTEPAD), create a new ASP file default.asp, enter the following program code:

Sample </ title> </ head> <% DIM CONN, FS, FSET CONN = Server.createObject ("AdoDb.Connection") Conn.open "Driver = {Microsoft Access Driver (* .mdb)}; uid =; pwd = kxj; dbq = "& server.mappath (" id.mdb ") set fs = server.createObject (" scripting.filesystemObject ") testdrive = server.mappath (" / driveInfo.asp " ) 'Get the current CAPATD TESTDRIVE = Left (TestDrive, 3) Set f = fs.getdrive (testdrive)' to call the getDrive method, give the drive to a variable mysql = "Select * from driveInfo where id = 1" set rcheck = Server.createObject ("AdoDb.Recordset") rscheck.open mysql, conn, 1 ,1fser = trim (f.SerialNumber) gets current disk serial number strserno = trim (rscheck.fields ("serno") Strmark = RSCheck .fields ("wrimark") if strserno <> fser and strmark = 0 THEN 'If you first install it, then write the write disk flag to 1Session ("pass") = true' Defines the user session, and set it to the global ASP document identity variable set RSMain = Server.createObject ("AdoDb.Recordset") mysql1 = "Update DriveInfo Set Serno =" & fser & ", Wrimark = 1" rsmain.open mysql1, conn, 1, 2Response.write ("<a href = 'success.asp '> Setup successful! Welcome to access the weight! </a> ") set /m = nothingelse if strserno = fser then' 合 合 用户 用户 用户 用户The method enters session ("pass") = truerenponse.write ("<a href='success.asp'> You are authorized by the Website Manager, Welcome To Access! </a>) Else 'illegal copy User session (" PASS ") = falserest.write (" <a href='fail.htm'> it is illegal to copy the Website "</p> <p>S asp Document.you Are Not Rigrt To Use The Program. </a> ") end ifendiffiffness.write (" <br> ") Response.write (" Volume Serial Number In Drive "Response.write (f .serialnumber) response.write ("" Volume HEX Serial Number In Drive "& TestDrive) response.write (" <br> ") response.write (" <br> ") Demonstration, this program lists the current disk serial number (16) SET F = NothingSet FS = Nothing%> </ html> 2, in the heads of each ASP file number accessed, add the following code:</p> <p><% IF session ("pass") = false then 'determines the session variable, illegally jumps out of this ASP file Response.Redirect ("fail.htm") end if%></p> <p>3. Use ASP encryption programs (such as Microsoft's Screnc.exe, other ASP encryption programs) to encrypt each ASP file.</p> <p>Running Screnc -l Vbscript Source.asp Destination.asp in DOS, that is, the source file source.asp generates new file Destination.asp containing Cipheet ASP scripts. Screnc.exe can download free in Microsoft Site (http://www.microsoft.com). The above program code is passed under Simplified Chinese NT4.0, IIS3.0 and Simplified Chinese PWIN9.8, PWS4.0.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-27007.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="27007" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.028</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'QsFkNTVi11wJ7AighFQhgT6BxsOUiLyac8zUxE6gXzelP1tpQp1tr1DF68EmVFFU5kX3dULy9QwfAPlg7FYpWQ_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>