Liuw's Thinkpad

想要赢就先学会输,想要成功就先学会失败

Archive for the ‘windows’ tag

一个简单的AHK脚本

without comments

#IfWinActive ahk_class Emacs
Capslock::Control
Control::Capslock
#IfWinActive

假如当前的ahk_class是Emacs,那么交换Ctrl和Caps,否则不交换。

Written by liuw

January 22nd, 2012 at 4:21 pm

Posted in 分享

Tagged with , , ,

Windows Mobile栈溢出漏洞利用

with 6 comments

这是暑期实习的成果。原来查了Phrack和PacketStorm等网站,都没有发现这方面的文档。

这篇文章主要解决了如何编写Unicode-proof ARM Shellcode的问题,个人觉得还是比较有意义的。其实也不一定是局限于Windows Mobile系统,只要是ARM架构,遇到要写Unicode-proof Shellcode这样的问题,这篇文章里面的方法都可以作为参考,因而放上来与大家一起分享。

本文采用Attribution-Noncommercial-Share Alike 2.5 China Mainland授权。

文章有点长,所以只放目录了,有兴趣看的再下PDF吧由于和导师有协议,所以不能把文章放出来,实在需要的联系我。

目 录
第一章 绪论 4
1.1 研究背景和意义 4
1.2 章节安排 4
第二章 相关概念和工具 5
2.1 Windows Mobile 6.1系统 5
2.2 ARM架构 5
2.3 Unicode编码 6
2.4 缓冲区溢出漏洞 6
2.5 相关工具软件 6
第三章 ARM架构 7
第四章 Windows CE 5.2 7
4.1 Windows CE 5.2的内存架构 7
4.2 当前运行进程的内存映射情况 9
4.3 Windows CE 5.2下的ARM栈祯结构 10
4.4 Windows CE 5.2下的ARM汇编 10
4.5 Windows CE 5.2系统安全性分析 11
第五章 漏洞分析与攻击 12
5.1 漏洞描述 12
5.2 漏洞成因 12
5.3 分析与攻击 12
第六章 已知的Shellcode编写技术 14
6.1 IA-32上Unicode-proof Shellcode的编写 14
6.2 纯数字字母的ARM Shellcode的编写 15
6.3 对两个方法的总结 16
第七章 Unicode-proof ARM Shellcode 16
7.1 ARM与x86在Shellcode编写上的差异 17
7.2 指令分析 17
7.2.1 Condition field 17
7.2.2 Data-processing instructions 18
7.2.3 Branch instructions 21
7.2.4 Load and store instructions 23
7.3 Shellcode编写方法:DirectConstructor 24
7.4 Shellcode实例:DirectConstructor方法 26
7.5 Shellcode编写方法:MagicLoopDecoder 31
7.6 Shellcode实例:MagicLoopDecoder方法 32
7.7 对编写Shellcode的一些建议 36
第八章 总结和展望 36
8.1 项目已完成部分 37
8.1.1 对千千静听1.29版的攻击 37
8.1.2 Unicode-proof ARM Shellcode的编写方法 37
8.1.3 辅助工具的编写 37
8.2 未来工作 37
8.2.1 Thumb状态指令Shellcode的编写 37
8.2.2 全自动化Shellcode生成工具的编写 38
参考文献 38
致谢 39
附录 40
A.1 trans工具的使用 40
A.2 findmagic工具的使用 41

Written by liuw

September 1st, 2009 at 2:50 pm

大雷,无意写出来一个病毒

with one comment

在看C++ Primer,随便写一个程序。

#include <iostream>
#include <string>
using namespace std;
int main()
{
  throw string("Test throw");
  return 0;
}
Virus alarm

Virus alarm

Written by liuw

June 16th, 2009 at 12:29 am

Posted in Programming,Tech

Tagged with , , , ,

Windows下获取文件大小的方法

without comments

转过来的,先记下了。

#include <iostream>
#include <io.h>
#include <sys\stat.h>
#include <afx.h>
#define _AFXDLL
using namespace std;

void main()
{
    // 此文件在工程打开状态下为不可访问
    char* filepath = "..\\test.ncb";

    // 方法一
    struct _stat info;
    _stat(filepath, &info);
    int size = info.st_size;
    cout<<size<<endl;

    // 方法二
    FILE* file = fopen(filepath, "rb");
    if (file)
    {
        int size = filelength(fileno(file));
        cout<<size<<endl;
        fclose(file);
    }

    // 方法三
    CFile cfile;
    if (cfile.Open(filepath, CFile::modeRead))
    {
        int size = cfile.GetLength();
        cout<<size<<endl;
    }

    // 方法四
    HANDLE handle = CreateFile(filepath, FILE_READ_EA, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
    if (handle != INVALID_HANDLE_VALUE)
    {
        int size = GetFileSize(handle, NULL);
        cout<<size<<endl;
        CloseHandle(handle);
    }
}

Written by liuw

May 31st, 2009 at 9:42 am

Posted in Programming

Tagged with , , ,

假如Matrix运行在WinXP上

without comments

The Matrix 这样的神作,我想我也用不着多费口舌了。Matrix 在原作中是很明显是运行在 UNIX 环境下的。这下好了,不知道哪位老兄来的创意了,假如 Matrix 运行在 Windows XP 上,会是什么结果呢?

Enjoy!

http://jandan.net/2008/11/12/if_the_matrix_ran_on_windows.html

Written by liuw

November 12th, 2008 at 7:10 pm

Posted in 分享

Tagged with , ,