EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TElSimpleFTPSServer Remote IP Address in OnAuthAttempt

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
Posted: 09/09/2015 07:18:30
by Alex Wardle (Standard support level)
Joined: 09/07/2015
Posts: 2

Is there a way to get the IP address of the client that is attempting to authenticate in the OnAuthAttempt event in TElSimpleFTPSServer?

I can get it in the OnBeforeNewConnection event by remoteIp string but there isn't anything similar in the OnAuthAttempt.

Thank you
Posted: 09/09/2015 07:42:32
by Vsevolod Ievgiienko (Team)

Thank you for contacting us.

OnBeforeNewConnection event is fired before OnAuthAttempt, so there is no need to duplicate the IP in both events - you can simply assign a boolean flag in the 1st event and then use it in the 2nd event.
Posted: 09/09/2015 08:22:26
by Alex Wardle (Standard support level)
Joined: 09/07/2015
Posts: 2

Thank you for your reply.

I don't really understand what this boolean flag is as I need a the IP address so if the authentication
(using a password) fails I can record it as a failed attempt and then block the IP address.

I can't use a static field in the class as I don't know what order the events will fire in when there
are multiple simultaneous connections. ie:

* Client 1 -> Connects triggering OnBeforeNewConnection
* Client 2 -> Connects triggering OnBeforeNewConnection
* Client 2 -> Attempts to authenticate triggering OnAuthAttempt
* Client 1 -> Attempts to authenticate triggering OnAuthAttempt

Client 1 & Client 2 have different IP addresses.


Separately can you extend the session time out on the forum as it logs out too quickly whilst you are trying to compose a message and then you lose the message. The auto timeout bar doesn't seem to appear or you can not see it as I have scrolled down the page to see the reply box.
Posted: 09/09/2015 08:47:39
by Vsevolod Ievgiienko (Team)

OnAuthAttempt receives an instance of TElSimpleFTPSServerSessionThread class as a 'sender' parameter. You can get the IP using TElSimpleFTPSServerSessionThread.Socket.RemoteAddress property.



Topic viewed 1747 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!