Beispiel #1
0
    def query(self):
        """ Returns the DNS query """

        dig_cmd = 'dig {0} @{1} {2}'.format(self.domain, self.dns,
                                            self.query_type)
        dig_ptr_cmd = 'dig -x {0} @{1}'.format(self.domain, self.dns)

        if self.query_type.lower() == 'ptr':
            out = runsub.cmd(dig_ptr_cmd)
            return out[1]

        else:
            out = runsub.cmd(dig_cmd)

            return out[1]
Beispiel #2
0
    def query(self):
        """ Executes the whois on the domain """

        whois_cmd = 'whois {0}'.format(self.domain)
        out = runsub.cmd(whois_cmd)

        return out[1]
Beispiel #3
0
    def run(self):
        """ Executes the nmap to the host """

        nmap_cmd = 'map {0}'.format(self.address)
        out = runsub.cmd(nmap_cmd)

        return out[1]
Beispiel #4
0
    def trace(self):
        """ Executes the trace route to address """

        traceroute_cmd = '/usr/sbin/traceroute -n -A {0}'.format(self.address)
        out = runsub.cmd(traceroute_cmd)

        return out[1]
Beispiel #5
0
    def do(self):
        """  Executes the ping to the address """

        ping_cmd = 'ping -c 4 {0}'.format(self.address)
        out = runsub.cmd(ping_cmd)
        return out[1]