amnesie 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +6 -0
- data/README.md +6 -2
- data/Rakefile +1 -1
- data/amnesie.gemspec +1 -1
- data/lib/amnesie/options.rb +5 -1
- data/lib/amnesie/persist.rb +10 -14
- data/lib/amnesie/runner.rb +2 -2
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 570877fce9e8b2a8b960dbb07352186c5a90d93650172d4b2c443104cbce4b45
|
4
|
+
data.tar.gz: 0154e2c00c893f94dc0323e131c4ae76f6bfb75f29e2088d62334b90c3724733
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a8b05b0343bde64c8d646015c798db099145a70560c10663b090aecbd41b68f8a79735612d72ce709e55a9f4d02716b03d102da599405e4c71c98a711b8331d
|
7
|
+
data.tar.gz: 9816484179011680de5d36a5956e3830e444bbb4b6a112d18d520fc8fa41476ad6a3fb037618f7d240c0fa775192cf4479a2168de1f14fa45c4ba5c7764b1b55
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.0.6, release 2020-05-20
|
2
|
+
* Init a doc with RDoc.
|
3
|
+
* Add -i|--init to start init process properly.
|
4
|
+
* Add dhcpcd to the mac@.service, dhclient doesn't seem necessary.
|
5
|
+
* Correct the mac@.service.
|
6
|
+
|
1
7
|
## 0.0.5, release 2020-05-19
|
2
8
|
* Create a amnesie-mac@.service (work only if the gem is install system-wide)
|
3
9
|
* Add -p|--persist
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Inspiration come from a post found on [Qubes-OS](https://www.qubes-os.org/doc/an
|
|
10
10
|
## Install
|
11
11
|
Amnesie is cryptographically signed, so add my public key (if you haven’t already) as a trusted certificate.
|
12
12
|
|
13
|
-
$ gem cert --add <(curl -Ls https://raw.githubusercontent.com/szorfein/
|
13
|
+
$ gem cert --add <(curl -Ls https://raw.githubusercontent.com/szorfein/amnesie/master/certs/szorfein.pem)
|
14
14
|
|
15
15
|
And install the gem
|
16
16
|
|
@@ -28,10 +28,14 @@ To change the MAC address for eth0:
|
|
28
28
|
|
29
29
|
$ amnesie -n eth0 -m
|
30
30
|
|
31
|
+
Create or Disable all systemd services for a network card:
|
32
|
+
|
33
|
+
$ amnesie -p -n wlp2s0
|
34
|
+
|
31
35
|
## Left Over
|
32
36
|
|
33
37
|
### Issues
|
34
|
-
For any questions, comments, feedback or issues, submit a [new issue](https://github.com/szorfein/
|
38
|
+
For any questions, comments, feedback or issues, submit a [new issue](https://github.com/szorfein/amnesie/issues/new).
|
35
39
|
|
36
40
|
### links
|
37
41
|
+ https://rubyreferences.github.io/rubyref
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ namespace :gem do
|
|
12
12
|
task :build do
|
13
13
|
Dir["amnesie*.gem"].each {|f| File.unlink(f) }
|
14
14
|
system("gem build amnesie.gemspec")
|
15
|
-
system("gem install amnesie-0.0.
|
15
|
+
system("gem install amnesie-0.0.6.gem -P MediumSecurity")
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
data/amnesie.gemspec
CHANGED
data/lib/amnesie/options.rb
CHANGED
@@ -2,7 +2,7 @@ require 'optparse'
|
|
2
2
|
|
3
3
|
module Amnesie
|
4
4
|
class Options
|
5
|
-
attr_reader :mac, :netcard, :persist
|
5
|
+
attr_reader :init, :mac, :netcard, :persist
|
6
6
|
|
7
7
|
def initialize(argv)
|
8
8
|
parse(argv)
|
@@ -11,6 +11,10 @@ module Amnesie
|
|
11
11
|
def parse(argv)
|
12
12
|
OptionParser.new do |opts|
|
13
13
|
|
14
|
+
opts.on("-i", "--init", "Used with init process (systemd, etc...)") do
|
15
|
+
@init = true
|
16
|
+
end
|
17
|
+
|
14
18
|
opts.on("-m", "--mac", "What is my MAC address?") do
|
15
19
|
@mac = true
|
16
20
|
end
|
data/lib/amnesie/persist.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require 'tempfile'
|
3
|
+
require 'tty-which'
|
3
4
|
require_relative 'helpers'
|
4
5
|
|
5
6
|
module Amnesie
|
@@ -21,18 +22,22 @@ module Amnesie
|
|
21
22
|
end
|
22
23
|
|
23
24
|
def mac_service
|
24
|
-
|
25
|
+
dhcp=''
|
26
|
+
if TTY::Which.exist?('dhcpcd')
|
27
|
+
dhcp='dhcpcd.service'
|
28
|
+
end
|
25
29
|
@string=<<EOF
|
26
30
|
[Unit]
|
27
31
|
Description=MAC Change %I
|
28
32
|
Wants=network-pre.target
|
29
|
-
Before=network-pre.target
|
33
|
+
Before=network-pre.target #{dhcp}
|
30
34
|
BindsTo=sys-subsystem-net-devices-%i.device
|
31
35
|
After=sys-subsystem-net-devices-%i.device
|
32
36
|
|
33
37
|
[Service]
|
34
38
|
Type=oneshot
|
35
|
-
ExecStart
|
39
|
+
ExecStart=/usr/bin/env bash -lc "amnesie -i -m -n %I"
|
40
|
+
TimeoutSec=30
|
36
41
|
|
37
42
|
[Install]
|
38
43
|
WantedBy=multi-user.target
|
@@ -60,17 +65,13 @@ EOF
|
|
60
65
|
end
|
61
66
|
|
62
67
|
def menu_mac
|
63
|
-
print "amnesie-mac@.service for #{@card}? (enable,disable
|
68
|
+
print "amnesie-mac@.service for #{@card}? (enable,disable) "
|
64
69
|
answer = gets.chomp
|
65
70
|
case answer
|
66
71
|
when /^enable/
|
67
72
|
mac_enable
|
68
73
|
when /^disable/
|
69
74
|
mac_disable
|
70
|
-
when /^stop/
|
71
|
-
mac_stop
|
72
|
-
when /^start/
|
73
|
-
mac_start
|
74
75
|
end
|
75
76
|
end
|
76
77
|
|
@@ -79,15 +80,10 @@ EOF
|
|
79
80
|
def mac_enable
|
80
81
|
@systemctl.run("enable amnesie-mac@#{@card}.service")
|
81
82
|
end
|
83
|
+
|
82
84
|
def mac_disable
|
83
85
|
@systemctl.run("disable amnesie-mac@#{@card}.service")
|
84
86
|
end
|
85
|
-
def mac_stop
|
86
|
-
@systemctl.run("stop amnesie-mac@#{@card}.service")
|
87
|
-
end
|
88
|
-
def mac_start
|
89
|
-
@systemctl.run("start amnesie-mac@#{@card}.service")
|
90
|
-
end
|
91
87
|
|
92
88
|
def search_systemd_dir
|
93
89
|
if Dir.exist? "/lib/systemd/system"
|
data/lib/amnesie/runner.rb
CHANGED
@@ -21,12 +21,12 @@ module Amnesie
|
|
21
21
|
process = Amnesie::Process.new(@network.card)
|
22
22
|
card = Amnesie::MAC.new(@network.card)
|
23
23
|
|
24
|
-
process.kill
|
24
|
+
process.kill unless @options.init
|
25
25
|
card.save_origin
|
26
26
|
card.rand
|
27
27
|
card.apply
|
28
28
|
puts card.to_s
|
29
|
-
process.restart
|
29
|
+
process.restart unless @options.init
|
30
30
|
end
|
31
31
|
if @options.persist then
|
32
32
|
if not @network
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amnesie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
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-20 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rake
|
metadata.gz.sig
CHANGED
Binary file
|