Простая задача раздать SSH на сокс, SSH уже реализован C# Console APP
Все что мне требуется это что бы вы скачали библиотеку Renci.SshNet по этой ссылке https://sshnet.codeplex.com/releases/view/120565
Скачивать нужно SshNet .NET 4.0 Binary Эту библиотеку добавить как ссылку для проекта, я работаю в мшыгфд 2013, по этому будет отлично если исходник будет в этой же среде.
Вам нужно обычное консольное C# приложение.
Как видите SSH с ключем и прочими вещами у меня реализован, вам остается сделать после порта форвардинг раздачу на сокс с авторизацией по логину и паролю т.е. сокс5 протокол
Сейчас у меня запуск ssh происходит
SSH client = new SSH("50.247.55.153", 22, "admin", "123123"); как видите здесь только SSH логин и пароль, также сюда нужно добавить порт на который мы хотим раздать сокс, а также логин и пароль и что бы это запускалось в новом потоке, как с потоками работать я полагаю вы и без меня знаете и сделаете. Строка запуска нового SSH должна выглядеть после вашнй работы так SSH("50.247.55.153", 22, "admin", "123123", "SOCKS5_PORT", "SOCKS5_LOGIN", "SOCKS5_PASS");
Задача простая, по этому и плачу соответственно. Если этот SSH будет занят исполнителю выдам новый. Реализовать нужно быстро, сегодня все должно работать! Оплата WMZ
А вот и сам скрипт
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.IO;
using System.Net;
using System.Text.RegularExpressions;
using System.Threading;
using Renci.SshNet;
using Renci.SshNet.Common;
namespace ProxyEasyWithThreads
{
public class SSH
{
string servername;
int port;
string username;
string password;
SshClient Server = null;
public SSH(string servername, int port, string username, string password)
{
this.servername = servername;
this.port = port;
this.username = username;
this.password = password;
this.ssh_sess();
}
private void ssh_sess()
{
KeyboardInteractiveAuthenticationMethod kauth = new KeyboardInteractiveAuthenticationMethod(this.username);
PasswordAuthenticationMethod pauth = new PasswordAuthenticationMethod(this.username, this.password);
kauth.AuthenticationPrompt += new EventHandler<AuthenticationPromptEventArgs>(HandleKeyEvent);
this.Server = new SshClient(new ConnectionInfo(this.servername, this.port, this.username, pauth, kauth));
Console.WriteLine("Connected");
try
{
Console.WriteLine("Start connection");
Server.Connect();
Console.WriteLine("Connected");
if (Server.IsConnected)
{
try
{
ForwardedPortDynamic prt;
prt = new ForwardedPortDynamic("127.0.0.1", 1080);
Server.AddForwardedPort(prt);
prt.Start();
Console.WriteLine("Port forwarding start");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message.ToString());
}
}
}
catch (Exception e)
{
Console.WriteLine(e.Message.ToString());
}
}
void HandleKeyEvent(Object sender, AuthenticationPromptEventArgs e)
{
foreach (AuthenticationPrompt prompt in e.Prompts)
{
if (prompt.Request.IndexOf("Password:", StringComparison.InvariantCultureIgnoreCase) != -1)
{
prompt.Response = this.password;
}
}
}
static void Main()
{
SSH client = new SSH("50.247.55.153", 22, "admin", "123123");
Console.ReadLine();
}
}
}
-
2 days200 USD
967 57 0 2 days200 USDЗдравствуйте!
Выполню Вашу задачу!
Свяжитесь со мной:
Current freelance projects in the category C#
A small game for Unity 2DThe technical specifications are here, the scene, UI, and graphics are already available, only programming is needed https://www.figma.com/design/btykPl7Odr8ggvwmTqO8pH/Robo-Loop?node-id=0-1&t=vlanszjRgKHH5U5m-1 C# ∙ 1 day 19 hours back ∙ 15 proposals |
Comparative analysis of the effectiveness of custom software (v2.2-field) and reference software (Meshtastic v2.x)
22 USD
Comparative analysis of the effectiveness of custom software (v2.2-field) and reference software (Meshtastic v2.x) on the identical hardware platform (ESP32 + SX1268, 2W) based on the criteria of range, throughput, link stability, and power consumption. Conduct tests with… C & C++, C# ∙ 5 days 21 hours back ∙ 2 proposals |
Creation of a plugin for integration with the POS system Syrve, C#Develop a plugin for the Syrve POS system (on-premise), which is installed on the establishment's server. The plugin must: (1) transmit data to our server in real-time — orders, table statuses, payments, receipts; (2) receive commands from Reservble — booking confirmations,… C#, Web Programming ∙ 8 days 17 hours back ∙ 14 proposals |