Total Commander Odzyskanie Hasła FTP — SDK

Dekoduj hasła FTP z Total Commandera. Oficjalne pakiety dla PHP, Pythona, JavaScript (Node.js), Rusta, C#, Go, Javy, PowerShell i Ruby.

Opis

Biblioteki Total Commander FTP Password Recovery implementują ten sam algorytm dekodowania co ta strona. Każda działa offline u Ciebie na komputerze — nadaje się do dekodowania pól hex z pliku wcx_ftp.ini lub do budowy własnych narzędzi. Wejściowy hex można wklejać elastycznie (wielkość liter bez znaczenia; dozwolone odstępy między parami bajtów), co ułatwia kopiowanie z pliku .ini.

Instalacja

Pakiety znajdują się na Packagist, PyPI, npm, crates.io, NuGet, pkg.go.dev, Maven, PowerShell Gallery i RubyGems. Kod źródłowy jest na GitHubie.

Język Instalacja Paczka Źródła
Język programowania PHP

Uruchom komendę:

php composer.phar require --prefer-dist pelock/total-commander-ftp-password-recovery "*"

lub dodaj do sekcji require w pliku konfiguracyjnym composer.json wpis:

"pelock/total-commander-ftp-password-recovery": "*"
Packagist GitHub
Język programowania Python pip install total-commander-ftp-password-recovery PyPI GitHub
Język programowania JavaScript

Uruchom komendę:

npm install total-commander-ftp-password-recovery

lub dodaj do sekcji dependencies w pliku konfiguracyjnym package.json wpis:

"dependencies": {
  "total-commander-ftp-password-recovery": "latest"
},

npm GitHub
Rust / Cargo

Uruchom komendę:

cargo add total-commander-ftp-password-recovery

lub dodaj wpis do sekcji [dependencies] w pliku Cargo.toml:

total-commander-ftp-password-recovery = "1"
Crates GitHub
Repozytorium NuGet

Uruchom komendę:

dotnet add package PELock.TotalCommanderFtpPasswordRecovery

lub dodaj do pliku .csproj:

<PackageReference Include="PELock.TotalCommanderFtpPasswordRecovery" Version="1.0.1" />
NuGet GitHub
Pakiety modułów Go

Uruchom komendę:

go get github.com/PELock/Total-Commander-FTP-Password-Recovery-Go

lub dodaj poniższy wpis do pliku go.mod

require github.com/PELock/Total-Commander-FTP-Password-Recovery-Go v1.0.1
Go GitHub
Centralne Repozytorium Maven Dodaj tę zależność do pliku pom.xml
<dependency>
  <groupId>com.pelock</groupId>
  <artifactId>total-commander-ftp-password-recovery</artifactId>
  <version>1.0.1</version>
</dependency>
Maven GitHub
PowerShell Gallery

Uruchom komendę:

Install-Module -Name TotalCommanderFtpPasswordRecovery

lub:

Install-PSResource -Name TotalCommanderFtpPasswordRecovery

PowerShell Gallery GitHub
Repozytorium RubyGems

Uruchom komendę:

gem install total-commander-ftp-password-recovery

lub dodaj poniższy wpis do pliku Gemfile

gem "total-commander-ftp-password-recovery"
RubyGems GitHub

Przykłady użycia

Dekodowanie pojedynczego ciągu hex (ciphertext)

<?php

declare(strict_types=1);

require __DIR__ . '/vendor/autoload.php';

use PELock\TotalCommanderFtpPassword\TotalCommanderPasswordDecoder;

$cipherHex = '00112233445566778899aabbccddeeff';

$decoder = new TotalCommanderPasswordDecoder();
$plain = $decoder->decryptPassword($cipherHex);

if ($plain === false) {
    throw new RuntimeException('Invalid ciphertext (bad hex, odd length, or too short).');
}

echo $plain;
echo bin2hex($plain);
from binascii import hexlify

from total_commander_ftp_password import TotalCommanderPasswordDecoder

cipher_hex = "00112233445566778899aabbccddeeff"

decoder = TotalCommanderPasswordDecoder()
plain = decoder.decrypt_password(cipher_hex)

if plain is None:
    raise RuntimeError("Invalid ciphertext (bad hex, odd length, or too short).")

print(plain)
print(hexlify(plain).decode("ascii"))
import { Buffer } from 'node:buffer';
import { TotalCommanderPasswordDecoder } from 'total-commander-ftp-password-recovery';

const cipherHex = '00112233445566778899aabbccddeeff';

const decoder = new TotalCommanderPasswordDecoder();
const plain = decoder.decryptPassword(cipherHex);

if (plain === null) {
  throw new Error('Invalid ciphertext (bad hex, odd length, or too short).');
}

console.log(Buffer.from(plain).toString('latin1'));
console.log(Buffer.from(plain).toString('hex'));
use total_commander_ftp_password_recovery::TotalCommanderPasswordDecoder;

let cipher_hex = "00112233445566778899aabbccddeeff";

let mut decoder = TotalCommanderPasswordDecoder::new();
let plain = decoder
    .decrypt_password(cipher_hex)
    .expect("Invalid ciphertext (bad hex, odd length, or too short).");

let latin1: String = plain.iter().map(|&b| char::from(b)).collect();
println!("{latin1}");

print!("hex: ");
for b in &plain {
    print!("{b:02x}");
}
println!();
/******************************************************************************
 * Total Commander FTP Password Recovery usage example.
 *
 * Version        : v1.0.1
 * Language       : C#
 * Author         : Bartosz Wójcik
 * Web page       : https://www.pelock.com
 *
 *****************************************************************************/

using PELock.TotalCommanderFtpPasswordRecovery;

const string cipherHex = "00112233445566778899aabbccddeeff";
var decoder = new TotalCommanderPasswordDecoder();
var plain = decoder.DecryptPassword(cipherHex);

if (plain is null)
{
    Console.Error.WriteLine("Decode failed.");
    return 1;
}

Console.WriteLine(System.Text.Encoding.Latin1.GetString(plain));
Console.WriteLine("hex: " + Convert.ToHexString(plain).ToLowerInvariant());
return 0;
/******************************************************************************
 * Total Commander FTP Password Recovery usage example.
 *
 * Version        : v1.0.1
 * Language       : Go
 * Author         : Bartosz Wójcik
 * Web page       : https://www.pelock.com
 *
 *****************************************************************************/

package main

import (
	"encoding/hex"
	"fmt"
	"os"

	totalcommanderftppasswordrecovery "github.com/PELock/Total-Commander-FTP-Password-Recovery-Go"
)

func main() {
	const cipherHex = "00112233445566778899aabbccddeeff"
	decoder := totalcommanderftppasswordrecovery.New()
	plain, err := decoder.DecryptPassword(cipherHex)
	if err != nil {
		fmt.Fprintln(os.Stderr, "Decode failed.")
		os.Exit(1)
	}
	fmt.Println(string(plain))
	fmt.Println("hex: " + hex.EncodeToString(plain))
}
/******************************************************************************
 * Total Commander FTP Password Recovery usage example.
 *
 * Version        : v1.0.1
 * Language       : Java
 * Author         : Bartosz Wójcik
 * Web page       : https://www.pelock.com
 *
 *****************************************************************************/

import com.pelock.totalcommander.TotalCommanderPasswordDecoder;

public class BasicUsage {

  public static void main(String[] args) {
    String cipherHex = "00112233445566778899aabbccddeeff";
    TotalCommanderPasswordDecoder decoder = new TotalCommanderPasswordDecoder();
    byte[] plain = decoder.decryptPassword(cipherHex);

    if (plain == null) {
      System.err.println("Decode failed.");
      System.exit(1);
    }

    System.out.println(decoder.decryptPasswordString(cipherHex));
    StringBuilder hex = new StringBuilder();
    for (byte b : plain) {
      hex.append(String.format("%02x", b & 0xFF));
    }
    System.out.println("hex: " + hex);
  }
}
################################################################################
#
# Total Commander FTP password decoder usage example.
#
# Decrypt a hex password stored in wcx_ftp.ini.
#
# Version        : v1.0.0
# Language       : PowerShell
# Author         : Bartosz Wójcik
# Web page       : https://www.pelock.com
#
################################################################################

using module TotalCommanderFtpPasswordRecovery

$decoder = New-TotalCommanderPasswordDecoder
$bytes = $decoder.DecryptPassword('00112233445566778899aabbccddeeff')

if ($null -eq $bytes) {
    Write-Host 'Could not decrypt the password (invalid hex or too short).'
}
else {
    $hex = [BitConverter]::ToString($bytes).Replace('-', '').ToLowerInvariant()
    Write-Host ("Decrypted bytes (hex): {0}" -f $hex)
}
# frozen_string_literal: true

###############################################################################
#
# Total Commander FTP Password Recovery
#
# Version        : v1.0.1
# Language       : Ruby
# Author         : Bartosz Wójcik
# Web page       : https://www.pelock.com
#
###############################################################################

require "total-commander-ftp-password-recovery"

cipher_hex = "00112233445566778899aabbccddeeff"
decoder = TotalCommanderPasswordDecoder.new
plain = decoder.decrypt_password(cipher_hex)

if plain.nil?
  warn "Decode failed."
  exit 1
end

puts decoder.decrypt_password_string(cipher_hex)
puts "hex: #{plain.map { |b| format("%02x", b) }.join}"

Pomocnicze narzędzia wiersza poleceń

Każdy pakiet udostępnia program tc-ftp-password-decode (np. przez vendor/bin w Composerze, skrypt pip, npx albo cargo install). Przykład:

tc-ftp-password-decode 00112233445566778899aabbccddeeff

Wymagane pakiety

Masz pytania?

Jeśli chcesz zapytać o biblioteki SDK do odzyskiwania hasła FTP w Total Commanderze albo coś jest niejasne, napisz do mnie. Z chęcią odpowiem.