ctf-party 1.3.5 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/bin/ctf-party +94 -0
 - data/lib/ctf_party/version.rb +1 -1
 - metadata +23 -6
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 10a305673b24e2d87a3bfa4323788418ebae0df79afca8214e6b61144c521aa9
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 26bd71e348d16938441a50f0e31cd9d27140b30dfa8eb47042166934a9334978
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: ff8243a49da5b97cbe1978a9c2243541ec5ede71ecaabdd9520fc38b59705506e98d3c3e9b5c1dc75ccfcbb41bc505c66424401c77873d5d08b762766f877ae8
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: d56fa0d1eba3673f3799a797582a809fddc86ea1a0b5e952db00aa7ac699be6760d0c4f275d903ef6c30a9d7659f29904c23a086e4c120fe4141e0133d4de10f
         
     | 
    
        data/bin/ctf-party
    ADDED
    
    | 
         @@ -0,0 +1,94 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #!/usr/bin/env ruby
         
     | 
| 
      
 2 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            # Ruby internal
         
     | 
| 
      
 5 
     | 
    
         
            +
            require 'pp'
         
     | 
| 
      
 6 
     | 
    
         
            +
            # Project internal
         
     | 
| 
      
 7 
     | 
    
         
            +
            require 'ctf_party'
         
     | 
| 
      
 8 
     | 
    
         
            +
            require 'ctf_party/version'
         
     | 
| 
      
 9 
     | 
    
         
            +
            # External
         
     | 
| 
      
 10 
     | 
    
         
            +
            require 'docopt'
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            cmd_whitelist = {
         
     | 
| 
      
 13 
     | 
    
         
            +
              alternatecase: 'Change one characte on two upcase and the other downcase',
         
     | 
| 
      
 14 
     | 
    
         
            +
              bin2hex: 'Encode an binary string to a hexadecimal string',
         
     | 
| 
      
 15 
     | 
    
         
            +
              bin2str: 'Alias for from_bin',
         
     | 
| 
      
 16 
     | 
    
         
            +
              dec2hex: 'Encode an decimal string to a hexadecimal string',
         
     | 
| 
      
 17 
     | 
    
         
            +
              dec2str: 'Alias for from_dec',
         
     | 
| 
      
 18 
     | 
    
         
            +
              from_b64: 'Decode the string from base64',
         
     | 
| 
      
 19 
     | 
    
         
            +
              from_bin: 'Decode a binary string',
         
     | 
| 
      
 20 
     | 
    
         
            +
              from_dec: 'Decode a decimal string (decimal to hexadecimal then hexadecimal to string)',
         
     | 
| 
      
 21 
     | 
    
         
            +
              from_hex: 'Decode a hexadecimal string',
         
     | 
| 
      
 22 
     | 
    
         
            +
              from_hexip: 'Decode a hexadecimal IP string into a dotted decimal one',
         
     | 
| 
      
 23 
     | 
    
         
            +
              hex2bin: 'Encode an hexadecimal string to a binary string',
         
     | 
| 
      
 24 
     | 
    
         
            +
              hex2dec: 'Encode an hexadecimal string to a decimal string',
         
     | 
| 
      
 25 
     | 
    
         
            +
              hex2str: 'Alias for from_hex',
         
     | 
| 
      
 26 
     | 
    
         
            +
              htmlescape: 'HTML escape the string',
         
     | 
| 
      
 27 
     | 
    
         
            +
              htmlunescape: 'HTML unescape the string',
         
     | 
| 
      
 28 
     | 
    
         
            +
              leet: 'Transform into leet speak (l337 5p34k)',
         
     | 
| 
      
 29 
     | 
    
         
            +
              md5: 'Calculate the md5 hash of the string',
         
     | 
| 
      
 30 
     | 
    
         
            +
              randomcase: 'Change the case of characters randomly',
         
     | 
| 
      
 31 
     | 
    
         
            +
              rmd160: 'Calculate the RIPEMD-160 hash of the string',
         
     | 
| 
      
 32 
     | 
    
         
            +
              rot13: 'Encrypt / Decrypt the string with Caesar cipher with a shift of 13',
         
     | 
| 
      
 33 
     | 
    
         
            +
              sha1: 'Calculate the sha1 hash of the string',
         
     | 
| 
      
 34 
     | 
    
         
            +
              sha2: 'Calculate the sha2 hash of the string',
         
     | 
| 
      
 35 
     | 
    
         
            +
              sha2_256: 'Alias for sha2 with bitlen of 256',
         
     | 
| 
      
 36 
     | 
    
         
            +
              sha2_384: 'Alias for sha2 with bitlen of 384',
         
     | 
| 
      
 37 
     | 
    
         
            +
              sha2_512: 'Alias for sha2 with bitlen of 512',
         
     | 
| 
      
 38 
     | 
    
         
            +
              str2bin: 'Alias for to_bin',
         
     | 
| 
      
 39 
     | 
    
         
            +
              str2dec: 'Alias for to_dec',
         
     | 
| 
      
 40 
     | 
    
         
            +
              str2hex: 'Alias for to_hex',
         
     | 
| 
      
 41 
     | 
    
         
            +
              to_b64: 'Encode the string into base64',
         
     | 
| 
      
 42 
     | 
    
         
            +
              to_bin: 'Encode a string into binary',
         
     | 
| 
      
 43 
     | 
    
         
            +
              to_dec: 'Encode a string into decimal (string to hexadecimal then hexadecimal to decimal)',
         
     | 
| 
      
 44 
     | 
    
         
            +
              to_hex: 'Encode a string into hexadecimal',
         
     | 
| 
      
 45 
     | 
    
         
            +
              to_hexip: 'Encode a dotted decimal IP into a hexadecimal one',
         
     | 
| 
      
 46 
     | 
    
         
            +
              urldecode: 'URL-decode the string',
         
     | 
| 
      
 47 
     | 
    
         
            +
              urlencode: 'URL-encode the string'
         
     | 
| 
      
 48 
     | 
    
         
            +
            }
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
            doc = <<~DOCOPT
         
     | 
| 
      
 51 
     | 
    
         
            +
              ctf-party by noraj
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
              Usage:
         
     | 
| 
      
 54 
     | 
    
         
            +
                ctf-party <string> <cmd>... [--debug]
         
     | 
| 
      
 55 
     | 
    
         
            +
                ctf-party --list-commands [--debug]
         
     | 
| 
      
 56 
     | 
    
         
            +
                ctf-party -h | --help
         
     | 
| 
      
 57 
     | 
    
         
            +
                ctf-party --version
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
              Options:
         
     | 
| 
      
 60 
     | 
    
         
            +
                -l, --list-commands   List available commands (see https://noraj.github.io/ctf-party/yard/String.html)
         
     | 
| 
      
 61 
     | 
    
         
            +
                --debug               Display arguments
         
     | 
| 
      
 62 
     | 
    
         
            +
                -h, --help            Show this screen
         
     | 
| 
      
 63 
     | 
    
         
            +
                --version             Show version
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
              Examples:
         
     | 
| 
      
 66 
     | 
    
         
            +
                ctf-party 'security' to_hex
         
     | 
| 
      
 67 
     | 
    
         
            +
                ctf-party 'NzQ2Zjc0NmY=' from_b64 hex2str str2bin
         
     | 
| 
      
 68 
     | 
    
         
            +
            DOCOPT
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
            begin
         
     | 
| 
      
 71 
     | 
    
         
            +
              args = Docopt.docopt(doc, version: Version::VERSION)
         
     | 
| 
      
 72 
     | 
    
         
            +
              # use case 1, using the tool
         
     | 
| 
      
 73 
     | 
    
         
            +
              pp args if args['--debug']
         
     | 
| 
      
 74 
     | 
    
         
            +
              if args['<string>']
         
     | 
| 
      
 75 
     | 
    
         
            +
                wrong_cmd = args['<cmd>'] - cmd_whitelist.keys.map(&:to_s)
         
     | 
| 
      
 76 
     | 
    
         
            +
                if wrong_cmd.empty?
         
     | 
| 
      
 77 
     | 
    
         
            +
                  output = args['<string>']
         
     | 
| 
      
 78 
     | 
    
         
            +
                  args['<cmd>'].each do |cmd|
         
     | 
| 
      
 79 
     | 
    
         
            +
                    output = output.public_send(cmd)
         
     | 
| 
      
 80 
     | 
    
         
            +
                  end
         
     | 
| 
      
 81 
     | 
    
         
            +
                  puts output
         
     | 
| 
      
 82 
     | 
    
         
            +
                else
         
     | 
| 
      
 83 
     | 
    
         
            +
                  abort "Those commands don't exist: #{wrong_cmd}"
         
     | 
| 
      
 84 
     | 
    
         
            +
                end
         
     | 
| 
      
 85 
     | 
    
         
            +
              elsif args['--list-commands']
         
     | 
| 
      
 86 
     | 
    
         
            +
                cmd_whitelist.each do |k, v|
         
     | 
| 
      
 87 
     | 
    
         
            +
                  puts "#{k.to_s.ljust(15)}#{v}"
         
     | 
| 
      
 88 
     | 
    
         
            +
                end
         
     | 
| 
      
 89 
     | 
    
         
            +
              end
         
     | 
| 
      
 90 
     | 
    
         
            +
              # use case 2, help: already handled by docopt
         
     | 
| 
      
 91 
     | 
    
         
            +
              # use case 3, version: already handled by docopt
         
     | 
| 
      
 92 
     | 
    
         
            +
            rescue Docopt::Exit => e
         
     | 
| 
      
 93 
     | 
    
         
            +
              puts e.message
         
     | 
| 
      
 94 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/ctf_party/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,15 +1,29 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: ctf-party
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.4.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Alexandre ZANNI
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2021-04- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-04-10 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
      
 13 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 14 
     | 
    
         
            +
              name: docopt
         
     | 
| 
      
 15 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 16 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '0.6'
         
     | 
| 
      
 20 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 21 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 22 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 23 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 24 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 25 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 26 
     | 
    
         
            +
                    version: '0.6'
         
     | 
| 
       13 
27 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
28 
     | 
    
         
             
              name: bundler
         
     | 
| 
       15 
29 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -136,16 +150,18 @@ dependencies: 
     | 
|
| 
       136 
150 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       137 
151 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       138 
152 
     | 
    
         
             
                    version: '0.9'
         
     | 
| 
       139 
     | 
    
         
            -
            description: A library to enhance and speed up script/ 
     | 
| 
       140 
     | 
    
         
            -
              (or security researchers, bug bountyhunters, pentesters but mostly focused 
     | 
| 
       141 
     | 
    
         
            -
              bypatching the String class to add a short syntax of  
     | 
| 
      
 153 
     | 
    
         
            +
            description: A CLI tool & library to enhance and speed up script/exploitwriting for
         
     | 
| 
      
 154 
     | 
    
         
            +
              CTF players (or security researchers, bug bountyhunters, pentesters but mostly focused
         
     | 
| 
      
 155 
     | 
    
         
            +
              on CTF) bypatching the String class to add a short syntax of usualcode patterns.
         
     | 
| 
       142 
156 
     | 
    
         
             
            email: alexandre.zanni@engineer.com
         
     | 
| 
       143 
157 
     | 
    
         
             
            executables:
         
     | 
| 
      
 158 
     | 
    
         
            +
            - ctf-party
         
     | 
| 
       144 
159 
     | 
    
         
             
            - ctf_party_console
         
     | 
| 
       145 
160 
     | 
    
         
             
            extensions: []
         
     | 
| 
       146 
161 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       147 
162 
     | 
    
         
             
            files:
         
     | 
| 
       148 
163 
     | 
    
         
             
            - LICENSE.txt
         
     | 
| 
      
 164 
     | 
    
         
            +
            - bin/ctf-party
         
     | 
| 
       149 
165 
     | 
    
         
             
            - bin/ctf_party_console
         
     | 
| 
       150 
166 
     | 
    
         
             
            - lib/ctf_party.rb
         
     | 
| 
       151 
167 
     | 
    
         
             
            - lib/ctf_party/base64.rb
         
     | 
| 
         @@ -187,5 +203,6 @@ requirements: [] 
     | 
|
| 
       187 
203 
     | 
    
         
             
            rubygems_version: 3.1.4
         
     | 
| 
       188 
204 
     | 
    
         
             
            signing_key:
         
     | 
| 
       189 
205 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       190 
     | 
    
         
            -
            summary: A library to enhance and speed up script/ 
     | 
| 
      
 206 
     | 
    
         
            +
            summary: A CLI tool & library to enhance and speed up script/exploitwriting for CTF
         
     | 
| 
      
 207 
     | 
    
         
            +
              players
         
     | 
| 
       191 
208 
     | 
    
         
             
            test_files: []
         
     |