spior 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 967b9db246b956fa477b0fcc62212846720f4722799997aff7fa95eb45ff9775
4
- data.tar.gz: 3469b8d3829a26bc46b576da7c15cc7bf420516e498d37fde8a39453cd2cff75
3
+ metadata.gz: 27c8fa0d8922c53ef9e3a7105c34de378489f3e70ddd334fedca96fe354da0ca
4
+ data.tar.gz: 70dbfd556eecb0db121145b43478129235c26b70a01c8a5c62a1194a9f98df7d
5
5
  SHA512:
6
- metadata.gz: 9a0e6279b2427995067d4bf4dded5ed0b7a412724009cab08ef5c779558b8e4e80f54b82b0520ca4e949ce7d445ec2fb86a7f954e426358a2162fcd333bd689e
7
- data.tar.gz: 2154da0c94cce48f71ff39fac3832ba3145388176b480a392f810ffeb5fa40e7dc66592bdf7aaf695bd2d26d6f27a4f03700a2dcaf375cfd5069afa5eeba8a3c
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 and randomize your hardware (MAC).
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
- To change the MAC address for eth0
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
- Look informations about your current ip address
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
 
File without changes
File without changes
File without changes
File without changes
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('../..' + '/conf', __dir__)
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
- def self.dependencies
10
- base_packages
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
- def self.build_pkg(name)
66
- old_path = Dir.pwd
67
- system("rm -rf /tmp/#{name}*")
68
- system("curl -L -o /tmp/#{name}.tar.gz https://github.com/szorfein/#{name}/archive/master.tar.gz")
69
- Dir.chdir("/tmp")
70
- system("tar xvf #{name}.tar.gz")
71
- Dir.chdir("#{name}-master")
72
- system("sudo make install")
73
- if TTY::Which.exist?('systemctl')
74
- if Dir.exist?("/lib/systemd/system")
75
- puts "lib/systemd"
76
- system("sudo cp deceitmac@.service /lib/systemd/system/")
77
- else
78
- puts "/usr/lib/systemd"
79
- system("sudo cp deceitmac@.service /usr/lib/systemd/system/")
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. Forge a new MAC address
20
- 2. Redirect traffic through tor
21
- 3. Reload tor and change your ip
22
- 4. Clear and restore your files
23
- 5. Check info on your current ip
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 '3'
30
+ when '2'
36
31
  Spior::Reload::tor
37
- when '4'
32
+ when '3'
38
33
  Spior::Clear::all
39
- when '5'
34
+ when '4'
40
35
  Spior::Status::info
41
- when '6'
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
- def self.head
4
+ extend self
5
+
6
+ def head
5
7
  puts Rainbow("------------------------------------------------").cyan
6
8
  end
7
9
 
8
- def self.p(text)
10
+ def p(text)
9
11
  puts Rainbow("[").cyan + Rainbow("+").white + Rainbow("]").cyan + " " + text
10
12
  end
11
13
 
12
- def self.err(text)
14
+ def err(text)
13
15
  puts Rainbow("[").red + Rainbow("-").white + Rainbow("]").red + " " + text
14
16
  end
15
17
 
16
- def self.info(text)
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 self.report(text)
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 self.for_no_systemd
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", "Install and update dependencies") do
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
@@ -10,7 +10,7 @@ module Spior
10
10
 
11
11
  def all(card_name)
12
12
  @card_name = card_name
13
- @services=[ "tor", "iptables", "deceitmac@" + @card_name ]
13
+ @services=[ "tor", "iptables" ]
14
14
  search_for_systemd
15
15
  end
16
16
 
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::dependencies
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
@@ -22,7 +22,7 @@ module Spior
22
22
  private
23
23
 
24
24
  def check_deps
25
- Spior::Install::check_base
25
+ Spior::Install::check_deps
26
26
  Spior::Copy::config_files
27
27
  verify_service
28
28
  end
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.2"
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.2
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-13 00:00:00.000000000 Z
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
- - conf/ipt_mod.conf
111
- - conf/iptables.service
112
- - conf/resolv.conf
113
- - conf/ssh.conf
114
- - conf/sshd.conf
115
- - conf/sshuttle.service
116
- - conf/torrc/torrc_archlinux
117
- - conf/torrc/torrc_default
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
@@ -1,11 +0,0 @@
1
- require "pathname"
2
- require_relative "msg"
3
-
4
- module Spior
5
- module MAC
6
- def self.randomize(interface)
7
- @network_int = interface
8
- system("deceitmac --interface #{@network_int} --random --dhcpcd --tor --no-banner")
9
- end
10
- end
11
- end