line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#=============================================================================== |
2
|
|
|
|
|
|
|
# PODNAME: Net::IP::Identifier::Plugin::Facebook |
3
|
|
|
|
|
|
|
# ABSTRACT: identify Facebook (AS32934) owned IP addresses |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# AUTHOR: Reid Augustin (REID) |
6
|
|
|
|
|
|
|
# EMAIL: reid@hellosix.com |
7
|
|
|
|
|
|
|
# CREATED: Thu Oct 30 14:28:30 PDT 2014 |
8
|
|
|
|
|
|
|
#=============================================================================== |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
35
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
47
|
|
11
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
12
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
44
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package Net::IP::Identifier::Plugin::Facebook; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
4
|
use Role::Tiny::With; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
297
|
|
17
|
|
|
|
|
|
|
with qw( Net::IP::Identifier_Role ); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '0.111'; # VERSION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
1
|
|
|
1
|
1
|
3
|
my ($class, %opts) = @_; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
1
|
my $self = {}; |
25
|
1
|
|
33
|
|
|
6
|
bless $self, (ref $class || $class); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# List of known Facebook (AS32934) IP blocks as of May 2015 |
28
|
1
|
|
|
|
|
4
|
$self->ips( |
29
|
|
|
|
|
|
|
# 14 Network Blocks |
30
|
|
|
|
|
|
|
'31.13.24.0/21', |
31
|
|
|
|
|
|
|
'31.13.64.0/18', |
32
|
|
|
|
|
|
|
'66.220.144.0/20', |
33
|
|
|
|
|
|
|
'69.63.176.0/20', |
34
|
|
|
|
|
|
|
'69.171.224.0/19', |
35
|
|
|
|
|
|
|
'74.119.76.0/22', |
36
|
|
|
|
|
|
|
'173.252.64.0/18', |
37
|
|
|
|
|
|
|
'185.60.216.0/22', |
38
|
|
|
|
|
|
|
'199.201.64.0/22', |
39
|
|
|
|
|
|
|
'204.15.20.0/22', |
40
|
|
|
|
|
|
|
'2401:db00::/32', |
41
|
|
|
|
|
|
|
'2620:0:1c00::/40', |
42
|
|
|
|
|
|
|
'2620:10d:c000::/40', |
43
|
|
|
|
|
|
|
'2a03:2880::/32', |
44
|
|
|
|
|
|
|
); |
45
|
1
|
|
|
|
|
7
|
return $self; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub name { |
49
|
3
|
|
|
3
|
0
|
11
|
return 'Facebook'; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub refresh { |
53
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
my @fb = system `whois -h whois.radb.net '!gAS32934'`; |
56
|
0
|
|
|
|
|
|
my @cidrs = split(/\s+/, join('', map { m|/| } @fb)); |
|
0
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
delete $self->{ips}; |
59
|
0
|
|
|
|
|
|
$self->ips(@cidrs); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |