Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement optional argument for more command line options to be used in nmap? #4

Closed
ioncodes opened this issue Jan 30, 2020 · 7 comments
Assignees

Comments

@ioncodes
Copy link
Contributor

Can you add an argument which allows you to pass selected arguments to the process? For example like this:

import nmap3
nmap = nmap3.NmapScanTechniques()
nmap.nmap_tcp_scan(target, args="-Pn")
# or
nmap.nmap_tcp_scan(target, args=["-Pn"])
@nmmapper nmmapper self-assigned this Feb 2, 2020
@nmmapper
Copy link
Owner

nmmapper commented Feb 2, 2020

Hello @ioncodes I will look into this, as i trying to avoid something like that. But if it will add more functionality I will surely consider it. Thank you soo much.

@nmmapper
Copy link
Owner

nmmapper commented Feb 2, 2020

I was planning to add that feature

class NmapHostDiscovery(Nmap):
    """
    This object will perform host discovery
    1) Only port scan    (-Pn)
    2) Only host discover    (-sn)
    3) Arp discovery on a local network  (-PR)
    4) Disable DNS resolution    (-n)
    """
    pass

@nmmapper
Copy link
Owner

nmmapper commented Feb 2, 2020

But I will look into chaining as you suggested

@ioncodes
Copy link
Contributor Author

ioncodes commented Feb 3, 2020

Thanks for considering it! :)

@ioncodes
Copy link
Contributor Author

Any updates on this feature?

@nmmapper
Copy link
Owner

I am just beginning to work on it, hope to finish it quite soon.

@nmmapper
Copy link
Owner

Have began adding them, but might take some time to complete all of them

def nmap_tcp_scan(self, host, args=None):
        """
        Scan host using the nmap tcp connect

        @cmd nmap -sT 192.168.178.1
        """
        if(args):
            assert(isinstance(args, str)), "Expected string got {0} instead".format(type(args))
            
        tcp_scan = " {host} {default}".format(host=host, default=self.tcp_connt)
        tcp_scan_command = self.default_command() + tcp_scan
        if(args):
            tcp_scan_command += " {0}".format(args)

nmmapper pushed a commit that referenced this issue Feb 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants