Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am developing a file transfer monitor system. For HTTP and FTP file transfer, it no problem to monitor the Port 80(HTTP) and Port 21(FTP) to capture the file transfer information. However, for SFTP(Port 22) and HTTPS(Port 443),the file name cannot be captured because of the encryption.
Is there any approach to capture the file name and file size on HTTPS and SFTP protocol by using C#?
Thanks a lot.
Posted
Updated 26-Nov-13 15:53pm
v3
Comments
Sergey Alexandrovich Kryukov 26-Nov-13 20:53pm    
Not clear. It's a big difference, upload or download. Why capture? When I do it, nothing "popped up". You something which pops up something and then want to get rid of it... What? Any code sample?
—SA
walterhevedeich 26-Nov-13 20:55pm    
Are you using a browser to download and upload files, or do you have your own application for that?
BillWoodruff 26-Nov-13 20:56pm    
Please say more about how your application will work.

Is it a browser-specific application; or, does it need to work when any browser is used ?

If you can monitor the results of a file change in a specific directory, will that meet your needs ?

Is your application going to be "always on," and watching for any file save dialog ?
wusir371 26-Nov-13 21:38pm    
I will improved the question. Thanks.
Dave Kreskowiak 26-Nov-13 21:43pm    
This doesn't make any sense. Are you trying to monitor the percentage progress of the download??

I think that's the whole idea behind putting the transmission under HTTPS/SFTP: to prevent your data from being sniffed. I think a better approach would be to scan the source or destination, if you have access.
 
Share this answer
 
Comments
wusir371 27-Nov-13 1:38am    
May I understand your approach this way: scan the source or destination drive, record the new created file name and monitor the HTTPS/SFTP port, combine the file created time and HTTPS/SFTP transfer time, the transfer file name can be monitored/analyzed.
One problem is: I really can install the monitor application on Intranet's client or server, but I have no access to remote server. If the file is uploaded to remote server by SFTP, no file name information can be captured, although the SFTP connection can be monitored.
walterhevedeich 27-Nov-13 3:29am    
I'm not sure how you are uploading your file, but for SFTP, if you are using some third party component like SSHNet, there is an event that is triggered when the upload is complete.
wusir371 27-Nov-13 3:42am    
That makes sense. How can I capture the event (or process) when the upload is complete.
Thanks.
You can't. It's that simple.

Unless your app is the one doing the transfer, you can't get the filename or any other data about the transfer. You're trying to be the "man in the middle" that encryption protects against!

Events really aren't going to help you because not every browser exposes events, not every browser exposes the events you're looking for and you'd have to write specific functionality for every browser you want to support.
 
Share this answer
 
Comments
wusir371 27-Nov-13 20:12pm    
Is there an event in OS? So no matter which ever browser is used, the OS exposes an event and can be captured by app.
Dave Kreskowiak 27-Nov-13 21:05pm    
Why would the O/S care about a very specific type of application?

No, there is no event. The O/S doesn't know what the browser is doing.
wusir371 28-Nov-13 20:22pm    
I mean: if somebody access a HTTPS website and wanna upload a file to this website, a dialog box is poped up to get the uploaded file/files. Is it possible to exposes an event or create a process in the OS when this dialog box is poped up? If it's possible, a file name may be parsed. The app can be installed in client as a service. Thanks
Dave Kreskowiak 28-Nov-13 22:45pm    
FOR THE LAST TIME, THERE IS NO SUCH EVENT! Also services cannot truly interact with the users desktop anymore, so writing a service to do this is impossible. This is because of security concerns.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900