Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Debian packaging #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions debian/badkarma.dirs
@@ -0,0 +1 @@
/usr/bin
3 changes: 3 additions & 0 deletions debian/badkarma.install
@@ -0,0 +1,3 @@
/usr/share/badkarma
/usr/share/icons
/usr/share/applications
1 change: 1 addition & 0 deletions debian/badkarma.links
@@ -0,0 +1 @@
/usr/share/badkarma/badkarma.py /usr/bin/badkarma
5 changes: 5 additions & 0 deletions debian/changelog
@@ -0,0 +1,5 @@
badkarma (0.0.1-1) unstable; urgency=medium

* Initial release

-- Eugenio Paolantonio (g7) <me@medesimo.eu> Thu, 13 Sep 2018 20:35:35 +0200
1 change: 1 addition & 0 deletions debian/compat
@@ -0,0 +1 @@
10
37 changes: 37 additions & 0 deletions debian/control
@@ -0,0 +1,37 @@
Source: badkarma
Section: net
Priority: optional
Maintainer: Eugenio Paolantonio (g7) <me@medesimo.eu>
Build-Depends: python3-all-dev (>= 3.2), debhelper (>= 8.0.0)
X-Python3-Version: >= 3.4
Standards-Version: 4.0.1
Homepage: http://github.com/r3vn/badKarma
Vcs-Git: git://github.com/r3vn/badKarma.git
Vcs-Browser: https://github.com/r3vn/badKarma

Package: badkarma
Architecture: all
Depends: ${misc:Depends},
${python3:Depends},
python3 (>= 3.4),
python3-libnmap,
python3-sqlalchemy,
python3-shodan,
python3-gi,
gir1.2-gtk-3.0,
gir1.2-gtk-vnc-2.0,
gir1.2-gtksource-3.0,
gir1.2-vte-2.91,
gir1.2-osmgpsmap-1.0,
gir1.2-webkit2-4.0,
phantomjs,
mitmproxy,
ffmpeg
Description: Advanced network reconnaissance toolkit
badKarma is a python3 GTK+ toolkit that aims to assist penetration
testers during all the network infrastructure penetration testing
activity phases.
.
It allows testers to save time by having point-and-click access to
their toolkits, launch them against single or multiple targets and
interact with them through semplified GUIs or Terminals.
46 changes: 46 additions & 0 deletions debian/copyright
@@ -0,0 +1,46 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: badKarma
Source: http://github.com/r3vn/badKarma

Files: *
Copyright: 2018 Giuseppe Corti
License: GPL-3+

Files: scripts/finger-user-enum.pl
Copyright: 2006 pentestmonkey pentestmonkey@pentestmonkey.net
License: GPL-2

Files: scripts/ftp-user-enum.pl
Copyright: 2006 pentestmonkey pentestmonkey@pentestmonkey.net
License: GPL-2

Files: wordlists/*
Copyright: Public Domain
License: public-domain

Files: debian/*
Copyright: 2018 Eugenio Paolantonio (g7) <me@medesimo.eu>
License: BSD-3-Clause

License: BSD-3-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 changes: 17 additions & 0 deletions debian/rules
@@ -0,0 +1,17 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1


%:
dh $@ --with python3 --buildsystem=pybuild

override_dh_install:
# FIXME?
1 change: 1 addition & 0 deletions debian/source/format
@@ -0,0 +1 @@
3.0 (quilt)
8 changes: 8 additions & 0 deletions extra/badkarma.desktop
@@ -0,0 +1,8 @@
[Desktop Entry]
Name=badKarma
Comment=Network reconnaissance toolkit
Icon=badkarma
Exec=badkarma
Terminal=false
Type=Application
Categories=Network;
Binary file added extra/hicolor/24x24/apps/badkarma.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extra/hicolor/32x32/apps/badkarma.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extra/hicolor/48x48/apps/badkarma.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extra/hicolor/64x64/apps/badkarma.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extra/hicolor/96x96/apps/badkarma.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions setup.cfg
@@ -0,0 +1,3 @@
[install]
install-lib=/usr/share/badkarma
install-scripts=/usr/share/badkarma
88 changes: 88 additions & 0 deletions setup.py
@@ -0,0 +1,88 @@
#!/usr/bin/env python3
# badKarma - network reconnaissance toolkit
#
# Copyright (C) 2018 <Giuseppe `r3vn` Corti>
#
# This program 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 3 of the License, or
# (at your option) any later version.
#
# This program 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 <http://www.gnu.org/licenses/>.
#
# File contributed by Eugenio "g7" Paolantonio
#

import os

from distutils.core import setup

def asset_walk(directory, target_prefix, root_replace=None):
"""
Walks through the specified directory and returns a distutils-compilant
tuple ready to be appended to data_files.

:param: directory: the directory to scan
:param: target_prefix: the prefix to append to the target directory
:param: root_replace: if != None, replaces the initial directory name with the
specified replacement. Note that the replacement is pretty lazy.
:returns: a tuple in the following format: ("%(target_prefix)s/%(directory)s", [files...])
"""

if os.path.isabs(directory):
raise Exception("directory must be a relative path")

return [
(
os.path.join(
target_prefix,
(
root.replace(
directory,
root_replace
)
if root_replace is not None
else root
)
),
[
os.path.join(root, file_)
for file_ in files
]
)
for root, directories, files in os.walk(directory)
if files
]

setup(
name="badKarma",
version="0.0.1",
description="network reconnaissance toolkit",
author="Giuseppe Corti",
url="https://github.com/r3vn/badKarma",
scripts=["badkarma.py"],
packages=[
"core",
"extensions",
],
data_files= [
("/usr/share/applications", ["extra/badkarma.desktop"]),
] + \
asset_walk("extra/hicolor", "/usr/share/icons", root_replace="hicolor") + \
asset_walk("assets", "/usr/share/badkarma") + \
asset_walk("conf", "/usr/share/badkarma") + \
asset_walk("scripts", "/usr/share/badkarma") + \
asset_walk("wordlists", "/usr/share/badkarma"),
requires=[
"libnmap",
"sqlalchemy",
"shodan",
"gi",
]
)