原创 Windows堆結構學習_堆塊

測試環境: xp sp3、vs2010、windbg 代碼如下: #include <stdio.h> #include <Windows.h> int main() { HANDLE hp=NULL; _asm { jm

原创 如何禁止編譯器內聯函數

在寫一些demo時總髮現strcpy()、strcat()函數或者我們自定義的小函數被編譯器會處理爲內聯函數,不仔細看彙編代碼還識別不出來,那麼怎樣一下就從彙編代碼識別出來呢? 禁止編譯器內聯唄 比如下面代碼: #include <st

原创 shellcode加載器分析

1、cuckoo中有一個shellcode的加載器execsc.exe,代碼如下: 大概流程: 打開shellcode文件;讀取shellcode文件內容;從shellcode起始位置開始執行。 問題: 默認shellcode的大小是2

原创 oday安全:軟件漏洞分析技術第五章例子_0

測試環境: Windows2000、VC++6.0、ollydbg(原版) 1、代碼如下: #include <stdio.h> #include <Windows.h> int main() { LoadLibraryA("use

原创 cuckoo主機和分析機通信過程分析

1、通信過程wireshark截圖: cuckoo主機向分析機發出請求,分析機回覆 2、分析機中agent.py精簡後代碼 #!/usr/bin/env python # Copyright (C) 2015-2017 Cuckoo

原创 Windows堆結構學習_快表

測試環境: windows2000 sp4、vc++6.0、ollydbg(原版) 代碼如下:HeapCreate(0,0,0)  //啓用快表 ollydbg調試過程 1、hp=HeapCreate(0,0,0)執行後,返回0x003

原创 Windows堆結構學習_空表

測試環境: xp sp3、vs2010、windbg 代碼如下: #include <stdio.h> #include <Windows.h> int main() { HLOCAL h1,h2,h3,h4,h5,h6; HA

原创 cuckoo的截圖功能

cuckoo使用的屏幕截圖庫是Pillow 客戶機位置:\lib\api\screenshot 其實就是調用了ImageGrab.grab( )這一個函數,ImageGrab.grab( )使用代碼: from PIL import I

原创 cuckoo中的is32bit.exe程序逆向

調用該程序的代碼位於分析機位置:C:\tmp2ow7jj\lib\api\process.py 具體是Process類中的is32bit( )函數。 逆向如下: 1、該程序使用說明: 2、根據傳入的不同參數調用不同函數輸出32或者64

原创 cuckoo提取樣本字符串

代碼位置:cuckoo\\processing\\strings.py 代碼整理後如下: #coding:utf-8 import re data=open("filepath","rb").read() # 一定要以二進制形式讀取文

原创 客戶機agent.py使用的argparse庫

該庫用來增加參數 agent.py中代碼如下: import argparse if __name__ == "__main__": # 生成一個parser對象 parser = argparse.ArgumentP

原创 oday安全:軟件漏洞分析技術第十章例子_0

編譯器在編譯程序時並不是對所有函數都應用GS,在不符合應用GS的函數中出現有安全隱患的代碼時,就可以通過溢出返回地址來執行任意代碼。 代碼如下: #include <stdio.h> #include <string.h> #prag

原创 WIndows堆結構學習

測試環境: xp sp3、vs2010、wndbg 代碼如下: #include <stdio.h> #include <Windows.h> int main() { HANDLE hp=NULL; _asm { jmp

原创 IDC腳本枚舉給定函數中的指令數量

腳本如下: #include <idc.idc> static main() { auto start,inst,end,count; start=GetFunctionAttr(ScreenEA(),FUNCATTR_START

原创 IDC腳本遍歷IDA數據庫中的函數信息

idc腳本語言借用了C語言很多語法,ida自身也沒有提供對應的編輯器,可以從設置中選擇notepad++ notepad++選擇C語言的編碼風格 idc腳本沒有提供調試功能,只能使用Message( )函數一行一行輸出,第一次嘗試寫了