A script to automate Jenkins credential store decryption
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Dockerfile
LICENSE
README.md
junkins.py
plain_postdata

README.md

Junkins logo
Jenkins logo: https://jenkins.io/ License: CC BY-SA 3.0

Junkins

I created this script to automate my Jenkins server credential store decryption. By default Jenkins credentials are encrypted, but the encryption key is stored locally on the server. This allows anyone with script interface access to decrypt any secret stored on the server.

Files

  • junkins.py: This is the script itself.
  • plain_postdata: This file contains the Jenkins groovy script.

Required

Posting the groovy script requires the 'requests' Python library.

Docker instructions

Optionally, if you'd like to run junkins in a docker container, use the following commands:

$ git clone https://github.com/chris408/junkins
$ cd junkins
$ docker build -t junkins ./
$ docker run -it junkins http://jenkins-server/scriptText/

TODO

  • Add CSRF 'Crumb' support.
  • Add proxy server command line argument support.
  • Add support to automate the creation of the plain_postdata file.
  • Add Dockerfile

Example output:

$ python junkins.py http://jenkins-server/scriptText/
Credential store dump:

username: testuser
password: testpassword

username: testuser_key
privatekey:
-----BEGIN RSA PRlVATE KEY-----
MIIEpAIBAAKCAQEAyLN2P5iv1gc7y3O0h1QsBlCpj0W+HQFJsfQC3b7m6j28ZHS7
QfUDGwya1Wx8dlCvTckwwzX+Bg26G7F6C9GQmSXgYF+dlsKgSnUp/60AcXdzaSyE
u5rqExFOdzd6kd2gbE1wwK0lg6iFObdiuJM3B5WYDSYc9KeopP0ve17nszrpEuNq
G8GXqeZu9Fq9QgibDhAQ3I/N0EDqf4dHv5PhLSinP2zmmyKSrHMmUIW0rpxUaU1o
f7FR1X8U/BTeBPyodAGnE2PHkdzCGYfOTl/PqNcATGHejYxwMaUKDaliNql9duuL
vNs9djI8PEEMYmuoKZ/HN9rMGFrG+mt7RgD0nwIDAQABAoIBAD9sJsP2FirGYmjq
iXPyb28Xcl2qJme4DnfDqlw0hXgkRjJgiQRQzshvdUZYYARrftpP567okvuKvvMd
ZHnzoYQj6gHK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mOhX1+KVmIjY
dYfxSwlUmnNIye2s9FA1wCxQYvfD/D4+YGjBuFsnUPwlhhUqC6QSEg==
-----END RSA PRlVATE KEY-----


username: testuser_key_withpassphrase
passphrase: testpassphrase

privatekey:
-----BEGIN RSA PRlVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,ECF34585F755D68F9111EEFABA777921

B8BJrH0tIFJQS26Q7DGluZwfzPB17YDl5pNvHMxoNITtmJn3xtNZQ+t68Qz61Qu1
R/MyKhCQFo3Oc8Z5TXDH6ZuUQWpQA7Uy7D4qdchCQdTi/nqnIfQ2jTMweSLsa0/f
XcKimsh23ldGnT9vu7b21PDms2RFJlEJNFPH6lqSYU0LScyZF/m3EOspQKqus3Gd
JjEB6Aw3VrlVj0Fl8MRpbVsOReILLby6+UgpoHScSrOtp4wHLL5sLhqEhg4X6azn
JqDjhcSMKUklPQS2B1dVSgSYderNuR6C8nV5D7vRkUvHZZth47PTtXQbKi7tXbpj
o/4s9N0tpaqfQIDFvYHuVncDbatENj8EAKiW/VqfQAIbh9ibPYFTu1/Gy9iv5HoL
1qujx7gxX1qt88fF4kwLffBi4V850qpR/SxdLh/2tOU6DbyybEf+W4XAEZG+ruKL
PaGjw3EYG34KYFELp0UxC5++vRkB9aaNx1htaFDGhEnYRAzWtd4Ew/Jgxp0y1BRz
JxjQIYMazDvz/h+MVoQIR5ThOEb8iXxnSiDtVcvJiBRMFXIuUmmYnkdA/77nzWNW
pZK5xyjLnRbcAvrFfT6vBixRGIOUODZCcI6aWeY+wgpHxgHXvIHk7D3nuAXTKJ1p
L2Jx8p28qIeMNv3wyuTV1qs2CTabiMDN2fOWRCHYa53vmN1BWV6g8xG52ycJEHEc
8xzNcv5uKriEoBxMWQccKoCHsYbssedXKkvgXswHvbYHHMRX85hc5qwrMbp+/GKo
Rk1+hNIDBJ2jzYiQd34NwQmDiiB0afcETMTtosIjY0fLnz0axpt3rfXM6QaEe2RT
JCAmpsR00Nc0H17ECqt2DP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