Problems with Bash Script
I am pretty new to bash scripting and I am having some problems with the bash script I am tying to create. What it does is it reads in a text file list of sub-domains, then it uses the host command to determine if the sub-domain exists, and prints the domain and IP if it does. Then lastly it runs a masscan on the IP and prints the ports it found.
1.) First problem is this: Example Output from host command: root@xss:~# host mail.ru mail.ru has address 94.100.180.202 mail.ru has address 217.69.139.202 mail.ru has address 94.100.180.200 mail.ru has address 217.69.139.200 mail.ru has IPv6 address 2a00:1148:db00:0:b0b0::1 mail.ru mail is handled by 10 mxs.mail.ru. If the host command returns more then one IP address, like in the example above, my script only takes the first IP address then ignores the rest. I'd like it to print out all the IP addresses associated with the domain, the n scan them. 2.) The second problem is that the masscan results print on the page, I'd like it to only list the open ports it finds. it currently does this, but it prints it after all the masscan info that I'd like to omit. I know its a lot of loaded questions, but I'd really appreciate any help. Below is the script I'm working on. Code:
#!/bin/bash |
1 Attachment(s)
PS..I've attached an output of the current script if that helps.
Thanks again. |
Just playing around with it for a minute. This might give you an idea.
using mail Code:
#!/bin/bash Code:
userx@slack.it.netters:~ |
Here's a slightly different way of doing it, keeping in line with what you currently have.
Code:
#!/bin/bash |
Thank you both. I found both your posts very helpful. Individual - your post was exactly what I was looking for.
Thanks again, Scrag |
Quote:
|
All times are GMT -5. The time now is 06:13 PM. |