Skip to content

Commit 3bfa81d

Browse files
committed
Merge pull request #12 from emperorcow/2.0
2.0
2 parents 4e6f2f2 + f37c196 commit 3bfa81d

20 files changed

Lines changed: 983 additions & 774 deletions

.build

Lines changed: 0 additions & 1 deletion
This file was deleted.

Makefile

Lines changed: 0 additions & 35 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
shareenum
22
==
33

4-
This is a tool that attempts to enumerate the permissions shares, directories, and files on Microsoft Windows systems. Using an implementation of the Samba (http://www.samba.org/) libsmbclient libraries this tool makes a SMB connection to a host and recursively gathers information over the file and directory entities, compared to several other share enumeration tools that use RPC calls to gather similar information. Both ways work, this was a bit easier to implement.
4+
This is a tool that attempts to enumerate the permissions shares, directories, and files on Microsoft Windows systems. Using an implementation of the Samba (http://www.samba.org/) libsmbclient libraries this tool makes a SMB connection to a host and recursively gathers information over the file and directory entities, compared to several other share enumeration tools that use RPC calls to gather similar information. Both ways work, this was a bit easier to implement and ends up being a lot faster.
55

66
```sh
7-
./shareenum -o output.csv -u DOMAIN\\username -p Password1 192.168.1.1
7+
shareenum -o output.csv -u DOMAIN\\username -p Password1 192.168.1.1
88
```
99

1010
License
@@ -32,23 +32,20 @@ Usage: shareenum -o FILE TARGET
3232

3333
> TARGET and FILE are required.
3434
35+
Download
36+
--
37+
We have provided deb binary files for Kali Linux to aid with installation. These binary files include both shareenum itself, as well as the correct Samba versions of the libraries to allow Shareenum to execute. You can download the latest releases here:
38+
39+
https://github.com/emperorcow/shareenum/releases
40+
3541
Installation
3642
--
43+
To install these binaries, its as simple as:
3744

3845
```sh
39-
git clone https://github.com/emperorcow/shareenum.git shareenum
40-
cd shareenum
41-
make
46+
dpkg -i shareenum_version.deb
4247
```
4348

44-
This tool requires the following packages to run on Kali:
45-
46-
* libsmbclient
47-
* samba
48-
* samba-common-bin
49-
50-
If you want to compile it, you'll also need:
49+
Make sure that you get the correct version for your system (i386 for 32bit and amd64 for 64bit).
5150

52-
* libsmbclient-dev
53-
* samba-dev
5451

build/Makefile

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always)
2+
SAMBAROOT=/usr/local/samba/lib
3+
BINFILE=../src/shareenum
4+
DSTDIR=/usr/local/shareenum
5+
6+
install:
7+
mkdir -p $(DSTDIR)/bin/
8+
cp $(BINFILE) $(DSTDIR)/bin/
9+
10+
deb:
11+
fpm -s dir -t deb -n "shareenum" -v $(GIT_VERSION) --before-remove beforeremove.sh --after-install afterinstall.sh --url https://github.com/emperorcow/shareenum --description "Tool for gathering permissions from MS shares" $(DSTDIR)/
12+
13+
libprep:
14+
mkdir -p $(DSTDIR)/lib/
15+
cp $(SAMBAROOT)/libsmbclient.so.0 $(DSTDIR)/lib/
16+
cp $(SAMBAROOT)/libsamba-util.so.0 $(DSTDIR)/lib/
17+
cp $(SAMBAROOT)/private/libreplace.so $(DSTDIR)/lib/
18+
cp $(SAMBAROOT)/private/libmsrpc3.so $(DSTDIR)/lib/
19+
cp $(SAMBAROOT)/private/liblibcli_lsa3.so $(DSTDIR)/lib/
20+
cp $(SAMBAROOT)/private/liblibsmb.so $(DSTDIR)/lib/
21+
cp $(SAMBAROOT)/private/libsamba-security.so $(DSTDIR)/lib/
22+
cp $(SAMBAROOT)/private/liberrors.so $(DSTDIR)/lib/
23+
cp $(SAMBAROOT)/libsmbconf.so.0 $(DSTDIR)/lib/
24+
cp $(SAMBAROOT)/libndr.so.0 $(DSTDIR)/lib/
25+
cp $(SAMBAROOT)/private/libgse.so $(DSTDIR)/lib/
26+
cp $(SAMBAROOT)/libndr-standard.so.0 $(DSTDIR)/lib/
27+
cp $(SAMBAROOT)/private/libdcerpc-samba.so $(DSTDIR)/lib/
28+
cp $(SAMBAROOT)/private/libcli_smb_common.so $(DSTDIR)/lib/
29+
cp $(SAMBAROOT)/private/libutil_cmdline.so $(DSTDIR)/lib/
30+
cp $(SAMBAROOT)/private/libsmbregistry.so $(DSTDIR)/lib/
31+
cp $(SAMBAROOT)/private/libsecrets3.so $(DSTDIR)/lib/
32+
cp $(SAMBAROOT)/private/libtevent.so.0 $(DSTDIR)/lib/
33+
cp $(SAMBAROOT)/private/libndr-samba.so $(DSTDIR)/lib/
34+
cp $(SAMBAROOT)/libsamba-credentials.so.0 $(DSTDIR)/lib/
35+
cp $(SAMBAROOT)/private/libsamba-sockets.so $(DSTDIR)/lib/
36+
cp $(SAMBAROOT)/libdcerpc-binding.so.0 $(DSTDIR)/lib/
37+
cp $(SAMBAROOT)/private/libcliauth.so $(DSTDIR)/lib/
38+
cp $(SAMBAROOT)/libgensec.so.0 $(DSTDIR)/lib/
39+
cp $(SAMBAROOT)/libtevent-util.so.0 $(DSTDIR)/lib/
40+
cp $(SAMBAROOT)/private/libsamba3-util.so $(DSTDIR)/lib/
41+
cp $(SAMBAROOT)/libwbclient.so.0 $(DSTDIR)/lib/
42+
cp $(SAMBAROOT)/private/libcli_cldap.so $(DSTDIR)/lib/
43+
cp $(SAMBAROOT)/private/libkrb5samba.so $(DSTDIR)/lib/
44+
cp $(SAMBAROOT)/private/libcom_err-samba4.so.0 $(DSTDIR)/lib/
45+
cp $(SAMBAROOT)/private/libasn1util.so $(DSTDIR)/lib/
46+
cp $(SAMBAROOT)/libsamba-hostconfig.so.0 $(DSTDIR)/lib/
47+
cp $(SAMBAROOT)/libndr-nbt.so.0 $(DSTDIR)/lib/
48+
cp $(SAMBAROOT)/private/libsmb_transport.so $(DSTDIR)/lib/
49+
cp $(SAMBAROOT)/private/libCHARSET3.so $(DSTDIR)/lib/
50+
cp $(SAMBAROOT)/private/libinterfaces.so $(DSTDIR)/lib/
51+
cp $(SAMBAROOT)/private/libccan.so $(DSTDIR)/lib/
52+
cp $(SAMBAROOT)/private/libdbwrap.so $(DSTDIR)/lib/
53+
cp $(SAMBAROOT)/private/libutil_tdb.so $(DSTDIR)/lib/
54+
cp $(SAMBAROOT)/private/libutil_reg.so $(DSTDIR)/lib/
55+
cp $(SAMBAROOT)/private/libsmbd_shim.so $(DSTDIR)/lib/
56+
cp $(SAMBAROOT)/private/libutil_setid.so $(DSTDIR)/lib/
57+
cp $(SAMBAROOT)/private/libtdb-wrap.so $(DSTDIR)/lib/
58+
cp $(SAMBAROOT)/private/libserver-role.so $(DSTDIR)/lib/
59+
cp $(SAMBAROOT)/private/libkrb5-samba4.so.26 $(DSTDIR)/lib/
60+
cp $(SAMBAROOT)/private/libaddns.so $(DSTDIR)/lib/
61+
cp $(SAMBAROOT)/private/libgssapi-samba4.so.2 $(DSTDIR)/lib/
62+
cp $(SAMBAROOT)/private/libauthkrb5.so $(DSTDIR)/lib/
63+
cp $(SAMBAROOT)/private/libcli-nbt.so $(DSTDIR)/lib/
64+
cp $(SAMBAROOT)/private/libldb.so.1 $(DSTDIR)/lib/
65+
cp $(SAMBAROOT)/private/libsamdb-common.so $(DSTDIR)/lib/
66+
cp $(SAMBAROOT)/private/libldbsamba.so $(DSTDIR)/lib/
67+
cp $(SAMBAROOT)/private/libsamba-modules.so $(DSTDIR)/lib/
68+
cp $(SAMBAROOT)/libsamdb.so.0 $(DSTDIR)/lib/
69+
cp $(SAMBAROOT)/private/libwinbind-client.so $(DSTDIR)/lib/
70+
cp $(SAMBAROOT)/private/libcli-ldap-common.so $(DSTDIR)/lib/
71+
cp $(SAMBAROOT)/private/libasn1-samba4.so.8 $(DSTDIR)/lib/
72+
cp $(SAMBAROOT)/private/libutil_ntdb.so $(DSTDIR)/lib/
73+
cp $(SAMBAROOT)/private/libntdb.so.0 $(DSTDIR)/lib/
74+
cp $(SAMBAROOT)/private/libheimbase-samba4.so.1 $(DSTDIR)/lib/
75+
cp $(SAMBAROOT)/private/libhx509-samba4.so.5 $(DSTDIR)/lib/
76+
cp $(SAMBAROOT)/private/libhcrypto-samba4.so.5 $(DSTDIR)/lib/
77+
cp $(SAMBAROOT)/private/libroken-samba4.so.19 $(DSTDIR)/lib/
78+
cp $(SAMBAROOT)/private/libwind-samba4.so.0 $(DSTDIR)/lib/
79+
cp $(SAMBAROOT)/libndr-krb5pac.so.0 $(DSTDIR)/lib/
80+
cp $(SAMBAROOT)/private/libauth_sam_reply.so $(DSTDIR)/lib/
81+
cp $(SAMBAROOT)/private/libflag_mapping.so $(DSTDIR)/lib/
82+
cp $(SAMBAROOT)/private/libtdb.so.1 $(DSTDIR)/lib/
83+
echo "Done."

build/afterinstall.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
SRC="/usr/local/shareenum/bin/shareenum"
3+
DST="/usr/bin/shareenum"
4+
if [ -f $DST ]; then
5+
rm $DST
6+
fi
7+
ln -s $SRC $DST

build/beforeremove.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
BINFILE="/usr/bin/shareenum"
3+
if [ -f $BINFILE ]; then
4+
rm /usr/bin/shareenum
5+
fi

0 commit comments

Comments
 (0)