Giter Club home page Giter Club logo

Comments (6)

hongkongkiwi avatar hongkongkiwi commented on July 1, 2024

By the way, I found this reference which is the obfuscated .js code. I suppose this was your original inspiration.
https://stackoverflow.com/questions/33818684/login-to-amazon-using-curl

from audible.cr.

omarroth avatar omarroth commented on July 1, 2024

Is your code available anywhere? I expect it's an issue with how integers are treated differently between languages. Here's a JS snippet that should be helpful:

object = `0E8B8D42#{"start":1549603736100,"interaction":{"keys":2...`

var rounds = Math.ceil(object.length / 4);
var temp2 = [];
for (var i = 0; i < rounds; i++) {
  temp2[i] = (object.charCodeAt(i * 4) & 255) +
      ((object.charCodeAt(i * 4 + 1) & 255) << 8) +
      ((object.charCodeAt(i * 4 + 2) & 255) << 16) +
      ((object.charCodeAt(i * 4 + 3) & 255) << 24);
}

var wrap = 2654435769;
var temp3 = [1888420705, 2576816180, 2347232058, 874813317];

var minor_rounds = Math.floor(6 + (52 / rounds));
var first = temp2[0];
var last = temp2[rounds - 1];

var inner_roll = 0;
while (minor_rounds-- > 0) {
  inner_roll += wrap;
  var inner_variable = inner_roll >>> 2 & 3;
  
  for (var i = 0; i < rounds; i++) {
    first = temp2[(i + 1) % rounds];
    last = temp2[i] +=
        (last >>> 5 ^ first << 2) + (first >>> 3 ^ last << 4) ^
        (inner_roll ^ first) + (temp3[i & 3 ^ inner_variable] ^ last);
  }
}

var final_round = [];

for (i = 0; i < rounds; i++) {
  final_round[i] = String.fromCharCode(
    temp2[i] & 255,
    temp2[i] >>> 8 & 255, 
    temp2[i] >>> 16 & 255,
    temp2[i] >>> 24 & 255
  );
}

final_round = final_round.join("")

var base64_encoded = btoa(final_round);
var final = 'ECdITeCs:' + base64_encoded;

Unfortunately there isn't very much information I could find that is up to date on metaData1 (although the SO answer appears to be very good). The above implementation was found by attaching a breakpoint to submit or similar action on the page and stepping through line-by-line.

The obfuscated source is here and here (pastebin).

from audible.cr.

hongkongkiwi avatar hongkongkiwi commented on July 1, 2024

Oh that's great! thanks. Works perfectly :)

You wouldn't happen to have the js code for decrypt & sign would you?

I'm working on the module, but it's not ready for primetime need a few more days. Here's my crypto.js page:
https://pastebin.com/PtW0TnFV

I plan to do the captcha solving via an automated service, that way I can automatically login.

from audible.cr.

omarroth avatar omarroth commented on July 1, 2024

Unfortunately the only thing I've implemented in JS is the above example, everything else is Crystal, although you don't actually need decrypt_metadata, it's provided mostly for completion's sake.

The code you linked looks pretty good. If you'd like I'd be happy to link your module in the README when you feel it's ready.

from audible.cr.

omarroth avatar omarroth commented on July 1, 2024

If you haven't already seen it I would also recommend taking a look at this library which is (except for authentication) a mostly complete implementation in Node.

from audible.cr.

omarroth avatar omarroth commented on July 1, 2024

Since this appears to be resolved I'm going to close this. If you have any more questions though feel free to open a new issue.

from audible.cr.

Related Issues (6)

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.