GithubHelp home page GithubHelp logo

jamf_decrypt's People

Contributors

armysick avatar dmaasland avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

armysick mlbz521

jamf_decrypt's Issues

Unable to successfully decrypt fields

Hello,

I've been trying to get jamf_decrypt.py run successfully the last couple days.

I've tried with the latest "update" for Python3, but the MySQLdb library looks like it's no longer supported and I can't get it to install -- not even with Python2.

I've converted the code to use the (official Oracle) mysql-connector-python library, which I use in another script that connects to the Jamf Pro database and I've got it working in jamf_decrypt.py, however, the decryption part seems to be where things are failing.

I may be missing something...

Here's where I'm currently at (with a little bit extra verbosity printed out):

$ python AxM/decrypt_jps_db.py 
SSH Connected!
Connecting to the jamfsoftware database on host 127.0.0.1...Connected!
[+] Got encryption_key:  'bytearray(b'<redacted>')'
[+] key:  'b'<redacted>''
[+] iv:  'b'<redacted>''
[+] Got session_key:  'b'<redacted>''
Connecting to the jamfsoftware database on host 127.0.0.1...Connected!
[-] Found encrypted data in table 'adcs_settings', decrypting...
column:  cat_client_cert_password_encrypted
[+] cipher_text:  'b'<redacted>''
Traceback (most recent call last):
  File "/Users/<user>/code/test/decrypt_jps_db.py", line 534, in <module>
    main()
  File "/Users/<user>/code/test/decrypt_jps_db.py", line 530, in main
    dump_data(jps, jamf_db_cursor)
  File "/Users/<user>/code/test/decrypt_jps_db.py", line 417, in dump_data
    f"\t\t\t\t\t<td>{jps.decrypt(base64.b64decode(row[column_index]))}</td>\n")
  File "/Users/<user>/code/test/decrypt_jps_db.py", line 162, in decrypt
    key, iv = generator.generate_derived_parameters(password, self.salt, self.iterations)
  File "/Users/<user>/code/test/.venv/lib/python3.10/site-packages/jasypt4py/generator.py", line 91, in generate_derived_parameters
    password_bytes = PKCS12ParameterGenerator.pkcs12_password_to_bytes(password)
  File "/Users/<user>/code/test/.venv/lib/python3.10/site-packages/jasypt4py/generator.py", line 45, in pkcs12_password_to_bytes
    digit = ord(password[i])
TypeError: ord() expected string of length 1, but int found

Basically, I'm connecting to my server over SSH, connecting to the MySQL database, and then the get_session_key function runs and I get a value (not sure if there's a way to validate this value is correct?) and finally, the dump_data function runs, which starts through through the tables, and on the first encrypted field (column) the above^^ happens.

Any help or insight would be greatly appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.