mcspoofy 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +6 -0
- data/bin/mcspoofy +74 -0
- data/lib/mcspoofy/version.rb +3 -0
- data/lib/mcspoofy.rb +4 -0
- data/mcspoofy.rdoc +5 -0
- metadata +122 -0
data/README.rdoc
ADDED
data/bin/mcspoofy
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
require 'gli'
|
4
|
+
require 'mcspoofy'
|
5
|
+
|
6
|
+
include GLI::App
|
7
|
+
|
8
|
+
program_desc 'Easily spoof your MAC address'
|
9
|
+
|
10
|
+
version Mcspoofy::VERSION
|
11
|
+
|
12
|
+
|
13
|
+
desc 'List available device interfaces and MAC addresses '
|
14
|
+
command :list do |c|
|
15
|
+
|
16
|
+
c.action do |global_options,options,args|
|
17
|
+
|
18
|
+
puts 'Interfaces: '
|
19
|
+
interfaces = `ifconfig -l`.split( )
|
20
|
+
interfaces.each do |interface|
|
21
|
+
mac = `ifconfig #{interface} | grep ether`.gsub(/ether/,'')
|
22
|
+
unless mac.empty?
|
23
|
+
puts "#{interface}: #{mac}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
desc 'Set MAC address to specified MAC address, Example: en0 6c:d1:c3:e5:s3:db '
|
30
|
+
arg_name 'Interface, MAC-address'
|
31
|
+
command :set do |c|
|
32
|
+
c.action do |global_options,options,args|
|
33
|
+
interface = args.first
|
34
|
+
mac = args.last
|
35
|
+
("Hello"=~/^[A-Z][a-z]+$/)
|
36
|
+
if (mac =~ /([0-9A-F]{2}[:-]){5}([0-9A-F]{2})/i)
|
37
|
+
# Set old MAC address to tempvariable
|
38
|
+
`sudo ifconfig #{interface} ether #{mac}`
|
39
|
+
end
|
40
|
+
puts "Now spoofing #{interface} with MAC address #{mac}"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
desc 'Reset to old MAC address'
|
45
|
+
arg_name 'Describe arguments to reset here'
|
46
|
+
command :reset do |c|
|
47
|
+
c.action do |global_options,options,args|
|
48
|
+
puts "TODO: temporary variable with old MAC address"
|
49
|
+
puts "Restart computer to reset MAC address"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
pre do |global,command,options,args|
|
54
|
+
# Pre logic here
|
55
|
+
# Return true to proceed; false to abort and not call the
|
56
|
+
# chosen command
|
57
|
+
# Use skips_pre before a command to skip this block
|
58
|
+
# on that command only
|
59
|
+
true
|
60
|
+
end
|
61
|
+
|
62
|
+
post do |global,command,options,args|
|
63
|
+
# Post logic here
|
64
|
+
# Use skips_post before a command to skip this
|
65
|
+
# block on that command only
|
66
|
+
end
|
67
|
+
|
68
|
+
on_error do |exception|
|
69
|
+
# Error logic here
|
70
|
+
# return false to skip default error handling
|
71
|
+
true
|
72
|
+
end
|
73
|
+
|
74
|
+
exit run(ARGV)
|
data/lib/mcspoofy.rb
ADDED
data/mcspoofy.rdoc
ADDED
metadata
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mcspoofy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jonathan
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-03-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rdoc
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: aruba
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: gli
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - '='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 2.5.4
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - '='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.5.4
|
78
|
+
description:
|
79
|
+
email: Jonathan.borg.frodin@gmail.com
|
80
|
+
executables:
|
81
|
+
- mcspoofy
|
82
|
+
extensions: []
|
83
|
+
extra_rdoc_files:
|
84
|
+
- README.rdoc
|
85
|
+
- mcspoofy.rdoc
|
86
|
+
files:
|
87
|
+
- bin/mcspoofy
|
88
|
+
- lib/mcspoofy/version.rb
|
89
|
+
- lib/mcspoofy.rb
|
90
|
+
- README.rdoc
|
91
|
+
- mcspoofy.rdoc
|
92
|
+
homepage: http://jb-san.github.com
|
93
|
+
licenses: []
|
94
|
+
post_install_message:
|
95
|
+
rdoc_options:
|
96
|
+
- --title
|
97
|
+
- mcspoofy
|
98
|
+
- --main
|
99
|
+
- README.rdoc
|
100
|
+
- -ri
|
101
|
+
require_paths:
|
102
|
+
- lib
|
103
|
+
- lib
|
104
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ! '>='
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
requirements: []
|
117
|
+
rubyforge_project:
|
118
|
+
rubygems_version: 1.8.25
|
119
|
+
signing_key:
|
120
|
+
specification_version: 3
|
121
|
+
summary: Easily spoof your MAC address
|
122
|
+
test_files: []
|