mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-04-21 14:21:02 +02:00
ntp-fingerprint: cleanup. Shouldh've probably just removed that useless tool
This commit is contained in:
parent
21c9fa726b
commit
5de8b6ed22
6 changed files with 26 additions and 199 deletions
|
|
@ -1,3 +1,2 @@
|
|||
AUX README.txt 1244 RMD160 d6e2ec928ed68d29b4553ffbb61ab7de7c535ad4 SHA1 1579dc4251d709136d30e22e7de0359946254f78 SHA256 66304f8ad79bac86390923df623829ada8eae128e65ce20e3cb736b56d100069
|
||||
AUX ntp-fingerprint.pl 3930 RMD160 ba4383d1289ac001e93c462b5661a1a7f89dba76 SHA1 76c220d47816613540f0cfbf56f74fd27e2ee699 SHA256 f017b3db70b202ab355b02cb6de5cb2a4e04ecca3d52de3c2c1752cbe7829803
|
||||
EBUILD ntp-fingerprint-0.1.ebuild 484 RMD160 f118ec181f54b9f57fcc082e7384b05be4f72c0d SHA1 e50c3dd7c8af651a305d63cbdabc2b264723937c SHA256 59b1c497194c5e4881fd4c8fd8119a49cefb10de446f4812e32ff920bad5fb46
|
||||
DIST ntp-fingerprint.tar.gz 7768 SHA256 6c32beed7d2297e3494cb1582c6d16a2d4cecb0fbb0cf68cb7fc46151e708754 SHA512 1ba667b458e8c2818c22f6569578c8d9d60f0fe0001d4f16577e53cb3bf3fb8873d1593e876a7795fcac258b3634fb3897729d69a4efeddf4811bcb4ebb5d9ab WHIRLPOOL b9ddb7b38c22ea46fbba7b2f280eab39209940de884e623f033c7932f20205191e424ade8293736ef0ec0162d617de907415e6ab9486332eeda9b138823977b9
|
||||
EBUILD ntp-fingerprint-0.1-r1.ebuild 508 SHA256 78426d8b98c7a583da3545d35ce265a6719c98353a5f66dc651f54a7e623b6ca SHA512 9238e5be4802a49f9a860d8ac860ba2351df925f2b41d0f03fac61b64f41aef61ffea2b7b5d3373d0b9a6cf1d26298146ea2f5c72df40fbdded03d33f3a0838d WHIRLPOOL e4fd92224f0d7f8807de092b1b6d11d7d6b1c6703d160b627c23f3879ee0ce8675c250843c04cd6e6314c8742c0a1276687790d713a80ebc2cbafbcb15795c18
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
NTPd servers always give away information about the OS they are running under.
|
||||
This seems to be a reliable and simple method of remote OS fingerprinting.
|
||||
Sometimes the output is limited:
|
||||
|
||||
$ perl ntp.pl -t cisco2600
|
||||
ntp-fingerprint.pl, , v 0.1
|
||||
************* NTP server found at host 192.168.66.202 *******
|
||||
#It was possible to gather the following information #
|
||||
#from the remote NTP host 192.168.66.202 #
|
||||
# Operating system: cisco #
|
||||
*************************************************************
|
||||
|
||||
But sometimes it's not:
|
||||
$ perl ntp.pl -t pingo
|
||||
ntp-fingerprint.pl, , v 0.1
|
||||
************* NTP server found at host pingo ********************************
|
||||
#It was possible to gather the following information #
|
||||
#from the remote NTP host pingo #
|
||||
# NTP daemon:ôoversion=ntpd 4.2.0@1.1161-r Sun Nov 7 22:50:28 GMT 2004 (1) #
|
||||
# Processor:i686 #
|
||||
# Operating system:Linux/2.6.10-gentoo-r5 #
|
||||
*****************************************************************************
|
||||
So, it is useful to have a utility to query NTPd for OS versions.
|
||||
|
|
@ -1,153 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
use IO::Socket;
|
||||
use Net::hostent;
|
||||
use Getopt::Std;
|
||||
|
||||
my $VERSION = "0.1";
|
||||
|
||||
sub usage { # print a short 'usage` message and exit
|
||||
print "usage: perl $0 -t <timeserver>\n";
|
||||
print"###############################################################\n";
|
||||
print"# NTP finger version $VERSION #\n";
|
||||
print"# Becase we need it... #\n";
|
||||
print"# http://www.arhont.com/index-5.html #\n";
|
||||
print"###############################################################\n";
|
||||
print"\n";
|
||||
|
||||
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
use vars qw($opt_h $opt_t); # command line options
|
||||
|
||||
|
||||
print "$0, $PgmName, V $VERSION \n";
|
||||
# handle the commandline options
|
||||
getopts('ht'); # look for -h and -t
|
||||
$opt_h && usage; # -h print usage message and exit
|
||||
|
||||
(!$ARGV[0]) && usage; # no server: print usage message and exit
|
||||
|
||||
my $server = $ARGV[0];
|
||||
my $serverIPv4 ="";
|
||||
if (gethostbyname($server)) {
|
||||
$serverIPv4 = sprintf("%d.%d.%d.%d",unpack("C4",gethostbyname($server)));
|
||||
}
|
||||
|
||||
my $timeout = 2;
|
||||
|
||||
|
||||
|
||||
my $ntp_msg; # NTP message according to NTP/SNTP protocol specification
|
||||
|
||||
sub get_ntp {
|
||||
|
||||
# open the connection to the ntp server,
|
||||
# prepare the ntp request packet
|
||||
# send and receive
|
||||
|
||||
my ($remote);
|
||||
my $ntp_msg;
|
||||
|
||||
$ntp_msg = pack "C*", (0x16, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00);
|
||||
|
||||
# open the connection to the ntp server
|
||||
$remote = IO::Socket::INET -> new(Proto => "udp", PeerAddr => $server,
|
||||
PeerPort => 123,
|
||||
Timeout => $timeout)
|
||||
or die "Can't connect to \"$server\"\n";
|
||||
|
||||
# send the ntp-request to the server
|
||||
$remote -> send($ntp_msg) or return undef;
|
||||
|
||||
|
||||
# receive the ntp-message from the server
|
||||
|
||||
sysread( $remote, $ntp_msg, 4096 ) or
|
||||
do { print "Receive error from $server \n"; exit};
|
||||
close $remote;
|
||||
print "#It was possible to gather the following information\n#from the remote NTP host $server #\n ";
|
||||
$ntp_msg =~ s/^\s+//;
|
||||
$ntp_msg =~ s/\"//g;
|
||||
@fields = split(/,/, $ntp_msg);
|
||||
foreach (@fields) {
|
||||
if ($_=~/version/) {
|
||||
$_=~s/mversion=//i;
|
||||
$_=~ s/^\s+//;
|
||||
print "# NTP daemon:$_ #\n";
|
||||
}
|
||||
if ($_=~/processor/) {
|
||||
$_=~s/processor=//i;
|
||||
$_=~ s/^\s+//;
|
||||
print "# Processor:$_ #\n";
|
||||
}
|
||||
if ($_=~/system/) {
|
||||
$_=~s/system=//i;
|
||||
$_=~ s/^\s+//;
|
||||
print "# Operating system:$_ #\n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
sub ntp_installed
|
||||
{
|
||||
my $ndata;
|
||||
my $timeout = 2;
|
||||
|
||||
|
||||
$ndata = pack "C*",(0xDB, 0x00, 0x04, 0xFA, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0xBE, 0x78, 0x2F, 0x1D, 0x19, 0xBA,
|
||||
0x00, 0x00);
|
||||
$remote = IO::Socket::INET -> new(Proto => "udp", PeerAddr => $server,
|
||||
PeerPort => 123,
|
||||
Timeout => $timeout);
|
||||
|
||||
|
||||
if ($remote)
|
||||
{
|
||||
# send the ntp-request to the server
|
||||
$remote -> send($ndata);
|
||||
|
||||
|
||||
# receive the ntp-message from the server
|
||||
$SIG{ALRM} = \&timed_out;
|
||||
alarm ($timeout);
|
||||
eval { $remote -> recv($ndata, length(4096),0);
|
||||
close $remote;
|
||||
alarm (0);
|
||||
}
|
||||
|
||||
}
|
||||
if ($ndata)
|
||||
{
|
||||
|
||||
return (1);
|
||||
|
||||
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub get {
|
||||
my $nlist;
|
||||
if (ntp_installed)
|
||||
{
|
||||
print "************* NTP server found at host $server **************\n";
|
||||
get_ntp;
|
||||
print "*************************************************************\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$opt_t && get ;
|
||||
24
net-analyzer/ntp-fingerprint/ntp-fingerprint-0.1-r1.ebuild
Normal file
24
net-analyzer/ntp-fingerprint/ntp-fingerprint-0.1-r1.ebuild
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Copyright 1999-2014 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
EAPI=5
|
||||
|
||||
DESCRIPTION="NTP fingerprinting utility"
|
||||
HOMEPAGE="http://www.arhont.com/en/category/resources/tools-utilities/"
|
||||
SRC_URI="http://www.arhont.com/en/wp-content/uploads/2010/01/ntp-fingerprint.tar.gz"
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86 ~ppc"
|
||||
IUSE=""
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="dev-lang/perl"
|
||||
|
||||
S=${WORKDIR}/${PN}
|
||||
|
||||
src_install() {
|
||||
newbin "${PN}".pl "${PN}"
|
||||
dodoc README.txt
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /root/portage/net-analyzer/ntp-fingerprint/ntp-fingerprint-0.1.ebuild,v 1.1.1.1 2006/03/09 21:57:23 grimmlin Exp $
|
||||
|
||||
DESCRIPTION="A ntp fingerprinter"
|
||||
HOMEPAGE="none"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86 ~ppc"
|
||||
IUSE=""
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="dev-lang/perl"
|
||||
|
||||
src_install() {
|
||||
newbin "${FILESDIR}"/"${PN}".pl "${PN}"
|
||||
dodoc "${FILESDIR}"/README.txt
|
||||
}
|
||||
Loading…
Reference in a new issue