Re: Python & nmap

2022-05-20 Thread Loris Bennett
Lars Liedtke writes: > Ansible has got a shell module, so you could run custom commands on all > hosts. But it gets more difficult in parsing the output afterwards. If you just want to copy files, pdsh[1] or clush[2] might be enough. Cheers, Loris Footnotes: [1] https://github.com/chaos/pdsh

Re: Python & nmap

2022-05-20 Thread Lars Liedtke
Ansible has got a shell module, so you could run custom commands on all hosts. But it gets more difficult in parsing the output afterwards. -- Lars Liedtke Software Entwickler Phone: Fax:+49 721 98993- E-mail: l...@solute.de solute GmbH Zeppelinstraße 15

Re: Python & nmap

2022-05-19 Thread MRAB
On 2022-05-19 20:28, ^Bart wrote: You forgot the second line (after 'import nmap' and before 'nm.scan()'): nm = nmap.PortScanner() import nmap nm = nmap.PortScanner() nm.scan(hosts='192.168.205.0/24', arguments='-n -sP -PE -PA21,23,80,3389') hosts_list = [(x, nm[x]['status']['state']) for

Re: Python & nmap

2022-05-19 Thread ^Bart
Opbservations worth considering 1) could possibly be handled by a simple bash script (My bash skills are not great So i would probably still go python myself anyway) Like what I wrote in my last reply to another user now I need to start this work asap so maybe I'll start to write a rough bash s

Re: Python & nmap

2022-05-19 Thread ^Bart
You forgot the second line (after 'import nmap' and before 'nm.scan()'): nm = nmap.PortScanner() import nmap nm = nmap.PortScanner() nm.scan(hosts='192.168.205.0/24', arguments='-n -sP -PE -PA21,23,80,3389') hosts_list = [(x, nm[x]['status']['state']) for x in nm.all_hosts()] for host, sta

Re: Python & nmap

2022-05-19 Thread ^Bart
Maybe it could be a good idea to look at Ansible for copying the Files to all the hosts, because that is one thing ansible is made for. I didn't know it... thanks to share it but... I should start to study it and I don't have not enought free time... but maybe in the future I'll do it! :) Fo

Re: Python & nmap

2022-05-19 Thread Lars Liedtke
# scp "my_file" root@192.168.205.x/my_directory Maybe it could be a good idea to look at Ansible for copying the Files to all the hosts, because that is one thing ansible is made for. For the nmap part: Ansible does not have a module for that (sadly) but is very extensible, so if you start d

Re: Python & nmap

2022-05-19 Thread alister via Python-list
of these clients the successfully update I remove from the lan > them and I put them to the box to send them to our customers. > > I found https://pypi.org/project/python-nmap/ and I followed the line > "To check the network status" but... it doesn't work. > > T

Re: Python & nmap

2022-05-18 Thread Jon Ribbens via Python-list
On 2022-05-18, ^Bart wrote: > THE INPUT > - > import nmap > nm.scan(hosts='192.168.205.0/24', arguments='-n -sP -PE -PA21,23,80,3389') > hosts_list = [(x, nm[x]['status']['state']) for x in nm.all_hosts()] > for host, status i

Python & nmap

2022-05-18 Thread ^Bart
stomers. I found https://pypi.org/project/python-nmap/ and I followed the line "To check the network status" but... it doesn't work. THE INPUT - import nmap nm.scan(hosts='192.168.205.0/24', arg

Re: python nmap for loop

2017-06-14 Thread Skip Montanaro
> I'm trying to make the following code work: > ... It seems fairly clear that you've posted code which couldn't possibly run (missing a closing quote and right paren). Let me suggest: 1. You copy and paste directly from a Python (or IPython/Jupyter/IDLE) session, including prompts and output. 2

python nmap for loop

2017-06-14 Thread SS
I'm trying to make the following code work: import os, sys app=['host1', 'host2', 'host3'] for i in app: os.system('nmap -p 22 -P0 %s | grep open 2>&1 > /dev/null && echo "%s up" I've tried many different iterations of the os.system call, how to make this work? TIA -- https://mail.pytho

Python Nmap script linux version

2007-11-28 Thread Daniel Folkes
I made this script for fun. you need to have Nmap installed on your linux computer and it will find all the computers on the network and then run Nmap on it. Hope you enjoy! import os fn = 'i.result' ip = '192.168.1.1-255' ip1 = ip[:3] ips = [] os.system("nmap -sP 192.168.1.1-255 > "+fn) f = ope

Python Nmap Scour sP script for linux

2007-11-27 Thread Daniel Folkes
I made this script for fun. you need to have Nmap installed on your linux computer and it will find all the computers on the network and then run Nmap on it. Hope you enjoy! import os fn = 'i.result' ip = '192.168.1.1-255' ip1 = ip[:3] ips = [] os.system("nmap -sP 192.168.1.1-255 > "+fn) f = o