hijack-test 1.0.2

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: 25166e5840bbf6923a4336e08fb05edc43c0e7cc64d5c3b0a179ba6f8520b131
4
+ data.tar.gz: f82b2878b8d534e22e08e522b033120a1e3e88124b3b7b3bb25940d1eb6d573c
5
+ SHA512:
6
+ metadata.gz: f057ff9e8fe49b325d8504b54357718edbacfa69d3fbaa133bc5e24a48efb37bd750ce8cb42449c681ff61fc72037477a5b157f433dd4cf1e17d48f5c702d8ce
7
+ data.tar.gz: 48433420947b81516a30ae9f3224e4e8ab6e25f90c03f2eb2048828289bfe42dcf799737b6105b59fc97a7966cdca7d1dbd02be0104f35a0f808a156a3d88acd
@@ -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 royalunited@protonmail.ch. 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 [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ #gemspec
4
+
5
+ gem 'clipboard'
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 linuxander
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,99 @@
1
+ *This gem is update of CLIT, but name is taken and I chose this one to make it more clear what it to*
2
+
3
+ # Introduction to Clipboard Hijack Tester
4
+
5
+ Clipboard is always a good resource to steal data. Passwords and bank accounts were targeted in past,
6
+ and cryptocurrencies in last few years. This is hard to determine since there's no server
7
+ for communication, it doesn't care about your files, it's only purpose is to wait for you to copy
8
+ BTC address to make a payment, to steal your coins. To keep us all safer, I've created `hijack-test gem`.
9
+
10
+ ---
11
+ # How to Run
12
+
13
+ Clone repository and run bin/setup to install dependencies:
14
+
15
+ ```
16
+ git clone https://www.github.com/cybersecrs/hijack-test && cd hijack-test && bin/setup
17
+ ```
18
+
19
+ This will download source of hijack-test and install:
20
+
21
+ * notify-send
22
+ * spd-say
23
+ * gem 'clipboard'
24
+
25
+ If you have notify-send and spd-say, you can run:
26
+
27
+ ```
28
+ bundle install
29
+ or
30
+ gem install clipboard
31
+ ```
32
+
33
+ To install gem locally run:
34
+
35
+ ```
36
+ gem install hijack-test
37
+ ```
38
+
39
+ This is not recommended way to install, until I create list of addresses to use, not just one
40
+
41
+ **Edit patterns for more security. Maybe someone put this address to avoid hijack-test.**
42
+
43
+ Open lib/hijack-test.rb and edit lines:
44
+
45
+ ```
46
+ BTC = 'change btc address here'
47
+ EMAIL = 'change email address here'
48
+ ```
49
+
50
+ Execute once
51
+
52
+ ```
53
+ ruby bin/hit
54
+ ```
55
+
56
+ Execute every "n" seconds (default 1 hour):
57
+
58
+ ```
59
+ ruby bin/hit -s
60
+ or
61
+ ruby bin/hit --start
62
+ ```
63
+
64
+ To change sleep time, edit number of seconds in *bin/hit* on line 11:
65
+
66
+ ```
67
+ sleep(3600)
68
+ ```
69
+
70
+
71
+ ---
72
+ # How Clipboard Hijacker Work?
73
+
74
+ There are many ways to create malware that steal or change clipboard data, and all of them use
75
+ different techniques to manipulate system clipboard api. Earlier this year [Ruby Gems Website](https://rubygems.org)
76
+ was filled with fake gems that include clipboard hijacker. It was found in 720 *ruby gems,* and malware targeted
77
+ windows users only. It monitor users clipboard, and if it recognize string similar to BTC address,
78
+ it change your clipboard data to one of many addresses from the list (recognition in this malware is based
79
+ on regex). Hopefully, it's removed after two days and nobody lost their money. But that's for 2020 only,
80
+ because [Ruby Gem's](https://rubygems.org) was under the same attack 2018 and 2019. They also think the
81
+ attack was performed by same people.
82
+
83
+ [Check 'CLISTER' repository for proof of concept how hijackers work](https://www.github.com/cybersecrs/clister)
84
+ >This script use `CryptoAddress Gem` to determine if clipboard data is valid address. If address is valid,
85
+ >it's changed with one you defined.
86
+
87
+ ---
88
+ ## How To Protect?
89
+
90
+ Get software that check your clipboard for changes when bitcoin address is copied.
91
+ I didn't found one, so I've created [Hijack-Test](https://www.github.com/cybersecrs/hijack-test).
92
+ This is in early development stage, but do it's job and test your device for Bitcoin address and E-mail address patterns.
93
+ If copied and pasted addresses are not same, you'll receive alarm with sound and visual notification, and error in terminal window.
94
+
95
+ ---
96
+ ## Contribution
97
+
98
+ If you like this gem, feel free to share it with your friends, so more people can use it.
99
+ [cybersecrs.github.io](https://cybersecrs.github.io)
data/bin/hit ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative '../lib/hijack-test.rb'
5
+
6
+ system("clear")
7
+ puts "Testing device on clipboard hijackers..."
8
+
9
+ unless ARGV[0] == '-s' || ARGV[0] == '--start'
10
+ HijackTest.new(1).start
11
+ else
12
+ while true do HijackTest.new(1).start; sleep(3600); system("clear") end
13
+ end
14
+
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'hijack-test'
5
+ s.version = '1.0.2'
6
+ s.summary = 'Clipboard Hijack Test'
7
+ s.description = <<~DESC
8
+ Hijack-Test check your device on clipboard hijackers.
9
+ Prevent loosing Bitcoins and test your device.
10
+ DESC
11
+ s.authors = ['Linuxander']
12
+ s.files = ['lib/hijack-test.rb']
13
+ s.homepage = 'https://cybersecrs.github.io/projects/hijack-test'
14
+ s.license = 'GPL-3.0-only'
15
+
16
+ s.metadata['homepage_uri'] = 'https://cybersecrs.github.io/project/hijack-test'
17
+ s.metadata['source_code_uri'] = 'https://www.github.com/cybersecrs/hijack-test'
18
+ s.metadata['bug_tracker_uri'] = 'https://www.github.com/cybersecrs/hijack-test/issues'
19
+
20
+ s.bindir = ['bin']
21
+ s.executables = ['hit']
22
+ s.require_paths = ['lib']
23
+
24
+ s.files = ['bin/hit', 'lib/hijack-test.rb', 'LICENSE', 'README.md', 'hijack-test.gemspec', 'Gemfile', 'CODE_OF_CONDUCT.md']
25
+
26
+ s.add_runtime_dependency 'clipboard'
27
+
28
+ s.add_development_dependency 'bundler'
29
+ s.add_development_dependency 'rake'
30
+ end
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #================================================================================#
4
+ # Clipboard Hijack Tester - Keep Your Bitcoins Safe - @cybersecrs #
5
+ #================================================================================#
6
+
7
+
8
+ require 'clipboard'
9
+
10
+
11
+ class HijackTest
12
+
13
+
14
+ # Define Bitcoin and E-mail address
15
+
16
+ BTC = "3AcLS7dgqVM1msDoaxzynNh4jRwmnQhcQ9"
17
+ EMAIL = "hijack@test.net"
18
+
19
+
20
+ # Define time to sleep between clipboard checking
21
+
22
+ def initialize(sleep_time)
23
+ @sleep = sleep_time.to_f
24
+ end
25
+
26
+
27
+ # Alarm for infected clipboard
28
+
29
+ def alarm
30
+ puts "\nYOUR DEVICE IS INFECTED WITH CLIPBOARD HIJACKER !"
31
+ system("notify-send -u critical 'YOUR DEVICE IS INFECTED WITH CLIPBOARD HIJACKER !'")
32
+ system("spd-say 'Your device is infected with clipboard hijacker!'")
33
+ end
34
+
35
+
36
+ # Define copy
37
+
38
+ def copy(str)
39
+ Clipboard.copy(str)
40
+ end
41
+
42
+
43
+ # Define paste
44
+
45
+ def paste
46
+ Clipboard.paste
47
+ end
48
+
49
+
50
+ # Clear Clipboard
51
+
52
+ def clear
53
+ Clipboard.clear
54
+ end
55
+
56
+
57
+ # Test clipboard with bitcoin address
58
+
59
+ def test_btc
60
+ a = copy(@btc)
61
+ sleep(@sleep)
62
+ b = paste
63
+ clear
64
+ unless a == b
65
+ alarm; puts "Bitcoin address changed in clipboard!\n\n"
66
+ else
67
+ puts "Bitcoin pattern - test passed"
68
+ end
69
+ end
70
+
71
+
72
+ # Test clipboard with e-mail
73
+
74
+ def test_email
75
+ a = copy(@email)
76
+ sleep(@sleep)
77
+ b = paste
78
+ clear
79
+ unless a == b
80
+ alarm; puts "E-mail address changed in clipboard!\n\n"
81
+ else
82
+ puts "E-mail pattern - test passed"
83
+ end
84
+ end
85
+
86
+
87
+ # Define time to wait between testing clipboard
88
+
89
+ def wait!
90
+ sleep(@sleep)
91
+ end
92
+
93
+
94
+ # Test clipboard for different types
95
+
96
+ def start
97
+ test_btc
98
+ test_email
99
+ end
100
+
101
+ end # END OF CLASS
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hijack-test
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Linuxander
8
+ autorequire:
9
+ bindir:
10
+ - bin
11
+ cert_chain: []
12
+ date: 2020-10-10 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: clipboard
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ description: "Hijack-Test check your device on clipboard hijackers. \nPrevent loosing
57
+ Bitcoins and test your device.\n"
58
+ email:
59
+ executables:
60
+ - hit
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - CODE_OF_CONDUCT.md
65
+ - Gemfile
66
+ - LICENSE
67
+ - README.md
68
+ - bin/hit
69
+ - hijack-test.gemspec
70
+ - lib/hijack-test.rb
71
+ homepage: https://cybersecrs.github.io/projects/hijack-test
72
+ licenses:
73
+ - GPL-3.0-only
74
+ metadata:
75
+ homepage_uri: https://cybersecrs.github.io/project/hijack-test
76
+ source_code_uri: https://www.github.com/cybersecrs/hijack-test
77
+ bug_tracker_uri: https://www.github.com/cybersecrs/hijack-test/issues
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubygems_version: 3.1.4
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Clipboard Hijack Test
97
+ test_files: []