diff --git a/.gitignore b/.gitignore index 8000dd9..d19b44c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .vagrant +build \ No newline at end of file diff --git a/torch-agent-0.0.1/debian/README.Debian b/debian/README.Debian similarity index 100% rename from torch-agent-0.0.1/debian/README.Debian rename to debian/README.Debian diff --git a/torch-agent-0.0.1/debian/README.source b/debian/README.source similarity index 100% rename from torch-agent-0.0.1/debian/README.source rename to debian/README.source diff --git a/torch-agent-0.0.1/debian/changelog b/debian/changelog similarity index 100% rename from torch-agent-0.0.1/debian/changelog rename to debian/changelog diff --git a/torch-agent-0.0.1/debian/control b/debian/control similarity index 100% rename from torch-agent-0.0.1/debian/control rename to debian/control diff --git a/torch-agent-0.0.1/debian/copyright b/debian/copyright similarity index 100% rename from torch-agent-0.0.1/debian/copyright rename to debian/copyright diff --git a/torch-agent-0.0.1/debian/debhelper-build-stamp b/debian/debhelper-build-stamp similarity index 100% rename from torch-agent-0.0.1/debian/debhelper-build-stamp rename to debian/debhelper-build-stamp diff --git a/torch-agent-0.0.1/debian/files b/debian/files similarity index 100% rename from torch-agent-0.0.1/debian/files rename to debian/files diff --git a/torch-agent-0.0.1/debian/manpage.1.ex b/debian/manpage.1.ex similarity index 100% rename from torch-agent-0.0.1/debian/manpage.1.ex rename to debian/manpage.1.ex diff --git a/torch-agent-0.0.1/debian/manpage.sgml.ex b/debian/manpage.sgml.ex similarity index 100% rename from torch-agent-0.0.1/debian/manpage.sgml.ex rename to debian/manpage.sgml.ex diff --git a/torch-agent-0.0.1/debian/manpage.xml.ex b/debian/manpage.xml.ex similarity index 100% rename from torch-agent-0.0.1/debian/manpage.xml.ex rename to debian/manpage.xml.ex diff --git a/torch-agent-0.0.1/debian/postinst b/debian/postinst similarity index 100% rename from torch-agent-0.0.1/debian/postinst rename to debian/postinst diff --git a/torch-agent-0.0.1/debian/postrm b/debian/postrm similarity index 100% rename from torch-agent-0.0.1/debian/postrm rename to debian/postrm diff --git a/torch-agent-0.0.1/debian/preinst b/debian/preinst similarity index 100% rename from torch-agent-0.0.1/debian/preinst rename to debian/preinst diff --git a/torch-agent-0.0.1/debian/prerm.ex b/debian/prerm.ex similarity index 100% rename from torch-agent-0.0.1/debian/prerm.ex rename to debian/prerm.ex diff --git a/torch-agent-0.0.1/debian/rules b/debian/rules similarity index 95% rename from torch-agent-0.0.1/debian/rules rename to debian/rules index a82715a..1f72afe 100755 --- a/torch-agent-0.0.1/debian/rules +++ b/debian/rules @@ -22,7 +22,6 @@ override_dh_installsystemd: override_dh_installinit: # --no-enable only on init-system-helpers (>= 1.51) - #dh_installinit --no-start --no-enable dh_installinit --no-start --no-enable # dh_make generated override targets diff --git a/torch-agent-0.0.1/debian/salsa-ci.yml.ex b/debian/salsa-ci.yml.ex similarity index 100% rename from torch-agent-0.0.1/debian/salsa-ci.yml.ex rename to debian/salsa-ci.yml.ex diff --git a/torch-agent-0.0.1/debian/source/format b/debian/source/format similarity index 100% rename from torch-agent-0.0.1/debian/source/format rename to debian/source/format diff --git a/debian/source/include-binaries b/debian/source/include-binaries new file mode 100755 index 0000000..65663a9 --- /dev/null +++ b/debian/source/include-binaries @@ -0,0 +1,2 @@ +src/usr/share/torch-agent/torch-agent.py +src/etc/torch/torch.conf \ No newline at end of file diff --git a/torch-agent-0.0.1/debian/src/etc/torch/torch.conf b/debian/src/etc/torch/torch.conf similarity index 100% rename from torch-agent-0.0.1/debian/src/etc/torch/torch.conf rename to debian/src/etc/torch/torch.conf diff --git a/torch-agent-0.0.1/debian/src/usr/share/torch-agent/torch-agent.py b/debian/src/usr/share/torch-agent/torch-agent.py similarity index 100% rename from torch-agent-0.0.1/debian/src/usr/share/torch-agent/torch-agent.py rename to debian/src/usr/share/torch-agent/torch-agent.py diff --git a/torch-agent-0.0.1/debian/torch-agent-docs.docs b/debian/torch-agent-docs.docs similarity index 100% rename from torch-agent-0.0.1/debian/torch-agent-docs.docs rename to debian/torch-agent-docs.docs diff --git a/torch-agent-0.0.1/debian/torch-agent.cron.d.ex b/debian/torch-agent.cron.d.ex similarity index 100% rename from torch-agent-0.0.1/debian/torch-agent.cron.d.ex rename to debian/torch-agent.cron.d.ex diff --git a/torch-agent-0.0.1/debian/torch-agent.debhelper.log b/debian/torch-agent.debhelper.log similarity index 100% rename from torch-agent-0.0.1/debian/torch-agent.debhelper.log rename to debian/torch-agent.debhelper.log diff --git a/torch-agent-0.0.1/debian/torch-agent.doc-base.EX b/debian/torch-agent.doc-base.EX similarity index 100% rename from torch-agent-0.0.1/debian/torch-agent.doc-base.EX rename to debian/torch-agent.doc-base.EX diff --git a/debian/torch-agent.install b/debian/torch-agent.install new file mode 100644 index 0000000..4db3ce4 --- /dev/null +++ b/debian/torch-agent.install @@ -0,0 +1,2 @@ +src/usr/share/torch-agent /usr/share/ +src/etc/torch /etc/ \ No newline at end of file diff --git a/torch-agent-0.0.1/debian/torch-agent.postrm.debhelper b/debian/torch-agent.postrm.debhelper similarity index 100% rename from torch-agent-0.0.1/debian/torch-agent.postrm.debhelper rename to debian/torch-agent.postrm.debhelper diff --git a/torch-agent-0.0.1/debian/torch-agent.substvars b/debian/torch-agent.substvars similarity index 100% rename from torch-agent-0.0.1/debian/torch-agent.substvars rename to debian/torch-agent.substvars diff --git a/torch-agent-0.0.1/debian/watch.ex b/debian/watch.ex similarity index 100% rename from torch-agent-0.0.1/debian/watch.ex rename to debian/watch.ex diff --git a/example/torch-agent_0.0.1-1_all.deb b/example/torch-agent_0.0.1-1_all.deb index 3082955..ca57b2d 100644 Binary files a/example/torch-agent_0.0.1-1_all.deb and b/example/torch-agent_0.0.1-1_all.deb differ diff --git a/install-ubuntu2004.sh b/install-ubuntu2004.sh deleted file mode 100755 index 91cb9e8..0000000 --- a/install-ubuntu2004.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -apt update -apt install -y tor python3-pip -sudo -H pip3 install stem paho-mqtt PySocks - -sed -i '/^#ControlPort 9051/s/^#//' /etc/tor/torrc -sed -i '/^#CookieAuthentication 1/s/^#//' /etc/tor/torrc -echo "CookieAuthFileGroupReadable 1" >> /etc/tor/torrc -systemctl reload tor - -useradd --system -g debian-tor torch - -mkdir -p /etc/torch -cp torch.conf /etc/torch/ -chown -R torch /etc/torch - -mkdir -p /usr/local/lib/torch -mv torch-agent.py /usr/local/lib/torch/ -chown root:root /usr/local/lib/torch/torch-agent.py -chmod 644 /usr/local/lib/torch/torch-agent.py - -mv torch.service /etc/systemd/system/ -chown root:root /etc/systemd/system/torch.service -chmod 644 /etc/systemd/system/torch.service - -systemctl daemon-reload -systemctl enable torch diff --git a/make-pkg.sh b/make-pkg.sh new file mode 100755 index 0000000..d02b254 --- /dev/null +++ b/make-pkg.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +TORCH_VERSION=0.0.1 +DEBIAN_PKG=torch-agent-$TORCH_VERSION +PKG_ROOT=build/$DEBIAN_PKG + +rf -rf $PKG_ROOT + +mkdir -p $PKG_ROOT +cp -r debian $PKG_ROOT + +mkdir -p $PKG_ROOT/src/etc/torch +cp torch.conf $PKG_ROOT/src/etc/torch/ + +mkdir -p $PKG_ROOT/src/usr/share/torch-agent +cp torch-agent.py $PKG_ROOT/src/usr/share/torch-agent/ + +cp torch-agent.service $PKG_ROOT/debian/ + +cd $PKG_ROOT + +export USER=`whoami` +dh_make --createorig -e $DEBEMAIL -s -y +dpkg-buildpackage -k$DEBEMAIL \ No newline at end of file diff --git a/torch-agent-0.0.1/debian/.debhelper/generated/torch-agent/installed-by-dh_install b/torch-agent-0.0.1/debian/.debhelper/generated/torch-agent/installed-by-dh_install deleted file mode 100644 index a2905db..0000000 --- a/torch-agent-0.0.1/debian/.debhelper/generated/torch-agent/installed-by-dh_install +++ /dev/null @@ -1,2 +0,0 @@ -./debian/src/usr/share/torch-agent -./debian/src/etc/torch diff --git a/torch-agent-0.0.1/debian/.debhelper/generated/torch-agent/installed-by-dh_installdocs b/torch-agent-0.0.1/debian/.debhelper/generated/torch-agent/installed-by-dh_installdocs deleted file mode 100644 index e69de29..0000000 diff --git a/torch-agent-0.0.1/debian/.debhelper/generated/torch-agent/postinst.service b/torch-agent-0.0.1/debian/.debhelper/generated/torch-agent/postinst.service deleted file mode 100644 index 4f984b0..0000000 --- a/torch-agent-0.0.1/debian/.debhelper/generated/torch-agent/postinst.service +++ /dev/null @@ -1,27 +0,0 @@ -# Automatically added by dh_installsystemd/12.10ubuntu1 -if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then - if deb-systemd-helper debian-installed 'torch-agent.service'; then - # This will only remove masks created by d-s-h on package removal. - deb-systemd-helper unmask 'torch-agent.service' >/dev/null || true - - if deb-systemd-helper --quiet was-enabled 'torch-agent.service'; then - # Create new symlinks, if any. - deb-systemd-helper enable 'torch-agent.service' >/dev/null || true - fi - fi - - # Update the statefile to add new symlinks (if any), which need to be cleaned - # up on purge. Also remove old symlinks. - deb-systemd-helper update-state 'torch-agent.service' >/dev/null || true -fi -# End automatically added section -# Automatically added by dh_installsystemd/12.10ubuntu1 -if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then - if [ -d /run/systemd/system ]; then - systemctl --system daemon-reload >/dev/null || true - if [ -n "$2" ]; then - deb-systemd-invoke try-restart 'torch-agent.service' >/dev/null || true - fi - fi -fi -# End automatically added section diff --git a/torch-agent-0.0.1/debian/.debhelper/generated/torch-agent/prerm.service b/torch-agent-0.0.1/debian/.debhelper/generated/torch-agent/prerm.service deleted file mode 100644 index b57cbab..0000000 --- a/torch-agent-0.0.1/debian/.debhelper/generated/torch-agent/prerm.service +++ /dev/null @@ -1,5 +0,0 @@ -# Automatically added by dh_installsystemd/12.10ubuntu1 -if [ -d /run/systemd/system ] && [ "$1" = remove ]; then - deb-systemd-invoke stop 'torch-agent.service' >/dev/null || true -fi -# End automatically added section diff --git a/torch-agent-0.0.1/debian/source/include-binaries b/torch-agent-0.0.1/debian/source/include-binaries deleted file mode 100755 index d233ebf..0000000 --- a/torch-agent-0.0.1/debian/source/include-binaries +++ /dev/null @@ -1,2 +0,0 @@ -debian/src/usr/share/torch-agent/torch-agent.py -debian/src/etc/torch/torch.conf \ No newline at end of file diff --git a/torch-agent-0.0.1/debian/torch-agent.install b/torch-agent-0.0.1/debian/torch-agent.install deleted file mode 100644 index 0e631be..0000000 --- a/torch-agent-0.0.1/debian/torch-agent.install +++ /dev/null @@ -1,2 +0,0 @@ -debian/src/usr/share/torch-agent /usr/share/ -debian/src/etc/torch /etc/ \ No newline at end of file diff --git a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/conffiles b/torch-agent-0.0.1/debian/torch-agent/DEBIAN/conffiles deleted file mode 100644 index e976293..0000000 --- a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/conffiles +++ /dev/null @@ -1 +0,0 @@ -/etc/torch/torch.conf diff --git a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/control b/torch-agent-0.0.1/debian/torch-agent/DEBIAN/control deleted file mode 100644 index 495161f..0000000 --- a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/control +++ /dev/null @@ -1,12 +0,0 @@ -Package: torch-agent -Version: 0.0.1-1 -Architecture: all -Maintainer: Benjamin Dweck -Installed-Size: 29 -Depends: ssh, tor, python3-pip -Section: net -Priority: optional -Homepage: https://rudefox.io -Description: TORch is a solution for creating an SSH-via-Tor - backdoor on a remote device as a means of fallback remote - management and initial headless device configuration. diff --git a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/md5sums b/torch-agent-0.0.1/debian/torch-agent/DEBIAN/md5sums deleted file mode 100644 index 392bfd4..0000000 --- a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/md5sums +++ /dev/null @@ -1,5 +0,0 @@ -1e2c6dfcdaab533fa279eef51cdaa500 lib/systemd/system/torch-agent.service -de899b3b2dbb67f357d153425a8421cd usr/share/doc/torch-agent/README.Debian -507827efdf54541d719f3a27e1a1db5f usr/share/doc/torch-agent/changelog.Debian.gz -7d50b1cef77999609862e52053d3ed74 usr/share/doc/torch-agent/copyright -94f2830be2c7420e0f1c4556fc08f1ec usr/share/torch-agent/torch-agent.py diff --git a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/postinst b/torch-agent-0.0.1/debian/torch-agent/DEBIAN/postinst deleted file mode 100755 index 2d04f0e..0000000 --- a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/postinst +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/sh -# postinst script for torch-agent -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-remove' -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see https://www.debian.org/doc/debian-policy/ or -# the debian-policy package - -USER="torch" -GROUP="debian-tor" - -TORRC="/etc/tor/torrc" - -configure_tor_controller() { - - TORRC_CHANGED=0 - - if ! grep -q "^ControlPort [0-9]\+" $TORRC; then - sed -i '/^#ControlPort 9051/s/^#//' $TORRC - TORRC_CHANGED=1 - fi - - if ! grep -q "^CookieAuthentication 1" $TORRC; then - sed -i '/^#CookieAuthentication 1/s/^#//' $TORRC - TORRC_CHANGED=1 - fi - - if ! grep -q "^CookieAuthFileGroupReadable 1" $TORRC; then - echo "CookieAuthFileGroupReadable 1" >> $TORRC - TORRC_CHANGED=1 - fi - - if [ $TORRC_CHANGED -eq 1 ]; then - systemctl reload tor - fi -} - -case "$1" in - configure) - - if ! getent passwd $USER >/dev/null ; then - useradd -r -g $GROUP $USER - fi - - chown $USER /etc/torch - chown $USER /etc/torch/torch.conf - chown $USER /usr/share/torch-agent/torch-agent.py - - configure_tor_controller - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -# Automatically added by dh_installsystemd/12.10ubuntu1 -if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then - if deb-systemd-helper debian-installed 'torch-agent.service'; then - # This will only remove masks created by d-s-h on package removal. - deb-systemd-helper unmask 'torch-agent.service' >/dev/null || true - - if deb-systemd-helper --quiet was-enabled 'torch-agent.service'; then - # Create new symlinks, if any. - deb-systemd-helper enable 'torch-agent.service' >/dev/null || true - fi - fi - - # Update the statefile to add new symlinks (if any), which need to be cleaned - # up on purge. Also remove old symlinks. - deb-systemd-helper update-state 'torch-agent.service' >/dev/null || true -fi -# End automatically added section -# Automatically added by dh_installsystemd/12.10ubuntu1 -if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then - if [ -d /run/systemd/system ]; then - systemctl --system daemon-reload >/dev/null || true - if [ -n "$2" ]; then - deb-systemd-invoke try-restart 'torch-agent.service' >/dev/null || true - fi - fi -fi -# End automatically added section - - -exit 0 diff --git a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/postrm b/torch-agent-0.0.1/debian/torch-agent/DEBIAN/postrm deleted file mode 100755 index e24684a..0000000 --- a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/postrm +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# postrm script for torch-agent -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' -# -# for details, see https://www.debian.org/doc/debian-policy/ or -# the debian-policy package - -USER="torch" - -case "$1" in - purge|abort-install) - rm -rf /etc/torch - rm -f /usr/share/torch-agent/torch-agent.py - if [ -x "$(command -v deluser)" ]; then - deluser --quiet --system $USER > /dev/null || true - else - echo >&2 "not removing $USER system account because deluser command was not found" - fi - ;; - remove) - ;; - upgrade|failed-upgrade|abort-upgrade|disappear) - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -# Automatically added by dh_installsystemd/12.10ubuntu1 -if [ -d /run/systemd/system ]; then - systemctl --system daemon-reload >/dev/null || true -fi -# End automatically added section -# Automatically added by dh_installsystemd/12.10ubuntu1 -if [ "$1" = "remove" ]; then - if [ -x "/usr/bin/deb-systemd-helper" ]; then - deb-systemd-helper mask 'torch-agent.service' >/dev/null || true - fi -fi - -if [ "$1" = "purge" ]; then - if [ -x "/usr/bin/deb-systemd-helper" ]; then - deb-systemd-helper purge 'torch-agent.service' >/dev/null || true - deb-systemd-helper unmask 'torch-agent.service' >/dev/null || true - fi -fi -# End automatically added section - - -exit 0 diff --git a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/preinst b/torch-agent-0.0.1/debian/torch-agent/DEBIAN/preinst deleted file mode 100755 index 8e3fed9..0000000 --- a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/preinst +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# preinst script for torch-agent -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `install' -# * `install' -# * `upgrade' -# * `abort-upgrade' -# for details, see https://www.debian.org/doc/debian-policy/ or -# the debian-policy package - -case "$1" in - install|upgrade) - - sudo -H pip3 install stem paho-mqtt PySocks - - mkdir -p /etc/torch - mkdir -p /usr/share/torch-agent - ;; - - abort-upgrade) - ;; - - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - - - -exit 0 diff --git a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/prerm b/torch-agent-0.0.1/debian/torch-agent/DEBIAN/prerm deleted file mode 100755 index d6934ef..0000000 --- a/torch-agent-0.0.1/debian/torch-agent/DEBIAN/prerm +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -set -e -# Automatically added by dh_installsystemd/12.10ubuntu1 -if [ -d /run/systemd/system ] && [ "$1" = remove ]; then - deb-systemd-invoke stop 'torch-agent.service' >/dev/null || true -fi -# End automatically added section diff --git a/torch-agent-0.0.1/debian/torch-agent/etc/torch/torch.conf b/torch-agent-0.0.1/debian/torch-agent/etc/torch/torch.conf deleted file mode 100755 index d9d0afd..0000000 --- a/torch-agent-0.0.1/debian/torch-agent/etc/torch/torch.conf +++ /dev/null @@ -1,19 +0,0 @@ -[tor] -ProxyPort = 9050 -ControllerPort = 9051 - -[ssh] -Port = 22 - -[mqtt] -BrokerHost = mqtt.example.com # OR example1i3uyrbfoi3fi.onion -BrokerPort = 1883 -ClientID = my-client -Topic = example/topic - -### Options for Using TLS - -#RequireCertificate = true -#CaFile = ca.crt -#CertFile = client.crt -#KeyFile = client.key \ No newline at end of file diff --git a/torch-agent-0.0.1/debian/torch-agent/lib/systemd/system/torch-agent.service b/torch-agent-0.0.1/debian/torch-agent/lib/systemd/system/torch-agent.service deleted file mode 100644 index 6816b64..0000000 --- a/torch-agent-0.0.1/debian/torch-agent/lib/systemd/system/torch-agent.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=TORch Agent: MQTT Publisher for Tor Hidden SSH Service URL -After=tor.service ssh.service -Requires=tor.service ssh.service - -[Service] -Environment=PYTHONUNBUFFERED=1 -ExecStart=/usr/bin/python3 /usr/share/torch-agent/torch-agent.py -User=torch -Group=debian-tor - -[Install] -WantedBy=multi-user.target ssh.service tor.service \ No newline at end of file diff --git a/torch-agent-0.0.1/debian/torch-agent/usr/share/doc/torch-agent/README.Debian b/torch-agent-0.0.1/debian/torch-agent/usr/share/doc/torch-agent/README.Debian deleted file mode 100644 index 699fb17..0000000 --- a/torch-agent-0.0.1/debian/torch-agent/usr/share/doc/torch-agent/README.Debian +++ /dev/null @@ -1,6 +0,0 @@ -torch-agent for Debian ---------------------- - - - - -- Benjamin Dweck Tue, 06 Oct 2020 15:53:02 +0200 diff --git a/torch-agent-0.0.1/debian/torch-agent/usr/share/doc/torch-agent/changelog.Debian.gz b/torch-agent-0.0.1/debian/torch-agent/usr/share/doc/torch-agent/changelog.Debian.gz deleted file mode 100644 index 87dac02..0000000 Binary files a/torch-agent-0.0.1/debian/torch-agent/usr/share/doc/torch-agent/changelog.Debian.gz and /dev/null differ diff --git a/torch-agent-0.0.1/debian/torch-agent/usr/share/doc/torch-agent/copyright b/torch-agent-0.0.1/debian/torch-agent/usr/share/doc/torch-agent/copyright deleted file mode 100644 index b1e631f..0000000 --- a/torch-agent-0.0.1/debian/torch-agent/usr/share/doc/torch-agent/copyright +++ /dev/null @@ -1,23 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: torch-agent -Upstream-Contact: bjdweck@gmail.com -Source: https://rudefox.io - -Files: debian/* -Copyright: 2020 Benjamin Dweck -License: GPL-2+ - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see - . - On Debian systems, the complete text of the GNU General - Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". \ No newline at end of file diff --git a/torch-agent-0.0.1/debian/torch-agent/usr/share/torch-agent/torch-agent.py b/torch-agent-0.0.1/debian/torch-agent/usr/share/torch-agent/torch-agent.py deleted file mode 100755 index 98fd542..0000000 --- a/torch-agent-0.0.1/debian/torch-agent/usr/share/torch-agent/torch-agent.py +++ /dev/null @@ -1,98 +0,0 @@ -from stem.control import Controller -import stem.connection -import paho.mqtt.client as mqtt -import ssl -import socks -import socket -import json -import configparser -import argparse -from datetime import datetime -from os import environ - -parser = argparse.ArgumentParser(description='Broadcast SSH hidden service hostname via MQTT') - -parser.add_argument('--config-dir', nargs='?', dest='configPath', default='/etc/torch', - help='configuration directory (default: /etc/torch)') - -args = parser.parse_args() - -configPath = args.configPath - -if "TORCH_CONFIG_DIR" in environ: - configPath = environ.get("TORCH_CONFIG_DIR") - -if not configPath.endswith("/"): - configPath = configPath + "/" - -print("Using torch configuration path: " + configPath) - -config = configparser.ConfigParser() -config.read(configPath + "torch.conf") - -torProxyPort = config['tor'].getint('ProxyPort', fallback = 9050) -torControllerPort = config['tor'].getint('ControllerPort', fallback = 9051) - -sshPort = config['ssh'].getint('Port', fallback = 22) - -mqttConfig = config['mqtt'] -mqttBrokerHost = mqttConfig.get('BrokerHost', fallback = "localhost") -mqttBrokerPort = mqttConfig.getint('BrokerPort', fallback = 1883) -clientID = mqttConfig.get('ClientID', fallback = socket.gethostname()) -mqttTopic = mqttConfig.get('Topic', fallback = "torch/%s/onion_url" % (clientID)) - -mqttRequireCertificate = mqttConfig.getboolean( - 'RequireCertificate', - fallback = False) - -mqttCaFile = configPath + mqttConfig.get('CaFile') -mqttCertFile = configPath + mqttConfig.get('CertFile') -mqttKeyFile = configPath + mqttConfig.get('KeyFile') - -with Controller.from_port(port = torControllerPort) as controller: - - protocolInfo = stem.connection.get_protocolinfo(controller) - - stem.connection.authenticate_safecookie( - controller, - protocolInfo.cookie_path) - - print("Connected to Tor on port %s" % (torControllerPort)) - - service = controller.create_ephemeral_hidden_service( - sshPort, - detached = True) - - onionAddress = "%s.onion" % (service.service_id) - - print("Created Tor Hidden Service for local port %s at %s" % (sshPort, onionAddress)) - -payload = { - 'clientId': clientID, - 'timestamp': datetime.now().strftime("%d-%b-%Y (%H:%M:%S.%f)"), - 'onionAddress': onionAddress, - 'sshPort': sshPort - } - -client = mqtt.Client() -protocol = "mqtt" - -if mqttRequireCertificate: - client.tls_set( - ca_certs = mqttCaFile, - certfile = mqttCertFile, - keyfile = mqttKeyFile, - cert_reqs=ssl.CERT_REQUIRED) - protocol = "mqtts" - -if mqttBrokerHost.endswith(".onion"): - client.proxy_set(proxy_type=socks.SOCKS5, proxy_addr="localhost", proxy_port=torProxyPort) - client.tls_insecure_set(True) - -client.connect(mqttBrokerHost, mqttBrokerPort, 60) -client.publish(mqttTopic, json.dumps(payload)) -print("Connected to MQTT Broker at %s://%s:%s/%s" % (protocol, mqttBrokerHost, mqttBrokerPort, mqttTopic)) -print("Published payload: " + json.dumps(payload)) - -client.disconnect() -print("Disconnected from MQTT Broker") diff --git a/torch-agent-0.0.1/debian/torch-agent.service b/torch-agent.service old mode 100644 new mode 100755 similarity index 100% rename from torch-agent-0.0.1/debian/torch-agent.service rename to torch-agent.service diff --git a/torch-agent_0.0.1-1.debian.tar.xz b/torch-agent_0.0.1-1.debian.tar.xz deleted file mode 100644 index 309aabe..0000000 Binary files a/torch-agent_0.0.1-1.debian.tar.xz and /dev/null differ diff --git a/torch-agent_0.0.1-1.dsc b/torch-agent_0.0.1-1.dsc deleted file mode 100644 index a62bfe5..0000000 --- a/torch-agent_0.0.1-1.dsc +++ /dev/null @@ -1,35 +0,0 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA512 - -Format: 3.0 (quilt) -Source: torch-agent -Binary: torch-agent -Architecture: all -Version: 0.0.1-1 -Maintainer: Benjamin Dweck -Homepage: https://rudefox.io -Standards-Version: 4.4.1 -Build-Depends: debhelper-compat (= 12) -Package-List: - torch-agent deb net optional arch=all -Checksums-Sha1: - 75a6ce9e0ad9f4ed0d2d31348c9db1238bd4f39d 9788 torch-agent_0.0.1.orig.tar.xz - 4b3e734647e0e62bbb17c1ed5dbbd853462613f9 9636 torch-agent_0.0.1-1.debian.tar.xz -Checksums-Sha256: - 30c630f9fdbaea2337a3e8701e753ef45a094b9403e77f9a42b2bd2ca63e8dc5 9788 torch-agent_0.0.1.orig.tar.xz - 0ffd62a08673dfc3d0a7544eb62398b8fd3bd0aa71bfd19c1a8dd816c430ec1b 9636 torch-agent_0.0.1-1.debian.tar.xz -Files: - 267a824b2a18ef73dcda05da7e99a4b5 9788 torch-agent_0.0.1.orig.tar.xz - ee6afe9f8ff5b6cade07a66f9075c505 9636 torch-agent_0.0.1-1.debian.tar.xz - ------BEGIN PGP SIGNATURE----- - -iQFGBAEBCgAwFiEEFNiF9i0uBB0TW5u+27VgOYC/OIMFAl988dMSHGJqZHdlY2tA -Z21haWwuY29tAAoJENu1YDmAvziDfVkIAIKkS0PLQsDNUu3cJ+3UY1PboECjQdSb -0SpNuS61gRFJED9yoRg9XO5DMnpfp1qhVoZF0/wJSfel4Mbvyf8KPTpDYja9ZAkH -sjFwfqmvB2Po2VAE64ym/j7HCOGSMle6+f+NrcpDiEi592UzHR6iFi6iy8YwjhDa -xFmUJp4tPu62IUqOtASOMuQHGsY2c0j18Ev5Su0Z303MmfEp+bc/Y99lISU8cwHs -xPxOhsPCVj55E1wEi6hFeCy7sxh28W796fqOuCWKLYjIbIk2VRZC7clZ/dLn3hHk -RoXsSsBM5eFTK7uGKAOXCe1+AHZgsdnOU8XxnbvDMMbHYaaz7rnTNrw= -=pqDg ------END PGP SIGNATURE----- diff --git a/torch-agent_0.0.1-1_all.deb b/torch-agent_0.0.1-1_all.deb deleted file mode 100644 index 3082955..0000000 Binary files a/torch-agent_0.0.1-1_all.deb and /dev/null differ diff --git a/torch-agent_0.0.1-1_amd64.buildinfo b/torch-agent_0.0.1-1_amd64.buildinfo deleted file mode 100644 index 8859537..0000000 --- a/torch-agent_0.0.1-1_amd64.buildinfo +++ /dev/null @@ -1,195 +0,0 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA512 - -Format: 1.0 -Source: torch-agent -Binary: torch-agent -Architecture: all source -Version: 0.0.1-1 -Checksums-Md5: - 0abbdb3e83d948e0076ba9298c5f5502 1397 torch-agent_0.0.1-1.dsc - 526fa2edc26efa17ce067b6b8b7780b5 5200 torch-agent_0.0.1-1_all.deb -Checksums-Sha1: - e88b32f193b3a57dd8717d02c643b6096b11e468 1397 torch-agent_0.0.1-1.dsc - 816e7a65d14e02df230346565496a2bfb4ace2ad 5200 torch-agent_0.0.1-1_all.deb -Checksums-Sha256: - 9b9a4486d39a88c09e1bd648560cd0c70cbba0e40bed9305e540e551db31d55e 1397 torch-agent_0.0.1-1.dsc - 1560cd30b4944162d0ea4f2e4c5402527d06587c98a907820c36ec455633aede 5200 torch-agent_0.0.1-1_all.deb -Build-Origin: Ubuntu -Build-Architecture: amd64 -Build-Date: Wed, 07 Oct 2020 00:38:11 +0200 -Build-Tainted-By: - merged-usr-via-symlinks - usr-local-has-libraries - usr-local-has-programs -Installed-Build-Depends: - autoconf (= 2.69-11.1), - automake (= 1:1.16.1-4ubuntu6), - autopoint (= 0.19.8.1-10build1), - autotools-dev (= 20180224.1), - base-files (= 11ubuntu5.1), - base-passwd (= 3.5.47), - bash (= 5.0-6ubuntu1.1), - binutils (= 2.34-6ubuntu1), - binutils-common (= 2.34-6ubuntu1), - binutils-x86-64-linux-gnu (= 2.34-6ubuntu1), - bsdmainutils (= 11.1.2ubuntu3), - bsdutils (= 1:2.34-0.1ubuntu9), - build-essential (= 12.8ubuntu1), - bzip2 (= 1.0.8-2), - coreutils (= 8.30-3ubuntu2), - cpp (= 4:9.3.0-1ubuntu2), - cpp-9 (= 9.3.0-10ubuntu2), - dash (= 0.5.10.2-6), - debconf (= 1.5.73), - debhelper (= 12.10ubuntu1), - debianutils (= 4.9.1), - dh-autoreconf (= 19), - dh-strip-nondeterminism (= 1.7.0-1), - diffutils (= 1:3.7-3), - dpkg (= 1.19.7ubuntu3), - dpkg-dev (= 1.19.7ubuntu3), - dwz (= 0.13-5), - file (= 1:5.38-4), - findutils (= 4.7.0-1ubuntu1), - g++ (= 4:9.3.0-1ubuntu2), - g++-9 (= 9.3.0-10ubuntu2), - gawk (= 1:5.0.1+dfsg-1), - gcc (= 4:9.3.0-1ubuntu2), - gcc-10-base (= 10-20200411-0ubuntu1), - gcc-9 (= 9.3.0-10ubuntu2), - gcc-9-base (= 9.3.0-10ubuntu2), - gettext (= 0.19.8.1-10build1), - gettext-base (= 0.19.8.1-10build1), - grep (= 3.4-1), - groff-base (= 1.22.4-4build1), - gzip (= 1.10-0ubuntu4), - hostname (= 3.23), - init-system-helpers (= 1.57), - install-info (= 6.7.0.dfsg.2-5), - intltool-debian (= 0.35.0+20060710.5), - libacl1 (= 2.2.53-6), - libarchive-zip-perl (= 1.67-2), - libasan5 (= 9.3.0-10ubuntu2), - libatomic1 (= 10-20200411-0ubuntu1), - libattr1 (= 1:2.4.48-5), - libaudit-common (= 1:2.8.5-2ubuntu6), - libaudit1 (= 1:2.8.5-2ubuntu6), - libbinutils (= 2.34-6ubuntu1), - libblkid1 (= 2.34-0.1ubuntu9), - libbsd0 (= 0.10.0-1), - libbz2-1.0 (= 1.0.8-2), - libc-bin (= 2.31-0ubuntu9), - libc-dev-bin (= 2.31-0ubuntu9), - libc6 (= 2.31-0ubuntu9), - libc6-dev (= 2.31-0ubuntu9), - libcap-ng0 (= 0.7.9-2.1build1), - libcc1-0 (= 10-20200411-0ubuntu1), - libcroco3 (= 0.6.13-1), - libcrypt-dev (= 1:4.4.10-10ubuntu4), - libcrypt1 (= 1:4.4.10-10ubuntu4), - libctf-nobfd0 (= 2.34-6ubuntu1), - libctf0 (= 2.34-6ubuntu1), - libdb5.3 (= 5.3.28+dfsg1-0.6ubuntu2), - libdebconfclient0 (= 0.251ubuntu1), - libdebhelper-perl (= 12.10ubuntu1), - libdpkg-perl (= 1.19.7ubuntu3), - libelf1 (= 0.176-1.1build1), - libffi7 (= 3.3-4), - libfile-stripnondeterminism-perl (= 1.7.0-1), - libgcc-9-dev (= 9.3.0-10ubuntu2), - libgcc-s1 (= 10-20200411-0ubuntu1), - libgcrypt20 (= 1.8.5-5ubuntu1), - libgdbm-compat4 (= 1.18.1-5), - libgdbm6 (= 1.18.1-5), - libglib2.0-0 (= 2.64.3-1~ubuntu20.04.1), - libgmp10 (= 2:6.2.0+dfsg-4), - libgomp1 (= 10-20200411-0ubuntu1), - libgpg-error0 (= 1.37-1), - libicu66 (= 66.1-2ubuntu2), - libisl22 (= 0.22.1-1), - libitm1 (= 10-20200411-0ubuntu1), - liblsan0 (= 10-20200411-0ubuntu1), - liblz4-1 (= 1.9.2-2), - liblzma5 (= 5.2.4-1ubuntu1), - libmagic-mgc (= 1:5.38-4), - libmagic1 (= 1:5.38-4), - libmount1 (= 2.34-0.1ubuntu9), - libmpc3 (= 1.1.0-1), - libmpfr6 (= 4.0.2-1), - libpam-modules (= 1.3.1-5ubuntu4), - libpam-modules-bin (= 1.3.1-5ubuntu4), - libpam-runtime (= 1.3.1-5ubuntu4), - libpam0g (= 1.3.1-5ubuntu4), - libpcre2-8-0 (= 10.34-7), - libpcre3 (= 2:8.39-12build1), - libperl5.30 (= 5.30.0-9build1), - libpipeline1 (= 1.5.2-2build1), - libquadmath0 (= 10-20200411-0ubuntu1), - libreadline8 (= 8.0-4), - libseccomp2 (= 2.4.3-1ubuntu3.20.04.3), - libselinux1 (= 3.0-1build2), - libsigsegv2 (= 2.12-2), - libsmartcols1 (= 2.34-0.1ubuntu9), - libstdc++-9-dev (= 9.3.0-10ubuntu2), - libstdc++6 (= 10-20200411-0ubuntu1), - libsub-override-perl (= 0.09-2), - libsystemd0 (= 245.4-4ubuntu3.2), - libtinfo6 (= 6.2-0ubuntu2), - libtool (= 2.4.6-14), - libtsan0 (= 10-20200411-0ubuntu1), - libubsan1 (= 10-20200411-0ubuntu1), - libuchardet0 (= 0.0.6-3build1), - libudev1 (= 245.4-4ubuntu3.2), - libunistring2 (= 0.9.10-2), - libuuid1 (= 2.34-0.1ubuntu9), - libxml2 (= 2.9.10+dfsg-5), - libzstd1 (= 1.4.4+dfsg-3), - linux-libc-dev (= 5.4.0-47.51), - login (= 1:4.8.1-1ubuntu5.20.04), - lsb-base (= 11.1.0ubuntu2), - m4 (= 1.4.18-4), - make (= 4.2.1-1.2), - man-db (= 2.9.1-1), - mawk (= 1.3.4.20200120-2), - ncurses-base (= 6.2-0ubuntu2), - ncurses-bin (= 6.2-0ubuntu2), - patch (= 2.7.6-6), - perl (= 5.30.0-9build1), - perl-base (= 5.30.0-9build1), - perl-modules-5.30 (= 5.30.0-9build1), - po-debconf (= 1.0.21), - readline-common (= 8.0-4), - sed (= 4.7-1), - sensible-utils (= 0.0.12+nmu1), - sysvinit-utils (= 2.96-2.1ubuntu1), - tar (= 1.30+dfsg-7), - tzdata (= 2020a-0ubuntu0.20.04), - util-linux (= 2.34-0.1ubuntu9), - xz-utils (= 5.2.4-1ubuntu1), - zlib1g (= 1:1.2.11.dfsg-2ubuntu1) -Environment: - DEB_BUILD_OPTIONS="parallel=4" - LANG="en_US.UTF-8" - LC_ADDRESS="en_US.UTF-8" - LC_IDENTIFICATION="en_US.UTF-8" - LC_MEASUREMENT="en_US.UTF-8" - LC_MONETARY="en_US.UTF-8" - LC_NAME="en_US.UTF-8" - LC_NUMERIC="en_US.UTF-8" - LC_PAPER="en_US.UTF-8" - LC_TELEPHONE="en_US.UTF-8" - LC_TIME="en_US.UTF-8" - SOURCE_DATE_EPOCH="1601992382" - ------BEGIN PGP SIGNATURE----- - -iQFGBAEBCgAwFiEEFNiF9i0uBB0TW5u+27VgOYC/OIMFAl988dQSHGJqZHdlY2tA -Z21haWwuY29tAAoJENu1YDmAvziDbhIH/RLtAHLasxrim/3qkhGJAUApkzoIhxEZ -feWBwQ5nncKnt9vNRaQVOuQ4GWVRcpNtEQGWc+6/XE9U28XcOMZ/DMlvt8laFOCp -w4mmTpzFUnskXaNHqNEP3en85Opb7eeQCOJjuvEvUmo8lk5jtASXcxT7pNcDlb3X -NAXUyO22s81SHB1TnnwXOfIKLV5duo0pSJxZ+QwKoQtfYIuyHNvilvr8DaoKiltp -a2EjwyBWPfdJHHnKcv2Zyye65eQOr3VE8dP6k5OQWcuC2bHh84YgwyN6cmgWaELt -XlCu5sA5TPzNbO0gyVOtMBnyZ3B9tQ80Yzu/UWIiVTfTUzyMF8nugNI= -=l2RV ------END PGP SIGNATURE----- diff --git a/torch-agent_0.0.1-1_amd64.changes b/torch-agent_0.0.1-1_amd64.changes deleted file mode 100644 index dd04e34..0000000 --- a/torch-agent_0.0.1-1_amd64.changes +++ /dev/null @@ -1,49 +0,0 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA512 - -Format: 1.8 -Date: Tue, 06 Oct 2020 15:53:02 +0200 -Source: torch-agent -Binary: torch-agent -Architecture: source all -Version: 0.0.1-1 -Distribution: unstable -Urgency: medium -Maintainer: Benjamin Dweck -Changed-By: Benjamin Dweck -Description: - torch-agent - TORch is a solution for creating an SSH-via-Tor -Changes: - torch-agent (0.0.1-1) unstable; urgency=medium - . - * Initial release -Checksums-Sha1: - e88b32f193b3a57dd8717d02c643b6096b11e468 1397 torch-agent_0.0.1-1.dsc - 75a6ce9e0ad9f4ed0d2d31348c9db1238bd4f39d 9788 torch-agent_0.0.1.orig.tar.xz - 4b3e734647e0e62bbb17c1ed5dbbd853462613f9 9636 torch-agent_0.0.1-1.debian.tar.xz - 816e7a65d14e02df230346565496a2bfb4ace2ad 5200 torch-agent_0.0.1-1_all.deb - d6de1f688aefa348cbcb38513c0418731a32be6c 6115 torch-agent_0.0.1-1_amd64.buildinfo -Checksums-Sha256: - 9b9a4486d39a88c09e1bd648560cd0c70cbba0e40bed9305e540e551db31d55e 1397 torch-agent_0.0.1-1.dsc - 30c630f9fdbaea2337a3e8701e753ef45a094b9403e77f9a42b2bd2ca63e8dc5 9788 torch-agent_0.0.1.orig.tar.xz - 0ffd62a08673dfc3d0a7544eb62398b8fd3bd0aa71bfd19c1a8dd816c430ec1b 9636 torch-agent_0.0.1-1.debian.tar.xz - 1560cd30b4944162d0ea4f2e4c5402527d06587c98a907820c36ec455633aede 5200 torch-agent_0.0.1-1_all.deb - 98ac5666f20bfc2c3a7f803db6ac769df8be8f7f9a65742651c988e7104e5c34 6115 torch-agent_0.0.1-1_amd64.buildinfo -Files: - 0abbdb3e83d948e0076ba9298c5f5502 1397 net optional torch-agent_0.0.1-1.dsc - 267a824b2a18ef73dcda05da7e99a4b5 9788 net optional torch-agent_0.0.1.orig.tar.xz - ee6afe9f8ff5b6cade07a66f9075c505 9636 net optional torch-agent_0.0.1-1.debian.tar.xz - 526fa2edc26efa17ce067b6b8b7780b5 5200 net optional torch-agent_0.0.1-1_all.deb - 22b4edf1ac9a92dd878357a8ea5ba939 6115 net optional torch-agent_0.0.1-1_amd64.buildinfo - ------BEGIN PGP SIGNATURE----- - -iQFGBAEBCgAwFiEEFNiF9i0uBB0TW5u+27VgOYC/OIMFAl988dQSHGJqZHdlY2tA -Z21haWwuY29tAAoJENu1YDmAvziDZJEH/0jFrjHV/crXnpwtzLt81CBJPTs84Uhp -crgNc1Dh6cul4a78mIlNMr/aTTAHUqV0PuOAuNsrsNZA0LBPH9Fa/sFuQAQVp8UC -TFffl9gt+s8UnR+JyYVW29PU/bLyrFeZPYYOrH/4xJ1houxgtAFgUh3B40cbX/26 -CKyR4xMOFdtccSsZVJkPewrTHKDF1hibh4isK53/mHeCUnrlzosoZn873ZallEFD -tgbnmfMfx+ILlraz5L5UqghMZp+v8UqGuFV8D2EOC0XyRcpCpqlkioflUmL1AHML -KBqLg28oKmF56wyGfZgygzTUt/5tWTehjNwn36Ro+ZKbDMy1topS6aw= -=ufxl ------END PGP SIGNATURE----- diff --git a/torch-agent_0.0.1.orig.tar.xz b/torch-agent_0.0.1.orig.tar.xz deleted file mode 100644 index d37703c..0000000 Binary files a/torch-agent_0.0.1.orig.tar.xz and /dev/null differ diff --git a/torch.service b/torch.service deleted file mode 100644 index d35b37f..0000000 --- a/torch.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Torch: MQTT Publisher for Tor Hidden SSH Service URL -After=tor.service ssh.service -Requires=tor.service ssh.service - -[Service] -Environment=PYTHONUNBUFFERED=1 -ExecStart=/usr/bin/python3 /usr/local/lib/torch/torch-agent.py -User=torch -Group=debian-tor - -[Install] -WantedBy=multi-user.target ssh.service tor.service \ No newline at end of file