Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Inject commands on an FTP connection

Does anyone know if it is possible to inject a command into an FTP conversation?

I've trying to work around a bug in the application that is incorrectly asking for a transfer in ascii mode and prior to any GET I'd like to inject a BIN command. It looks like the server defaults to ASCII so I can't just remove the ASCII command from the stream so the [TCP::Payload] replacement thing doesn't seem appropriate.

Anyone got any bright ideas?

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

try the below

when SERVER_CONNECTED {
TCP::collect
}
when SERVER_DATA {
if {[TCP::payload] contains "string after which you want to inject BIN" }
TCP::respond "BIN"
TCP::payload replace 0 [TCP::payload length] ""
TCP::release

}
0
Comments on this Answer
Comment made 19-May-2017 by KenG 2

Might be my not understanding but won't that respond to the client with BIN rather than inject an additional command to the server as if from the client?

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Or you can use sideband connections

0
Comments on this Answer
Comment made 19-May-2017 by KenG 2

That would be a different connection outwith the client session...unless I can create a connection object out of the current client/server session and do a send on it?

0