在windows cmd中制作图片一句话

本文介绍了一种利用网站图片上传功能植入后门的方法,通过将恶意代码隐藏在图片中,再借助特定工具实现远程控制,从而快速获得webshell。文中详细说明了在Windows系统下如何生成这类图片,并讨论了不同场景下文件命名的重要性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在测试网站时如果允许上传图片,可以通过上传一个隐藏后门代码的图片,然后用菜刀连接快速得到webshell。

在windows cmd.exe(windows+R后输入cmd可快速打开)中可以快速制作这种图片:

copy  source.jpg/b+chopper.php  target.jpg

其中source.jpg为原图片,chopper.php为含有后门代码的脚本,target.jpg为生成的图片一句话。

再多说一句,可能有的地方最终保存为图片的扩展名,有的地方教给大家保存为脚本文件的扩展名,这样会使一些人感到迷惑。我是这样理解的,其实在制作时保存成哪个都无所谓,因为正常情况下在使用时还会对它重命名。

假入你已经找到了iis6.0服务器下的一个.asp或者.asa结尾的文件夹并且能够将文件传进去,那么你就算保存成图片格式也无妨,因为iis6.0的解析漏洞的影响会将其按照asp文件解释(aspx不行)。但是如果你要通过其它方式使web容器按照脚本解释你上传的文件,那么就要保存为example.asp;1.jpg(仅为例子)。

所以说,到底是什么名字是由你渗透的方式决定的。

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、付费专栏及课程。

余额充值