-
Notifications
You must be signed in to change notification settings - Fork 5
/
threatbutt.pl
47 lines (40 loc) · 1.06 KB
/
threatbutt.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/perl
#
# Licensed under ABRMS
#
use strict;
use warnings;
use LWP::Curl;
use Getopt::Long qw(GetOptions);
my $ip;
my $md5;
my $curl = LWP::Curl->new();
print "\nThreatbutt Client 0.1.1\n";
if (!@ARGV) { die "\nUsage: \nperl $0 --ip IPADDR\nperl $0 --md5 HASH\n\n"; }
GetOptions(
'ip=s' => \$ip,
'md5=s' => \$md5,
) or die "\nUsage: \nperl $0 --ip IPADDR\nperl $0 --md5 HASH\n\n";
if ($ip) {
my $attribute = {
'threat' => 'ip=' . $ip,
};
my $content = $curl->post('http://threatbutt.io/api', $attribute);
print "Connecting...\n";
print "Establishing TLS 1.2 Handshake using TLS_RSA_WITH_AES_256_CBC_SHA_ETC128...\n";
sleep 2;
print "Handshake failed, retrying... \n";
sleep 2;
print "Received data: $content\n\n";
} elsif ($md5) {
my $dong = {
'hash' => $md5,
};
my $content = $curl->post('http://threatbutt.io/api/md5/' . $md5, $dong);
print "Connecting...\n";
print "Establishing TLS 1.2 Handshake using TLS_RSA_WITH_AES_256_CBC_SHA_ETC128...\n";
sleep 2;
print "Handshake failed, retrying... \n";
sleep 2;
print "Received data: $content\n\n";
}