Пример #1
0
		/// <exception cref="System.Exception"></exception>
		internal override void DoRequest(Session session, Channel channel)
		{
			base.DoRequest(session, channel);
			Buffer buf = new Buffer();
			Packet packet = new Packet(buf);
			// byte      SSH_MSG_CHANNEL_REQUEST(98)
			// uint32 recipient channel
			// string request type        // "x11-req"
			// boolean want reply         // 0
			// boolean   single connection
			// string    x11 authentication protocol // "MIT-MAGIC-COOKIE-1".
			// string    x11 authentication cookie
			// uint32    x11 screen number
			packet.Reset();
			buf.PutByte(unchecked((byte)Session.SSH_MSG_CHANNEL_REQUEST));
			buf.PutInt(channel.GetRecipient());
			buf.PutString(Util.Str2byte("x11-req"));
			buf.PutByte(unchecked((byte)(WaitForReply() ? 1 : 0)));
			buf.PutByte(unchecked((byte)0));
			buf.PutString(Util.Str2byte("MIT-MAGIC-COOKIE-1"));
			buf.PutString(ChannelX11.GetFakedCookie(session));
			buf.PutInt(0);
			Write(packet);
			session.x11_forwarding = true;
		}
Пример #2
0
		/// <exception cref="System.Exception"></exception>
		public virtual bool Start(Session session)
		{
			this.userinfo = session.GetUserInfo();
			this.packet = session.packet;
			this.buf = packet.GetBuffer();
			this.username = session.GetUserName();
			return true;
		}
Пример #3
0
		/// <exception cref="System.Exception"></exception>
		internal override void DoRequest(Session session, Channel channel)
		{
			base.DoRequest(session, channel);
			Buffer buf = new Buffer();
			Packet packet = new Packet(buf);
			packet.Reset();
			buf.PutByte(unchecked((byte)Session.SSH_MSG_CHANNEL_REQUEST));
			buf.PutInt(channel.GetRecipient());
			buf.PutString(Util.Str2byte("subsystem"));
			buf.PutByte(unchecked((byte)(WaitForReply() ? 1 : 0)));
			buf.PutString(Util.Str2byte(subsystem));
			Write(packet);
		}
Пример #4
0
		/// <exception cref="System.Exception"></exception>
		internal override void DoRequest(Session session, Channel channel)
		{
			base.DoRequest(session, channel);
			Buffer buf = new Buffer();
			Packet packet = new Packet(buf);
			// send
			// byte     SSH_MSG_CHANNEL_REQUEST(98)
			// uint32 recipient channel
			// string request type       // "shell"
			// boolean want reply        // 0
			packet.Reset();
			buf.PutByte(unchecked((byte)Session.SSH_MSG_CHANNEL_REQUEST));
			buf.PutInt(channel.GetRecipient());
			buf.PutString(Util.Str2byte("shell"));
			buf.PutByte(unchecked((byte)(WaitForReply() ? 1 : 0)));
			Write(packet);
		}
Пример #5
0
		/// <exception cref="System.Exception"></exception>
		internal override void DoRequest(Session session, Channel channel)
		{
			base.DoRequest(session, channel);
			SetReply(false);
			Buffer buf = new Buffer();
			Packet packet = new Packet(buf);
			// byte      SSH_MSG_CHANNEL_REQUEST(98)
			// uint32 recipient channel
			// string request type        // "*****@*****.**"
			// boolean want reply         // 0
			packet.Reset();
			buf.PutByte(unchecked((byte)Session.SSH_MSG_CHANNEL_REQUEST));
			buf.PutInt(channel.GetRecipient());
			buf.PutString(Util.Str2byte("*****@*****.**"));
			buf.PutByte(unchecked((byte)(WaitForReply() ? 1 : 0)));
			Write(packet);
			session.agent_forwarding = true;
		}
Пример #6
0
		/// <exception cref="System.Exception"></exception>
		internal override void DoRequest(Session session, Channel channel)
		{
			base.DoRequest(session, channel);
			Buffer buf = new Buffer();
			Packet packet = new Packet(buf);
			packet.Reset();
			buf.PutByte(unchecked((byte)Session.SSH_MSG_CHANNEL_REQUEST));
			buf.PutInt(channel.GetRecipient());
			buf.PutString(Util.Str2byte("pty-req"));
			buf.PutByte(unchecked((byte)(WaitForReply() ? 1 : 0)));
			buf.PutString(Util.Str2byte(ttype));
			buf.PutInt(tcol);
			buf.PutInt(trow);
			buf.PutInt(twp);
			buf.PutInt(thp);
			buf.PutString(terminal_mode);
			Write(packet);
		}
Пример #7
0
		/// <exception cref="System.Exception"></exception>
		internal override void DoRequest(Session session, Channel channel)
		{
			base.DoRequest(session, channel);
			Buffer buf = new Buffer();
			Packet packet = new Packet(buf);
			//byte      SSH_MSG_CHANNEL_REQUEST
			//uint32    recipient_channel
			//string    "window-change"
			//boolean   FALSE
			//uint32    terminal width, columns
			//uint32    terminal height, rows
			//uint32    terminal width, pixels
			//uint32    terminal height, pixels
			packet.Reset();
			buf.PutByte(unchecked((byte)Session.SSH_MSG_CHANNEL_REQUEST));
			buf.PutInt(channel.GetRecipient());
			buf.PutString(Util.Str2byte("window-change"));
			buf.PutByte(unchecked((byte)(WaitForReply() ? 1 : 0)));
			buf.PutInt(width_columns);
			buf.PutInt(height_rows);
			buf.PutInt(width_pixels);
			buf.PutInt(height_pixels);
			Write(packet);
		}
Пример #8
0
		public Packet(Buffer buffer)
		{
			this.buffer = buffer;
		}