Mercurial > hg > anonet-resdb
annotate contrib/whoisd/whoisd.pl @ 1215:7f3fc3fcba90 draft
adding self
author | opal hart <opal@wowana.me> |
---|---|
date | Sat, 25 Aug 2018 23:05:47 +0000 |
parents | 7fa47f376c41 |
children | b8624e57fd96 |
rev | line source |
---|---|
1208
4e77dfbee7e7
fixed stupid shebang for whoisd.pl
epochqwert <epoch@hacking.allowed.org>
parents:
1207
diff
changeset
|
1 #!/usr/bin/env perl |
1186
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
2 # ncat -klp 43 -e ./whoisd.pl |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
3 # use inetd or tcpserver or ncat |
1131
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
4 |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
5 use strict; |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
6 |
1143
ca4d35064aa2
fixed the ns.whois.ano thing... don't remember what I did to whoisd.pl. Oh well.
epoch <epoch@hacking.allowed.org>
parents:
1141
diff
changeset
|
7 #maybe chroot this whoisd? |
1131
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
8 my $RESDB = "/services/resdb/resdb"; |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
9 |
1138
c95369b825a2
whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents:
1133
diff
changeset
|
10 my $HACK=0; |
1131
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
11 my $QUERY=<stdin>; |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
12 $QUERY =~ s/\r\n//g; |
1143
ca4d35064aa2
fixed the ns.whois.ano thing... don't remember what I did to whoisd.pl. Oh well.
epoch <epoch@hacking.allowed.org>
parents:
1141
diff
changeset
|
13 $QUERY =~ s/\///g; |
ca4d35064aa2
fixed the ns.whois.ano thing... don't remember what I did to whoisd.pl. Oh well.
epoch <epoch@hacking.allowed.org>
parents:
1141
diff
changeset
|
14 if($QUERY eq '') { |
ca4d35064aa2
fixed the ns.whois.ano thing... don't remember what I did to whoisd.pl. Oh well.
epoch <epoch@hacking.allowed.org>
parents:
1141
diff
changeset
|
15 printf "%% error. no query. wtf?"; |
ca4d35064aa2
fixed the ns.whois.ano thing... don't remember what I did to whoisd.pl. Oh well.
epoch <epoch@hacking.allowed.org>
parents:
1141
diff
changeset
|
16 exit 0; |
ca4d35064aa2
fixed the ns.whois.ano thing... don't remember what I did to whoisd.pl. Oh well.
epoch <epoch@hacking.allowed.org>
parents:
1141
diff
changeset
|
17 } |
1131
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
18 my $out; |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
19 my $title; |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
20 my $value; |
1178
1112129d9653
hey, pgp key! don't remember what I changed in whoisd.pl
epoch <epoch@hacking.allowed.ano>
parents:
1146
diff
changeset
|
21 my @value; |
1131
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
22 my @parts; |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
23 my $i; |
1186
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
24 my $d; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
25 |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
26 my $user; |
1131
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
27 |
1138
c95369b825a2
whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents:
1133
diff
changeset
|
28 if($QUERY eq "!!\n") { |
c95369b825a2
whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents:
1133
diff
changeset
|
29 $QUERY=<stdin>; |
c95369b825a2
whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents:
1133
diff
changeset
|
30 $QUERY =~ s/^!r(.+?)[\/,].*$/\1/; |
c95369b825a2
whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents:
1133
diff
changeset
|
31 printf "A500\n"; #fake this I guess. Does it even use that number for anything? |
c95369b825a2
whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents:
1133
diff
changeset
|
32 printf "%% Looks like you're trying -A on a BSDian traceroute with this server.\n"; |
c95369b825a2
whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents:
1133
diff
changeset
|
33 $HACK=1; |
c95369b825a2
whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents:
1133
diff
changeset
|
34 } |
c95369b825a2
whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents:
1133
diff
changeset
|
35 |
1186
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
36 sub get_user_from_ASN { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
37 my $AS=$_[0]; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
38 my $user; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
39 chdir("$RESDB/db/as") || die "%% error"; |
1187
7ea11723da51
made a couple error messages more informative
epoch <epoch@hacking.allowed.ano>
parents:
1186
diff
changeset
|
40 if(chdir($AS) || die "%% ASN not found.") { |
7ea11723da51
made a couple error messages more informative
epoch <epoch@hacking.allowed.ano>
parents:
1186
diff
changeset
|
41 open(FILE,"owner") || die "%% ASN's owner not found."; |
1186
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
42 $user=<FILE>; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
43 close(FILE); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
44 } else { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
45 printf "%% AS not found."; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
46 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
47 return $user; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
48 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
49 |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
50 sub get_user_from_IPv4 { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
51 my @parts; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
52 my $user; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
53 chdir("$RESDB/db/ip") || die "%% error"; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
54 @parts=split(/\./,$_[0]); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
55 for($i=0;$i<scalar(@parts)-1;$i++) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
56 if(!chdir(sprintf("%02X",$parts[$i]))) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
57 printf "%-20s %s\n", "error" . ":", "IP not found." unless $HACK; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
58 exit; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
59 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
60 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
61 open(FILE,"owner") || die "%% IP not found."; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
62 $user=<FILE>; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
63 close(FILE); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
64 return $user; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
65 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
66 |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
67 sub get_user_from_domain { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
68 my @parts; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
69 my $user; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
70 my $i; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
71 @parts=split(/\./,$_[0]); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
72 chdir("$RESDB/db/dom") || die "%% error"; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
73 for($i=scalar(@parts)-1;$i>scalar(@parts)-3;$i--) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
74 if(!$parts[$i]) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
75 printf "%% error"; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
76 exit |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
77 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
78 if(!chdir($parts[$i])) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
79 printf "%-20s %s", "warning" . ":", "domain not found."; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
80 exit; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
81 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
82 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
83 open(FILE,"owner") || die "%% IP's owner not found."; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
84 $user=<FILE>; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
85 close(FILE); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
86 return $user; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
87 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
88 |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
89 sub get_user_from_IPv6 { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
90 chdir("$RESDB/db/ip6") || die "%% error. no resdb/db/ip6\n"; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
91 $d=$_[0]; |
1214
7fa47f376c41
seeing if this change to the whoisd will make it show IP6 registrations based on username
epochqwert <epoch@hacking.allowed.org>
parents:
1208
diff
changeset
|
92 #print "$d"; |
1186
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
93 $d =~ s/[^0-9a-f]//gi; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
94 $d =~ tr/a-z/A-Z/; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
95 foreach(split(//,$d)) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
96 $d=$_; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
97 chdir($d); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
98 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
99 open(FILE,"owner") || die "%% IP6's owner not found."; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
100 $user=<FILE>; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
101 close(FILE); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
102 return $user; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
103 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
104 |
1146
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
105 sub ASN_lookup { |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
106 if($QUERY =~ m/^AS(.+?)$/) { |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
107 printf "%% AS section for %s\n", $QUERY; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
108 my $AS=$1; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
109 chdir("$RESDB/db/as") || die "%% error"; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
110 if(chdir($AS) || die "%% error") { |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
111 foreach(split(/\n/,`grep '' -r .`)) { |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
112 $out = $_; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
113 $out =~ s/^\.\///g; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
114 $out =~ m/^(.+?):(.+?)$/; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
115 ($title, $value) = ($1, $2); |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
116 printf "%-20s %s\n", $title . ":", $value; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
117 if($title eq "owner") { |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
118 $QUERY = $value; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
119 } |
1131
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
120 } |
1146
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
121 } else { |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
122 printf "AS not found."; |
1131
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
123 } |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
124 } |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
125 } |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
126 |
1146
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
127 |
1189 | 128 # IPv4 addresses #this checks all dirs in the ip dir. so, 1., 2., and 21. (15) |
1186
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
129 sub IPv4_lookup { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
130 if($QUERY =~ m/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
131 printf "%% IP section for %s\n", $QUERY unless $HACK; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
132 chdir("$RESDB/db/ip") || die "%% error"; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
133 @parts=split(/\./,$QUERY); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
134 for($i=0;$i<scalar(@parts)-1;$i++) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
135 if(!chdir(sprintf("%02X",$parts[$i]))) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
136 printf "%-20s %s\n", "error" . ":", "IP not found." unless $HACK; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
137 exit; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
138 } |
1133
1a5d655cae9c
fixed another bug in whoisd
epoch <epoch@hacking.allowed.org>
parents:
1132
diff
changeset
|
139 } |
1186
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
140 foreach(split(/\n/,`grep '' -r .`)) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
141 $out = $_; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
142 $out =~ s/^\.\///g; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
143 ($title, @value) = split(/:/,$out); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
144 $value=join(":",@value); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
145 printf "%-20s %s\n", $title . ":", $value unless $HACK; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
146 if($title eq "owner") { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
147 $QUERY = $value ; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
148 } |
1131
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
149 } |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
150 } |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
151 } |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
152 |
1186
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
153 |
1131
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
154 # if we get here and there's still a . in the query it is probably a domain. |
1186
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
155 sub domain_lookup { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
156 if($QUERY =~ m/\./) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
157 printf "%% domain section for %s\n", $QUERY; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
158 @parts=split(/\./,$QUERY); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
159 chdir("$RESDB/db/dom") || die "%% error"; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
160 for($i=scalar(@parts)-1;$i>scalar(@parts)-3;$i--) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
161 if(!$parts[$i]) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
162 printf "%% error"; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
163 exit |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
164 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
165 if(!chdir($parts[$i])) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
166 printf "%-20s %s", "warning" . ":", "domain not found."; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
167 exit; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
168 } |
1141
58130f5eecf2
found a bug when sending just '.'... wasn't good.
epoch <epoch@hacking.allowed.org>
parents:
1140
diff
changeset
|
169 } |
1186
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
170 foreach(split(/\n/,`grep '' -r .`)) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
171 $out = $_; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
172 $out =~ s/^\.\///g; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
173 $out =~ m/^(.+?):(.+?)$/; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
174 ($title, $value) = ($1, $2); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
175 printf "%-20s %s\n", $title . ":", $value; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
176 if($title eq "owner") { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
177 $QUERY = $value; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
178 } |
1131
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
179 } |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
180 } |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
181 } |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
182 |
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
183 |
1186
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
184 #IPv6 addresses |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
185 sub IPv6_lookup { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
186 if($QUERY =~ m/:/) {#close enough? |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
187 $QUERY =~ s/://g; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
188 $QUERY =~ s/[^a-fA-F0-9]//g; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
189 $QUERY = uc($QUERY); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
190 chdir("$RESDB/db/ip6"); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
191 foreach(split(//,$QUERY)) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
192 chdir($_);; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
193 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
194 foreach(split(/\n/,`grep '' -r .`)) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
195 $out = $_; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
196 $out =~ s/^\.\///g; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
197 $out =~ m/^(.+?):(.+?)$/; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
198 ($title, $value) = ($1, $2); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
199 printf "%-20s %s\n", $title . ":", $value; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
200 if($title eq "owner") { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
201 $QUERY = $value; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
202 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
203 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
204 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
205 } |
1146
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
206 |
1189 | 207 sub user_based_lookups { |
1146
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
208 printf "%% user section for '%s'\n", $QUERY unless $HACK; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
209 |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
210 chdir("$RESDB/db/usr") || die "%% error"; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
211 if(chdir($QUERY)) { |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
212 foreach(split(/\n/,`grep '' -r .`)) { |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
213 $out = $_; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
214 $out =~ s/^\.\///g; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
215 $out =~ m/^(.+?):(.+?)$/; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
216 ($title, $value) = ($1, $2); |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
217 printf "%-20s %s\n", $title . ":", $value unless $HACK; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
218 } |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
219 } else { |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
220 printf "%-20s missing db/usr file.\n", "warning" . ":" unless $HACK; |
1131
16cef39f682d
Added a whoisd to make for easier querying of the resdb's info. Read the source.
epoch <epoch@hacking.allowed.org>
parents:
diff
changeset
|
221 } |
1146
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
222 chdir("$RESDB/db/as") || die "%% error"; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
223 my @asn; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
224 foreach(split(/\n/,`grep '^$QUERY\$' */owner | cut -d/ -f1`)) { |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
225 $out = $_; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
226 $out =~ s/\n//g; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
227 printf "%-20s AS%s\n", "origin" . ":", $out if $HACK; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
228 printf "%-20s AS%s\n", "origin" . ":", $out unless $HACK; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
229 @asn[scalar(@asn)]=$out; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
230 } |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
231 chdir("$RESDB/db/ip") || die "%% error"; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
232 my $merp; |
1189 | 233 foreach(split(/\n/,`grep '^$QUERY\$' */*/*/owner | cut -d/ -f1-3 | xargs printf '%s/cidr\n' | xargs cat | uniq`)) { |
234 chomp $_; | |
235 printf "%-20s %s\n", "cidr" . ":", $_; | |
1146
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
236 } |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
237 |
1214
7fa47f376c41
seeing if this change to the whoisd will make it show IP6 registrations based on username
epochqwert <epoch@hacking.allowed.org>
parents:
1208
diff
changeset
|
238 chdir("$RESDB/db/ip6") || die "%% error"; |
7fa47f376c41
seeing if this change to the whoisd will make it show IP6 registrations based on username
epochqwert <epoch@hacking.allowed.org>
parents:
1208
diff
changeset
|
239 foreach(split(/\n/,`grep '^$QUERY\$' -r * | cut -d/ -f1-16 | xargs printf '%s/cidr\n' | xargs cat | uniq`)) { |
7fa47f376c41
seeing if this change to the whoisd will make it show IP6 registrations based on username
epochqwert <epoch@hacking.allowed.org>
parents:
1208
diff
changeset
|
240 chomp $_; |
7fa47f376c41
seeing if this change to the whoisd will make it show IP6 registrations based on username
epochqwert <epoch@hacking.allowed.org>
parents:
1208
diff
changeset
|
241 printf "%-20s %s\n", "cidr" . ":", $_; |
7fa47f376c41
seeing if this change to the whoisd will make it show IP6 registrations based on username
epochqwert <epoch@hacking.allowed.org>
parents:
1208
diff
changeset
|
242 } |
7fa47f376c41
seeing if this change to the whoisd will make it show IP6 registrations based on username
epochqwert <epoch@hacking.allowed.org>
parents:
1208
diff
changeset
|
243 |
1146
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
244 foreach(split(/\n/,`grep -i -e "^$QUERY\$" "$RESDB/db/dom"/*/*/owner`)) { |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
245 $out = $_; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
246 $out =~ s/.*\/db\/dom\/(.+?)\/(.+?)\/owner.*/\2\.\1/; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
247 if ($out ne "") { #fix this comparison. |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
248 printf "%-20s %s\n", "domain" . ":", $out; |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
249 } |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
250 } |
1132 | 251 |
1146
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
252 foreach(@asn) { |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
253 $QUERY="AS$_"; #meh. fix to pass it instead of global. |
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
254 ASN_lookup(); |
1132 | 255 } |
1146
da853b90f62b
Added mkz to anonet and as many of the needed files as I could think of.
epoch <epoch@hacking.allowed.org>
parents:
1143
diff
changeset
|
256 #printf "%-20s %s\n", "notice:","$QUERY did not claim any domains yet"; |
1186
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
257 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
258 |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
259 if($QUERY =~ m/^AS(.+?)$/) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
260 $user=get_user_from_ASN($1); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
261 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
262 elsif($QUERY =~ m/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
263 $user=get_user_from_IPv4($QUERY); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
264 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
265 elsif($QUERY =~ m/\./) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
266 $user=get_user_from_domain($QUERY); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
267 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
268 elsif($QUERY =~ m/:/) { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
269 $user=get_user_from_IPv6($QUERY); |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
270 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
271 else { |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
272 $user=$QUERY; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
273 } |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
274 $user =~ s/[\r\n]//g; |
1198
93f2650b65c0
added a small tweak to whoisd to show current commit of resdb in whoisd. added and change angelica's resources.
epoch <epoch@hacking.allowed.ano>
parents:
1189
diff
changeset
|
275 printf "%%%% %s", `git log -1 | head -n1`; |
1186
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
276 printf "%%%% found user: %s for the query.\n", $user; |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
277 |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
278 #k. we got user... now to find stuff belonging to that user. |
98707534e274
added a chan domain. changed some marc stuff. anocheck script for watching for ASN downages.
epoch <epoch@hacking.allowed.ano>
parents:
1178
diff
changeset
|
279 |
1187
7ea11723da51
made a couple error messages more informative
epoch <epoch@hacking.allowed.ano>
parents:
1186
diff
changeset
|
280 ASN_lookup($user); |
7ea11723da51
made a couple error messages more informative
epoch <epoch@hacking.allowed.ano>
parents:
1186
diff
changeset
|
281 IPv4_lookup($user); |
7ea11723da51
made a couple error messages more informative
epoch <epoch@hacking.allowed.ano>
parents:
1186
diff
changeset
|
282 domain_lookup($user); |
7ea11723da51
made a couple error messages more informative
epoch <epoch@hacking.allowed.ano>
parents:
1186
diff
changeset
|
283 IPv6_lookup($user); |
1189 | 284 $QUERY=$user; |
285 user_based_lookups($user); |