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
|
|
39
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
69
|
|
11
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
83
|
|
12
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
70
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package Net::IP::Identifier::Plugin::Facebook; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
7
|
use Role::Tiny::With; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
424
|
|
17
|
|
|
|
|
|
|
with qw( Net::IP::Identifier_Role ); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '0.110'; # VERSION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
1
|
|
|
1
|
1
|
4
|
my ($class, %opts) = @_; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
2
|
my $self = {}; |
25
|
1
|
|
33
|
|
|
13
|
bless $self, (ref $class || $class); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# List of known Facebook (AS32934) IP blocks as of May 2015 |
28
|
1
|
|
|
|
|
5
|
$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
|
|
|
|
|
11
|
return $self; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub name { |
49
|
3
|
|
|
3
|
0
|
17
|
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__ |