This is mbank-cli, a basic command-line interface to the online banking system of mBank.
Warning: You use mbank-cli on your own risk! The software is provided “as is”, without warranty of any kind.
- Perl (≥ 5.14) with the following Perl modules:
- HTML::TreeBuilder (≥ 5)
- IO::Socket::SSL (≥ 1.81)
- IPC::Run (optional: for password encryption, or for password manager support)
- JSON or JSON::PP (the latter is a core module since Perl 5.14)
- LWP::UserAgent (≥ 6)
- Net::SSLeay (≥ 1.43)
- Term::ReadLine::Gnu (optional: for account password prompt)
- UUID::Tiny (not needed on Linux)
- GnuPG (optional: for password encryption)
Cheat sheet for free software distributions
pacman -S perl-html-form perl-html-tree perl-lwp-protocol-https pacman -S perl-term-readline-gnu # for account password prompt pacman -S perl-ipc-run # for password management pacman -S gnupg # for password encryption
yum install epel-release # some packages are only in EPEL yum install perl-core perl-LWP-Protocol-https perl-HTML-Form perl-HTML-Tree yum install perl-Term-ReadLine-Gnu # for account password prompt yum install perl-IPC-Run # for password management
Debian 8 (jessie) or newer; Ubuntu 14.04 (trusty) or newer:
apt-get install libwww-perl libhtml-form-perl apt-get install libterm-readline-gnu-perl # for account password prompt apt-get install libipc-run-perl # for password management apt-get install gnupg # for password encryption
Cheat sheet for cpanm(1)
cpanm HTML::Form HTML::TreeBuilder IO::Socket::SSL JSON::PP LWP::UserAgent LWP::Protocol::https Net::HTTPS Net::SSLeay UUID::Tiny cpanm Term::ReadLine::Gnu # for account password prompt cpanm IPC::Run # for password management
mbank-cli has to verify that the server certificate has been signed by a trusted CA (certificate authority). Unlike many other TLS clients, it doesn't trust all the CAs whose certificates are installed system-wide, but only DigiCert High Assurance EV Root CA, which is known to be the root CA for mBank.
mbank-cli tries to find the certificate in the system certificate directory;
if that fails, it uses
ca.crt from the same directory as the script
This procedure might not be adequate when the program is installed
system-wide on some operating systems. Packagers/administrators might want
to patch the
get_default_ca_path() subroutine in such case.