Portál AbcLinuxu, 12. května 2025 06:40
Dobry den, zajimalo by me, jakym zpusobem mohu zkompilovat tento zdrojovy kod:
http://www.milw0rm.com/exploits/295
gcc v Linuxu ani Dev-Cpp ve Windows mi ho prelozit nechteji.
Pak me napadlo vymenit
#include <windows.h>
za
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <time.h> #include <netinet/in.h> #include <curses.h> #include <unistd.h> #include <errno.h> #include <netdb.h> #include <signal.h> #include <sys/types.h> #include <sys/time.h> #include <sys/select.h> #include <netinet/in.h> #include <arpa/inet.h>
a gcc mi haze uz jenom tyto chyby:
winXP.c:294: warning: initialization makes integer from pointer without a cast winXP.c: In function ‘main’: winXP.c:350: error: ‘WSADATA’ undeclared (first use in this function) winXP.c:350: error: (Each undeclared identifier is reported only once winXP.c:350: error: for each function it appears in.) winXP.c:350: error: expected ‘;’ before ‘wsa’ winXP.c:383: error: ‘USHORT’ undeclared (first use in this function) winXP.c:383: error: expected ‘;’ before numeric constant winXP.c:384: error: ‘ULONG’ undeclared (first use in this function) winXP.c:384: error: expected ‘;’ before numeric constant winXP.c:389: error: expected ‘;’ before numeric constant winXP.c:427: error: ‘wsa’ undeclared (first use in this function)
Nevite prosim, co mam jeste udelat, abych mohl tento zdrojovy kod zkomplilovat?
Pro ty co me chteji poslat nekam s tim, ze je to exploit: Zajima me to ciste teoreticky, jak podobny zdrojovy kod zkomplilovat, nejde mi o zneuziti exploitu (ktery je stejne uz davno out-of-date). Dekuji.
zkompiluješ ho ve Visual Studiu - http://www.microsoft.com/express/vc/
A zkousel jste to? Nerad bych zbytecne shanel a instaloval VS.
Odkaz mate, stahnout jde zdarma, tak co chcete shanet?
Taky muzete dva radky pridat:
typedef unsigned short USHORT; typedef unsigned long ULONG;
A dva zakomentovat (najdete si je v souboru):
/* WSAStartup(MAKEWORD(2,0),&wsa); */ /* WSADATA wsa; */
Kdyz provedu zmeny, ktere pisete, bude program stale fungovat? Ty dva radky tam maji jiste nejaky vyznam, ne?
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.