Rename the project to Deceptifeed

This commit is contained in:
Ryan Smith
2024-10-21 17:18:09 -07:00
parent 34fbbc8233
commit d17f6fffaa
12 changed files with 47 additions and 51 deletions

14
.gitignore vendored
View File

@@ -19,16 +19,12 @@ go.work.sum
.env
# Ignore Linux binary, but allow folder of same name.
cti-honeypot
!cti-honeypot/
deceptifeed
!deceptifeed/
# Ignore default user configuration and log files used by cti-honeypot.
cti-honeypot.xml
cti-honeypot-log.txt
cti-honeypot-feed.json
cti-honeypot-https.crt
cti-honeypot-https.key
cti-honeypot-ssh.key
# Ignore default user configuration and log files used by Deceptifeed.
deceptifeed.*
deceptifeed-*.*
# Ignore build output directory used by Makefile.
out/

View File

@@ -1,7 +1,7 @@
# Makefile for CTI Honeypot
# Makefile for Deceptifeed
TARGET_BINARY := ./out/cti-honeypot
SOURCE := ./cmd/cti-honeypot/
TARGET_BINARY := ./out/deceptifeed
SOURCE := ./cmd/deceptifeed/
INSTALL_SCRIPT := ./scripts/install.sh
UNINSTALL_SCRIPT := ./scripts/install.sh --uninstall
GO := go

View File

@@ -5,12 +5,12 @@ import (
"log"
"sync"
"github.com/r-smith/cti-honeypot/internal/config"
"github.com/r-smith/cti-honeypot/internal/httpserver"
"github.com/r-smith/cti-honeypot/internal/sshserver"
"github.com/r-smith/cti-honeypot/internal/tcpserver"
"github.com/r-smith/cti-honeypot/internal/threatfeed"
"github.com/r-smith/cti-honeypot/internal/udpserver"
"github.com/r-smith/deceptifeed/internal/config"
"github.com/r-smith/deceptifeed/internal/httpserver"
"github.com/r-smith/deceptifeed/internal/sshserver"
"github.com/r-smith/deceptifeed/internal/tcpserver"
"github.com/r-smith/deceptifeed/internal/threatfeed"
"github.com/r-smith/deceptifeed/internal/udpserver"
)
func main() {

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<config>
<defaultLogPath>/opt/cti-honeypot/var/log/honeypot-log.txt</defaultLogPath>
<defaultLogPath>/opt/deceptifeed/var/log/honeypot-log.txt</defaultLogPath>
<honeypotServers>
<server type="http">
@@ -16,8 +16,8 @@
<port>8443</port>
<logEnabled>true</logEnabled>
<sendToThreatFeed>true</sendToThreatFeed>
<certPath>/opt/cti-honeypot/certs/https-cert.pem</certPath>
<keyPath>/opt/cti-honeypot/certs/https-key.pem</keyPath>
<certPath>/opt/deceptifeed/certs/https-cert.pem</certPath>
<keyPath>/opt/deceptifeed/certs/https-key.pem</keyPath>
</server>
<server type="ssh">
@@ -25,7 +25,7 @@
<port>2022</port>
<logEnabled>true</logEnabled>
<sendToThreatFeed>true</sendToThreatFeed>
<keyPath>/opt/cti-honeypot/certs/ssh-key.pem</keyPath>
<keyPath>/opt/deceptifeed/certs/ssh-key.pem</keyPath>
<banner>SSH-2.0-OpenSSH_9.3 FreeBSD-20230316</banner>
</server>
</honeypotServers>
@@ -33,7 +33,7 @@
<threatFeed>
<enabled>true</enabled>
<port>8081</port>
<databasePath>/opt/cti-honeypot/var/log/threatfeed.json</databasePath>
<databasePath>/opt/deceptifeed/var/log/threatfeed.json</databasePath>
<threatExpiryHours>168</threatExpiryHours>
<isPrivateIncluded>false</isPrivateIncluded>
</threatFeed>

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/r-smith/cti-honeypot
module github.com/r-smith/deceptifeed
go 1.23

View File

@@ -19,13 +19,13 @@ const (
DefaultPortSSH = "2022"
DefaultPortThreatFeed = "8081"
DefaultThreatExpiryHours = 168
DefaultThreatDatabasePath = "cti-honeypot-feed.json"
DefaultThreatDatabasePath = "deceptifeed-database.json"
DefaultThreatIncludePrivate = true
DefaultLogPath = "cti-honeypot-log.txt"
DefaultLogPath = "deceptifeed-log.txt"
DefaultHtmlPath = ""
DefaultCertPathHTTPS = "cti-honeypot-https.crt"
DefaultKeyPathHTTPS = "cti-honeypot-https.key"
DefaultKeyPathSSH = "cti-honeypot-ssh.key"
DefaultCertPathHTTPS = "deceptifeed-https.crt"
DefaultKeyPathHTTPS = "deceptifeed-https.key"
DefaultKeyPathSSH = "deceptifeed-ssh.key"
DefaultBannerSSH = "SSH-2.0-OpenSSH_9.3 FreeBSD-20230316" // SSH banner for FreeBSD 13.2
)

View File

@@ -17,8 +17,8 @@ import (
"strings"
"time"
"github.com/r-smith/cti-honeypot/internal/config"
"github.com/r-smith/cti-honeypot/internal/threatfeed"
"github.com/r-smith/deceptifeed/internal/config"
"github.com/r-smith/deceptifeed/internal/threatfeed"
)
// StartHTTP initializes and starts an HTTP honeypot server. This is a fully

View File

@@ -11,8 +11,8 @@ import (
"net"
"os"
"github.com/r-smith/cti-honeypot/internal/config"
"github.com/r-smith/cti-honeypot/internal/threatfeed"
"github.com/r-smith/deceptifeed/internal/config"
"github.com/r-smith/deceptifeed/internal/threatfeed"
"golang.org/x/crypto/ssh"
)

View File

@@ -11,8 +11,8 @@ import (
"strings"
"time"
"github.com/r-smith/cti-honeypot/internal/config"
"github.com/r-smith/cti-honeypot/internal/threatfeed"
"github.com/r-smith/deceptifeed/internal/config"
"github.com/r-smith/deceptifeed/internal/threatfeed"
)
// serverTimeout defines the duration after which connected clients are

View File

@@ -12,7 +12,7 @@ import (
"sync"
"time"
"github.com/r-smith/cti-honeypot/internal/config"
"github.com/r-smith/deceptifeed/internal/config"
)
var (

View File

@@ -9,7 +9,7 @@ import (
"strconv"
"strings"
"github.com/r-smith/cti-honeypot/internal/config"
"github.com/r-smith/deceptifeed/internal/config"
)
// StartUDP serves as a wrapper to initialize and start a generic UDP honeypot

View File

@@ -3,16 +3,16 @@
# =============================================================================
# Variable declarations.
# =============================================================================
INSTALL_DIR="/opt/cti-honeypot"
USERNAME="honeypot"
TARGET_BIN="${INSTALL_DIR}/bin/cti-honeypot"
INSTALL_DIR="/opt/deceptifeed"
USERNAME="deceptifeed"
TARGET_BIN="${INSTALL_DIR}/bin/deceptifeed"
TARGET_CFG="${INSTALL_DIR}/etc/config.xml"
SOURCE_BIN="cti-honeypot"
SOURCE_BIN="deceptifeed"
SOURCE_CFG="default-config.xml"
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
SYSTEMD_CHECK_DIR="/run/systemd/system"
SYSTEMD_DIR="/etc/systemd/system"
SYSTEMD_UNIT="cti-honeypot.service"
SYSTEMD_UNIT="deceptifeed.service"
# =============================================================================
# startup_checks:
@@ -76,7 +76,7 @@ upgrade_app() {
# Prompt for upgrade.
#
echo
echo -e "${YELLOW}CTI Honeypot is already installed to: ${BLUE}${INSTALL_DIR}/${CLEAR}"
echo -e "${YELLOW}Deceptifeed is already installed to: ${BLUE}${INSTALL_DIR}/${CLEAR}"
echo -e "${YELLOW}Would you like to upgrade? ${WHITE}(y/N) ${CLEAR}"
read -r CONFIRM
if [[ "${CONFIRM}" != "y" && "${CONFIRM}" != "Y" ]]; then
@@ -90,8 +90,8 @@ upgrade_app() {
# Print upgrade banner.
#
echo
echo -e " ${WHITE}Upgrading CTI Honeypot${CLEAR}"
echo -e " ${DGRAY}======================${CLEAR}"
echo -e " ${WHITE}Upgrading Deceptifeed${CLEAR}"
echo -e " ${DGRAY}=====================${CLEAR}"
echo
#echo -e " ${DGRAY}- ${LGRAY}Installation path: ${CYAN}'${INSTALL_DIR}/'"
@@ -202,8 +202,8 @@ install_app() {
# Print install banner.
#
echo
echo -e " ${WHITE}Installing CTI Honeypot${CLEAR}"
echo -e " ${DGRAY}=======================${CLEAR}"
echo -e " ${WHITE}Installing Deceptifeed${CLEAR}"
echo -e " ${DGRAY}======================${CLEAR}"
echo
echo -e " ${DGRAY}- ${LGRAY}Installing to: ${CYAN}'${INSTALL_DIR}/'"
@@ -268,7 +268,7 @@ install_app() {
chmod 664 "${TARGET_CFG}"
#
# Allow cti-honeypot to bind to a port < 1024 when running as a non-root user.
# Allow the app to bind to a port < 1024 when running as a non-root user.
#
setcap cap_net_bind_service=+ep "${TARGET_BIN}"
@@ -279,7 +279,7 @@ install_app() {
if [ ! -f "${SYSTEMD_DIR}/${SYSTEMD_UNIT}" ]; then
cat > "${SYSTEMD_DIR}/${SYSTEMD_UNIT}" << EOF
[Unit]
Description=CTI Honeypot
Description=Deceptifeed
ConditionPathExists=${TARGET_BIN}
After=network.target
@@ -335,7 +335,7 @@ uninstall_app() {
# Print uninstall banner.
#
echo
echo -e " ${WHITE}Unnstalling CTI Honeypot${CLEAR}"
echo -e " ${WHITE}Uninstalling Deceptifeed${CLEAR}"
echo -e " ${DGRAY}========================${CLEAR}"
echo
@@ -399,7 +399,7 @@ uninstall_app() {
echo -e " ${DGRAY}=======================${CLEAR}"
echo
echo -e " ${GREEN}Success${CLEAR}"
echo -e " ${LGRAY}CTI Honeypot uninstallation is complete.${CLEAR}"
echo -e " ${LGRAY}Deceptifeed uninstallation is complete.${CLEAR}"
echo
echo
}