diff options
author | Tyler St. Onge <tylertstonge@gmail.com> | 2020-07-18 01:24:12 -0400 |
---|---|---|
committer | Tyler St. Onge <tylertstonge@gmail.com> | 2020-07-18 01:24:12 -0400 |
commit | 248f358e3a7602e5e3e4149ebbd0e7f1b6fa9e37 (patch) | |
tree | 671f263b351fe68b58207af6de90531a9fe9663a |
initial commit
-rw-r--r-- | .gitignore | 107 | ||||
-rw-r--r-- | .idea/.gitignore | 3 | ||||
-rw-r--r-- | .idea/codeStyles/Project.xml | 7 | ||||
-rw-r--r-- | .idea/codeStyles/codeStyleConfig.xml | 5 | ||||
-rw-r--r-- | .idea/misc.xml | 4 | ||||
-rw-r--r-- | .idea/modules.xml | 9 | ||||
-rw-r--r-- | .idea/modules/honeypot-build.iml | 114 | ||||
-rw-r--r-- | .idea/modules/honeypot.iml | 18 | ||||
-rw-r--r-- | .idea/sbt.xml | 17 | ||||
-rw-r--r-- | .idea/scala_compiler.xml | 6 | ||||
-rw-r--r-- | .idea/vcs.xml | 6 | ||||
-rw-r--r-- | build.sbt | 7 | ||||
-rw-r--r-- | project/build.properties | 1 | ||||
-rw-r--r-- | src/main/scala/com/tylerstonge/honeypot/Main.scala | 9 | ||||
-rw-r--r-- | src/main/scala/com/tylerstonge/honeypot/SimplisticHandler.scala | 11 | ||||
-rw-r--r-- | src/main/scala/com/tylerstonge/honeypot/Supervisor.scala | 14 | ||||
-rw-r--r-- | src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala | 48 | ||||
-rw-r--r-- | src/main/scala/com/tylerstonge/honeypot/http/HttpListener.scala | 28 |
18 files changed, 414 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3f1345d --- /dev/null +++ b/.gitignore @@ -0,0 +1,107 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/scala,intellij +# Edit at https://www.toptal.com/developers/gitignore?templates=scala,intellij + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/**/sonarlint/ + +# SonarQube Plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +### Scala ### +*.class +*.log + +target/ + +# End of https://www.toptal.com/developers/gitignore/api/scala,intellij diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..919ce1f --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,7 @@ +<component name="ProjectCodeStyleConfiguration"> + <code_scheme name="Project" version="173"> + <ScalaCodeStyleSettings> + <option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" /> + </ScalaCodeStyleSettings> + </code_scheme> +</component>
\ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ +<component name="ProjectCodeStyleConfiguration"> + <state> + <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" /> + </state> +</component>
\ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..794aa67 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK" /> +</project>
\ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..acc4039 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/modules/honeypot.iml" filepath="$PROJECT_DIR$/.idea/modules/honeypot.iml" /> + <module fileurl="file://$PROJECT_DIR$/.idea/modules/honeypot-build.iml" filepath="$PROJECT_DIR$/.idea/modules/honeypot-build.iml" /> + </modules> + </component> +</project>
\ No newline at end of file diff --git a/.idea/modules/honeypot-build.iml b/.idea/modules/honeypot-build.iml new file mode 100644 index 0000000..725673b --- /dev/null +++ b/.idea/modules/honeypot-build.iml @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module external.linked.project.id="honeypot-build" external.linked.project.path="$MODULE_DIR$/../../project" external.root.project.path="$MODULE_DIR$/../.." external.system.id="SBT" sbt.imports="_root_.sbt.Keys._, _root_.sbt.ScriptedPlugin.autoImport._, _root_.sbt._, _root_.sbt.nio.Keys._, _root_.sbt.plugins.IvyPlugin, _root_.sbt.plugins.JvmPlugin, _root_.sbt.plugins.CorePlugin, _root_.sbt.ScriptedPlugin, _root_.sbt.plugins.SbtPlugin, _root_.sbt.plugins.SemanticdbPlugin, _root_.sbt.plugins.JUnitXmlReportPlugin, _root_.sbt.plugins.Giter8TemplatePlugin, _root_.scala.xml.{TopScope=&gt;SUB:DOLLARscope}" sbt.resolvers="https://repo1.maven.org/maven2/|maven|public, /home/dropkick/.ivy2/cache|ivy|Local cache, file:/home/dropkick/.sbt/preloaded|maven|local-preloaded" type="SBT_MODULE" version="4"> + <component name="NewModuleRootManager"> + <output url="file://$MODULE_DIR$/../../project/target/idea-classes" /> + <output-test url="file://$MODULE_DIR$/../../project/target/idea-test-classes" /> + <exclude-output /> + <content url="file://$MODULE_DIR$/../../project"> + <sourceFolder url="file://$MODULE_DIR$/../../project" isTestSource="false" /> + <excludeFolder url="file://$MODULE_DIR$/../../project/project/target" /> + <excludeFolder url="file://$MODULE_DIR$/../../project/target" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module-library"> + <library name="sbt: sbt-and-plugins"> + <CLASSES> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/lib/jansi.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/lib/jline.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/lib/scala-compiler.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/lib/scala-library.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/lib/scala-reflect.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/lib/scala-xml_2.12.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/actions_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/caffeine-2.5.6.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/collections_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/command_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/compiler-bridge_2.12-1.3.4.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/compiler-interface-1.3.4.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/completion_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/config-1.3.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/core-macros_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/disruptor-3.4.2.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/fastparse-utils_2.12-0.4.2.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/fastparse_2.12-0.4.2.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/file-tree-views-2.1.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/gigahorse-core_2.12-0.5.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/gigahorse-okhttp_2.12-0.5.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/io_2.12-1.3.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/ipcsocket-1.0.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/ivy-2.3.0-sbt-88d6a93d15f9b029958c1c289a8859e8dfe31a19.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/jawn-parser_2.12-0.10.4.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/jline-2.14.6.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/jna-4.5.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/jna-platform-4.5.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/jsch-0.1.54.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/launcher-interface-1.1.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/lenses_2.12-0.4.12.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/librarymanagement-core_2.12-1.3.1.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/librarymanagement-ivy_2.12-1.3.1.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/lm-coursier-shaded_2.12-2.0.0-RC5-3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/log4j-api-2.11.2.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/log4j-core-2.11.2.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/log4j-slf4j-impl-2.11.2.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/logic_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/main-settings_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/main_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/okhttp-3.14.2.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/okhttp-urlconnection-3.7.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/okio-1.17.2.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/protobuf-java-3.7.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/protocol_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/reactive-streams-1.0.2.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/run_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/sbinary_2.12-0.5.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/sbt-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/scala-parser-combinators_2.12-1.1.2.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/scala-reflect-2.12.10.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/scala-xml_2.12-1.2.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/scalacache-caffeine_2.12-0.20.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/scalacache-core_2.12-0.20.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/scalapb-runtime_2.12-0.6.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/scripted-plugin_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/scripted-sbt-redux_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/shaded-scalajson_2.12-1.0.0-M4.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/sjson-new-core_2.12-0.8.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/sjson-new-murmurhash_2.12-0.8.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/sjson-new-scalajson_2.12-0.8.2.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/slf4j-api-1.7.26.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/sourcecode_2.12-0.1.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/ssl-config-core_2.12-0.4.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/task-system_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/tasks_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/template-resolver-0.1.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/test-agent-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/test-interface-1.0.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/testing_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/util-cache_2.12-1.3.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/util-control_2.12-1.3.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/util-interface-1.3.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/util-logging_2.12-1.3.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/util-position_2.12-1.3.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/util-relation_2.12-1.3.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/util-scripted_2.12-1.3.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/util-tracking_2.12-1.3.3.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/zinc-apiinfo_2.12-1.3.4.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/zinc-classfile_2.12-1.3.4.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/zinc-classpath_2.12-1.3.4.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/zinc-compile-core_2.12-1.3.4.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/zinc-compile_2.12-1.3.4.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/zinc-core_2.12-1.3.4.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/zinc-lm-integration_2.12-1.3.8.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/zinc-persist_2.12-1.3.4.jar!/" /> + <root url="jar://$USER_HOME$/.sbt/boot/scala-2.12.10/org.scala-sbt/sbt/1.3.8/zinc_2.12-1.3.4.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + </component> + <component name="SbtModule"> + <option name="buildForURI" value="file:$MODULE_DIR$/../../" /> + <option name="imports" value="_root_.sbt.Keys._, _root_.sbt.ScriptedPlugin.autoImport._, _root_.sbt._, _root_.sbt.nio.Keys._, _root_.sbt.plugins.IvyPlugin, _root_.sbt.plugins.JvmPlugin, _root_.sbt.plugins.CorePlugin, _root_.sbt.ScriptedPlugin, _root_.sbt.plugins.SbtPlugin, _root_.sbt.plugins.SemanticdbPlugin, _root_.sbt.plugins.JUnitXmlReportPlugin, _root_.sbt.plugins.Giter8TemplatePlugin, _root_.scala.xml.{TopScope=>SUB:DOLLARscope}" /> + </component> +</module>
\ No newline at end of file diff --git a/.idea/modules/honeypot.iml b/.idea/modules/honeypot.iml new file mode 100644 index 0000000..e735fa7 --- /dev/null +++ b/.idea/modules/honeypot.iml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module external.linked.project.id="honeypot [file:/home/dropkick/dev/honeypot/honeypot/]" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="SBT" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> + <output url="file://$MODULE_DIR$/../../target/scala-2.13/classes" /> + <output-test url="file://$MODULE_DIR$/../../target/scala-2.13/test-classes" /> + <exclude-output /> + <content url="file://$MODULE_DIR$/../.."> + <sourceFolder url="file://$MODULE_DIR$/../../src/main/scala" isTestSource="false" /> + <excludeFolder url="file://$MODULE_DIR$/../../target" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="sbt: com.typesafe.akka:akka-actor_2.13:2.6.6:jar" level="project" /> + <orderEntry type="library" name="sbt: com.typesafe:config:1.4.0:jar" level="project" /> + <orderEntry type="library" name="sbt: org.scala-lang.modules:scala-java8-compat_2.13:0.9.0:jar" level="project" /> + <orderEntry type="library" name="sbt: org.scala-lang:scala-library:2.13.1:jar" level="project" /> + </component> +</module>
\ No newline at end of file diff --git a/.idea/sbt.xml b/.idea/sbt.xml new file mode 100644 index 0000000..fffb6e3 --- /dev/null +++ b/.idea/sbt.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ScalaSbtSettings"> + <option name="linkedExternalProjectsSettings"> + <SbtProjectSettings> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + <option value="$PROJECT_DIR$/project" /> + </set> + </option> + <option name="sbtVersion" value="1.3.8" /> + </SbtProjectSettings> + </option> + </component> +</project>
\ No newline at end of file diff --git a/.idea/scala_compiler.xml b/.idea/scala_compiler.xml new file mode 100644 index 0000000..3185530 --- /dev/null +++ b/.idea/scala_compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ScalaCompilerConfiguration"> + <profile name="sbt 1" modules="honeypot,honeypot_9523" /> + </component> +</project>
\ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$" vcs="Git" /> + </component> +</project>
\ No newline at end of file diff --git a/build.sbt b/build.sbt new file mode 100644 index 0000000..04e6aec --- /dev/null +++ b/build.sbt @@ -0,0 +1,7 @@ +scalaVersion := "2.13.1" + +name := "honeypot" +organization := "com.tylerstonge" +version := "1.0" + +libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.6.6" diff --git a/project/build.properties b/project/build.properties new file mode 100644 index 0000000..a919a9b --- /dev/null +++ b/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.3.8 diff --git a/src/main/scala/com/tylerstonge/honeypot/Main.scala b/src/main/scala/com/tylerstonge/honeypot/Main.scala new file mode 100644 index 0000000..3c01fc8 --- /dev/null +++ b/src/main/scala/com/tylerstonge/honeypot/Main.scala @@ -0,0 +1,9 @@ +package com.tylerstonge.honeypot + +import akka.actor.{ActorSystem, Props} +import com.tylerstonge.honeypot.ftp.FtpListener + +object Main extends App { + val system = ActorSystem("hello-system") + val listener = system.actorOf(Props[FtpListener], name = "ftp-listener") +} diff --git a/src/main/scala/com/tylerstonge/honeypot/SimplisticHandler.scala b/src/main/scala/com/tylerstonge/honeypot/SimplisticHandler.scala new file mode 100644 index 0000000..41b49c9 --- /dev/null +++ b/src/main/scala/com/tylerstonge/honeypot/SimplisticHandler.scala @@ -0,0 +1,11 @@ +package com.tylerstonge.honeypot + +import akka.actor.Actor +import akka.io.Tcp.{PeerClosed, Received, Write} + +class SimplisticHandler extends Actor { + def receive: Receive = { + case Received(data) => sender() ! Write(data) + case PeerClosed => context.stop(self) + } +} diff --git a/src/main/scala/com/tylerstonge/honeypot/Supervisor.scala b/src/main/scala/com/tylerstonge/honeypot/Supervisor.scala new file mode 100644 index 0000000..a04a6e8 --- /dev/null +++ b/src/main/scala/com/tylerstonge/honeypot/Supervisor.scala @@ -0,0 +1,14 @@ +package com.tylerstonge.honeypot + +import akka.actor.Actor + +class Supervisor extends Actor { + + override def receive: Receive = { + case _ => println("kk dood") + } + + override def postStop { + println("Supervisor::postStop") + } +}
\ No newline at end of file diff --git a/src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala b/src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala new file mode 100644 index 0000000..460f2f8 --- /dev/null +++ b/src/main/scala/com/tylerstonge/honeypot/ftp/FtpListener.scala @@ -0,0 +1,48 @@ +package com.tylerstonge.honeypot.ftp + +import java.net.InetSocketAddress + +import akka.actor.{Actor, Props} +import akka.event.{Logging, LoggingAdapter} +import akka.io.Tcp._ +import akka.io.{IO, Tcp} +import akka.util.ByteString + +class FtpListener extends Actor { + + val log: LoggingAdapter = Logging(context.system, this) + IO(Tcp)(context.system) ! Bind(self, new InetSocketAddress("localhost", 2121)) + + + override def receive: Receive = { + case Bound(localAddress) => + log.info("listening on {}", localAddress) + case CommandFailed(_: Bind) => context.stop(self) + case Connected(remote, local) => + val handler = context.actorOf(Props[FtpHandler]) + val connection = sender() + connection ! Register(handler) + connection ! Write(ByteString.apply("220 (vulnFTPd 2.0.1)\n")) + } +} + +class FtpHandler extends Actor { + val log: LoggingAdapter = Logging(context.system, this) + + override def receive: Receive = { + case Received(data) => { + log.info(">> {}", data.utf8String) + sender() ! Write(ByteString.apply(parse(data.utf8String))) + } + case PeerClosed => { + log.info("closing connection") + context.stop(self) + } + } + + def parse(msg: String): String = msg match { + case "AUTH SSL" => "500 cmd not recognized\n" + case "USER dropkick" => "200 come on in\n" + case _ => "200 sure\n" + } +} diff --git a/src/main/scala/com/tylerstonge/honeypot/http/HttpListener.scala b/src/main/scala/com/tylerstonge/honeypot/http/HttpListener.scala new file mode 100644 index 0000000..edd2b01 --- /dev/null +++ b/src/main/scala/com/tylerstonge/honeypot/http/HttpListener.scala @@ -0,0 +1,28 @@ +package com.tylerstonge.honeypot.http + +import java.net.InetSocketAddress + +import akka.actor.{Actor, Props} +import akka.event.Logging +import akka.io.Tcp._ +import akka.io.{IO, Tcp} +import com.tylerstonge.honeypot.SimplisticHandler + + +class HttpListener extends Actor { + val log = Logging(context.system, this) + + import context.system + + IO(Tcp) ! Bind(self, new InetSocketAddress("localhost", 7333)) + + override def receive: Receive = { + case b@Bound(localAddress) => context.parent ! b + case CommandFailed(_: Bind) => context.stop(self) + case c@Connected(remote, local) => + val handler = context.actorOf(Props[SimplisticHandler]) + val connection = sender() + connection ! Register(handler) + } + +}
\ No newline at end of file |