diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..a78339a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,7 @@ +python-ldapdomaindump (0.8.7-0kali1) kali-dev; urgency=medium + + * Initial release + * Package Python 2 version for new impacket release (not ready for Python 3 + now) + + -- Sophie Brun Thu, 14 Mar 2019 14:51:09 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b4de394 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +11 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..c476f61 --- /dev/null +++ b/debian/control @@ -0,0 +1,45 @@ +Source: python-ldapdomaindump +Section: python +Priority: optional +Maintainer: Kali Developers +Uploaders: Sophie Brun +Build-Depends: debhelper (>= 11), dh-python, python-all, python-setuptools, python3-all, python3-setuptools, python-ldap3, python3-ldap3, python-dnspython, python3-dnspython +Standards-Version: 4.2.1 +Homepage: https://github.com/dirkjanm/ldapdomaindump +Vcs-Browser: http://git.kali.org/gitweb/?p=packages/python-ldapdomaindump;a=summary +Vcs-Git: git://git.kali.org/packages/python-ldapdomaindump.git +Testsuite: autopkgtest-pkg-python + +Package: python-ldapdomaindump +Architecture: all +Depends: ${python:Depends}, ${misc:Depends} +Description: Active Directory information dumper via LDAP (Python 2) + This package contains an Active Directory information dumper via LDAP. In an + Active Directory domain, a lot of interesting information can be retrieved via + LDAP by any authenticated user (or machine). This makes LDAP an interesting + protocol for gathering information in the recon phase of a pentest of an + internal network. A problem is that data from LDAP often is not available in + an easy to read format. + . + ldapdomaindump is a tool which aims to solve this problem, by collecting and + parsing information available via LDAP and outputting it in a human readable + HTML format, as well as machine readable json and csv/tsv/greppable files. + . + This package installs the library for Python 2. + +Package: python3-ldapdomaindump +Architecture: all +Depends: ${python3:Depends}, ${misc:Depends} +Description: Active Directory information dumper via LDAP (Python 3) + This package contains an Active Directory information dumper via LDAP. In an + Active Directory domain, a lot of interesting information can be retrieved via + LDAP by any authenticated user (or machine). This makes LDAP an interesting + protocol for gathering information in the recon phase of a pentest of an + internal network. A problem is that data from LDAP often is not available in + an easy to read format. + . + ldapdomaindump is a tool which aims to solve this problem, by collecting and + parsing information available via LDAP and outputting it in a human readable + HTML format, as well as machine readable json and csv/tsv/greppable files. + . + This package installs the library for Python 3. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..83e48e1 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,30 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ldapdomaindump +Source: https://github.com/dirkjanm/ldapdomaindump + +Files: * +Copyright: 2016-2017 Dirk-jan Mollema +License: MIT + +Files: debian/* +Copyright: 2018 Sophie Brun +License: MIT + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. diff --git a/debian/patches/prepare-for-python3.patch b/debian/patches/prepare-for-python3.patch new file mode 100644 index 0000000..f934b07 --- /dev/null +++ b/debian/patches/prepare-for-python3.patch @@ -0,0 +1,30 @@ +--- a/ldapdomaindump/__init__.py ++++ b/ldapdomaindump/__init__.py +@@ -25,7 +25,11 @@ + import sys, os, re, codecs, json, argparse, getpass, base64 + # import class and constants + from datetime import datetime +-from urllib import quote_plus ++# Handle python3: urllib has been split into parts ++try: ++ from urllib import quote_plus ++except: ++ from urllib.parse import quote_plus + + import ldap3 + from ldap3 import Server, Connection, SIMPLE, SYNC, ALL, SASL, NTLM +@@ -799,11 +803,11 @@ class reportWriter(object): + + #Some quick logging helpers + def log_warn(text): +- print '[!] %s' % text ++ print ('[!] %s' % text) + def log_info(text): +- print '[*] %s' % text ++ print ('[*] %s' % text) + def log_success(text): +- print '[+] %s' % text ++ print ('[+] %s' % text) + + def main(): + parser = argparse.ArgumentParser(description='Domain information dumper via LDAP. Dumps users/computers/groups and OS/membership information to HTML/JSON/greppable output.') diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..57f6007 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +prepare-for-python3.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..6587fea --- /dev/null +++ b/debian/rules @@ -0,0 +1,14 @@ +#!/usr/bin/make -f +#export DH_VERBOSE = 1 + +export PYBUILD_NAME=ldapdomaindump + +%: + dh $@ --with python2,python3 --buildsystem=pybuild + +override_dh_install: + dh_install + # don't install the python2 binaries to avoid conflicts between + # Python2 and Python3 packages. + rm debian/python2-ldapdomaindump/usr/bin/ldapdomaindump + rm debian/python2-ldapdomaindump/usr/bin/ldd2bloodhound diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..cb61fa5 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +extend-diff-ignore = "^[^/]*[.]egg-info/" diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..0b7ccfd --- /dev/null +++ b/debian/watch @@ -0,0 +1,4 @@ +version=4 +opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%python-ldapdomaindump-$1.tar.gz%" \ + https://github.com/dirkjanm/ldapdomaindump/tags \ + (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate