From 778faf722c88f38597b5d4a59eee0b4eca12bb6f Mon Sep 17 00:00:00 2001 From: "Tyler St. Onge" Date: Wed, 11 Nov 2020 09:51:54 -0500 Subject: allow akka to generate the name of the handler automatically --- src/main/scala/com/tylerstonge/honeypot/ftp/FtpHandler.scala | 2 +- src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/scala/com/tylerstonge/honeypot') diff --git a/src/main/scala/com/tylerstonge/honeypot/ftp/FtpHandler.scala b/src/main/scala/com/tylerstonge/honeypot/ftp/FtpHandler.scala index 313bf64..187017b 100644 --- a/src/main/scala/com/tylerstonge/honeypot/ftp/FtpHandler.scala +++ b/src/main/scala/com/tylerstonge/honeypot/ftp/FtpHandler.scala @@ -40,7 +40,7 @@ class FtpHandler(client: ActorRef) extends Actor { val r = new Random() val p1 = r.nextInt(200) val p2 = r.nextInt(200) - fileReceiver = context.actorOf(FtpFileReceiver.props(p1 * 256 + p2, client), name = "passive-connection") + fileReceiver = context.actorOf(FtpFileReceiver.props(p1 * 256 + p2, client), name = "passive-connection-" + (p1 * 256 + p2)) Thread.sleep(256) "227 entering passive mode (127,0,0,1," + p1 + "," + p2 + ")\n" case "stor" => diff --git a/src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala b/src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala index 2f581bd..9e98a39 100644 --- a/src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala +++ b/src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala @@ -24,7 +24,7 @@ class FtpListener(port: Int) extends Actor { case CommandFailed(_: Bind) => context.stop(self) case Connected(remote, _) => val connection = sender() - val handler = context.actorOf(FtpHandler.props(connection), name = "handler") + val handler = context.actorOf(FtpHandler.props(connection)) context.system.eventStream.publish(MNewConnection(remote.getHostString)) connection ! Register(handler) connection ! Write(ByteString.apply("220 (vulnFTPd 2.0.1)\n")) -- cgit v1.1