473,545 Members | 2,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Nmap Scour sP script for linux

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!

<code>

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 = open(fn)
try:
for line in f:
if ip1 in line:
ips.append(line[5:-19])

finally:
f.close()

os.system("clea r")
for i in ips:
print '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='
os.system("nmap "+i)
print '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='
raw_input('pres s to continue...')

</code>
Nov 28 '07 #1
0 2318

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1500
by: Mark Hahn | last post by:
(I apologize in advance if this is not an appropriate posting) I have written a simple windows shareware app, EzPicMailer, in Python 2.3, wxPython 2.4.1, and PIL 1.1.4 that lets computer novices find photo files, edit them, and mail them, all in one simple app. Everyone is encouraged to check out my beta version at http://EzPicMailer.com....
4
3828
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or less - during my own installation of Python 2.3 on Fedora Core 1 Linux for a friend of mine). Anyway, HTH, L.
9
1772
by: Sam Watson | last post by:
Hi, I could use a little help with a project i'm going to build. I know I want to use python and wxWindows but thats about all I know. The client will be linux or windows. The server will be linux. Basically, its a client/server app with a rich GUI client. The big catch is I want to be able to run the client/server remotely across the...
5
1979
by: Ben Finney | last post by:
Howdy all, I'm experimenting with carrying my personal computing environment around on a keychain USB flash storage device. I have the usual suspects on there: SSH keys, GPG keys, program configs. I'm probably not the first to think that a standalone distribution of Python would be a useful thing to have in my back pocket. Finding...
9
2066
by: TPJ | last post by:
First I have to admit that my English isn't good enough. I'm still studying and sometimes I just can't express what I want to express. A few weeks ago I've written 'Python Builder' - a bash script that allows anyone to download, compile (with flags given by user) and install Python and some external modules (e.g. wxPython, PyGTK,...
34
6371
by: Ville Voipio | last post by:
I would need to make some high-reliability software running on Linux in an embedded system. Performance (or lack of it) is not an issue, reliability is. The piece of software is rather simple, probably a few hundred lines of code in Python. There is a need to interact with network using the socket module, and then probably a need to do...
5
2768
by: lasek | last post by:
Hi all...now after a lot of experiments in c programming(two weeks..for precision), i've seen another strange instraction..and i post you the question... Like in the subject...why i must use nmap rather then malloc????. Best regards all.. See you from Rome, Cla.
2
14827
by: sunyao | last post by:
Hi Friend, I write a linux shell script to call a python script inside. But I got a wrong exit code from Python exit code. The linux shell script as follows; #!/bin/bash MyPython.py exit $? After run the above linux script, I always got exit code 0. But autually the Python log file shows that its exit code is 256. In python script, use...
0
1647
by: Daniel Folkes | last post by:
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
0
7490
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7682
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7449
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5351
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5069
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3465
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1911
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.