pass-station 1.4.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dce80d32341aedab22c054f5bba662411df09d1d585e8e7988fcbc6cb7a14a6c
4
- data.tar.gz: cc71183091fed6f3766f7d4390973ecc869022a8760ebd8706d837066f240610
3
+ metadata.gz: 4efd8c7e41726625f3d899f50e045e8492502506f3868c97dccf176fe7e676a0
4
+ data.tar.gz: 6eec1f4dfad4f9f146df669c4c3f99577fc0551029c101c718087f8e6e9f27ab
5
5
  SHA512:
6
- metadata.gz: 6b48de95b152bcb493551c380390d528de04d61e36123d06d5ec62f2cc3bafd987ec8e411f8b10ef109b1ec116f08375f367da20860ee79813cf92a866d9efad
7
- data.tar.gz: b5b30dc1e5885101617d0d893286d6b1086672fc8fd01d2a2767336f37c5d96551d76366897d3193d8e9828ac57fbc7333504895f7b661f30a44210ddfa6d229
6
+ metadata.gz: 9a3bdebaf3d6c3c587378ae0b047edbc597b4217d4035b61e8091ddab3bc173e2fb384145361e3a9e79deffbdc49d708ddd4a610926bf6c79d1cd0132b9c1212
7
+ data.tar.gz: a2ed0c157c67250638c4583671c9bf278e0e8f051f30195dcc06e98573618b66994524fc0eccfe160f670220498339a87e838aaf1d55781cd5cd147b26c78807
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Alexandre ZANNI
3
+ Copyright (c) 2021-2023 Alexandre ZANNI
4
4
  Copyright (c) 2021 Alexandre ZANNI at SEC-IT
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
data/bin/pass-station CHANGED
@@ -2,7 +2,6 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # Ruby internal
5
- require 'pp'
6
5
  # Project internal
7
6
  require 'pass_station'
8
7
  require 'pass_station/output'
@@ -11,41 +10,51 @@ require 'docopt'
11
10
  require 'paint'
12
11
 
13
12
  doc = <<~DOCOPT
14
- Pass Station v#{PassStation::VERSION}
13
+ #{Paint['Pass Station', :bold, '#2db453']} v#{Paint[PassStation::VERSION, :bold]}
15
14
 
16
- Usage:
15
+ #{Paint['Usage:', '#2db453']}
17
16
  pass-station list [--sort <col> --output <format>] [--source <id> --debug]
18
17
  pass-station search <term> [--field <col> --sort <col> --sensitive --output <format>] [--source <id> --no-color --debug]
19
18
  pass-station update ([--force] <path> | --check) [--debug]
20
19
  pass-station -h | --help
21
20
  pass-station --version
22
21
 
23
- List options: list all default credentials
22
+ #{Paint['List options:', '#2db453']} #{Paint['list all default credentials', :underline]}
24
23
 
25
- Output options: can be used with list and search commands
24
+ #{Paint['Output options:', '#2db453']} #{Paint['can be used with list and search commands', :underline]}
26
25
  -o <format>, --output <format> Output format: JSON, CSV, YAML, table, pretty-table [default: pretty-table]
27
26
  -s <col>, --sort <col> Sort by column (see documentation, columns depends on the database source)
28
27
 
29
- Search options:
28
+ #{Paint['Search options:', '#2db453']} #{Paint['search for default credentials', :underline]}
30
29
  --field <col> Search in column: column name (see documentation, columns depends on the database source) or all
31
30
  --sensitive Search is case sensitive (case insensitive by default)
32
31
 
33
- Update options: update the password database (replace Pass Station DB with upstream DB, use with care)
32
+ #{Paint['Update options:', '#2db453']} #{Paint['update the password database (replace Pass Station DB with upstream DB, use with care)', :underline]}
34
33
  -f, --force Bypass hash checking
35
34
  -c, --check Check for possible update
36
35
 
37
- Other options:
36
+ #{Paint['Other options:', '#2db453']}
38
37
  --source <id> Credentials source database: 1 (Default Credentials Cheat Sheet), 2 (Many passwords) [default: 1]
39
38
  --no-color Disable colorized output
40
39
  --debug Display arguments
41
40
  -h, --help Show this screen
42
41
  --version Show version
42
+
43
+ #{Paint['Examples:', '#2db453']}
44
+ pass-station search WEBLOGIC --field username --sensitive
45
+ pass-station search 'admin[0-9]+' --field all
46
+ pass-station list --sort username --output json
47
+
48
+ #{Paint['Project:', '#2db453']}
49
+ #{Paint['author', :underline]} (https://pwn.by/noraj / https://x.com/noraj_rawsec)
50
+ #{Paint['source', :underline]} (https://github.com/noraj/pass-station)
51
+ #{Paint['documentation', :underline]} (https://noraj.github.io/pass-station)
43
52
  DOCOPT
44
53
 
45
54
  begin
46
55
  args = Docopt.docopt(doc, version: PassStation::VERSION)
47
56
  Paint.mode = 0 if args['--no-color']
48
- pp args if args['--debug']
57
+ puts args if args['--debug']
49
58
  if args['update']
50
59
  if args['<path>']
51
60
  PassStation::DB::UPSTREAM_DATABASE[:MAPPING].each do |k, v|
@@ -68,15 +77,15 @@ begin
68
77
  end
69
78
  end
70
79
  elsif args['list']
71
- db = args['--source'].nil? ? nil : args['--source'].to_i
80
+ db = args['--source']&.to_i
72
81
  ps = PassStation::DB.new(db)
73
82
  args['--sort'].nil? ? ps.parse : ps.parse(args['--sort'].to_sym)
74
83
  puts ps.output_list(args['--output'])
75
84
  elsif args['search']
76
- db = args['--source'].nil? ? nil : args['--source'].to_i
85
+ db = args['--source']&.to_i
77
86
  ps = PassStation::DB.new(db)
78
87
  args['--sort'].nil? ? ps.parse : ps.parse(args['--sort'].to_sym)
79
- field = args['--field'].nil? ? nil : args['--field'].to_sym
88
+ field = args['--field']&.to_sym
80
89
  ps.search(args['<term>'], field, sensitive: args['--sensitive'])
81
90
  output = ps.output_search(args['--output'])
82
91
  puts '[-] No result' if output.empty?