誰が電話回線をタップしているかを確認し、whoisを介して電話回線をタップしたい人のアドレスを表示するスクリプトです。
awk '{
for (i = 1; i <= NF; i++)
if ($i ~ /^SRC=/)
print substr($i, 5)
}' /var/log/syslog | sort -u | while read ip; #former file was: /etc/sysconfig/syslog
do
printf ' INVALID STATE ' && printf ' === %s ===\n' "$ip"
whois "$ip" >> output-001.txt;
done
このスクリプトはIPv4アドレスでは機能しますが、IPv6では機能しません。両方のアドレスで動作するようにどのように調整する必要がありますか?電話回線に連絡する人のwhoisアドレスが必要です。
内容はoutput-001.txt
次のとおりです。
不明なAS番号または不明なIPネットワーク。このプログラム(whois)をアップグレードしてください。
プロバイダのファイアウォールによってスクリプトがブロックされたためです。プロバイダ(unitymedia)のファイアウォールを通過するために何を追加できますか?
roaimaの場合、2016年の夏の結果はoutput-001.txtに次のようになります。
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf
% Note: this output has been filtered.
% To receive output for a database update, use the "-B" flag.
% Information related to '2a02:908::/32'
% Abuse contact for '2a02:908::/32' is '[email protected]'
inet6num: 2a02:908::/32
netname: DE-KNRW-20090121
country: DE
org: ORG-iGCK3-RIPE
admin-c: UMAC-RIPE
tech-c: UMTC-RIPE
status: ALLOCATED-BY-RIR
mnt-by: RIPE-NCC-HM-MNT
mnt-lower: UNITYMEDIA-MNT
mnt-routes: UNITYMEDIA-MNT
mnt-domains: UNITYMEDIA-MNT
created: 2009-01-21T09:36:59Z
last-modified: 2016-04-14T09:45:51Z
source: RIPE # Filtered
remarks: Contact data for any network abuse/spam/security issue:
remarks: [email protected]
remarks: =======================================================
remarks: Contact data for any legal/law enforcement inquiries:
remarks: Auskunft.UM (at) unitymedia.de
remarks: Fax: 49 2273 5947 3220 (primary)
remarks: Fax: 49 2273 5947 2251 (backup)
organisation: ORG-iGCK3-RIPE
org-name: Unitymedia NRW GmbH
org-type: LIR
address: Aachener Str. 746 - 750
address: 50933
address: Koeln
address: GERMANY
phone: +49 2273 605 8567
fax-no: +49 2273 5947 2251
fax-no: +49 2273 605 4339
abuse-mailbox: [email protected]
admin-c: SB666-RIPE
admin-c: JK8125-RIPE
admin-c: MH3982-RIPE
mnt-ref: RIPE-NCC-HM-MNT
mnt-ref: UNITYMEDIA-MNT
mnt-by: RIPE-NCC-HM-MNT
abuse-c: UKAD1-RIPE
created: 2004-04-17T11:09:24Z
last-modified: 2016-03-11T12:07:57Z
source: RIPE # Filtered
role: Unitymedia Administration
address: Unitymedia Group
Aachener Strasse 746-750
50933 Koeln
Germany
admin-c: EM572-RIPE
tech-c: UMTC-RIPE
nic-hdl: UMAC-RIPE
remarks: =====================================================
remarks: Contact data for any legal/law enforcement inquiries:
remarks: Auskunft.UM (at) unitymedia.de
remarks: Fax: +49 2273 5947 3220 (primary)
remarks: Fax: +49 2273 5947 2251 (backup)
remarks: =====================================================
abuse-mailbox: [email protected]
mnt-by: UNITYMEDIA-MNT
created: 2009-07-10T11:13:10Z
last-modified: 2009-09-03T09:14:51Z
source: RIPE # Filtered
role: Unitymedia Technical Contact
address: Unitymedia KabelBW GmbH
address: Michael-Schumacher-Strasse 1
address: 50170 Kerpen
address: DE
admin-c: UMAC-RIPE
tech-c: MH3982-RIPE
tech-c: SJ3189-RIPE
tech-c: EM10466-RIPE
nic-hdl: UMTC-RIPE
remarks: =====================================================
remarks: Contact data for any legal/law enforcement inquiries:
remarks: Auskunft.UM (at) unitymedia.de
remarks: Fax: +49 2273 5947 3220 (primary)
remarks: Fax: +49 2273 5947 2251 (backup)
remarks: =====================================================
abuse-mailbox: [email protected]
mnt-by: UNITYMEDIA-MNT
created: 2009-07-10T11:13:10Z
last-modified: 2014-11-19T06:01:06Z
source: RIPE # Filtered
% Information related to '2a02:908:8000::/33AS20825'
route6: 2a02:908:8000::/33
descr: Unitymedia
origin: AS20825
mnt-by: UNITYMEDIA-MNT
created: 2016-02-11T13:24:04Z
last-modified: 2016-02-11T13:25:00Z
source: RIPE
% Information related to '2a02:908:8000::/33AS6830'
route6: 2a02:908:8000::/33
descr: Unitymedia
origin: AS6830
mnt-by: UNITYMEDIA-MNT
created: 2016-02-11T14:58:12Z
last-modified: 2016-02-11T14:58:12Z
source: RIPE
% This query was served by the RIPE Database Query Service version 1.87.4 (BLAARKOP)
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf
% Note: this output has been filtered.
% To receive output for a database update, use the "-B" flag.
% Information related to '2a02:908::/32'
% Abuse contact for '2a02:908::/32' is '[email protected]'
inet6num: 2a02:908::/32
netname: DE-KNRW-20090121
country: DE
org: ORG-iGCK3-RIPE
admin-c: UMAC-RIPE
tech-c: UMTC-RIPE
status: ALLOCATED-BY-RIR
mnt-by: RIPE-NCC-HM-MNT
mnt-lower: UNITYMEDIA-MNT
mnt-routes: UNITYMEDIA-MNT
mnt-domains: UNITYMEDIA-MNT
created: 2009-01-21T09:36:59Z
last-modified: 2016-04-14T09:45:51Z
source: RIPE # Filtered
remarks: Contact data for any network abuse/spam/security issue:
remarks: [email protected]
remarks: =======================================================
remarks: Contact data for any legal/law enforcement inquiries:
remarks: Auskunft.UM (at) unitymedia.de
remarks: Fax: 49 2273 5947 3220 (primary)
remarks: Fax: 49 2273 5947 2251 (backup)
organisation: ORG-iGCK3-RIPE
org-name: Unitymedia NRW GmbH
org-type: LIR
address: Aachener Str. 746 - 750
address: 50933
address: Koeln
address: GERMANY
phone: +49 2273 605 8567
fax-no: +49 2273 5947 2251
fax-no: +49 2273 605 4339
abuse-mailbox: [email protected]
admin-c: SB666-RIPE
admin-c: JK8125-RIPE
admin-c: MH3982-RIPE
mnt-ref: RIPE-NCC-HM-MNT
mnt-ref: UNITYMEDIA-MNT
mnt-by: RIPE-NCC-HM-MNT
abuse-c: UKAD1-RIPE
created: 2004-04-17T11:09:24Z
last-modified: 2016-03-11T12:07:57Z
source: RIPE # Filtered
role: Unitymedia Administration
address: Unitymedia Group
Aachener Strasse 746-750
50933 Koeln
Germany
admin-c: EM572-RIPE
tech-c: UMTC-RIPE
nic-hdl: UMAC-RIPE
remarks: =====================================================
remarks: Contact data for any legal/law enforcement inquiries:
remarks: Auskunft.UM (at) unitymedia.de
remarks: Fax: +49 2273 5947 3220 (primary)
remarks: Fax: +49 2273 5947 2251 (backup)
remarks: =====================================================
abuse-mailbox: [email protected]
mnt-by: UNITYMEDIA-MNT
created: 2009-07-10T11:13:10Z
last-modified: 2009-09-03T09:14:51Z
source: RIPE # Filtered
role: Unitymedia Technical Contact
address: Unitymedia KabelBW GmbH
address: Michael-Schumacher-Strasse 1
address: 50170 Kerpen
address: DE
admin-c: UMAC-RIPE
tech-c: MH3982-RIPE
tech-c: SJ3189-RIPE
tech-c: EM10466-RIPE
nic-hdl: UMTC-RIPE
remarks: =====================================================
remarks: Contact data for any legal/law enforcement inquiries:
remarks: Auskunft.UM (at) unitymedia.de
remarks: Fax: +49 2273 5947 3220 (primary)
remarks: Fax: +49 2273 5947 2251 (backup)
remarks: =====================================================
abuse-mailbox: [email protected]
mnt-by: UNITYMEDIA-MNT
created: 2009-07-10T11:13:10Z
last-modified: 2014-11-19T06:01:06Z
source: RIPE # Filtered
% Information related to '2a02:908:8000::/33AS20825'
route6: 2a02:908:8000::/33
descr: Unitymedia
origin: AS20825
mnt-by: UNITYMEDIA-MNT
created: 2016-02-11T13:24:04Z
last-modified: 2016-02-11T13:25:00Z
source: RIPE
% Information related to '2a02:908:8000::/33AS6830'
route6: 2a02:908:8000::/33
descr: Unitymedia
origin: AS6830
mnt-by: UNITYMEDIA-MNT
created: 2016-02-11T14:58:12Z
last-modified: 2016-02-11T14:58:12Z
source: RIPE
% This query was served by the RIPE Database Query Service version 1.87.4 (ANGUS)
Unbekannte AS-Nummer oder unbekanntes IP-Netzwerk. Bitte führen Sie ein Upgrade dieses Programms durch.
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf
% Note: this output has been filtered.
% To receive output for a database update, use the "-B" flag.
% Information related to '2a02:908::/32'
% Abuse contact for '2a02:908::/32' is '[email protected]'
inet6num: 2a02:908::/32
netname: DE-KNRW-20090121
country: DE
org: ORG-iGCK3-RIPE
admin-c: UMAC-RIPE
tech-c: UMTC-RIPE
status: ALLOCATED-BY-RIR
mnt-by: RIPE-NCC-HM-MNT
mnt-lower: UNITYMEDIA-MNT
mnt-routes: UNITYMEDIA-MNT
mnt-domains: UNITYMEDIA-MNT
created: 2009-01-21T09:36:59Z
last-modified: 2016-04-14T09:45:51Z
source: RIPE # Filtered
remarks: Contact data for any network abuse/spam/security issue:
remarks: [email protected]
remarks: =======================================================
remarks: Contact data for any legal/law enforcement inquiries:
remarks: Auskunft.UM (at) unitymedia.de
remarks: Fax: 49 2273 5947 3220 (primary)
remarks: Fax: 49 2273 5947 2251 (backup)
organisation: ORG-iGCK3-RIPE
org-name: Unitymedia NRW GmbH
org-type: LIR
address: Aachener Str. 746 - 750
address: 50933
address: Koeln
address: GERMANY
phone: +49 2273 605 8567
fax-no: +49 2273 5947 2251
fax-no: +49 2273 605 4339
abuse-mailbox: [email protected]
admin-c: SB666-RIPE
admin-c: JK8125-RIPE
admin-c: MH3982-RIPE
mnt-ref: RIPE-NCC-HM-MNT
mnt-ref: UNITYMEDIA-MNT
mnt-by: RIPE-NCC-HM-MNT
abuse-c: UKAD1-RIPE
created: 2004-04-17T11:09:24Z
last-modified: 2016-03-11T12:07:57Z
source: RIPE # Filtered
role: Unitymedia Administration
address: Unitymedia Group
Aachener Strasse 746-750
50933 Koeln
Germany
admin-c: EM572-RIPE
tech-c: UMTC-RIPE
nic-hdl: UMAC-RIPE
remarks: =====================================================
remarks: Contact data for any legal/law enforcement inquiries:
remarks: Auskunft.UM (at) unitymedia.de
remarks: Fax: +49 2273 5947 3220 (primary)
remarks: Fax: +49 2273 5947 2251 (backup)
remarks: =====================================================
abuse-mailbox: [email protected]
mnt-by: UNITYMEDIA-MNT
created: 2009-07-10T11:13:10Z
last-modified: 2009-09-03T09:14:51Z
source: RIPE # Filtered
role: Unitymedia Technical Contact
address: Unitymedia KabelBW GmbH
address: Michael-Schumacher-Strasse 1
address: 50170 Kerpen
address: DE
admin-c: UMAC-RIPE
tech-c: MH3982-RIPE
tech-c: SJ3189-RIPE
tech-c: EM10466-RIPE
nic-hdl: UMTC-RIPE
remarks: =====================================================
remarks: Contact data for any legal/law enforcement inquiries:
remarks: Auskunft.UM (at) unitymedia.de
remarks: Fax: +49 2273 5947 3220 (primary)
remarks: Fax: +49 2273 5947 2251 (backup)
remarks: =====================================================
abuse-mailbox: [email protected]
mnt-by: UNITYMEDIA-MNT
created: 2009-07-10T11:13:10Z
last-modified: 2014-11-19T06:01:06Z
source: RIPE # Filtered
% Information related to '2a02:908:8000::/33AS20825'
ベストアンサー1
出力ファイルの最初のIPv6アドレスを使用すると、
$whois 2a02:908::/32
期待した結果を得ました。 whoisエラーはありません(未知のAS番号または不明なIPネットワークです。このプログラム(whois)をアップグレードしてください)
$whois 2a02:908::/32
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf
% Note: this output has been filtered.
% To receive output for a database update, use the "-B" flag.
% Information related to '2a02:908::/32'
% Abuse contact for '2a02:908::/32' is '[email protected]'
inet6num: 2a02:908::/32
netname: DE-KNRW-20090121
country: DE
org: ORG-iGCK3-RIPE
admin-c: UMAC-RIPE
tech-c: UMTC-RIPE
status: ALLOCATED-BY-RIR
remarks: Contact data for any network abuse/spam/security issue:
remarks: [email protected]
remarks: =======================================================
remarks: Contact data for any legal/law enforcement inquiries:
remarks: Auskunft.UM (at) unitymedia.de
remarks: Fax: 49 2273 5947 3220 (primary)
remarks: Fax: 49 2273 5947 2251 (backup)
mnt-by: RIPE-NCC-HM-MNT
mnt-by: UNITYMEDIA-MNT
mnt-lower: UNITYMEDIA-MNT
mnt-routes: UNITYMEDIA-MNT
mnt-domains: UNITYMEDIA-MNT
created: 2009-01-21T09:36:59Z
last-modified: 2016-08-25T14:02:54Z
source: RIPE # Filtered
organisation: ORG-iGCK3-RIPE
org-name: Unitymedia NRW GmbH
org-type: LIR
address: Aachener Str. 746 - 750
address: 50933
address: Koeln
address: GERMANY
phone: +49 2273 605 8567
fax-no: +49 2273 5947 2251
fax-no: +49 2273 605 4339
admin-c: SB666-RIPE
admin-c: JK8125-RIPE
admin-c: MH3982-RIPE
abuse-c: UKAD1-RIPE
mnt-ref: RIPE-NCC-HM-MNT
mnt-ref: UNITYMEDIA-MNT
abuse-mailbox: [email protected]
mnt-by: RIPE-NCC-HM-MNT
mnt-by: UNITYMEDIA-MNT
created: 2004-04-17T11:09:24Z
last-modified: 2016-08-25T14:03:26Z
source: RIPE # Filtered
role: Unitymedia Administration
address: Unitymedia Group
Aachener Strasse 746-750
50933 Koeln
Germany
admin-c: EM572-RIPE
tech-c: UMTC-RIPE
nic-hdl: UMAC-RIPE
remarks: =====================================================
remarks: Contact data for any legal/law enforcement inquiries:
remarks: Auskunft.UM (at) unitymedia.de
remarks: Fax: +49 2273 5947 3220 (primary)
remarks: Fax: +49 2273 5947 2251 (backup)
remarks: =====================================================
abuse-mailbox: [email protected]
mnt-by: UNITYMEDIA-MNT
created: 2009-07-10T11:13:10Z
last-modified: 2009-09-03T09:14:51Z
source: RIPE # Filtered
role: Unitymedia Technical Contact
address: Unitymedia KabelBW GmbH
address: Michael-Schumacher-Strasse 1
address: 50170 Kerpen
address: DE
admin-c: UMAC-RIPE
tech-c: MH3982-RIPE
tech-c: SJ3189-RIPE
tech-c: EM10466-RIPE
nic-hdl: UMTC-RIPE
remarks: =====================================================
remarks: Contact data for any legal/law enforcement inquiries:
remarks: Auskunft.UM (at) unitymedia.de
remarks: Fax: +49 2273 5947 3220 (primary)
remarks: Fax: +49 2273 5947 2251 (backup)
remarks: =====================================================
abuse-mailbox: [email protected]
mnt-by: UNITYMEDIA-MNT
created: 2009-07-10T11:13:10Z
last-modified: 2014-11-19T06:01:06Z
source: RIPE # Filtered
% Information related to '2a02:908::/32AS20825'
route6: 2a02:908::/32
descr: Unitymedia
origin: AS20825
mnt-by: UNITYMEDIA-MNT
created: 2009-01-23T22:05:02Z
last-modified: 2009-07-10T15:01:59Z
source: RIPE
% Information related to '2a02:908::/32AS6830'
route6: 2a02:908::/32
descr: Unitymedia
origin: AS6830
mnt-by: UNITYMEDIA-MNT
created: 2016-02-11T14:56:17Z
last-modified: 2016-02-11T14:56:17Z
source: RIPE
% This query was served by the RIPE Database Query Service version 1.88 (BLAARKOP)
このメッセージは、whoisプログラムを更新するように求められます。
最近whoisプログラムを更新/アップグレードしてみましたか?