Alvin
Alvin

Reputation: 10458

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.

Upvotes: 0

Views: 2401

Answers (6)

cjs
cjs

Reputation: 27261

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.

Upvotes: 0

Thomas Tempelmann
Thomas Tempelmann

Reputation: 12095

On Unix, tcpdump might be your friend. Maybe you should first state which OS you're targeting, though.

Upvotes: 0

Tuminoid
Tuminoid

Reputation: 9715

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.

Upvotes: 1

The Archetypal Paul
The Archetypal Paul

Reputation: 41769

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.

Upvotes: 1

kshahar
kshahar

Reputation: 10513

You can use the Wireshark application: http://www.wireshark.org/

It should have decent parsing capabilities for FTP as well as other protocols.

Upvotes: 4

Chris Kimpton
Chris Kimpton

Reputation: 5541

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.

Upvotes: 5

Related Questions