I have file IP.txt
:
192.168.69.100
192.168.69.141
I also have file Ports.txt
:
open port: 21 on IP: 192.168.69.100 with banner:
220 FTP server ready
open port: 22 on IP: 192.168.69.100 with banner:
SSH-OpenSSH
open port: 21 on IP: 192.168.69.141 with banner:
220 FTP server ready
open port: 22 on IP: 192.168.69.141 with banner:
SSH-OpenSSH
I need the 2 files merged into Results.txt
, like so:
192.168.69.100
open port: 21 on IP: 192.168.69.100 with banner:
220 FTP server ready
open port: 22 on IP: 192.168.69.100 with banner:
SSH-OpenSSH
192.168.69.141
open port: 21 on IP: 192.168.69.141 with banner:
220 FTP server ready
open port: 22 on IP: 192.168.69.141 with banner:
SSH-OpenSSH
Note how there is a new line empty space after the port's banner and before the next IP.
So, to grab the open port... on 192.168.69....
line and the line below it, then place them after the 192.168.69....
line, then finally adding a new empty line.
How can i achieve this?