mirror of
				https://github.com/jtesta/ssh-audit.git
				synced 2025-10-30 13:05:26 +01:00 
			
		
		
		
	Add kex/pkm payload generation.
This commit is contained in:
		
							
								
								
									
										39
									
								
								ssh-audit.py
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								ssh-audit.py
									
									
									
									
									
								
							| @@ -247,6 +247,27 @@ class SSH2(object): | |||||||
| 		def unused(self): | 		def unused(self): | ||||||
| 			return self.__unused | 			return self.__unused | ||||||
| 		 | 		 | ||||||
|  | 		def write(self, wbuf): | ||||||
|  | 			wbuf.write(self.cookie) | ||||||
|  | 			wbuf.write_list(self.kex_algorithms) | ||||||
|  | 			wbuf.write_list(self.key_algorithms) | ||||||
|  | 			wbuf.write_list(self.client.encryption) | ||||||
|  | 			wbuf.write_list(self.server.encryption) | ||||||
|  | 			wbuf.write_list(self.client.mac) | ||||||
|  | 			wbuf.write_list(self.server.mac) | ||||||
|  | 			wbuf.write_list(self.client.compression) | ||||||
|  | 			wbuf.write_list(self.server.compression) | ||||||
|  | 			wbuf.write_list(self.client.languages) | ||||||
|  | 			wbuf.write_list(self.server.languages) | ||||||
|  | 			wbuf.write_bool(self.follows) | ||||||
|  | 			wbuf.write_int(self.__unused) | ||||||
|  | 		 | ||||||
|  | 		@property | ||||||
|  | 		def payload(self): | ||||||
|  | 			wbuf = WriteBuf() | ||||||
|  | 			self.write(wbuf) | ||||||
|  | 			return wbuf.write_flush() | ||||||
|  | 		 | ||||||
| 		@classmethod | 		@classmethod | ||||||
| 		def parse(cls, payload): | 		def parse(cls, payload): | ||||||
| 			buf = ReadBuf(payload) | 			buf = ReadBuf(payload) | ||||||
| @@ -403,6 +424,24 @@ class SSH1(object): | |||||||
| 					auths.append(SSH1.AUTHS[i]) | 					auths.append(SSH1.AUTHS[i]) | ||||||
| 			return auths | 			return auths | ||||||
| 		 | 		 | ||||||
|  | 		def write(self, wbuf): | ||||||
|  | 			wbuf.write(self.cookie) | ||||||
|  | 			wbuf.write_int(self.server_key_bits) | ||||||
|  | 			wbuf.write_mpint1(self.server_key_public_exponent) | ||||||
|  | 			wbuf.write_mpint1(self.server_key_public_modulus) | ||||||
|  | 			wbuf.write_int(self.host_key_bits) | ||||||
|  | 			wbuf.write_mpint1(self.host_key_public_exponent) | ||||||
|  | 			wbuf.write_mpint1(self.host_key_public_modulus) | ||||||
|  | 			wbuf.write_int(self.protocol_flags) | ||||||
|  | 			wbuf.write_int(self.supported_ciphers_mask) | ||||||
|  | 			wbuf.write_int(self.supported_authentications_mask) | ||||||
|  | 		 | ||||||
|  | 		@property | ||||||
|  | 		def payload(self): | ||||||
|  | 			wbuf = WriteBuf() | ||||||
|  | 			self.write(wbuf) | ||||||
|  | 			return wbuf.write_flush() | ||||||
|  | 		 | ||||||
| 		@classmethod | 		@classmethod | ||||||
| 		def parse(cls, payload): | 		def parse(cls, payload): | ||||||
| 			buf = ReadBuf(payload) | 			buf = ReadBuf(payload) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Andris Raugulis
					Andris Raugulis