print source address in UDP mode

This commit is contained in:
Pavel Zhukov 2018-01-22 15:41:17 +01:00
parent d28113d61d
commit d838f9b961
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,29 @@
commit e8b73078fd56a4d16ffa9cbb51f43ac75c5f7f1f
Author: nnposter <nnposter@e0a8ed71-7df4-0310-8962-fdc924857419>
Date: Mon Sep 11 02:33:07 2017 +0000
Provides more meaningful information about the connecting client when in UDP listening mode. Closes #980
diff --git a/ncat/ncat_listen.c b/ncat/ncat_listen.c
index b047a5866..20b14b7db 100644
--- a/ncat/ncat_listen.c
+++ b/ncat/ncat_listen.c
@@ -898,8 +898,8 @@ static int ncat_listen_dgram(int proto)
ncat_log_recv(buf, nbytes);
}
- if (o.debug > 1)
- logdebug("Valid Connection from %d\n", socket_n);
+ if (o.verbose)
+ loguser("Connection from %s.\n", inet_socktop(&remotess));
conn_inc++;
@@ -917,6 +917,7 @@ static int ncat_listen_dgram(int proto)
struct fdinfo info = { 0 };
info.fd = socket_n;
+ info.remoteaddr = remotess;
if (o.keepopen)
netrun(&info, o.cmdexec);
else

View File

@ -8,7 +8,7 @@ Name: nmap
Epoch: 2
Version: 7.60
#global prerelease TEST5
Release: 9%{?dist}
Release: 10%{?dist}
# Uses combination of licenses based on GPL license, but with extra modification
# so it got its own license tag rhbz#1055861
License: Nmap
@ -32,6 +32,10 @@ Patch7: nmap-7.60-bundled_libssh2_libz.patch
# https://github.com/nmap/nmap/pull/973
# https://github.com/nmap/nmap/pull/975
Patch8: nmap-7.60-memleak.patch
## e8b73078f Provides more meaningful information about the connecting client
## when in UDP listening mode. Closes #980 - nnposter, 4 months ago
Patch9: nmap-7.60-udp_remoteaddr.patch
URL: http://nmap.org/
@ -101,6 +105,7 @@ BuildArch: noarch
%patch6 -p1 -b .displayerror
%patch7 -p1 -b .libssh2
%patch8 -p1 -b .memleak
%patch9 -p1 -b .udp_address
#be sure we're not using tarballed copies of some libraries
#rm -rf liblua libpcap libpcre macosx mswin32 ###TODO###
@ -225,6 +230,9 @@ rm -rf %{buildroot}
%{_mandir}/man1/xnmap.1.gz
%changelog
* Mon Jan 22 2018 Pavel Zhukov <pzhukov@redhat.com> - 2:7.60-10
- Print source address in UDP mode
* Thu Jan 18 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2:7.60-9
- Remove obsolete scriptlets