@@ -1,100 +0,0 @@
1−# This is the installation portion of kippo.
2−# This is somewhat jumbled together. There is no "easy_install" for kippo,
3−# and there isn't a way to regenerate the twistd plugin cache.
4−#
5−# Use the services.kippo options to properly configure if on NixOS.
6−# On other platforms there is a problem with hardcoded paths.
7−# Your best bet is to change kippo source to customise
8−# or manually copy the proper filesystems.
9−# At a minimum the following are required in /var/lib/kippo:
10−# honeyfs/
11−# fs.pickle
12−# data/
13−# txtcmds/
14−#
15−# There is also benefit in preparing /var/log/kippo
16−# tty/
17−# dl/
18−#
19−# Most of these files need read/write permissions.
20−#
21−# Read only files: kippo.tac and kippo.cfg
22−#
23−# Execution may look like this:
24−# twistd -y kippo.tac --syslog --pidfile=kippo.pid
25−#
26−# Use this package at your own risk.
27−
28−{lib, stdenv, fetchurl, pythonPackages }:
29−
30−let
31−
32− twisted_13 = pythonPackages.buildPythonPackage rec {
33− # NOTE: When updating please check if new versions still cause issues
34− # to packages like carbon (http://stackoverflow.com/questions/19894708/cant-start-carbon-12-04-python-error-importerror-cannot-import-name-daem)
35− disabled = pythonPackages.isPy3k;
36−
37− name = "Twisted-13.2.0";
38− src = fetchurl {
39− url = "mirror://pypi/T/Twisted/${name}.tar.bz2";
40− sha256 = "1wrcqv5lvgwk2aq83qb2s2ng2vx14hbjjk2gc30cg6h1iiipal89";
41− };
42−
43− propagatedBuildInputs = with pythonPackages; [ zope_interface ];
44−
45− # Generate Twisted's plug-in cache. Twited users must do it as well. See
46− # http://twistedmatrix.com/documents/current/core/howto/plugin.html#auto3
47− # and http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477103 for
48− # details.
49− postInstall = "$out/bin/twistd --help > /dev/null";
50−
51− meta = with lib; {
52− homepage = "https://twistedmatrix.com/";
53− description = "Twisted, an event-driven networking engine written in Python";
54− longDescription = ''
55− Twisted is an event-driven networking engine written in Python
56− and licensed under the MIT license.
57− '';
58− license = licenses.mit;
59− };
60− };
61−
62−in stdenv.mkDerivation rec {
63− pname = "kippo";
64− version = "0.8";
65− src = fetchurl {
66− url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/kippo/${pname}-${version}.tar.gz";
67− sha256 = "0rd2mk36d02qd24z8s4xyy64fy54rzpar4379iq4dcjwg7l7f63d";
68− };
69− buildInputs = with pythonPackages; [ pycrypto pyasn1 twisted_13 ];
70− installPhase = ''
71− substituteInPlace ./kippo.tac --replace "kippo.cfg" "$out/src/kippo.cfg"
72− substituteInPlace ./kippo.cfg --replace "log_path = log" "log_path = /var/log/kippo" \
73− --replace "download_path = dl" "download_path = /var/log/kippo/dl" \
74− --replace "contents_path = honeyfs" "filesystem_file = /var/lib/kippo/honeyfs" \
75− --replace "filesystem_file = fs.pickle" "filesystem_file = /var/lib/kippo/fs.pickle" \
76− --replace "data_path = data" "data_path = /var/lib/kippo/data" \
77− --replace "txtcmds_path = txtcmds" "txtcmds_path = /var/lib/kippo/txtcmds" \
78− --replace "public_key = public.key" "public_key = /var/lib/kippo/keys/public.key" \
79− --replace "private_key = private.key" "private_key = /var/lib/kippo/keys/private.key"
80− mkdir -p $out/bin
81− mkdir -p $out/src
82− mv ./* $out/src
83− mv $out/src/utils/* $out/bin
84− '';
85−
86− passthru.twisted = twisted_13;
87−
88− meta = with lib; {
89− homepage = "https://github.com/desaster/kippo";
90− description = "SSH Honeypot";
91− longDescription = ''
92− Default port is 2222. Recommend using something like this for port redirection to default SSH port:
93− networking.firewall.extraCommands = '''
94− iptables -t nat -A PREROUTING -i IN_IFACE -p tcp --dport 22 -j REDIRECT --to-port 2222''' '';
95− license = licenses.bsd3;
96− platforms = platforms.linux;
97− maintainers = with maintainers; [ tomberek ];
98− broken = true; # 2018-09-12, failed on hydra since 2017-12-11
99− };
100−}