apility 1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 49805fcb6db3e143bcd706f6b0872ecb87cb93e86f7fe13cc53a2407d759e04e
4
+ data.tar.gz: 438475fba13a860426cdda4389c427a2c2f67e5e7897d45ff270be1018384207
5
+ SHA512:
6
+ metadata.gz: c3ec5e3186686904febf01b689c4ee7ad7bb9fd360bfea349a1118d071ced3115b3b0079f12ff63d07b02be6b1bac935d08f3d48916d69b0da3a27c98b7ed61b
7
+ data.tar.gz: 1ea2fdcae1291c49d93b5c1bfc74da7ee3490c0acbeb767d4504fb95c3170ca7424bdd80fd2298f7dcd6b419caa82023d3bcaaf024818ac9f69101ab44849675
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at suyeshb@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Suyesh Bhandari
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,104 @@
1
+ ## Apility - Keep Moochers Out
2
+
3
+ This is Ruby interface for Moocher api, Currently renamed to [Apility](https://apility.io/docs/ruby-wrapper-interface/) , A Reputation API and Anti-Abuse Service. Still in developmental phase.
4
+ Currently functioning features are listed below.
5
+
6
+ ###Installation
7
+
8
+ Add the following to your Gemfile and bundle install
9
+
10
+ ```ruby
11
+ gem 'apility'
12
+ ```
13
+ Or
14
+
15
+ ```shell
16
+ gem install moocher
17
+ ```
18
+ ## Instantiate Moocher::Resource
19
+
20
+ ```ruby
21
+ require 'apility'
22
+
23
+ moocher = Apility::Resource.new
24
+
25
+ ```
26
+
27
+ ## Check Blacklisted IP
28
+
29
+ ```ruby
30
+
31
+ moocher.ip_blacklisted? "8.8.8.8"
32
+
33
+ #=> false
34
+
35
+ # If IP is found in blacklisted database it will return true.
36
+ ```
37
+
38
+ ## Check Blacklisted domains
39
+
40
+ ```ruby
41
+
42
+ moocher.domain_blacklisted? "google.com"
43
+ #=> false
44
+
45
+ moocher.domain_blacklisted? "google.com", details: true #Swithing details to true will give you detailed response on domain
46
+
47
+ #=> {"response"=>{"source_ip"=>{"geo"=>{}, "score"=>0, "is_quarantined"=>false, "blacklist"=>[]}, "domain"=>{"mx"=>["aspmx.l.google.com", "alt3.aspmx.l.google.com", "alt4.aspmx.l.google.com", "alt2.aspmx.l.google.com", "alt1.aspmx.l.google.com"], "blacklist"=>[], "ns"=>["ns1.google.com.", "ns3.google.com.", "ns2.google.com.", "ns4.google.com."], "score"=>0, "blacklist_mx"=>[], "blacklist_ns"=>[]}, "score"=>0, "ip"=>{"geo"=>{"hostname"=>"", "address"=>"216.58.214.174", "longitude"=>-122.0574, "region"=>"California", "country"=>"US", "as"=>{"asn"=>"15169", "country"=>"US", "networks"=>"['8.8.4.0/24', '8.8.8.0/24', '8.34.208.0/21', '8.34.216.0/21', '8.35.192.0/21', '8.35.200.0/21', '23.236.48.0/20', '23.251.128.0/19', '35.184.0.0/13', '64.233.160.0/19', '64.233.160.0/24', '64.233.161.0/24', '64.233.162.0/24', '64.233.163.0/24', '64.233.164.0/24', '64.233.165.0/24', '64.233.166.0/24', '64.233.167.0/24', '64.233.168.0/24', '64.233.169.0/24', '64.233.171.0/24', '64.233.176.0/24', '64.233.177.0/24', '64.233.178.0/24', '64.233.179.0/24', '64.233.180.0/24', '64.233.181.0/24', '64.233.182.0/24', '64.233.183.0/24', '64.233.184.0/24', '64.233.185.0/24', '64.233.186.0/24', '64.233.187.0/24', '64.233.188.0/24', '64.233.189.0/24', '64.233.190.0/24', '64.233.191.0/24', '66.102.0.0/20', '66.102.1.0/24', '66.102.2.0/24', '66.102.3.0/24', '66.102.4.0/24', '66.102.12.0/24', '66.249.64.0/19', '70.32.128.0/19', '70.32.131.0/24', '70.32.145.0/24', '70.32.146.0/23', '70.32.151.0/24', '72.14.192.0/18', '74.114.24.0/21', '74.125.0.0/16', '74.125.0.0/18', '74.125.6.0/24', '74.125.21.0/24', '74.125.22.0/24', '74.125.23.0/24', '74.125.26.0/24', '74.125.27.0/24', '74.125.28.0/24', '74.125.29.0/24', '74.125.30.0/24', '74.125.31.0/24', '74.125.39.0/24', '74.125.68.0/24', '74.125.69.0/24', '74.125.70.0/24', '74.125.71.0/24', '74.125.126.0/24', '74.125.127.0/24', '74.125.128.0/24', '74.125.129.0/24', '74.125.130.0/24', '74.125.131.0/24', '74.125.132.0/24', '74.125.133.0/24', '74.125.134.0/24', '74.125.135.0/24', '74.125.138.0/24', '74.125.139.0/24', '74.125.140.0/24', '74.125.141.0/24', '74.125.142.0/24', '74.125.143.0/24', '74.125.192.0/24', '74.125.193.0/24', '74.125.195.0/24', '74.125.196.0/24', '74.125.198.0/24', '74.125.199.0/24', '74.125.200.0/24', '74.125.201.0/24', '74.125.202.0/24', '74.125.203.0/24', '74.125.204.0/24', '74.125.205.0/24', '74.125.206.0/24', '74.125.225.0/24', '74.125.226.0/24', '74.125.227.0/24', '74.125.228.0/24', '74.125.230.0/24', '74.125.232.0/24', '74.125.234.0/24', '74.125.235.0/24', '74.125.236.0/24', '74.125.238.0/24', '104.132.0.0/23', '104.132.5.0/24', '104.132.7.0/24', '104.132.8.0/24', '104.132.11.0/24', '104.132.34.0/24', '104.132.51.0/24', '104.132.141.0/24', '104.133.0.0/24', '104.133.2.0/23', '104.154.0.0/15', '104.196.0.0/14', '107.167.160.0/19', '107.178.192.0/18', '108.59.80.0/20', '108.170.192.0/18', '108.177.0.0/17', '108.177.8.0/24', '108.177.9.0/24', '108.177.10.0/24', '108.177.11.0/24', '108.177.12.0/24', '108.177.14.0/24', '108.177.15.0/24', '108.177.96.0/24', '108.177.97.0/24', '108.177.98.0/24', '130.211.0.0/16', '142.250.0.0/15', '146.148.0.0/17', '162.216.148.0/22', '162.222.176.0/21', '172.102.8.0/21', '172.102.8.0/24', '172.102.9.0/24', '172.102.10.0/24', '172.102.11.0/24', '172.102.12.0/23', '172.102.14.0/23', '172.110.32.0/21', '172.217.0.0/16', '172.217.0.0/24', '172.217.16.0/24', '172.217.24.0/24', '172.217.28.0/24', '172.217.30.0/24', '172.253.0.0/16', '173.194.0.0/16', '173.194.7.0/24', '173.194.32.0/24', '173.194.34.0/24', '173.194.35.0/24', '173.194.36.0/24', '173.194.37.0/24', '173.194.38.0/24', '173.194.39.0/24', '173.194.40.0/24', '173.194.41.0/24', '173.194.42.0/24', '173.194.44.0/24', '173.194.46.0/24', '173.194.53.0/24', '173.194.63.0/24', '173.194.64.0/24', '173.194.66.0/24', '173.194.67.0/24', '173.194.68.0/24', '173.194.69.0/24', '173.194.70.0/24', '173.194.73.0/24', '173.194.74.0/24', '173.194.76.0/24', '173.194.77.0/24', '173.194.78.0/24', '173.194.79.0/24', '173.194.112.0/24', '173.194.113.0/24', '173.194.117.0/24', '173.194.118.0/24', '173.194.119.0/24', '173.194.120.0/24', '173.194.121.0/24', '173.194.124.0/24', '173.194.132.0/24', '173.194.136.0/24', '173.194.140.0/24', '173.194.141.0/24', '173.194.142.0/24', '173.194.175.0/24', '173.194.192.0/24', '173.194.193.0/24', '173.194.194.0/24', '173.194.195.0/24', '173.194.196.0/24', '173.194.197.0/24', '173.194.198.0/24', '173.194.199.0/24', '173.194.200.0/24', '173.194.201.0/24', '173.194.202.0/24', '173.194.203.0/24', '173.194.204.0/24', '173.194.205.0/24', '173.194.206.0/24', '173.194.207.0/24', '173.194.208.0/24', '173.194.209.0/24', '173.194.210.0/24', '173.194.211.0/24', '173.194.212.0/24', '173.194.213.0/24', '173.194.214.0/24', '173.194.215.0/24', '173.194.216.0/24', '173.194.217.0/24', '173.194.218.0/24', '173.194.219.0/24', '173.194.220.0/24', '173.194.221.0/24', '173.194.222.0/24', '173.194.223.0/24', '173.255.112.0/20', '185.25.28.0/23', '185.150.148.0/22', '192.104.160.0/23', '192.158.28.0/22', '192.178.0.0/15', '199.192.112.0/22', '199.223.232.0/21', '207.223.160.0/20', '208.68.108.0/22', '208.81.188.0/22', '209.85.128.0/17', '209.85.144.0/24', '209.85.145.0/24', '209.85.147.0/24', '209.85.200.0/24', '209.85.201.0/24', '209.85.202.0/24', '209.85.203.0/24', '209.85.232.0/24', '209.85.233.0/24', '209.85.234.0/24', '209.85.235.0/24', '209.107.176.0/20', '209.107.176.0/23', '209.107.182.0/23', '216.58.192.0/19', '216.58.200.0/24', '216.58.208.0/24', '216.58.209.0/24', '216.58.210.0/24', '216.58.211.0/24', '216.58.212.0/24', '216.58.213.0/24', '216.58.214.0/24', '216.58.215.0/24', '216.58.216.0/24', '216.58.217.0/24', '216.58.218.0/24', '216.58.219.0/24', '216.58.220.0/24', '216.58.221.0/24', '216.58.222.0/24', '216.58.223.0/24', '216.73.80.0/20', '216.239.32.0/19', '216.239.32.0/24', '216.239.33.0/24', '216.239.34.0/24', '216.239.35.0/24', '216.239.36.0/24', '216.239.38.0/24', '216.239.39.0/24', '216.252.220.0/22', '216.252.220.0/24', '216.252.221.0/24', '216.252.222.0/24']", "name"=>"GOOGLE - Google Inc."}, "city"=>"Mountain View", "continent"=>"NA", "postal"=>"94043", "latitude"=>37.419200000000004}, "score"=>0, "is_quarantined"=>false, "blacklist"=>[]}}, "type"=>"baddomain"}
48
+
49
+ #This payload is an enriched version of the domain reputation results. The extra information provided can help #to determine if the email is valid: The SMTP server is available or not The email account exists in the server #The server has a catch-all directive enabled or not The email has been created in a disposable email service #The email has been created in a free email service The email has been used for spam or abuse activities and it #is blacklisted.
50
+ #The service returns a global score and several specific scores. The global score is the sum of the specific #scores. The more negative the score, the riskier the email. A positive score normally its a good Reputation #email, and a zero score means neutral. For example, free email services normally return zero score.
51
+ ```
52
+
53
+ ## Check Blacklisted Emails
54
+
55
+ ```ruby
56
+
57
+ moocher.email_blacklisted? "goodemail@gmail.com"
58
+ #=> false
59
+
60
+ moocher.email_blacklisted? "goodemail@gmail.com", details: true
61
+
62
+ #=> {"response"=>{"address"=>{"score"=>0, "is_well_formed"=>true, "is_role"=>false}, "domain"=>{"mx"=>["alt1.gmail-smtp-in.l.google.com", "alt3.gmail-smtp-in.l.google.com", "alt4.gmail-smtp-in.l.google.com", "alt2.gmail-smtp-in.l.google.com", "gmail-smtp-in.l.google.com"], "blacklist"=>["FREEMAIL"], "ns"=>["ns2.google.com.", "ns3.google.com.", "ns1.google.com.", "ns4.google.com."], "score"=>-1, "blacklist_mx"=>[], "blacklist_ns"=>[]}, "email"=>{"score"=>0, "blacklist"=>[]}, "ip"=>{"geo"=>{"hostname"=>"", "address"=>"216.58.214.165", "longitude"=>-122.0574, "region"=>"California", "country"=>"US", "as"=>{"asn"=>"15169", "country"=>"US", "networks"=>"['8.8.4.0/24', '8.8.8.0/24', '8.34.208.0/21', '8.34.216.0/21', '8.35.192.0/21', '8.35.200.0/21', '23.236.48.0/20', '23.251.128.0/19', '35.184.0.0/13', '64.233.160.0/19', '64.233.160.0/24', '64.233.161.0/24', '64.233.162.0/24', '64.233.163.0/24', '64.233.164.0/24', '64.233.165.0/24', '64.233.166.0/24', '64.233.167.0/24', '64.233.168.0/24', '64.233.169.0/24', '64.233.171.0/24', '64.233.176.0/24', '64.233.177.0/24', '64.233.178.0/24', '64.233.179.0/24', '64.233.180.0/24', '64.233.181.0/24', '64.233.182.0/24', '64.233.183.0/24', '64.233.184.0/24', '64.233.185.0/24', '64.233.186.0/24', '64.233.187.0/24', '64.233.188.0/24', '64.233.189.0/24', '64.233.190.0/24', '64.233.191.0/24', '66.102.0.0/20', '66.102.1.0/24', '66.102.2.0/24', '66.102.3.0/24', '66.102.4.0/24', '66.102.12.0/24', '66.249.64.0/19', '70.32.128.0/19', '70.32.131.0/24', '70.32.145.0/24', '70.32.146.0/23', '70.32.151.0/24', '72.14.192.0/18', '74.114.24.0/21', '74.125.0.0/16', '74.125.0.0/18', '74.125.6.0/24', '74.125.21.0/24', '74.125.22.0/24', '74.125.23.0/24', '74.125.26.0/24', '74.125.27.0/24', '74.125.28.0/24', '74.125.29.0/24', '74.125.30.0/24', '74.125.31.0/24', '74.125.39.0/24', '74.125.68.0/24', '74.125.69.0/24', '74.125.70.0/24', '74.125.71.0/24', '74.125.126.0/24', '74.125.127.0/24', '74.125.128.0/24', '74.125.129.0/24', '74.125.130.0/24', '74.125.131.0/24', '74.125.132.0/24', '74.125.133.0/24', '74.125.134.0/24', '74.125.135.0/24', '74.125.138.0/24', '74.125.139.0/24', '74.125.140.0/24', '74.125.141.0/24', '74.125.142.0/24', '74.125.143.0/24', '74.125.192.0/24', '74.125.193.0/24', '74.125.195.0/24', '74.125.196.0/24', '74.125.198.0/24', '74.125.199.0/24', '74.125.200.0/24', '74.125.201.0/24', '74.125.202.0/24', '74.125.203.0/24', '74.125.204.0/24', '74.125.205.0/24', '74.125.206.0/24', '74.125.225.0/24', '74.125.226.0/24', '74.125.227.0/24', '74.125.228.0/24', '74.125.230.0/24', '74.125.232.0/24', '74.125.234.0/24', '74.125.235.0/24', '74.125.236.0/24', '74.125.238.0/24', '104.132.0.0/23', '104.132.5.0/24', '104.132.7.0/24', '104.132.8.0/24', '104.132.11.0/24', '104.132.34.0/24', '104.132.51.0/24', '104.132.141.0/24', '104.133.0.0/24', '104.133.2.0/23', '104.154.0.0/15', '104.196.0.0/14', '107.167.160.0/19', '107.178.192.0/18', '108.59.80.0/20', '108.170.192.0/18', '108.177.0.0/17', '108.177.8.0/24', '108.177.9.0/24', '108.177.10.0/24', '108.177.11.0/24', '108.177.12.0/24', '108.177.14.0/24', '108.177.15.0/24', '108.177.96.0/24', '108.177.97.0/24', '108.177.98.0/24', '130.211.0.0/16', '142.250.0.0/15', '146.148.0.0/17', '162.216.148.0/22', '162.222.176.0/21', '172.102.8.0/21', '172.102.8.0/24', '172.102.9.0/24', '172.102.10.0/24', '172.102.11.0/24', '172.102.12.0/23', '172.102.14.0/23', '172.110.32.0/21', '172.217.0.0/16', '172.217.0.0/24', '172.217.16.0/24', '172.217.24.0/24', '172.217.28.0/24', '172.217.30.0/24', '172.253.0.0/16', '173.194.0.0/16', '173.194.7.0/24', '173.194.32.0/24', '173.194.34.0/24', '173.194.35.0/24', '173.194.36.0/24', '173.194.37.0/24', '173.194.38.0/24', '173.194.39.0/24', '173.194.40.0/24', '173.194.41.0/24', '173.194.42.0/24', '173.194.44.0/24', '173.194.46.0/24', '173.194.53.0/24', '173.194.63.0/24', '173.194.64.0/24', '173.194.66.0/24', '173.194.67.0/24', '173.194.68.0/24', '173.194.69.0/24', '173.194.70.0/24', '173.194.73.0/24', '173.194.74.0/24', '173.194.76.0/24', '173.194.77.0/24', '173.194.78.0/24', '173.194.79.0/24', '173.194.112.0/24', '173.194.113.0/24', '173.194.117.0/24', '173.194.118.0/24', '173.194.119.0/24', '173.194.120.0/24', '173.194.121.0/24', '173.194.124.0/24', '173.194.132.0/24', '173.194.136.0/24', '173.194.140.0/24', '173.194.141.0/24', '173.194.142.0/24', '173.194.175.0/24', '173.194.192.0/24', '173.194.193.0/24', '173.194.194.0/24', '173.194.195.0/24', '173.194.196.0/24', '173.194.197.0/24', '173.194.198.0/24', '173.194.199.0/24', '173.194.200.0/24', '173.194.201.0/24', '173.194.202.0/24', '173.194.203.0/24', '173.194.204.0/24', '173.194.205.0/24', '173.194.206.0/24', '173.194.207.0/24', '173.194.208.0/24', '173.194.209.0/24', '173.194.210.0/24', '173.194.211.0/24', '173.194.212.0/24', '173.194.213.0/24', '173.194.214.0/24', '173.194.215.0/24', '173.194.216.0/24', '173.194.217.0/24', '173.194.218.0/24', '173.194.219.0/24', '173.194.220.0/24', '173.194.221.0/24', '173.194.222.0/24', '173.194.223.0/24', '173.255.112.0/20', '185.25.28.0/23', '185.150.148.0/22', '192.104.160.0/23', '192.158.28.0/22', '192.178.0.0/15', '199.192.112.0/22', '199.223.232.0/21', '207.223.160.0/20', '208.68.108.0/22', '208.81.188.0/22', '209.85.128.0/17', '209.85.144.0/24', '209.85.145.0/24', '209.85.147.0/24', '209.85.200.0/24', '209.85.201.0/24', '209.85.202.0/24', '209.85.203.0/24', '209.85.232.0/24', '209.85.233.0/24', '209.85.234.0/24', '209.85.235.0/24', '209.107.176.0/20', '209.107.176.0/23', '209.107.182.0/23', '216.58.192.0/19', '216.58.200.0/24', '216.58.208.0/24', '216.58.209.0/24', '216.58.210.0/24', '216.58.211.0/24', '216.58.212.0/24', '216.58.213.0/24', '216.58.214.0/24', '216.58.215.0/24', '216.58.216.0/24', '216.58.217.0/24', '216.58.218.0/24', '216.58.219.0/24', '216.58.220.0/24', '216.58.221.0/24', '216.58.222.0/24', '216.58.223.0/24', '216.73.80.0/20', '216.239.32.0/19', '216.239.32.0/24', '216.239.33.0/24', '216.239.34.0/24', '216.239.35.0/24', '216.239.36.0/24', '216.239.38.0/24', '216.239.39.0/24', '216.252.220.0/22', '216.252.220.0/24', '216.252.221.0/24', '216.252.222.0/24']", "name"=>"GOOGLE - Google Inc."}, "city"=>"Mountain View", "continent"=>"NA", "postal"=>"94043", "latitude"=>37.419200000000004}, "score"=>0, "is_quarantined"=>false, "blacklist"=>[]}, "score"=>0, "disposable"=>{"is_disposable"=>false, "score"=>0}, "source_ip"=>{"geo"=>{}, "score"=>0, "is_quarantined"=>false, "blacklist"=>[]}, "smtp"=>{"exist_catchall"=>false, "score"=>1, "exist_address"=>true, "exist_mx"=>true}, "freemail"=>{"score"=>0, "is_freemail"=>true}}, "type"=>"bademail"}
63
+
64
+
65
+ #This payload is an enriched version of the domain reputation results. The extra information provided can help #to determine if the email is valid: The SMTP server is available or not The email account exists in the server #The server has a catch-all directive enabled or not The email has been created in a disposable email service #The email has been created in a free email service The email has been used for spam or abuse activities and it #is blacklisted.
66
+ #The service returns a global score and several specific scores. The global score is the sum of the specific #scores. The more negative the score, the riskier the email. A positive score normally its a good Reputation #email, and a zero score means neutral. For example, free email services normally return zero score.
67
+
68
+ ```
69
+
70
+ ## Geolocate IP
71
+
72
+ ```ruby
73
+
74
+ moocher.geolocate_ip "8.8.8.8" #Will return geolocation of IP using Maxmind GeoIP database
75
+
76
+ #=> {"ip"=>{"hostname"=>"google-public-dns-a.google.com", "address"=>"8.8.8.8", "longitude"=>-122.0838, "region"=>"California", "country"=>"US", "as"=>{"asn"=>"15169", "country"=>"US", "networks"=>"['8.8.4.0/24', '8.8.8.0/24', '8.34.208.0/21', '8.34.216.0/21', '8.35.192.0/21', '8.35.200.0/21', '23.236.48.0/20', '23.251.128.0/19', '35.184.0.0/13', '64.233.160.0/19', '64.233.160.0/24', '64.233.161.0/24', '64.233.162.0/24', '64.233.163.0/24', '64.233.164.0/24', '64.233.165.0/24', '64.233.166.0/24', '64.233.167.0/24', '64.233.168.0/24', '64.233.169.0/24', '64.233.171.0/24', '64.233.176.0/24', '64.233.177.0/24', '64.233.178.0/24', '64.233.179.0/24', '64.233.180.0/24', '64.233.181.0/24', '64.233.182.0/24', '64.233.183.0/24', '64.233.184.0/24', '64.233.185.0/24', '64.233.186.0/24', '64.233.187.0/24', '64.233.188.0/24', '64.233.189.0/24', '64.233.190.0/24', '64.233.191.0/24', '66.102.0.0/20', '66.102.1.0/24', '66.102.2.0/24', '66.102.3.0/24', '66.102.4.0/24', '66.102.12.0/24', '66.249.64.0/19', '70.32.128.0/19', '70.32.131.0/24', '70.32.145.0/24', '70.32.146.0/23', '70.32.151.0/24', '72.14.192.0/18', '74.114.24.0/21', '74.125.0.0/16', '74.125.0.0/18', '74.125.6.0/24', '74.125.21.0/24', '74.125.22.0/24', '74.125.23.0/24', '74.125.26.0/24', '74.125.27.0/24', '74.125.28.0/24', '74.125.29.0/24', '74.125.30.0/24', '74.125.31.0/24', '74.125.39.0/24', '74.125.68.0/24', '74.125.69.0/24', '74.125.70.0/24', '74.125.71.0/24', '74.125.126.0/24', '74.125.127.0/24', '74.125.128.0/24', '74.125.129.0/24', '74.125.130.0/24', '74.125.131.0/24', '74.125.132.0/24', '74.125.133.0/24', '74.125.134.0/24', '74.125.135.0/24', '74.125.138.0/24', '74.125.139.0/24', '74.125.140.0/24', '74.125.141.0/24', '74.125.142.0/24', '74.125.143.0/24', '74.125.192.0/24', '74.125.193.0/24', '74.125.195.0/24', '74.125.196.0/24', '74.125.198.0/24', '74.125.199.0/24', '74.125.200.0/24', '74.125.201.0/24', '74.125.202.0/24', '74.125.203.0/24', '74.125.204.0/24', '74.125.205.0/24', '74.125.206.0/24', '74.125.225.0/24', '74.125.226.0/24', '74.125.227.0/24', '74.125.228.0/24', '74.125.230.0/24', '74.125.232.0/24', '74.125.234.0/24', '74.125.235.0/24', '74.125.236.0/24', '74.125.238.0/24', '104.132.0.0/23', '104.132.5.0/24', '104.132.7.0/24', '104.132.8.0/24', '104.132.11.0/24', '104.132.34.0/24', '104.132.51.0/24', '104.132.141.0/24', '104.133.0.0/24', '104.133.2.0/23', '104.154.0.0/15', '104.196.0.0/14', '107.167.160.0/19', '107.178.192.0/18', '108.59.80.0/20', '108.170.192.0/18', '108.177.0.0/17', '108.177.8.0/24', '108.177.9.0/24', '108.177.10.0/24', '108.177.11.0/24', '108.177.12.0/24', '108.177.14.0/24', '108.177.15.0/24', '108.177.96.0/24', '108.177.97.0/24', '108.177.98.0/24', '130.211.0.0/16', '142.250.0.0/15', '146.148.0.0/17', '162.216.148.0/22', '162.222.176.0/21', '172.102.8.0/21', '172.102.8.0/24', '172.102.9.0/24', '172.102.10.0/24', '172.102.11.0/24', '172.102.12.0/23', '172.102.14.0/23', '172.110.32.0/21', '172.217.0.0/16', '172.217.0.0/24', '172.217.16.0/24', '172.217.24.0/24', '172.217.28.0/24', '172.217.30.0/24', '172.253.0.0/16', '173.194.0.0/16', '173.194.7.0/24', '173.194.32.0/24', '173.194.34.0/24', '173.194.35.0/24', '173.194.36.0/24', '173.194.37.0/24', '173.194.38.0/24', '173.194.39.0/24', '173.194.40.0/24', '173.194.41.0/24', '173.194.42.0/24', '173.194.44.0/24', '173.194.46.0/24', '173.194.53.0/24', '173.194.63.0/24', '173.194.64.0/24', '173.194.66.0/24', '173.194.67.0/24', '173.194.68.0/24', '173.194.69.0/24', '173.194.70.0/24', '173.194.73.0/24', '173.194.74.0/24', '173.194.76.0/24', '173.194.77.0/24', '173.194.78.0/24', '173.194.79.0/24', '173.194.112.0/24', '173.194.113.0/24', '173.194.117.0/24', '173.194.118.0/24', '173.194.119.0/24', '173.194.120.0/24', '173.194.121.0/24', '173.194.124.0/24', '173.194.132.0/24', '173.194.136.0/24', '173.194.140.0/24', '173.194.141.0/24', '173.194.142.0/24', '173.194.175.0/24', '173.194.192.0/24', '173.194.193.0/24', '173.194.194.0/24', '173.194.195.0/24', '173.194.196.0/24', '173.194.197.0/24', '173.194.198.0/24', '173.194.199.0/24', '173.194.200.0/24', '173.194.201.0/24', '173.194.202.0/24', '173.194.203.0/24', '173.194.204.0/24', '173.194.205.0/24', '173.194.206.0/24', '173.194.207.0/24', '173.194.208.0/24', '173.194.209.0/24', '173.194.210.0/24', '173.194.211.0/24', '173.194.212.0/24', '173.194.213.0/24', '173.194.214.0/24', '173.194.215.0/24', '173.194.216.0/24', '173.194.217.0/24', '173.194.218.0/24', '173.194.219.0/24', '173.194.220.0/24', '173.194.221.0/24', '173.194.222.0/24', '173.194.223.0/24', '173.255.112.0/20', '185.25.28.0/23', '185.150.148.0/22', '192.104.160.0/23', '192.158.28.0/22', '192.178.0.0/15', '199.192.112.0/22', '199.223.232.0/21', '207.223.160.0/20', '208.68.108.0/22', '208.81.188.0/22', '209.85.128.0/17', '209.85.144.0/24', '209.85.145.0/24', '209.85.147.0/24', '209.85.200.0/24', '209.85.201.0/24', '209.85.202.0/24', '209.85.203.0/24', '209.85.232.0/24', '209.85.233.0/24', '209.85.234.0/24', '209.85.235.0/24', '209.107.176.0/20', '209.107.176.0/23', '209.107.182.0/23', '216.58.192.0/19', '216.58.200.0/24', '216.58.208.0/24', '216.58.209.0/24', '216.58.210.0/24', '216.58.211.0/24', '216.58.212.0/24', '216.58.213.0/24', '216.58.214.0/24', '216.58.215.0/24', '216.58.216.0/24', '216.58.217.0/24', '216.58.218.0/24', '216.58.219.0/24', '216.58.220.0/24', '216.58.221.0/24', '216.58.222.0/24', '216.58.223.0/24', '216.73.80.0/20', '216.239.32.0/19', '216.239.32.0/24', '216.239.33.0/24', '216.239.34.0/24', '216.239.35.0/24', '216.239.36.0/24', '216.239.38.0/24', '216.239.39.0/24', '216.252.220.0/22', '216.252.220.0/24', '216.252.221.0/24', '216.252.222.0/24']", "name"=>"GOOGLE - Google Inc."}, "city"=>"Mountain View", "continent"=>"NA", "postal"=>"94035", "latitude"=>37.386}}
77
+
78
+ moocher.geolocate_ip #With no IP passed, Will return Geolocation of Client's ip from Maxmind GeoIP database
79
+
80
+ #=> {"ip"=>{"hostname"=>"cpe-74-73-145-6.nyc.res.rr.com", "address"=>"74.73.145.6", "longitude"=>-74.0052, "region"=>"New York", "country"=>"US", "as"=>{"asn"=>"12271", "country"=>"US", "networks"=>"['23.246.64.0/19', '23.246.96.0/19', '24.29.96.0/19', '24.29.128.0/19', '24.30.224.0/20', '24.39.104.0/21', '24.39.112.0/20', '24.39.128.0/19', '24.42.64.0/18', '24.90.0.0/19', '24.90.32.0/19', '24.90.64.0/18', '24.90.128.0/19', '24.90.160.0/20', '24.90.176.0/20', '24.90.192.0/18', '24.97.123.0/24', '24.97.124.0/22', '24.97.184.0/23', '24.97.200.0/21', '24.102.64.0/18', '24.103.0.0/18', '24.103.64.0/18', '24.103.224.0/20', '24.103.240.0/20', '24.104.192.0/18', '24.105.128.0/20', '24.105.143.0/24', '24.105.144.0/20', '24.136.96.0/20', '24.136.112.0/20', '24.136.126.0/24', '24.136.127.0/24', '24.161.0.0/17', '24.164.128.0/19', '24.164.160.0/19', '24.168.0.0/18', '24.168.64.0/19', '24.168.96.0/19', '24.168.128.0/19', '24.193.0.0/18', '24.193.64.0/19', '24.193.96.0/20', '24.193.112.0/20', '24.193.128.0/17', '24.199.64.0/19', '24.199.96.0/20', '24.199.112.0/20', '24.213.160.0/19', '24.213.180.0/22', '24.215.128.0/17', '24.215.128.0/18', '24.215.192.0/18', '24.239.128.0/18', '24.239.160.0/19', '50.74.0.0/16', '50.74.0.0/18', '50.75.192.0/18', '64.131.128.0/18', '64.131.192.0/18', '66.65.0.0/17', '66.65.128.0/18', '66.108.0.0/17', '66.108.128.0/17', '66.110.97.0/24', '66.212.81.0/24', '66.234.32.0/19', '67.243.0.0/16', '67.244.0.0/19', '67.244.64.0/18', '67.245.0.0/16', '67.247.0.0/18', '67.247.96.0/19', '67.250.0.0/16', '67.251.128.0/19', '67.251.192.0/18', '67.251.192.0/19', '67.254.0.0/16', '68.172.208.0/20', '68.172.224.0/19', '68.173.0.0/16', '68.174.0.0/18', '68.174.44.0/22', '68.174.48.0/20', '68.174.64.0/18', '68.174.128.0/18', '68.174.192.0/18', '68.175.0.0/17', '69.22.192.0/19', '69.22.224.0/19', '69.86.0.0/19', '69.86.32.0/19', '69.86.64.0/19', '69.86.96.0/20', '69.86.112.0/20', '69.86.128.0/19', '69.86.160.0/20', '69.86.176.0/20', '69.86.192.0/19', '69.86.224.0/20', '69.86.240.0/20', '69.193.128.0/18', '69.193.192.0/19', '69.193.224.0/19', '69.193.230.0/24', '69.193.231.0/24', '69.193.232.0/21', '69.193.241.0/24', '69.193.250.0/23', '69.193.252.0/22', '69.200.64.0/19', '69.200.224.0/19', '69.200.240.0/21', '69.201.128.0/18', '69.201.192.0/18', '69.202.128.0/17', '69.203.0.0/17', '69.203.128.0/19', '69.203.192.0/18', '69.204.224.0/19', '69.206.0.0/17', '69.206.128.0/17', '72.43.96.0/19', '72.43.128.0/18', '72.225.64.0/18', '72.225.128.0/17', '72.226.0.0/17', '72.227.128.0/17', '72.229.0.0/17', '72.229.128.0/17', '72.231.0.0/17', '74.64.0.0/16', '74.65.192.0/18', '74.66.0.0/16', '74.68.0.0/18', '74.68.64.0/18', '74.68.128.0/17', '74.71.0.0/16', '74.72.0.0/15', '74.74.0.0/18', '76.15.0.0/18', '76.15.64.0/19', '76.15.96.0/19', '76.15.128.0/18', '76.15.192.0/18', '98.0.128.0/17', '98.7.0.0/17', '98.7.192.0/18', '98.12.0.0/16', '98.13.128.0/18', '98.13.192.0/18', '98.14.0.0/16', '98.15.0.0/17', '98.15.128.0/17', '104.162.0.0/16', '108.176.0.0/18', '108.176.128.0/18', '108.182.0.0/16', '142.105.0.0/17', '142.254.160.0/20', '142.255.0.0/17', '158.222.128.0/17', '172.254.0.0/16', '184.74.128.0/19', '184.74.160.0/19', '184.74.192.0/19', '184.74.208.0/20', '184.74.224.0/19', '184.75.0.0/17', '184.75.0.0/18', '184.75.64.0/19', '184.75.64.0/24', '184.75.120.0/22', '184.152.0.0/16', '184.153.0.0/17', '198.179.64.0/19', '204.210.128.0/19', '207.251.238.0/23', '208.105.0.0/18', '208.105.0.0/22', '208.105.64.0/19', '208.120.0.0/18', '208.120.64.0/18', '208.120.128.0/17', '208.125.0.0/19']", "name"=>"SCRR-12271 - Time Warner Cable Internet LLC"}, "city"=>"New York", "continent"=>"NA", "postal"=>"10013", "latitude"=>40.7214}}
81
+
82
+ ```
83
+
84
+ ## Trace Credit Cards
85
+
86
+ ```ruby
87
+ moocher.creditcard "67068224343254254"
88
+
89
+ #=>"{\"scheme\": \"MASTERCARD\", \"bank_logo\": \"\", \"number_length\": \"\", \"bank_phone\": \"+49116116\", \"iin\": 670686, \"brand\": \"Maestro\", \"bank_url\": \"www.fidor.de\", \"country\": \"DE\", \"bank_name\": \"Fidor Bank AG\", \"prepaid\": \"\", \"bank_city\": \"M\\u00fcnchen\", \"type\": \"DEBIT\"}"
90
+ ```
91
+
92
+ The above 'creditcard' function extracts BIN from Creditcard and return its information. BIN typically show the type of card like Debit or Credit, brand of card (e.g. Visa, MasterCard, Discover, American Express, etc.), and level of card such as Classic, Standard, Gold, Platinum, and World Signia. All these information combined with geolocation of the user, card and IP can help to reduce fraud. The service returns the following information:
93
+ 1. Issuer Identification Number (IIN)
94
+ 2. Card Brand
95
+ 3. Card Type
96
+ 4. Country
97
+ 5. Card Scheme
98
+ 6. Bank Logo
99
+ 7. Bank Phone
100
+ 8. Bank Name
101
+ 9. Bank URL
102
+ 10. Bank City
103
+ 11. Prepaid
104
+ 12. Number Length
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,38 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'apility/version'
5
+ #require 'moocher/banner'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "apility"
9
+ spec.version = Apility::VERSION
10
+ spec.authors = ["Suyesh Bhandari"]
11
+ spec.email = ["suyeshb@gmail.com"]
12
+
13
+ spec.summary = "Ruby interface for Apility api"
14
+ spec.description = "Keep Moochers Out. Ruby interface for Apility api, A Reputation API and Anti-Abuse Service."
15
+ spec.homepage = "https://github.com/suyesh/moocher"
16
+ spec.license = "MIT"
17
+
18
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
19
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
20
+ if spec.respond_to?(:metadata)
21
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
22
+ else
23
+ raise "RubyGems 2.0 or newer is required to protect against " \
24
+ "public gem pushes."
25
+ end
26
+
27
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
28
+ f.match(%r{^(test|spec|features)/})
29
+ end
30
+ spec.bindir = "exe"
31
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ["lib"]
33
+ #spec.post_install_message = Moocher::Banner.new.to_s
34
+ spec.add_development_dependency "bundler", "~> 1.13"
35
+ spec.add_development_dependency "rake", "~> 10.0"
36
+ spec.add_dependency 'httparty', '~> 0.14.0'
37
+ spec.add_dependency 'ipaddress', '~> 0.8.3'
38
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "apility"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,17 @@
1
+ require "apility/version"
2
+ require "apility/creditcards"
3
+ require "apility/domains"
4
+ require "apility/emails"
5
+ require "apility/geo_ip"
6
+ require "apility/ip"
7
+ require "apility/passwords"
8
+
9
+ module Apility
10
+ class Resource
11
+ include Apility::Ip
12
+ include Apility::Domain
13
+ include Apility::Email
14
+ include Apility::GeoIp
15
+ include Apility::Creditcard
16
+ end
17
+ end
@@ -0,0 +1,39 @@
1
+ module Apility
2
+ class Banner
3
+ def initialize(env = ENV)
4
+ @env = env
5
+ end
6
+
7
+ def to_s
8
+ moocher_banner
9
+ end
10
+
11
+ def moocher_banner
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
+ end
38
+ end
39
+ end
@@ -0,0 +1,13 @@
1
+ require 'httparty'
2
+
3
+ module Apility
4
+ module Creditcard
5
+ def creditcard(cc_number)
6
+ bin = cc_number.to_s.strip[0..5]
7
+ return "Not a Valid input" if (bin =~ /\A\d{6}/).nil?
8
+ base_url = 'https://api.apility.net/l/BINLISTNET/t/creditcard/i/'
9
+ response = HTTParty.get("#{base_url}#{bin}")
10
+ response.success? ? response.parsed_response : response.success?
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,22 @@
1
+ require 'httparty'
2
+
3
+
4
+ module Apility
5
+ module Domain
6
+ def domain_blacklisted?(domain_name, details: false)
7
+ return "Domain doesn't seem to be valid." if (domain_name =~ /^((http|https):\/\/)?[a-z0-9]*(\.?[a-z0-9]+)\.[a-z]{2,5}(:[0-9]{1,5})?(\/.)?$/ix).nil?
8
+ base_url = 'https://api.apility.net/baddomain/'
9
+ unless details
10
+ response = HTTParty.get(base_url + domain_name)
11
+ response.success?
12
+ else
13
+ if details == true
14
+ response = HTTParty.get("https://api.apility.net/baddomain/#{domain_name}", headers: {"Content-Type": "application/json"})
15
+ return response.parsed_response
16
+ else
17
+ "'details:' is by default set to false. You can only be set it to true."
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ require 'httparty'
2
+
3
+
4
+ module Apility
5
+ module Email
6
+ def email_blacklisted?(email, details: false)
7
+ return "Email doesn't seem to be valid." if (email =~ /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i).nil?
8
+ base_url = 'https://api.apility.net/bademail/'
9
+ unless details
10
+ response = HTTParty.get(base_url + email)
11
+ (response["response"]["email"]["blacklist"].empty? && response["response"]["source_ip"]["blacklist"].empty?) ? false : true
12
+ else
13
+ if details == true
14
+ response = HTTParty.get("https://api.apility.net/bademail/#{email}", headers: {"Content-Type": "application/json"})
15
+ return response.parsed_response
16
+ else
17
+ "'details:' is by default set to false. You can only be set it to true."
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,19 @@
1
+ require 'httparty'
2
+ require 'ipaddress'
3
+
4
+
5
+ module Apility
6
+ module GeoIp
7
+ def geolocate_ip(ipaddress=nil)
8
+ base_url = 'https://api.apility.net/ip/'
9
+ if ipaddress
10
+ return "IP Address doesn't seem to be valid." if !(IPAddress.valid? ipaddress)
11
+ response = HTTParty.get(base_url + ipaddress)
12
+ response.success? ? response.parsed_response : "Sorry No data was found."
13
+ else
14
+ response = HTTParty.get(base_url)
15
+ response.success? ? response.parsed_response : "Sorry No data was found."
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,14 @@
1
+ require 'httparty'
2
+ require 'ipaddress'
3
+
4
+
5
+ module Apility
6
+ module Ip
7
+ def ip_blacklisted?(ipaddress)
8
+ return "IP Address doesn't seem to be valid." if !(IPAddress.valid? ipaddress)
9
+ base_url = 'https://api.apility.net/badip/IPV4/'
10
+ response = HTTParty.get(base_url + ipaddress)
11
+ response.success?
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,2 @@
1
+ module Apility
2
+ end
@@ -0,0 +1,3 @@
1
+ module Apility
2
+ VERSION = "1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: apility
3
+ version: !ruby/object:Gem::Version
4
+ version: '1.0'
5
+ platform: ruby
6
+ authors:
7
+ - Suyesh Bhandari
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-06-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.13'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.13'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: httparty
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.14.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.14.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: ipaddress
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.8.3
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.8.3
69
+ description: Keep Moochers Out. Ruby interface for Apility api, A Reputation API and
70
+ Anti-Abuse Service.
71
+ email:
72
+ - suyeshb@gmail.com
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - CODE_OF_CONDUCT.md
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - apility.gemspec
84
+ - bin/console
85
+ - bin/setup
86
+ - lib/apility.rb
87
+ - lib/apility/banner.rb
88
+ - lib/apility/creditcards.rb
89
+ - lib/apility/domains.rb
90
+ - lib/apility/emails.rb
91
+ - lib/apility/geo_ip.rb
92
+ - lib/apility/ip.rb
93
+ - lib/apility/passwords.rb
94
+ - lib/apility/version.rb
95
+ homepage: https://github.com/suyesh/moocher
96
+ licenses:
97
+ - MIT
98
+ metadata:
99
+ allowed_push_host: https://rubygems.org
100
+ post_install_message:
101
+ rdoc_options: []
102
+ require_paths:
103
+ - lib
104
+ required_ruby_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ requirements: []
115
+ rubyforge_project:
116
+ rubygems_version: 2.7.7
117
+ signing_key:
118
+ specification_version: 4
119
+ summary: Ruby interface for Apility api
120
+ test_files: []