Skip to content

Commit

Permalink
Fix smtp-user-enum
Browse files Browse the repository at this point in the history
  • Loading branch information
D3vil0p3r committed Dec 14, 2024
1 parent 92753e8 commit ebbce4c
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From: Maverick <[email protected]>
Date: Sat, 14 Nov 2020 13:00:47 +0100
Subject: Fix missing -T option in getopts declaration.

* The -T option to define a file-of-targets is mentioned in the pdf as
well as the usage section, however, it failed to include it as part of
the getopts declaration in line:87
---
CHANGELOG | 3 +++
smtp-user-enum.pl | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 4c23d06..eb0b77d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+2020-08-17 smtp-user-enum v1.3
+
+* Bug fix: -T option works now.

2008-04-20 smtp-user-enum v1.2

diff --git a/smtp-user-enum.pl b/smtp-user-enum.pl
index 8735270..c6f073e 100755
--- a/smtp-user-enum.pl
+++ b/smtp-user-enum.pl
@@ -84,7 +84,7 @@ Examples:

USAGE

-getopts('m:u:U:s:S:r:dt:vhM:f:D:p:w:', \%opts);
+getopts('m:u:U:s:S:r:dt:T:vhM:f:D:p:w:', \%opts);

# Print help message if required
if ($opts{'h'}) {
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
From: Marius Renner <[email protected]>
Date: Tue, 4 Aug 2020 10:50:08 +0200
Subject: Fix timeout option by changing it to '-w'

The usage hint listed both the option for the target host and the option
for the query timeout as '-t'. Of course there is no way to make that
work reliably.

As there was no way to properly specify the timeout before, it is safe
to assume that absolutely nobody could rely on the old option '-t' for
the timeout. Therefore the timeout option was changed to '-w' and added
to the option parser. Old commandlines will still work because '-t'
always was and still is used for the target host.
---
smtp-user-enum.pl | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/smtp-user-enum.pl b/smtp-user-enum.pl
index 7600bd3..8735270 100755
--- a/smtp-user-enum.pl
+++ b/smtp-user-enum.pl
@@ -69,7 +69,7 @@ options are:
-T file File of hostnames running the smtp service
-p port TCP port on which smtp service runs (default: $smtp_port)
-d Debugging output
- -t n Wait a maximum of n seconds for reply (default: $query_timeout)
+ -w n Wait a maximum of n seconds for reply (default: $query_timeout)
-v Verbose
-h This help message

@@ -84,7 +84,7 @@ Examples:

USAGE

-getopts('m:u:U:s:S:r:dt:vhM:f:D:p:', \%opts);
+getopts('m:u:U:s:S:r:dt:vhM:f:D:p:w:', \%opts);

# Print help message if required
if ($opts{'h'}) {
@@ -105,6 +105,7 @@ $debug = $opts{'d'} if $opts{'d'};
$smtp_port = $opts{'p'} if $opts{'p'};
$mode = $opts{'M'} if $opts{'M'};
$from_address = $opts{'f'} if $opts{'f'};
+$query_timeout = $opts{'w'} if $opts{'w'};

# Check for illegal option combinations
unless ((defined($username) or defined($username_file)) and (defined($host) or defined($host_file))) {
22 changes: 18 additions & 4 deletions packages/pentesting/smtp-user-enum/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@

pkgname=smtp-user-enum
pkgver=1.2
pkgrel=6
pkgrel=7
groups=('athena' 'athena-recon' 'athena-scanner')
pkgdesc='Username guessing tool primarily for use against the default Solaris SMTP service. Can use either EXPN, VRFY or RCPT TO.'
url='http://pentestmonkey.net/tools/user-enumeration/smtp-user-enum'
url='https://pentestmonkey.net/tools/user-enumeration/smtp-user-enum'
arch=('any')
license=('GPL-2.0-or-later')
source=("http://pentestmonkey.net/tools/$pkgname/$pkgname-$pkgver.tar.gz")
sha512sums=('dc33536957f54ec6d76d22d28d38c9653e06632cd87a94ed528692c38f31dd94f768765ce7539f69c072e0003f7769f009cf2f935823e1cdf31dfde1ca0dafcf')
source=("https://pentestmonkey.net/tools/$pkgname/$pkgname-$pkgver.tar.gz"
"Fix-missing-T-option-in-getopts-declaration.patch"
"Fix-timeout-option-by-changing-it-to-w.patch"
"fix-usage-output")
sha512sums=('dc33536957f54ec6d76d22d28d38c9653e06632cd87a94ed528692c38f31dd94f768765ce7539f69c072e0003f7769f009cf2f935823e1cdf31dfde1ca0dafcf'
'81d801d8b172afaffec84b48da3ac9bc83e1e7c19cb16cc4bd9728445cbf332f20645edb4dfde74d24985c766d021b133556e42024fa11a1c215feac114b9c9b'
'81f43eeb82f6c42c7a8016dfe957a48313afc630ae6d25bb5ab2d843d5bff27c7d2cf819fb476743f1f6915104238e72d7e23a7ce345e2a7477f09a7aaf87eea'
'c2fa09b82a20903ff6b4bf1ea72e2991b2de4de93c68c5ced7626f54ef5ceda89e8b6a07d1045cadbc1776c7814455ab65c155e5fd93a4813ef0ca1789ad876d')

prepare() {
cd "$pkgname-$pkgver"

patch -p1 < ../Fix-timeout-option-by-changing-it-to-w.patch
patch -p1 < ../Fix-missing-T-option-in-getopts-declaration.patch
patch -p1 < ../fix-usage-output
}

package() {
cd "$pkgname-$pkgver"
Expand Down
37 changes: 37 additions & 0 deletions packages/pentesting/smtp-user-enum/fix-usage-output
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From: Kali Developers <[email protected]>
Date: Sat, 14 Nov 2020 12:56:09 +0100
Subject: fix-usage-output

Updated the usage examples to reflect the actual binary name.
---
smtp-user-enum.pl | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/smtp-user-enum.pl b/smtp-user-enum.pl
index 5613985..7600bd3 100755
--- a/smtp-user-enum.pl
+++ b/smtp-user-enum.pl
@@ -53,7 +53,7 @@ my %opts;
my $usage=<<USAGE;
smtp-user-enum v$VERSION ( http://pentestmonkey.net/tools/smtp-user-enum )

-Usage: smtp-user-enum.pl [options] ( -u username | -U file-of-usernames ) ( -t host | -T file-of-targets )
+Usage: smtp-user-enum [options] ( -u username | -U file-of-usernames ) ( -t host | -T file-of-targets )

options are:
-m n Maximum number of processes (default: $max_procs)
@@ -77,10 +77,10 @@ Also see smtp-user-enum-user-docs.pdf from the smtp-user-enum tar ball.

Examples:

-\$ smtp-user-enum.pl -M VRFY -U users.txt -t 10.0.0.1
-\$ smtp-user-enum.pl -M EXPN -u admin1 -t 10.0.0.1
-\$ smtp-user-enum.pl -M RCPT -U users.txt -T mail-server-ips.txt
-\$ smtp-user-enum.pl -M EXPN -D example.com -U users.txt -t 10.0.0.1
+\$ smtp-user-enum -M VRFY -U users.txt -t 10.0.0.1
+\$ smtp-user-enum -M EXPN -u admin1 -t 10.0.0.1
+\$ smtp-user-enum -M RCPT -U users.txt -T mail-server-ips.txt
+\$ smtp-user-enum -M EXPN -D example.com -U users.txt -t 10.0.0.1

USAGE

0 comments on commit ebbce4c

Please sign in to comment.