App-Greple-pw
view release on metacpan or search on metacpan
- Unified configuration interface supporting multiple parameter formats
- Support for both command-line options (--parse-matrix) and config syntax (parse_matrix)
- Direct parameter assignment to PwBlock variables for better integration
- Comprehensive test suite implementation
- Added t/Util.pm for greple integration testing
- Created 18 tests covering basic functionality, configuration, and options
- Test runner integration using git submodules
- Enhanced documentation and user experience
- Improved module description: "Interactive password and ID information extractor"
- Added structured Key Features section highlighting security and usability
- Comprehensive configuration examples and browser integration documentation
- Hidden internal functions from user-facing documentation
- Bug fixes and code improvements
- Fixed critical clipboard assignment vs comparison bug (= to eq)
- Fixed browser variable typo ($brouse to $browser)
- Improved option naming consistency (underscores vs hyphens)
- Added proper data encapsulation for PwBlock parameter management
{
"abstract" : "Interactive password and ID information extractor for greple",
"author" : [
"Kazumasa Utashiro"
],
"dynamic_config" : 0,
"generated_by" : "Minilla/v3.1.26",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
---
abstract: 'Interactive password and ID information extractor for greple'
author:
- 'Kazumasa Utashiro'
build_requires:
Test::More: '0.98'
configure_requires:
Module::Build::Tiny: '0.035'
dynamic_config: 0
generated_by: 'Minilla/v3.1.26, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
[](https://github.com/kaz-utashiro/greple-pw/actions) [](https://metacpan.org/release/App-Greple-pw)
# NAME
pw - Interactive password and ID information extractor for greple
# SYNOPSIS
# Basic usage
greple -Mpw pattern file
# Search in encrypted files
greple -Mpw password ~/secure/*.gpg
# Configure options
greple -Mpw --no-clear-screen --chrome password data.txt
greple -Mpw --config timeout=600 --config debug=1 password file.txt
# VERSION
Version 1.02
# DESCRIPTION
The **pw** module is a **greple** extension that provides secure, interactive
handling of sensitive information such as passwords, user IDs, and account
details found in text files. It is designed with security in mind, ensuring
that sensitive data doesn't remain visible on screen or in terminal history.
## Key Features
- **Interactive password handling**
Passwords are masked by default and can be safely copied to clipboard
without displaying the actual content on screen.
- **Secure cleanup**
Terminal scroll buffer and screen are automatically cleared when the
command exits, and clipboard content is replaced with a harmless string
to prevent sensitive information from persisting.
- **Encrypted file support**
Seamlessly works with PGP encrypted files using **greple**'s standard
features. Files with "_.gpg_" extension are automatically decrypted,
and the **--pgp** option allows entering the passphrase once for
multiple files.
- **Intelligent pattern recognition**
Automatically detects ID and password information using configurable
keywords like "user", "account", "password", "pin", etc. Custom
keywords can be configured to match your specific data format.
- **Browser integration**
Includes browser automation features for automatically filling web
forms with extracted credentials.
Some banks use random number matrices as a countermeasure for tapping.
If the module successfully guesses the matrix area, it blacks out the
table and remembers them.
- **List parameters**
**id\_keys** and **pw\_keys** are lists of keywords separated by spaces:
--config id_keys="USER ACCOUNT LOGIN EMAIL"
--config pw_keys="PASS PASSWORD PIN SECRET"
- **Password display control**
**pw\_blackout** controls password display:
0=show passwords, 1=mask with 'x', >1=fixed length mask.
- **PwBlock integration**
Parameters **parse\_matrix**, **parse\_id**, **parse\_pw**, **id\_\***, and **pw\_\***
are passed to the PwBlock module for pattern recognition and display control.
- **pw\_status**
Print current configuration status. Next command displays current settings:
Shortcut options for specific browsers:
greple -Mpw --chrome # equivalent to --browser=chrome
greple -Mpw --safari # equivalent to --browser=safari
During interactive mode, you can use the `input` command to send
data to browser forms automatically.
# EXAMPLES
- Search for passwords in encrypted files
greple -Mpw password ~/secure/*.gpg
- Use with specific browser and no screen clearing
greple -Mpw --chrome --no-clear-screen password data.txt
- Configure custom keywords and timeout
greple -Mpw --config id_keys="LOGIN EMAIL USER" --config timeout=600 password file.txt
- Check current configuration
greple -Mpw::pw_status= dummy /dev/null
# SEE ALSO
[App::Greple](https://metacpan.org/pod/App%3A%3AGreple), [App::Greple::pw](https://metacpan.org/pod/App%3A%3AGreple%3A%3Apw)
[https://github.com/kaz-utashiro/greple-pw](https://github.com/kaz-utashiro/greple-pw)
lib/App/Greple/PwBlock.pm view on Meta::CPAN
=head1 SYNOPSIS
use App::Greple::PwBlock;
# Create a new PwBlock object
my $pb = App::Greple::PwBlock->new($text);
# Access parsed information
my $id = $pb->id('0'); # Get ID by label
my $pw = $pb->pw('a'); # Get password by label
my $cell = $pb->cell('A', 0); # Get matrix cell value
# Configuration
use App::Greple::PwBlock qw(config);
config('id_keys', 'LOGIN EMAIL USER ACCOUNT');
config('pw_blackout', 0);
=head1 DESCRIPTION
B<App::Greple::PwBlock> is a specialized parser for extracting and managing
password and ID information from text blocks. It provides intelligent
pattern recognition for common credential formats and includes support
for random number matrices used by banking systems.
The module uses L<Getopt::EX::Config> for centralized parameter management,
allowing configuration of parsing behavior, display colors, and keyword
patterns.
=head1 METHODS
=over 4
=item B<new>([I<text>])
Creates a new PwBlock object. If I<text> is provided, it will be parsed
immediately.
my $pb = App::Greple::PwBlock->new($credential_text);
=item B<parse>(I<text>)
Parses the given text to extract ID, password, and matrix information.
This method is called automatically by B<new> if text is provided.
$pb->parse($text);
=item B<id>(I<label>)
Returns the ID value associated with the given label. Labels are assigned
automatically during parsing (e.g., '0', '1', '2', ...).
my $username = $pb->id('0');
=item B<pw>(I<label>)
Returns the password value associated with the given label. Labels are
assigned automatically during parsing (e.g., 'a', 'b', 'c', ...).
my $password = $pb->pw('a');
=item B<cell>(I<column>, I<row>)
Returns the value from a matrix cell at the specified column and row.
Useful for banking security matrices.
my $value = $pb->cell('E', 3); # Column E, Row 3
=item B<any>(I<label>)
Returns any value (ID, password, or matrix cell) associated with the label.
This is a convenient method that checks all types.
my $value = $pb->any('a');
=item B<orig>()
Returns the original unparsed text.
=item B<masked>()
Returns the text with passwords masked according to the B<pw_blackout> setting.
=item B<matrix>()
Returns a hash reference containing the parsed matrix data.
=back
=head1 CONFIGURATION
This module uses L<Getopt::EX::Config> for parameter management. Configuration
lib/App/Greple/PwBlock.pm view on Meta::CPAN
=item B<parse_matrix> (boolean, default: 1)
Enable or disable matrix parsing.
=item B<parse_id> (boolean, default: 1)
Enable or disable ID field parsing.
=item B<parse_pw> (boolean, default: 1)
Enable or disable password field parsing.
=item B<id_keys> (string, default: "ID ACCOUNT USER CODE NUMBER URL ã¦ã¼ã¶ ã¢ã«ã¦ã³ã ã³ã¼ã çªå·")
Space-separated list of keywords that identify ID fields.
=item B<id_chars> (string, default: "[\w\.\-\@]")
Regular expression character class for valid ID characters.
=item B<id_color> (string, default: "K/455")
Color specification for ID values in output.
=item B<id_label_color> (string, default: "S;C/555")
Color specification for ID labels in output.
=item B<pw_keys> (string, default: "PASS PIN ãã¹ æè¨¼")
Space-separated list of keywords that identify password fields.
=item B<pw_chars> (string, default: "\S")
Regular expression character class for valid password characters.
=item B<pw_color> (string, default: "K/545")
Color specification for password values in output.
=item B<pw_label_color> (string, default: "S;M/555")
Color specification for password labels in output.
=item B<pw_blackout> (boolean, default: 1)
When enabled, passwords are masked in the output for security.
=back
=head2 Configuration Examples
# Customize ID keywords
config('id_keys', 'LOGIN EMAIL USERNAME ACCOUNT');
# Disable password masking
config('pw_blackout', 0);
# Add custom password keywords
config('pw_keys', 'PASS PASSWORD PIN SECRET TOKEN');
=head1 MATRIX SUPPORT
The module can automatically detect and parse random number matrices
commonly used by banking systems for security:
| A B C D E F G H I J
--+--------------------
0 | Y W 0 B 8 P 4 C Z H
lib/App/Greple/pw.pm view on Meta::CPAN
package App::Greple::pw;
our $VERSION = "1.02";
=head1 NAME
pw - Interactive password and ID information extractor for greple
=head1 SYNOPSIS
# Basic usage
greple -Mpw pattern file
# Search in encrypted files
greple -Mpw password ~/secure/*.gpg
# Configure options
greple -Mpw --no-clear-screen --chrome password data.txt
greple -Mpw --config timeout=600 --config debug=1 password file.txt
=head1 VERSION
Version 1.02
=head1 DESCRIPTION
The B<pw> module is a B<greple> extension that provides secure, interactive
handling of sensitive information such as passwords, user IDs, and account
details found in text files. It is designed with security in mind, ensuring
that sensitive data doesn't remain visible on screen or in terminal history.
=head2 Key Features
=over 4
=item * B<Interactive password handling>
Passwords are masked by default and can be safely copied to clipboard
without displaying the actual content on screen.
=item * B<Secure cleanup>
Terminal scroll buffer and screen are automatically cleared when the
command exits, and clipboard content is replaced with a harmless string
to prevent sensitive information from persisting.
=item * B<Encrypted file support>
Seamlessly works with PGP encrypted files using B<greple>'s standard
features. Files with "I<.gpg>" extension are automatically decrypted,
and the B<--pgp> option allows entering the passphrase once for
multiple files.
=item * B<Intelligent pattern recognition>
Automatically detects ID and password information using configurable
keywords like "user", "account", "password", "pin", etc. Custom
keywords can be configured to match your specific data format.
=item * B<Browser integration>
Includes browser automation features for automatically filling web
forms with extracted credentials.
=back
Some banks use random number matrices as a countermeasure for tapping.
lib/App/Greple/pw.pm view on Meta::CPAN
=item B<List parameters>
B<id_keys> and B<pw_keys> are lists of keywords separated by spaces:
--config id_keys="USER ACCOUNT LOGIN EMAIL"
--config pw_keys="PASS PASSWORD PIN SECRET"
=item B<Password display control>
B<pw_blackout> controls password display:
0=show passwords, 1=mask with 'x', >1=fixed length mask.
=item B<PwBlock integration>
Parameters B<parse_matrix>, B<parse_id>, B<parse_pw>, B<id_*>, and B<pw_*>
are passed to the PwBlock module for pattern recognition and display control.
=back
=over 4
lib/App/Greple/pw.pm view on Meta::CPAN
=back
During interactive mode, you can use the C<input> command to send
data to browser forms automatically.
=head1 EXAMPLES
=over 4
=item Search for passwords in encrypted files
greple -Mpw password ~/secure/*.gpg
=item Use with specific browser and no screen clearing
greple -Mpw --chrome --no-clear-screen password data.txt
=item Configure custom keywords and timeout
greple -Mpw --config id_keys="LOGIN EMAIL USER" --config timeout=600 password file.txt
=item Check current configuration
greple -Mpw::pw_status= dummy /dev/null
=back
=head1 SEE ALSO
L<App::Greple>, L<App::Greple::pw>
( run in 0.278 second using v1.01-cache-2.11-cpan-ba5c0e88f22 )