Password scrambling for Proxy Sock

Forum / NoMachine for Linux / Password scrambling for Proxy Sock

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #45946
    Oscar18
    Participant

    Hello,

    Im trying to dynamically generate nxs files but Im stuck on the Proxy Sock authentication password.

    I’ve managed to scramble the password of the user password authentication of the target node, that works fine.

    The Proxy Socks password though looks nothing like the generated one.

    For example if I type it in the UI of NoMachine. The field in the NXS file looks like:

    <option key=”HTTP proxy password” value=”:123:456:78:123:45:67:89:12:34:” />

    But using the perl script scramble_alg.pl I get a password in this format: Mj!3Kmz8Np(:Qs(?Tv2AWy4DZ|8Oix3JlO

    Is the Proxy password algorithm different?

     

    #45954
    Britgirl
    Keymaster

    Hi,

    for compatibility with old client versions, that were using only part of the scrambling algorithm, you should modify the perl script to just call the encodePassword routine for the proxy password.

    #45961
    Oscar18
    Participant

    Thank you Britgirl.

    For anyone interested here’s the modified file:

    #!/usr/bin/env perl

    use strict;

    #
    # ./encode_password.pl password
    #
    my $password = $ARGV[0];

    if ($password) {
    my $encodedPassword = encodePassword($password);
    print “$encodedPassword\n”;
    } else {
    print “Please provide a password as an argument.\n”;
    }

    sub encodePassword {
    my $p = shift;
    my $sPass = “:”;
    my $sTmp = “”;

    if (!$p) {
    return “”;
    }

    for (my $i = 0; $i < length($p); $i++) {
    my $c = substr($p, $i, 1);
    my $a = ord($c);

    $sTmp = ($a + $i + 1) . “:”;
    $sPass .= $sTmp;
    $sTmp = “”;
    }

    return $sPass;
    }

Viewing 3 posts - 1 through 3 (of 3 total)

This topic was marked as solved, you can't post.