spior 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +6 -0
- data/README.md +7 -14
- data/{conf → ext}/ipt_mod.conf +0 -0
- data/{conf → ext}/iptables.service +0 -0
- data/{conf → ext}/resolv.conf +0 -0
- data/{conf → ext}/ssh.conf +0 -0
- data/{conf → ext}/sshd.conf +0 -0
- data/{conf → ext}/sshuttle.service +0 -0
- data/{conf → ext}/torrc/torrc_archlinux +0 -0
- data/{conf → ext}/torrc/torrc_default +0 -0
- data/lib/spior/copy.rb +1 -1
- data/lib/spior/install.rb +21 -73
- data/lib/spior/menu.rb +9 -14
- data/lib/spior/msg.rb +8 -6
- data/lib/spior/options.rb +1 -5
- data/lib/spior/persist.rb +1 -1
- data/lib/spior/runner.rb +1 -10
- data/lib/spior/tor.rb +1 -1
- data/spior.gemspec +1 -1
- metadata +10 -11
- metadata.gz.sig +0 -0
- data/lib/spior/mac.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27c8fa0d8922c53ef9e3a7105c34de378489f3e70ddd334fedca96fe354da0ca
|
4
|
+
data.tar.gz: 70dbfd556eecb0db121145b43478129235c26b70a01c8a5c62a1194a9f98df7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f66d9d28077922f149b01a869a77b494d22d75713f6eeffb65a856efaed6556ec686346de7e1241ede0352328dc4f0e01a9f2c4983a5197aacb28b398413828b
|
7
|
+
data.tar.gz: a14c7edbab9887624014b668377286efb71c5115aebd847ef28da081fedb6dd82882baf0cf8c4175822547d7322e581dd92eefbaf678d7ef69a985152f0190dd
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.1.3, release 2020-05-14
|
2
|
+
* Rename conf dir by ext
|
3
|
+
* Clearing all codes about MAC
|
4
|
+
* Remove deceitmac
|
5
|
+
* Mac change and other randomize features will go on another gem amnesie
|
6
|
+
|
1
7
|
## 0.1.2, release 2020-05-13
|
2
8
|
* Add instructions for the persistent mode
|
3
9
|
* Add dependency iptables-persistant for distro based on debian
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# spior
|
2
|
-
(Spider|Tor) A tool to make TOR your default gateway
|
2
|
+
(Spider|Tor) A tool to make TOR your default gateway.
|
3
3
|
|
4
4
|
## Install
|
5
5
|
Spior is cryptographically signed, so add my public key (if you haven’t already) as a trusted certificate.
|
@@ -10,28 +10,21 @@ And install the gem
|
|
10
10
|
|
11
11
|
$ gem install spior -P MediumSecurity
|
12
12
|
|
13
|
-
To be able to use the `persist mode` (with systemd for now), the gem should be installed system-wide:
|
14
|
-
+ For gentoo, a package is available on my repo [ninjatools](https://github.com/szorfein/ninjatools/tree/master/dev-ruby/spior).
|
15
|
-
+ Arch seem to use [Quarry](https://wiki.archlinux.org/index.php/Ruby#Quarry).
|
16
|
-
+ On distro based on debian, gem are installed system-wide.
|
17
|
-
|
18
|
-
If you can, i recommend that you create a package for your distribution.
|
19
|
-
|
20
13
|
## Usage
|
21
14
|
|
22
15
|
$ spior -h
|
23
16
|
|
24
17
|
### Examples
|
25
|
-
|
26
|
-
|
27
|
-
$ spior -n eth0 -m
|
28
|
-
|
29
|
-
Redirect traffic through TOR
|
18
|
+
Redirect traffic through TOR:
|
30
19
|
|
31
20
|
$ spior -t
|
32
21
|
$ spior -t -n eth0
|
33
22
|
|
34
|
-
|
23
|
+
Change your ip address by reloading the TOR circuit:
|
24
|
+
|
25
|
+
$ spior -r
|
26
|
+
|
27
|
+
Look informations about your current ip address:
|
35
28
|
|
36
29
|
$ spior -s
|
37
30
|
|
data/{conf → ext}/ipt_mod.conf
RENAMED
File without changes
|
File without changes
|
data/{conf → ext}/resolv.conf
RENAMED
File without changes
|
data/{conf → ext}/ssh.conf
RENAMED
File without changes
|
data/{conf → ext}/sshd.conf
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/spior/copy.rb
CHANGED
@@ -9,7 +9,7 @@ module Spior
|
|
9
9
|
|
10
10
|
def self.config_files
|
11
11
|
@cp = Helpers::Exec.new("cp -a")
|
12
|
-
@conf_dir = File.expand_path('../..' + '/
|
12
|
+
@conf_dir = File.expand_path('../..' + '/ext', __dir__)
|
13
13
|
copy_torrc
|
14
14
|
copy_file(@conf_dir + "/resolv.conf", "/etc/resolv.conf")
|
15
15
|
copy_file(@conf_dir + "/ipt_mod.conf", "/etc/modules-load.d/ipt_mod.conf")
|
data/lib/spior/install.rb
CHANGED
@@ -5,84 +5,32 @@ require_relative 'helpers'
|
|
5
5
|
|
6
6
|
module Spior
|
7
7
|
class Install
|
8
|
+
class << self
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
mac_update
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.check_base
|
15
|
-
base_packages
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.check_mac
|
19
|
-
pkg_mac
|
20
|
-
end
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
def self.base_packages
|
25
|
-
if not TTY::Which.exist?('iptables') or not TTY::Which.exist?('tor')
|
26
|
-
case Nomansland::installer?
|
27
|
-
when :emerge
|
28
|
-
emerge = Helpers::Exec.new("emerge -av --changed-use")
|
29
|
-
emerge.run("tor iptables")
|
30
|
-
when :pacman
|
31
|
-
pacman = Helpers::Exec.new("pacman -S --needed")
|
32
|
-
pacman.run("tor iptables")
|
33
|
-
when :yum
|
34
|
-
yum = Helpers::Exec.new("yum install")
|
35
|
-
yum.run("tor iptables")
|
36
|
-
else
|
37
|
-
apt_get = Helpers::Exec.new("apt-get install")
|
38
|
-
apt_get.run("tor iptables iptables-persistent")
|
39
|
-
end
|
10
|
+
def check_deps
|
11
|
+
base_packages
|
40
12
|
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.pkg_mac
|
44
|
-
pkg_name="deceitmac"
|
45
|
-
if not TTY::Which.exist?(pkg_name)
|
46
|
-
build_pkg(pkg_name)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def self.mac_update
|
51
|
-
pkg_name="deceitmac"
|
52
|
-
if TTY::Which.exist?(pkg_name)
|
53
|
-
print "Target #{pkg_name} exist, update? [N/y] "
|
54
|
-
choice = gets.chomp
|
55
|
-
if choice =~ /y|Y/ then
|
56
|
-
puts "Update #{pkg_name}..."
|
57
|
-
build_pkg(pkg_name)
|
58
|
-
end
|
59
|
-
else
|
60
|
-
puts "Install #{pkg_name}..."
|
61
|
-
build_pkg(pkg_name)
|
62
|
-
end
|
63
|
-
end
|
64
13
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
14
|
+
private
|
15
|
+
|
16
|
+
def base_packages
|
17
|
+
if not TTY::Which.exist?('iptables') or not TTY::Which.exist?('tor')
|
18
|
+
case Nomansland::installer?
|
19
|
+
when :emerge
|
20
|
+
emerge = Helpers::Exec.new("emerge -av --changed-use")
|
21
|
+
emerge.run("tor iptables")
|
22
|
+
when :pacman
|
23
|
+
pacman = Helpers::Exec.new("pacman -S --needed")
|
24
|
+
pacman.run("tor iptables")
|
25
|
+
when :yum
|
26
|
+
yum = Helpers::Exec.new("yum install")
|
27
|
+
yum.run("tor iptables")
|
28
|
+
else
|
29
|
+
apt_get = Helpers::Exec.new("apt-get install")
|
30
|
+
apt_get.run("tor iptables iptables-persistent")
|
31
|
+
end
|
80
32
|
end
|
81
33
|
end
|
82
|
-
Msg.p "pkg #{name} installed"
|
83
|
-
Dir.chdir(old_path)
|
84
|
-
rescue => e
|
85
|
-
Msg.err e
|
86
34
|
end
|
87
35
|
end
|
88
36
|
end
|
data/lib/spior/menu.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require_relative 'msg'
|
2
|
-
require_relative 'mac'
|
3
2
|
require_relative 'iptables'
|
4
3
|
require_relative 'network'
|
5
4
|
require_relative 'reload'
|
@@ -16,29 +15,25 @@ module Spior
|
|
16
15
|
Msg.head
|
17
16
|
puts %q{Please select an option:
|
18
17
|
|
19
|
-
1.
|
20
|
-
2.
|
21
|
-
3.
|
22
|
-
4.
|
23
|
-
5.
|
24
|
-
6. Quit}
|
18
|
+
1. Redirect traffic through tor
|
19
|
+
2. Reload tor and change your ip
|
20
|
+
3. Clear and restore your files
|
21
|
+
4. Check info on your current ip
|
22
|
+
5. Quit}
|
25
23
|
|
26
24
|
puts
|
27
25
|
print ">> "
|
28
26
|
case gets.chomp
|
29
27
|
when '1'
|
30
|
-
check_network
|
31
|
-
Spior::MAC::randomize(@network.card)
|
32
|
-
when '2'
|
33
28
|
check_network
|
34
29
|
Spior::Iptables::tor(@network.card)
|
35
|
-
when '
|
30
|
+
when '2'
|
36
31
|
Spior::Reload::tor
|
37
|
-
when '
|
32
|
+
when '3'
|
38
33
|
Spior::Clear::all
|
39
|
-
when '
|
34
|
+
when '4'
|
40
35
|
Spior::Status::info
|
41
|
-
when '
|
36
|
+
when '5'
|
42
37
|
exit
|
43
38
|
end
|
44
39
|
end
|
data/lib/spior/msg.rb
CHANGED
@@ -1,30 +1,32 @@
|
|
1
1
|
require 'rainbow'
|
2
2
|
|
3
3
|
module Msg
|
4
|
-
|
4
|
+
extend self
|
5
|
+
|
6
|
+
def head
|
5
7
|
puts Rainbow("------------------------------------------------").cyan
|
6
8
|
end
|
7
9
|
|
8
|
-
def
|
10
|
+
def p(text)
|
9
11
|
puts Rainbow("[").cyan + Rainbow("+").white + Rainbow("]").cyan + " " + text
|
10
12
|
end
|
11
13
|
|
12
|
-
def
|
14
|
+
def err(text)
|
13
15
|
puts Rainbow("[").red + Rainbow("-").white + Rainbow("]").red + " " + text
|
14
16
|
end
|
15
17
|
|
16
|
-
def
|
18
|
+
def info(text)
|
17
19
|
puts Rainbow("-").blue + Rainbow("-").white + Rainbow("-").blue + " " + text + " " + Rainbow("-").blue + Rainbow("-").white + Rainbow("-").blue
|
18
20
|
end
|
19
21
|
|
20
|
-
def
|
22
|
+
def report(text)
|
21
23
|
puts ""
|
22
24
|
info text
|
23
25
|
puts "Please, report this issue at https://github.com/szorfein/spior/issues"
|
24
26
|
puts ""
|
25
27
|
end
|
26
28
|
|
27
|
-
def
|
29
|
+
def for_no_systemd
|
28
30
|
puts "Init system is not yet supported. You can contribute to add it."
|
29
31
|
end
|
30
32
|
end
|
data/lib/spior/options.rb
CHANGED
@@ -20,7 +20,7 @@ module Spior
|
|
20
20
|
|
21
21
|
def parse(argv)
|
22
22
|
OptionParser.new do |opts|
|
23
|
-
opts.on("-i", "--install", "
|
23
|
+
opts.on("-i", "--install", "Check and install dependencies") do
|
24
24
|
@install = true
|
25
25
|
end
|
26
26
|
|
@@ -28,10 +28,6 @@ module Spior
|
|
28
28
|
@interface = net
|
29
29
|
end
|
30
30
|
|
31
|
-
opts.on("-m", "--mac", "Change your mac") do
|
32
|
-
@mac = true
|
33
|
-
end
|
34
|
-
|
35
31
|
opts.on("-t", "--tor", "Redirect traffic through TOR") do
|
36
32
|
@tor = true
|
37
33
|
end
|
data/lib/spior/persist.rb
CHANGED
data/lib/spior/runner.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require_relative 'options'
|
2
2
|
require_relative 'install'
|
3
3
|
require_relative 'copy'
|
4
|
-
require_relative 'mac'
|
5
4
|
require_relative 'iptables'
|
6
5
|
require_relative 'network'
|
7
6
|
require_relative 'persist'
|
@@ -17,17 +16,9 @@ module Spior
|
|
17
16
|
def run
|
18
17
|
if @options.install then
|
19
18
|
Msg.head
|
20
|
-
Spior::Install::
|
19
|
+
Spior::Install::deps
|
21
20
|
Spior::Copy::config_files
|
22
21
|
end
|
23
|
-
if @options.mac then
|
24
|
-
Msg.head
|
25
|
-
Spior::Install::check_mac
|
26
|
-
if not @network
|
27
|
-
@network = Spior::Network.new(@options.interface)
|
28
|
-
end
|
29
|
-
Spior::MAC::randomize(@network.card)
|
30
|
-
end
|
31
22
|
if @options.tor then
|
32
23
|
Msg.head
|
33
24
|
if not @network
|
data/lib/spior/tor.rb
CHANGED
data/spior.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "spior"
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.3"
|
4
4
|
s.summary = "A tool to make TOR your default gateway and randomize your hardware"
|
5
5
|
s.description = <<-EOF
|
6
6
|
A tool to make TOR your default gateway and randomize your hardware.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spior
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- szorfein
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
J/zT/q2Ac7BWpSLbv6p9lChBiEnD9j24x463LR5QQjDNS5SsjzRQfFuprsa9Nqf2
|
36
36
|
Tw==
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2020-05-
|
38
|
+
date: 2020-05-14 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rainbow
|
@@ -107,20 +107,19 @@ files:
|
|
107
107
|
- LICENSE
|
108
108
|
- README.md
|
109
109
|
- bin/spior
|
110
|
-
-
|
111
|
-
-
|
112
|
-
-
|
113
|
-
-
|
114
|
-
-
|
115
|
-
-
|
116
|
-
-
|
117
|
-
-
|
110
|
+
- ext/ipt_mod.conf
|
111
|
+
- ext/iptables.service
|
112
|
+
- ext/resolv.conf
|
113
|
+
- ext/ssh.conf
|
114
|
+
- ext/sshd.conf
|
115
|
+
- ext/sshuttle.service
|
116
|
+
- ext/torrc/torrc_archlinux
|
117
|
+
- ext/torrc/torrc_default
|
118
118
|
- lib/spior/clear.rb
|
119
119
|
- lib/spior/copy.rb
|
120
120
|
- lib/spior/helpers.rb
|
121
121
|
- lib/spior/install.rb
|
122
122
|
- lib/spior/iptables.rb
|
123
|
-
- lib/spior/mac.rb
|
124
123
|
- lib/spior/menu.rb
|
125
124
|
- lib/spior/msg.rb
|
126
125
|
- lib/spior/network.rb
|
metadata.gz.sig
CHANGED
Binary file
|
data/lib/spior/mac.rb
DELETED