Force Client to reconnect to ftp server - windows

so the case is: Client is in ftp session with server and how could i corrupt the connection so user would have to reconnect again? I'm thinking about blocking the clients ftp port, how could i accomplish that?

Simple thing to do is to add and enable a firewall rule from the Control Panel. You can even do it programmatically with the Windows Firewall API including from script.

Related

Forwarding RDP in tcp tunnel

I am creating a TCP tunnel application for RDP connections, On Server-side: Redirecting RDP connections to tunnel-server, Then sending those data to Client-side which receives the data successfully. But what happens after that? I don't know!
I know it is easier if traffic was HTTP/HTTPS because you can parse the header to address and content then send back the result. You don't even need TCP or sockets but forwarding RDP is unclear for me.
How can i forward those traffics from client-side then sending the results back to server and mstsc (windows default RDP client)? My problem is with the concept, Should i send those RDP data to client then from client machine to port 3389? And this app is considered some sort of Socks Proxy i guess.
This is the structure of what i have done at the moment:
Similar threads that aren't answer to my issue:
RDP through TCP Proxy
How to create a simple proxy in C#?
C# Proxy using Sockets, how should I do this?
P.S. The type of programming language doesn't matter for me (Currently working with c# and python but newer languages are OK too), I just want to learn how it works conceptually with a simple pseudo-code or sample, All kind of explanations or examples are appreciated.

Firewall blocks connection to second WebSocket server

In short we have two separate servers for our web app. The first one is the main server that uses Websockets for handling "chat rooms", and the second server only handles WebRTC audio chat rooms via Websocket. Both servers use Express to create a HTTPS server, use secure Websocket and the port 443.
I recently encountered a problem where a corporate client's firewall blocked the wss-connection to only the WebRTC server. The error logged in the user's browser was "ERR_CONNECTION_TIMED_OUT", which means the user never connects via Websocket. This has not happened with any other clients.
The Websocket connection works normally between the user and the main server, and no rules have been added to their firewall to use our app.
Has anyone encountered something similar? What kind of a firewall setting might cause this? Could this be a cors problem, since the servers are on their own sub-domains?
The main server could be restricting the type of data sent on port 443, which will use SSL to secure that transmitted data.
Refer to this page for information on the "Well-know port numbers".
The WebRTC audio data may need to be transmitted on its own dedicated port number that has been configured on the main server for this.
The problem was that the main server WebSocket used TCP and the WebRTC server used UDP, and UDP was blocked by corporate firewall on default.
WebRTC should use TCP as a backup, but I'm assuming UDP is still needed for the handshake.

How to establish a client server connection outside the LAN?

I am unable to establish a connection to the server of my client server app written in vb 6.0.
This is just because that the server of the app is behind a LAN router and the router of the LAN is not in my access so as to configure it. If it is possible to establish a connection so please let me know how? and if it is not possible than how the programs like team viewer and LogMein can establish a connection.
Ask the person who does administer the router to open the port or to give you a VPN tunnel, or to move the server to a lan with lower security requirements. If you have a good reason for needing this they shouldn't make a fuzz about it.
TeamViewer and LogMeIn rely on central systems under their own control. Both the client and the server make an outgoing connection to the central system that patches them through to each other. So on both sides the firewall only has to allow outgoing connections.
Depending on the router at the server end you might be able to use UPnP in your server to map the port through the NAT router.
See Easy UPnP NAT Traversal for a VB6 discussion of the topic.

Why is Passive FTP used more frequently?

As there are two questions about Passive vs. Active FTP mode
Passive FTP instead of Active FTP
What is the difference between active and passive FTP?
And if we kindly omit existence of FTP over SSH or FTPS (aka FTP with SSL/TLS)
What are security pros and cons of using Passive FTP?
My question comes out from experience that nearly every FTP I've came to touch with, was using Passive mode. So if it wasn't result of internal security policy, than please what is the motivation for using Passive FTP mode?
FTP is not secure, and never will be. The only reason to use passive ftp is that it works through any kind of firewall, as all connections are initiated by the client. Active FTP has the server connecting BACK to the client to initiate data transfers, which dumb firewalls will disallow, as they have no way to know that the incoming connection is related to the FTP connection and should be allowed through.
Passive FTP is easier to get through firewalls. For "active" FTP, the client has to be connectable from the internet, for passive ftp, that burden is on the server.

How do I monitor what commands my ftp application is sending to a ftp server

F
Is there a way to monitor the FTP port so that I can know what commands my FTP application is sending to a FTP server?
I am using a closed-source FTP client application, which is not working with a closed-source FTP application server. The client and the server are not communicating well with each other, and I would like to find out why. I wish to reverse-engineer the client to see what commends the client are sending to the sever. I used a web test tool before that allowed me to monitor the content transferring through HTTP, but I can't seem to find such tool for FTP. I appreciate it if you can help me out, thanks.
Sounds like you need a packet sniffer - assuming your network admins/company policy allows it...I have used wireshark fairly successfully before.
The core FTP commands should be visible in the packets.
You can use the Wireshark application: http://www.wireshark.org/
It should have decent parsing capabilities for FTP as well as other protocols.
Can you configure a proxy with the client? Then you could install an ftp proxy server using the logging on that to see what's going on?
There's a proxy server for Linux here: http://frox.sourceforge.net/doc/FAQ.html
Paul.
Do you have access to ftp-server logs? Its likely those commands would be logged there.
If they aren't, your next option would be to configure the server to log them, if you have access.
If thats not an option or server does not log such things, then you have to go to either packet sniffer or a proxy, as suggested by previous posters.
On Unix, tcpdump might be your friend. Maybe you should first state which OS you're targeting, though.
If you have the ability (often requiring root access) to use a packet sniffer, tcpflow sniffing the TCP control channel will show you the commands and responses going back and forth in an easy-to-read format.
If you don't have such access, tools such as ktrace and strace will allow you to see all data read and written on the socket for this connection, though it will be a little work to extract it.
If you could tell us just what tool you were using for HTTP traffic, that would allow us to look for something similar for FTP traffic.

Resources