annotate contrib/whoisd/whoisd.pl @ 1244:f1d3deaa98d2 draft

forgot to add an i to the second place I have the AS query regex. -_-"
author epoch <epoch@hack.thebackupbox.net>
date Sat, 21 Mar 2020 08:58:32 +0000
parents b8624e57fd96
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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?
1243
b8624e57fd96 added case-insensitive matching to ASN queries.
epoch <epoch@hack.thebackupbox.net>
parents: 1214
diff changeset
8 #my $RESDB = "/services/resdb/resdb";
b8624e57fd96 added case-insensitive matching to ASN queries.
epoch <epoch@hack.thebackupbox.net>
parents: 1214
diff changeset
9 my $RESDB = "/var/db/resdb";
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
10
1138
c95369b825a2 whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents: 1133
diff changeset
11 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
12 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
13 $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
14 $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
15 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
16 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
17 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
18 }
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
19 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
20 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
21 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
22 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
23 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
24 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
25 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
26
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
27 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
28
1138
c95369b825a2 whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents: 1133
diff changeset
29 if($QUERY eq "!!\n") {
c95369b825a2 whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents: 1133
diff changeset
30 $QUERY=<stdin>;
c95369b825a2 whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents: 1133
diff changeset
31 $QUERY =~ s/^!r(.+?)[\/,].*$/\1/;
c95369b825a2 whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents: 1133
diff changeset
32 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
33 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
34 $HACK=1;
c95369b825a2 whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents: 1133
diff changeset
35 }
c95369b825a2 whoisd... don't remember.
epoch <epoch@hacking.allowed.org>
parents: 1133
diff changeset
36
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
37 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
38 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
39 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
40 chdir("$RESDB/db/as") || die "%% error";
1187
7ea11723da51 made a couple error messages more informative
epoch <epoch@hacking.allowed.ano>
parents: 1186
diff changeset
41 if(chdir($AS) || die "%% ASN not found.") {
7ea11723da51 made a couple error messages more informative
epoch <epoch@hacking.allowed.ano>
parents: 1186
diff changeset
42 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
43 $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
44 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
45 } 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
46 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
47 }
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 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
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
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 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
52 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
53 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
54 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
55 @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
56 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
57 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
58 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
59 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
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 }
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 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
63 $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
64 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
65 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
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
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 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
69 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
70 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
71 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
72 @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
73 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
74 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
75 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
76 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
77 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
78 }
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 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
80 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
81 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
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 }
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 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
85 $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
86 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
87 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
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
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 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
91 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
92 $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
93 #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
94 $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
95 $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
96 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
97 $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 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
99 }
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 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
101 $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
102 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
103 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
104 }
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
105
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
106 sub ASN_lookup {
1243
b8624e57fd96 added case-insensitive matching to ASN queries.
epoch <epoch@hack.thebackupbox.net>
parents: 1214
diff changeset
107 if($QUERY =~ m/^AS(.+?)$/i) {
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
108 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
109 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
110 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
111 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
112 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
113 $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
114 $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
115 $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
116 ($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
117 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
118 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
119 $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
120 }
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
121 }
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
122 } 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
123 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
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 }
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
127
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
128
1189
7a618eaa29cb LOTS of shit.
epoch <epoch@hacking.allowed.ano>
parents: 1187
diff changeset
129 # 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
130 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
131 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
132 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
133 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
134 @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
135 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
136 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
137 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
138 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
139 }
1133
1a5d655cae9c fixed another bug in whoisd
epoch <epoch@hacking.allowed.org>
parents: 1132
diff changeset
140 }
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
141 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
142 $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
143 $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
144 ($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
145 $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
146 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
147 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
148 $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
149 }
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
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 }
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
153
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
154
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
155 # 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
156 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
157 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
158 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
159 @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
160 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
161 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
162 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
163 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
164 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
165 }
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 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
167 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
168 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
169 }
1141
58130f5eecf2 found a bug when sending just '.'... wasn't good.
epoch <epoch@hacking.allowed.org>
parents: 1140
diff changeset
170 }
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
171 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
172 $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
173 $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
174 $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
175 ($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
176 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
177 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
178 $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
179 }
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
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
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
184
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
185 #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
186 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
187 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
188 $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
189 $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
190 $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
191 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
192 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
193 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
194 }
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 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
196 $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
197 $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
198 $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
199 ($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
200 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
201 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
202 $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
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 }
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
206 }
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
207
1189
7a618eaa29cb LOTS of shit.
epoch <epoch@hacking.allowed.ano>
parents: 1187
diff changeset
208 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
209 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
210
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 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
212 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
213 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
214 $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
215 $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
216 $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
217 ($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
218 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
219 }
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 } 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
221 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
222 }
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
223 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
224 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
225 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
226 $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
227 $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
228 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
229 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
230 @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
231 }
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 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
233 my $merp;
1189
7a618eaa29cb LOTS of shit.
epoch <epoch@hacking.allowed.ano>
parents: 1187
diff changeset
234 foreach(split(/\n/,`grep '^$QUERY\$' */*/*/owner | cut -d/ -f1-3 | xargs printf '%s/cidr\n' | xargs cat | uniq`)) {
7a618eaa29cb LOTS of shit.
epoch <epoch@hacking.allowed.ano>
parents: 1187
diff changeset
235 chomp $_;
7a618eaa29cb LOTS of shit.
epoch <epoch@hacking.allowed.ano>
parents: 1187
diff changeset
236 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
237 }
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
238
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
239 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
240 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
241 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
242 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
243 }
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
244
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
245 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
246 $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
247 $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
248 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
249 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
250 }
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
251 }
1132
2fd95bea3988 updated whoid
epoch <epoch@hacking.allowed.org>
parents: 1131
diff changeset
252
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
253 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
254 $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
255 ASN_lookup();
1132
2fd95bea3988 updated whoid
epoch <epoch@hacking.allowed.org>
parents: 1131
diff changeset
256 }
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
257 #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
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
1244
f1d3deaa98d2 forgot to add an i to the second place I have the AS query regex. -_-"
epoch <epoch@hack.thebackupbox.net>
parents: 1243
diff changeset
260 if($QUERY =~ m/^AS(.+?)$/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
261 $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
262 }
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 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
264 $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
265 }
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 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
267 $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
268 }
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 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
270 $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
271 }
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 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
273 $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
274 }
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
275 $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
276 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
277 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
278
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 #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
280
1187
7ea11723da51 made a couple error messages more informative
epoch <epoch@hacking.allowed.ano>
parents: 1186
diff changeset
281 ASN_lookup($user);
7ea11723da51 made a couple error messages more informative
epoch <epoch@hacking.allowed.ano>
parents: 1186
diff changeset
282 IPv4_lookup($user);
7ea11723da51 made a couple error messages more informative
epoch <epoch@hacking.allowed.ano>
parents: 1186
diff changeset
283 domain_lookup($user);
7ea11723da51 made a couple error messages more informative
epoch <epoch@hacking.allowed.ano>
parents: 1186
diff changeset
284 IPv6_lookup($user);
1189
7a618eaa29cb LOTS of shit.
epoch <epoch@hacking.allowed.ano>
parents: 1187
diff changeset
285 $QUERY=$user;
7a618eaa29cb LOTS of shit.
epoch <epoch@hacking.allowed.ano>
parents: 1187
diff changeset
286 user_based_lookups($user);