#######################################################################

                             Luigi Auriemma

Application:  DATAC RealWin
              http://www.dataconline.com/software/realwin.php
              http://www.realflex.com
Versions:     <= 2.1 (Build 6.1.10.10)
Platforms:    Windows
Bug:          stack overflow
Exploitation: remote, versus server
Date:         21 Mar 2011 (found 25 Nov 2010)
Author:       Luigi Auriemma
              e-mail: aluigi@autistici.org
              web:    aluigi.org


#######################################################################


1) Introduction
2) Bug
3) The Code
4) Fix


#######################################################################

===============
1) Introduction
===============


"RealWin is a SCADA server package for medium / small applications."


#######################################################################

======
2) Bug
======


The part of the server listening on port 910 is vulnerable to a buffer
overflow happening in the function 004be510 that splits the input
strings using some delimiters passed by the callee functions and copies
them in a stack buffer of 1024 bytes.

One of the ways to exploit the vulnerability in that function is
through an On_FC_CONNECT_FCS_LOGIN packet containing a long username.


#######################################################################

===========
3) The Code
===========


http://aluigi.org/poc/realwin_2.zip

  nc SERVER 910 < realwin_2.dat


#######################################################################

======
4) Fix
======


No fix.


#######################################################################
