Solved Pro coder thì vào đây share cho cái này để bỏ Bitvise đi là vừa.

là sao baby
tới cái hàm Console.ReadLine(); nó dừng lại rồi . tới đó nó chờ mình enter mới close cái port~
nhưng sao xài trên firefox ko dc!

thì console tới đó enter là out chứ gì nữa...mà định chơi gui winform hay console đây má?:D
 
1. Phải download đúng file dll Renci này: http://www.mediafire.com/download/q01gp2l926a9qc6/Renci.SshNet.rar
2. Code demo SSH thành Socks5:


PHP:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Text.RegularExpressions;
using System.Threading;


using Renci;
using Renci.SshNet;

namespace VinaCaptcha_Test_SSH
{
    class Program
    {
        static void Main(string[] args)
        {
            SshClient client = new SshClient("219.94.63.62", 22, "guest", "guest");
            try
            {
                client.ConnectionInfo.Timeout = new TimeSpan(0, 0, 60);
                client.KeepAliveInterval = new TimeSpan(0, 0, 30);
                client.Connect();
            }
            catch
            {
                Console.WriteLine("Connect error");
                Console.ReadLine();
            }

            if (client.IsConnected)
            {
                //ForwardedPortLocal local = new ForwardedPortLocal("127.0.0.1", (uint) port, "ipinfo.io", 80);
                ForwardedPortDynamic local = new ForwardedPortDynamic("127.0.0.1", (uint)1100);
                local.RequestReceived += new EventHandler<Renci.SshNet.Common.PortForwardEventArgs>(local_RequestReceived);
                local.Exception += new EventHandler<Renci.SshNet.Common.ExceptionEventArgs>(local_Exception);
                client.AddForwardedPort(local);
              
                try
                {
                    local.Start();
                }
                catch
                {
                }

                Thread.Sleep(1000);
              
                if (local.IsStarted)
                {
                    Console.WriteLine("Socks5 on 127.0.0.1:1100 is ready");
                    Console.ReadLine();
                }

                //try
                //{
                //    local.Stop();
                //}
                //catch
                //{
                //}

                //try
                //{
                //    client.Disconnect();
                //    client.RemoveForwardedPort(local);
                //}
                //catch
                //{
                //}
                //try
                //{
                //    local.Dispose();
                //    client.Dispose();
                //}
                //catch
                //{
                //}

            }

        }

        static void local_Exception(object sender, Renci.SshNet.Common.ExceptionEventArgs e)
        {
            Console.WriteLine("Exception: "+e.Exception.Message);
            //throw new NotImplementedException();
        }

        static void local_RequestReceived(object sender, Renci.SshNet.Common.PortForwardEventArgs e)
        {
            Console.WriteLine("Request Received: " + e.OriginatorHost + ":" + e.OriginatorPort);
            //throw new NotImplementedException();
        }
    }
}
 
1. Phải download đúng file dll Renci này: http://www.mediafire.com/download/q01gp2l926a9qc6/Renci.SshNet.rar
2. Code demo SSH thành Socks5:


PHP:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Text.RegularExpressions;
using System.Threading;


using Renci;
using Renci.SshNet;

namespace VinaCaptcha_Test_SSH
{
    class Program
    {
        static void Main(string[] args)
        {
            SshClient client = new SshClient("219.94.63.62", 22, "guest", "guest");
            try
            {
                client.ConnectionInfo.Timeout = new TimeSpan(0, 0, 60);
                client.KeepAliveInterval = new TimeSpan(0, 0, 30);
                client.Connect();
            }
            catch
            {
                Console.WriteLine("Connect error");
                Console.ReadLine();
            }

            if (client.IsConnected)
            {
                //ForwardedPortLocal local = new ForwardedPortLocal("127.0.0.1", (uint) port, "ipinfo.io", 80);
                ForwardedPortDynamic local = new ForwardedPortDynamic("127.0.0.1", (uint)1100);
                local.RequestReceived += new EventHandler<Renci.SshNet.Common.PortForwardEventArgs>(local_RequestReceived);
                local.Exception += new EventHandler<Renci.SshNet.Common.ExceptionEventArgs>(local_Exception);
                client.AddForwardedPort(local);
             
                try
                {
                    local.Start();
                }
                catch
                {
                }

                Thread.Sleep(1000);
             
                if (local.IsStarted)
                {
                    Console.WriteLine("Socks5 on 127.0.0.1:1100 is ready");
                    Console.ReadLine();
                }

                //try
                //{
                //    local.Stop();
                //}
                //catch
                //{
                //}

                //try
                //{
                //    client.Disconnect();
                //    client.RemoveForwardedPort(local);
                //}
                //catch
                //{
                //}
                //try
                //{
                //    local.Dispose();
                //    client.Dispose();
                //}
                //catch
                //{
                //}

            }

        }

        static void local_Exception(object sender, Renci.SshNet.Common.ExceptionEventArgs e)
        {
            Console.WriteLine("Exception: "+e.Exception.Message);
            //throw new NotImplementedException();
        }

        static void local_RequestReceived(object sender, Renci.SshNet.Common.PortForwardEventArgs e)
        {
            Console.WriteLine("Request Received: " + e.OriginatorHost + ":" + e.OriginatorPort);
            //throw new NotImplementedException();
        }
    }
}
Đã tést nhưng ko dùng trên firefox dc.
 
Đã tést nhưng ko dùng trên firefox dc.
vào chỉnh cái proxy lại cho đúng theo code đi thím, như trên là hóst=127.0.0.1 và port=1100

@VinaCaptcha Post luôn đoạn check ssh bị gãy và reconnect lên luôn đê :D
 
Code:
The thread '<No Name>' (0x56fc) has exited with code 0 (0x0).
The thread '<No Name>' (0x57e8) has exited with code 0 (0x0).
The thread '<No Name>' (0x5408) has exited with code 0 (0x0).
SshNet.Logging Verbose: 1 : SendMessage to server 'IgnoreMessage': 'SSH_MSG_IGNORE'.
The thread '<No Name>' (0x544c) has exited with code 0 (0x0).
The thread '<No Name>' (0x3bdc) has exited with code 0 (0x0).
SshNet.Logging Verbose: 1 : SendMessage to server 'IgnoreMessage': 'SSH_MSG_IGNORE'.
 
vào chỉnh cái proxy lại cho đúng theo code đi thím, như trên là hóst=127.0.0.1 và port=1100

@VinaCaptcha Post luôn đoạn check ssh bị gãy và reconnect lên luôn đê :D
Reconnect tự làm được mà cậu ! Cứ cho loop trong threading và check nếu client.Isconnected == false thì client.Connect();
 
Code:
The thread '<No Name>' (0x56fc) has exited with code 0 (0x0).
The thread '<No Name>' (0x57e8) has exited with code 0 (0x0).
The thread '<No Name>' (0x5408) has exited with code 0 (0x0).
SshNet.Logging Verbose: 1 : SendMessage to server 'IgnoreMessage': 'SSH_MSG_IGNORE'.
The thread '<No Name>' (0x544c) has exited with code 0 (0x0).
The thread '<No Name>' (0x3bdc) has exited with code 0 (0x0).
SshNet.Logging Verbose: 1 : SendMessage to server 'IgnoreMessage': 'SSH_MSG_IGNORE'.
Pác gửi message gì tới ssh vậy?
 
Đã xài dc!
Không biết nếu làm tool chạy 500 con ssh cùng lúc mở 500 port thì dùng mul thread hay xài vòng lập v bác
 
Đã xài dc!
Không biết nếu làm tool chạy 500 con ssh cùng lúc mở 500 port thì dùng mul thread hay xài vòng lập v bác

Chạy được là kết nối đến browser rồi duyệt web bình thường chưa thím?
port thì dể thôi mà cho hàm random
 
1. Phải download đúng file dll Renci này: http://www.mediafire.com/download/q01gp2l926a9qc6/Renci.SshNet.rar
2. Code demo SSH thành Socks5:


PHP:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Text.RegularExpressions;
using System.Threading;


using Renci;
using Renci.SshNet;

namespace VinaCaptcha_Test_SSH
{
    class Program
    {
        static void Main(string[] args)
        {
            SshClient client = new SshClient("219.94.63.62", 22, "guest", "guest");
            try
            {
                client.ConnectionInfo.Timeout = new TimeSpan(0, 0, 60);
                client.KeepAliveInterval = new TimeSpan(0, 0, 30);
                client.Connect();
            }
            catch
            {
                Console.WriteLine("Connect error");
                Console.ReadLine();
            }

            if (client.IsConnected)
            {
                //ForwardedPortLocal local = new ForwardedPortLocal("127.0.0.1", (uint) port, "ipinfo.io", 80);
                ForwardedPortDynamic local = new ForwardedPortDynamic("127.0.0.1", (uint)1100);
                local.RequestReceived += new EventHandler<Renci.SshNet.Common.PortForwardEventArgs>(local_RequestReceived);
                local.Exception += new EventHandler<Renci.SshNet.Common.ExceptionEventArgs>(local_Exception);
                client.AddForwardedPort(local);
             
                try
                {
                    local.Start();
                }
                catch
                {
                }

                Thread.Sleep(1000);
             
                if (local.IsStarted)
                {
                    Console.WriteLine("Socks5 on 127.0.0.1:1100 is ready");
                    Console.ReadLine();
                }

                //try
                //{
                //    local.Stop();
                //}
                //catch
                //{
                //}

                //try
                //{
                //    client.Disconnect();
                //    client.RemoveForwardedPort(local);
                //}
                //catch
                //{
                //}
                //try
                //{
                //    local.Dispose();
                //    client.Dispose();
                //}
                //catch
                //{
                //}

            }

        }

        static void local_Exception(object sender, Renci.SshNet.Common.ExceptionEventArgs e)
        {
            Console.WriteLine("Exception: "+e.Exception.Message);
            //throw new NotImplementedException();
        }

        static void local_RequestReceived(object sender, Renci.SshNet.Common.PortForwardEventArgs e)
        {
            Console.WriteLine("Request Received: " + e.OriginatorHost + ":" + e.OriginatorPort);
            //throw new NotImplementedException();
        }
    }
}

Còn kết giai đoạn kết nối đến browser và fake = sock5 đó và duyệt web thì sao pro? :(
 
Chạy được là kết nối đến browser rồi duyệt web bình thường chưa thím?
port thì dể thôi mà cho hàm random
Mình làm chạy 500 thread chạy 500 con SSH rùi! open port từ 1001 -> 1500
Nhưng cảm thấy tốc độ connect ko nhanh lắm.
Cái mul thread của mình hình như 1 thread phải chạy rồi thì thread tiếp theo mới chạy.
Không biết làm cách nào để khởi động 500 thread cùng lúc
 
Mình làm chạy 500 thread chạy 500 con SSH rùi! open port từ 1001 -> 1500
Nhưng cảm thấy tốc độ connect ko nhanh lắm.
Cái mul thread của mình hình như 1 thread phải chạy rồi thì thread tiếp theo mới chạy.
Không biết làm cách nào để khởi động 500 thread cùng lúc

Theard là để chạy 2 tiến trình cùng lúc mà bác. Mình củng đang vướng khúc này. Nhưng thấy mấy thằng bạn làm được nhưng ngại hỏi.

Có mắt, chân, tay + đầu nghiên cứu thêm 1 thời gian nữa xem sao.
 
Còn kết giai đoạn kết nối đến browser và fake = sock5 đó và duyệt web thì sao pro? :(

Khi nào bác hỏi luôn được source luôn thì share em với nhé :) Thank bác trước ! Mình tính đợi thớt để sài thử tool này nhưng nếu bác xin được soucre và share mình thì còn gì bằng.
 
Theard là để chạy 2 tiến trình cùng lúc mà bác. Mình củng đang vướng khúc này. Nhưng thấy mấy thằng bạn làm được nhưng ngại hỏi.


Có mắt, chân, tay + đầu nghiên cứu thêm 1 thời gian nữa xem sao.

Cảm giác nó vẫn không tối ựu giống như tiến trình này thực hiện xong thì tiến trình kia mới vạo
SAo thấy mày tool check ssh check nhanh v tạ Dùng thuật toán nào vs thread để tối ưu nhĩ . 500 thread của mình
Code:
 for (int i = 1; i <= 500; i++)
            {
                try
                {
                    if ((line = file.ReadLine()) != null)
                    {
                       // Console.WriteLine(line);
                        string[] words = line.Split('|');
                        if (words[1] != null)
                        {
                            try
                            {
                                SSHThread[i] = new Thread(() => sshThread(words[0], words[1], words[2], i));
                                SSHThread[i].Start();
                                Thread.Sleep(1);
                            }
                            catch(Exception e)
                            {

                            }
                        }
                    }
                }
                catch
                {

                }
            }
 
Mình làm chạy 500 thread chạy 500 con SSH rùi! open port từ 1001 -> 1500
Nhưng cảm thấy tốc độ connect ko nhanh lắm.
Cái mul thread của mình hình như 1 thread phải chạy rồi thì thread tiếp theo mới chạy.
Không biết làm cách nào để khởi động 500 thread cùng lúc

ông thánh! cái kết nối đến browser dc chưa mà thia với thịa?
cho for chạy đi treo luôn....soft trâu hay sao mà 500 thread cùng lúc:confused:
 
Cảm giác nó vẫn không tối ựu giống như tiến trình này thực hiện xong thì tiến trình kia mới vạo
SAo thấy mày tool check ssh check nhanh v tạ Dùng thuật toán nào vs thread để tối ưu nhĩ . 500 thread của mình
Code:
 for (int i = 1; i <= 500; i++)
            {
                try
                {
                    if ((line = file.ReadLine()) != null)
                    {
                       // Console.WriteLine(line);
                        string[] words = line.Split('|');
                        if (words[1] != null)
                        {
                            try
                            {
                                SSHThread[i] = new Thread(() => sshThread(words[0], words[1], words[2], i));
                                SSHThread[i].Start();
                                Thread.Sleep(1);
                            }
                            catch(Exception e)
                            {

                            }
                        }
                    }
                }
                catch
                {

                }
            }
Thím quất như này thì 1 lần nó chạy 500 thread luôn rồi :D
 

Announcements

Today's birthdays

Forum statistics

Threads
421,496
Messages
7,111,194
Members
173,671
Latest member
cavoidelltin

Most viewed of week

Most viewed of week

Back
Top Bottom