Exemplo n.º 1
0
Arquivo: Job.cs Projeto: 0x0mar/Xploit
        /// <summary>
        /// Create a new job
        /// </summary>
        /// <param name="cmd">Command</param>
        /// <param name="obj">Object for dispose</param>
        public static Job Create(IModule module, IJobable obj)
        {
            if (module == null || obj == null) return null;

            Job j = new Job(obj, module.FullPath);
            // Append to global list
            JobCollection.Current.Add(j);

            module.WriteInfo(Lang.Get("Job_Created"), j.Id.ToString(), ConsoleColor.Green);
            return j;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create a new job
        /// </summary>
        /// <param name="cmd">Command</param>
        /// <param name="obj">Object for dispose</param>
        public static Job Create(IModule module, IJobable obj)
        {
            if (module == null || obj == null)
            {
                return(null);
            }

            Job j = new Job(obj, module.FullPath);

            // Append to global list
            JobCollection.Current.Add(j);

            module.WriteInfo(Lang.Get("Job_Created"), j.Id.ToString(), ConsoleColor.Green);
            return(j);
        }
Exemplo n.º 3
0
        public override bool Run()
        {
            ForwardedPort port;

            switch (Method)
            {
            default:
            case EForwardMethod.LocalToRemote:
            {
                port = new ForwardedPortRemote(RemoteHost.Address, (uint)RemoteHost.Port, LocalHost.Address, (uint)LocalHost.Port);
                break;
            }

            case EForwardMethod.RemoteToLocal:
            {
                port = new ForwardedPortLocal(LocalHost.Address.ToString(), (uint)LocalHost.Port, RemoteHost.Address.ToString(), (uint)RemoteHost.Port);
                break;
            }
            }

            WriteInfo("Connecting ...");

            SshClient SSH = new SshClient(Host.Address.ToString(), Host.Port, User, Password);

            SSH.Connect();
            WriteInfo("Connected successful");

            Thread thread = new Thread(new ParameterizedThreadStart(jobRun));

            thread.IsBackground = true;
            thread.Name         = "SSH-PortForwarding";

            thread.Start(new object[] { SSH, port });

            IJobable job = thread;

            job.Tag        = SSH;
            job.DisposeTag = true;

            CreateJob(job);
            return(true);
        }
Exemplo n.º 4
0
Arquivo: Job.cs Projeto: 0x0mar/Xploit
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="obj">Object</param>
 /// <param name="fullPathModule">FullPath module</param>
 private Job(IJobable obj, string fullPathModule)
 {
     _Object = obj;
     _FullPathModule = fullPathModule;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="obj">Object</param>
 /// <param name="fullPathModule">FullPath module</param>
 private Job(IJobable obj, string fullPathModule)
 {
     _Object         = obj;
     _FullPathModule = fullPathModule;
 }