ctf-party 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +29 -0
  3. data/.yardopts +4 -0
  4. data/.yardopts-dev +6 -0
  5. data/Gemfile +6 -0
  6. data/Gemfile.lock +52 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +57 -0
  9. data/Rakefile +11 -0
  10. data/bin/ctf_party_console +7 -0
  11. data/bin/ctf_party_setup +6 -0
  12. data/docs/.nojekyll +0 -0
  13. data/docs/About.md +5 -0
  14. data/docs/CHANGELOG.md +5 -0
  15. data/docs/README.md +52 -0
  16. data/docs/_coverpage.md +10 -0
  17. data/docs/_media/logo.png +0 -0
  18. data/docs/_navbar.md +3 -0
  19. data/docs/_sidebar.md +13 -0
  20. data/docs/index.html +31 -0
  21. data/docs/pages/documentation.md +30 -0
  22. data/docs/pages/install.md +84 -0
  23. data/docs/pages/publishing.md +39 -0
  24. data/docs/pages/quick-start.md +23 -0
  25. data/docs/pages/usage.md +61 -0
  26. data/docs/vendor/docsify.js +1 -0
  27. data/docs/vendor/plugins/emoji.min.js +1 -0
  28. data/docs/vendor/plugins/search.min.js +1 -0
  29. data/docs/vendor/prismjs/components/prism-ruby.min.js +1 -0
  30. data/docs/vendor/themes/vue.css +1 -0
  31. data/docs/yard/String.html +2909 -0
  32. data/docs/yard/Version.html +121 -0
  33. data/docs/yard/_index.html +123 -0
  34. data/docs/yard/class_list.html +51 -0
  35. data/docs/yard/css/common.css +1 -0
  36. data/docs/yard/css/full_list.css +58 -0
  37. data/docs/yard/css/style.css +496 -0
  38. data/docs/yard/file.LICENSE.html +70 -0
  39. data/docs/yard/file.README.html +124 -0
  40. data/docs/yard/file_list.html +61 -0
  41. data/docs/yard/frames.html +17 -0
  42. data/docs/yard/index.html +124 -0
  43. data/docs/yard/js/app.js +303 -0
  44. data/docs/yard/js/full_list.js +216 -0
  45. data/docs/yard/js/jquery.js +4 -0
  46. data/docs/yard/method_list.html +275 -0
  47. data/docs/yard/top-level-namespace.html +112 -0
  48. data/lib/ctf_party.rb +7 -0
  49. data/lib/ctf_party/base64.rb +99 -0
  50. data/lib/ctf_party/digest.rb +115 -0
  51. data/lib/ctf_party/flag.rb +94 -0
  52. data/lib/ctf_party/rot.rb +47 -0
  53. data/lib/ctf_party/version.rb +5 -0
  54. data/test/test_string.rb +134 -0
  55. metadata +218 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1c9bbfee898723defee53d242711a127753c3bef4f6828477d4f686e4487713e
4
+ data.tar.gz: 69f0e9e1e7bb5fd27dcbd37b2c86d8ce6514307f3eb413d196e89822ad8e6e6e
5
+ SHA512:
6
+ metadata.gz: 58b042d0a45a771eb5889438497c15c8126039016b70362d0dcffd58b41a35442735351a14d099744603a778a3dc9684e76a1f72334adca4b2124552205e0b2f
7
+ data.tar.gz: 35c6e42f0c33448bba0acfd9ac126221ac557cfd47f4042edf844aed7bccf0272aaba52e38ee184959dbe0c56630f10c08575b6f0be25e9eeb3bd2a21ac02537
@@ -0,0 +1,29 @@
1
+ # Metrics
2
+ AllCops:
3
+ TargetRubyVersion: 2.4
4
+
5
+ Layout/AlignHash:
6
+ Include:
7
+ - 'lib/**/*.rb'
8
+ Metrics/AbcSize:
9
+ Enabled: false
10
+ Metrics/ClassLength:
11
+ Max: 200
12
+ Metrics/CyclomaticComplexity:
13
+ Enabled: false
14
+ Metrics/LineLength:
15
+ Include:
16
+ - 'lib/**/*.rb'
17
+ Metrics/BlockNesting:
18
+ Exclude:
19
+ - 'bin/*'
20
+ Metrics/MethodLength:
21
+ Max: 25
22
+ Metrics/PerceivedComplexity:
23
+ Max: 10
24
+ Style/ClassVars:
25
+ Enabled: false
26
+ Style/Documentation:
27
+ Enabled: false
28
+ Style/RedundantReturn:
29
+ Enabled: false
@@ -0,0 +1,4 @@
1
+ --output-dir docs/yard
2
+ -
3
+ --main README.md
4
+ LICENSE.txt
@@ -0,0 +1,6 @@
1
+ --output-dir docs/yard
2
+ --protected
3
+ --private
4
+ -
5
+ --main README.md
6
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in .gemspec
6
+ gemspec
@@ -0,0 +1,52 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ctf-party (1.0.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.0)
10
+ commonmarker (0.20.1)
11
+ ruby-enum (~> 0.5)
12
+ concurrent-ruby (1.1.5)
13
+ github-markup (3.0.4)
14
+ i18n (1.7.0)
15
+ concurrent-ruby (~> 1.0)
16
+ jaro_winkler (1.5.3)
17
+ minitest (5.12.2)
18
+ parallel (1.18.0)
19
+ parser (2.6.5.0)
20
+ ast (~> 2.4.0)
21
+ rainbow (3.0.0)
22
+ rake (12.3.3)
23
+ redcarpet (3.5.0)
24
+ rubocop (0.75.1)
25
+ jaro_winkler (~> 1.5.1)
26
+ parallel (~> 1.10)
27
+ parser (>= 2.6)
28
+ rainbow (>= 2.2.2, < 4.0)
29
+ ruby-progressbar (~> 1.7)
30
+ unicode-display_width (>= 1.4.0, < 1.7)
31
+ ruby-enum (0.7.2)
32
+ i18n
33
+ ruby-progressbar (1.10.1)
34
+ unicode-display_width (1.6.0)
35
+ yard (0.9.20)
36
+
37
+ PLATFORMS
38
+ ruby
39
+
40
+ DEPENDENCIES
41
+ bundler (~> 2.0)
42
+ commonmarker (~> 0.20)
43
+ ctf-party!
44
+ github-markup (~> 3.0)
45
+ minitest (~> 5.11)
46
+ rake (~> 12.3)
47
+ redcarpet (~> 3.4)
48
+ rubocop (~> 0.63)
49
+ yard (~> 0.9)
50
+
51
+ BUNDLED WITH
52
+ 2.0.2
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Alexandre ZANNI
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,57 @@
1
+ # ctf-party
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/ctf-party.svg)](https://badge.fury.io/rb/ctf-party)
4
+ ![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/Orange-Cyberdefense/ctf-party)
5
+ [![GitHub forks](https://img.shields.io/github/forks/Orange-Cyberdefense/ctf-party)](https://github.com/Orange-Cyberdefense/ctf-party/network)
6
+ [![GitHub stars](https://img.shields.io/github/stars/Orange-Cyberdefense/ctf-party)](https://github.com/Orange-Cyberdefense/ctf-party/stargazers)
7
+ [![GitHub license](https://img.shields.io/github/license/Orange-Cyberdefense/ctf-party)](https://github.com/Orange-Cyberdefense/ctf-party/blob/master/LICENSE.txt)
8
+ [![Rawsec's CyberSecurity Inventory](https://inventory.rawsec.ml/img/badges/Rawsec-inventoried-FF5050_flat.svg)](https://inventory.rawsec.ml/tools.html#ctf-party)
9
+
10
+ [![Packaging status](https://repology.org/badge/vertical-allrepos/ctf-party.svg)](https://repology.org/project/ctf-party/versions)
11
+
12
+ ![](https://orange-cyberdefense.github.io/ctf-party/_media/logo.png)
13
+
14
+
15
+ ## What it is
16
+
17
+ A library to enhance and speed up script/exploit writting for CTF players (or
18
+ security researchers, bug bounty hunters, pentesters but mostly focused on CTF)
19
+ by patching the String class to add a short syntax of usual code patterns.
20
+ The philosophy is also to keep the library to be pure ruby (no dependencies)
21
+ and not to re-implement what another library is already doing well
22
+ (eg.[xorcist] for xor).
23
+
24
+ [xorcist]:https://github.com/fny/xorcist
25
+
26
+ For example instead of writting:
27
+
28
+ ```ruby
29
+ require 'base64'
30
+
31
+ myvar = 'string'
32
+ myvar = Base64.strict_encode64(myvar)
33
+ ```
34
+
35
+ Just write (shorter and easier to remember):
36
+
37
+ ```ruby
38
+ require 'ctf_library'
39
+
40
+ myvar = 'string'
41
+ myvar.to_b64!
42
+ ```
43
+
44
+ ## Features
45
+
46
+ - base64: `to_b64`, `to_b64!`, `from_b64`, `from_b64!`, `b64?`
47
+ - digest: `md5`, `md5!`, `sha1`, `sha1!`, etc.
48
+ - flag: `flag`, `flag!`, `flag?` (apply/check a flag format)
49
+ - rot: `rot`, `rot!`, `rot13`, `rot13!`
50
+
51
+ ## References
52
+
53
+ Homepage / Documentation: https://orange-cyberdefense.github.io/ctf-party/
54
+
55
+ ## Author
56
+
57
+ Made by Alexandre ZANNI ([@noraj](https://github.com/noraj)), pentester from Orange Cyberdefense.
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rake/testtask'
4
+ require 'bundler/gem_tasks'
5
+
6
+ Rake::TestTask.new do |t|
7
+ t.libs << 'test'
8
+ end
9
+
10
+ desc 'Run tests'
11
+ task default: :test
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'ctf_party'
5
+ require 'irb'
6
+
7
+ IRB.start(__FILE__)
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
File without changes
@@ -0,0 +1,5 @@
1
+ # About
2
+
3
+ ## Logo
4
+
5
+ Logo made with [DesignEvo](https://www.designevo.com).
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## [1.0.0]
4
+
5
+ - Initial version
@@ -0,0 +1,52 @@
1
+ # ctf-party
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/ctf-party.svg)](https://badge.fury.io/rb/ctf-party)
4
+ ![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/Orange-Cyberdefense/ctf-party)
5
+ [![GitHub forks](https://img.shields.io/github/forks/Orange-Cyberdefense/ctf-party)](https://github.com/Orange-Cyberdefense/ctf-party/network)
6
+ [![GitHub stars](https://img.shields.io/github/stars/Orange-Cyberdefense/ctf-party)](https://github.com/Orange-Cyberdefense/ctf-party/stargazers)
7
+ [![GitHub license](https://img.shields.io/github/license/Orange-Cyberdefense/ctf-party)](https://github.com/Orange-Cyberdefense/ctf-party/blob/master/LICENSE.txt)
8
+ [![Rawsec's CyberSecurity Inventory](https://inventory.rawsec.ml/img/badges/Rawsec-inventoried-FF5050_flat.svg)](https://inventory.rawsec.ml/tools.html#ctf-party)
9
+
10
+ ## What it is
11
+
12
+ A library to enhance and speed up script/exploit writting for CTF players (or
13
+ security researchers, bug bounty hunters, pentesters but mostly focused on CTF)
14
+ by patching the String class to add a short syntax of usual code patterns.
15
+ The philosophy is also to keep the library to be pure ruby (no dependencies)
16
+ and not to re-implement what another library is already doing well
17
+ (eg.[xorcist] for xor).
18
+
19
+ [xorcist]:https://github.com/fny/xorcist
20
+
21
+ For example instead of writting:
22
+
23
+ ```ruby
24
+ require 'base64'
25
+
26
+ myvar = 'string'
27
+ myvar = Base64.strict_encode64(myvar)
28
+ ```
29
+
30
+ Just write (shorter and easier to remember):
31
+
32
+ ```ruby
33
+ require 'ctf_party'
34
+
35
+ myvar = 'string'
36
+ myvar.to_b64!
37
+ ```
38
+
39
+ ## Features
40
+
41
+ - base64: `to_b64`, `to_b64!`, `from_b64`, `from_b64!`, `b64?`
42
+ - digest: `md5`, `md5!`, `sha1`, `sha1!`, etc.
43
+ - flag: `flag`, `flag!`, `flag?` (apply/check a flag format)
44
+ - rot: `rot`, `rot!`, `rot13`, `rot13!`
45
+
46
+ ## References
47
+
48
+ Homepage / Documentation: https://orange-cyberdefense.github.io/ctf-party/
49
+
50
+ ## Author
51
+
52
+ Made by Alexandre ZANNI ([@noraj](https://github.com/noraj)), pentester from Orange Cyberdefense.
@@ -0,0 +1,10 @@
1
+ ![](_media/logo.png)
2
+
3
+ # ctf-party
4
+
5
+ A Ruby library to enhance and speed up script/exploit writting for CTF players.
6
+
7
+ [GitHub](https://github.com/Orange-Cyberdefense/ctf-party/)
8
+ [Get Started](pages/quick-start?id=quick-start)
9
+
10
+ ![color](#ffffff)
Binary file
@@ -0,0 +1,3 @@
1
+ - [Home](/)
2
+ - [Doc](https://orange-cyberdefense.github.io/ctf-party/yard/)
3
+ - [Source](https://github.com/Orange-Cyberdefense/ctf-rabid/)
@@ -0,0 +1,13 @@
1
+ - Getting started
2
+
3
+ - [Quick start](pages/quick-start.md)
4
+ - [Installation](pages/install.md)
5
+ - [Usage](pages/usage.md)
6
+
7
+ - Guide
8
+
9
+ - [Documentation](pages/documentation.md)
10
+ - [Publishing](pages/publishing.md)
11
+
12
+ - [About](About.md)
13
+ - [Changelog](CHANGELOG.md)
@@ -0,0 +1,31 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Document</title>
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
7
+ <meta name="description" content="Description">
8
+ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
9
+ <link rel="stylesheet" href="vendor/themes/vue.css">
10
+ </head>
11
+ <body>
12
+ <div id="app"></div>
13
+ <script>
14
+ window.$docsify = {
15
+ name: 'ctf-party',
16
+ repo: 'https://github.com/Orange-Cyberdefense/ctf-party/',
17
+ loadSidebar: true,
18
+ subMaxLevel: 2,
19
+ loadNavbar: true,
20
+ coverpage: true,
21
+ logo: '_media/logo.png',
22
+ themeColor: '#FF6600',
23
+ search: 'auto',
24
+ }
25
+ </script>
26
+ <script src="vendor/docsify.js"></script>
27
+ <script src="vendor/plugins/search.min.js"></script>
28
+ <script src="vendor/plugins/emoji.min.js"></script>
29
+ <script src="vendor/prismjs/components/prism-ruby.min.js"></script>
30
+ </body>
31
+ </html>
@@ -0,0 +1,30 @@
1
+ # Documentation
2
+
3
+ ## Server locally
4
+
5
+ ```
6
+ $ npm i docsify-cli -g
7
+ $ docsify serve docs
8
+ ```
9
+
10
+ ## Library doc
11
+
12
+ The output directory of the library documentation will be `docs/yard`.
13
+
14
+ You can consult it online [here](https://orange-cyberdefense.github.io/ctf-party/yard/).
15
+
16
+ ### Building locally: for library users
17
+
18
+ For developers who only want to use the library.
19
+
20
+ ```
21
+ $ bundle exec yard doc
22
+ ```
23
+
24
+ ### Building locally: for developer
25
+
26
+ For developers who want to participate to the development.
27
+
28
+ ```
29
+ $ bundle exec yard doc --yardopts .yardopts-dev
30
+ ```
@@ -0,0 +1,84 @@
1
+ # Installation
2
+
3
+ ## Production
4
+
5
+ ### Install from rubygems.org
6
+
7
+ ```
8
+ $ gem install ctf-party
9
+ ```
10
+
11
+ Gem: [ctf-party](https://rubygems.org/gems/ctf-party)
12
+
13
+ ### Install from BlackArch
14
+
15
+ From the repository:
16
+
17
+ ```
18
+ # pacman -S ruby-ctf-party
19
+ ```
20
+
21
+ From git:
22
+
23
+ ```
24
+ # blackman -i ruby-ctf-party
25
+ ```
26
+
27
+ PKGBUILD: [ruby-ctf-party](https://github.com/BlackArch/blackarch/blob/master/packages/ruby-ctf-party/PKGBUILD)
28
+
29
+ ### Install from ArchLinux
30
+
31
+ Manually:
32
+
33
+ ```
34
+ $ git clone https://aur.archlinux.org/ruby-ctf-party.git
35
+ $ cd ruby-ctf-rabid
36
+ $ makepkg -sic
37
+ ```
38
+
39
+ With an AUR helper ([Pacman wrappers](https://wiki.archlinux.org/index.php/AUR_helpers#Pacman_wrappers)), eg. pikaur:
40
+
41
+ ```
42
+ $ pikaur -S ruby-ctf-rabid
43
+ ```
44
+
45
+ AUR: [ruby-ctf-rabid](https://aur.archlinux.org/packages/ruby-ctf-rabid/)
46
+
47
+ ## Development
48
+
49
+ It's better to use [rbenv](https://github.com/rbenv/rbenv) to have latests version of ruby and to avoid trashing your system ruby.
50
+
51
+ ### Install from rubygems.org
52
+
53
+ ```
54
+ $ gem install --development ctf-party
55
+ ```
56
+
57
+ ### Build from git
58
+
59
+ Just replace `x.x.x` with the gem version you see after `gem build`.
60
+
61
+ ```
62
+ $ git clone https://github.com/Orange-Cyberdefense/ctf-party.git rabid
63
+ $ cd ctf-party
64
+ $ gem install bundler
65
+ $ bundler install
66
+ $ gem build ctf_party.gemspec
67
+ $ gem install ctf-party-x.x.x.gem
68
+ ```
69
+
70
+ Note: if an automatic install is needed you can get the version with `$ gem build ctf_party.gemspec | grep Version | cut -d' ' -f4`.
71
+
72
+ ### Run the library in irb without installing the gem
73
+
74
+ From local file:
75
+
76
+ ```
77
+ $ irb -Ilib -rctf_party
78
+ ```
79
+
80
+ From the installed gem:
81
+
82
+ ```
83
+ $ ctf_party_console
84
+ ```