Sponsored Content
Top Forums Programming Nmap shell script goes in infinite loop Post 302998127 by Don Cragun on Thursday 25th of May 2017 03:22:46 PM
Old 05-25-2017
With your code:
Code:
while read -r line
do
name="$line"
echo "$name"
count=$line

nmap -oG output.txt -T4 -f -iL iplist.txt $line1
done < iplist.txt

you have three names for the contents of a line from iplist.txt: line, name, and count. But in your invocation of nmap you use $line1. Since line1 has not been defined in your script anywhere, that will expand to an empty string unless line1 is an exported variable in your environment.

I don't have nmap on my system. The Linux nmap man page isn't clear about what servers(s) it attempts to scan if no targets are given on the command line. Maybe it seems like an infinite loop because you are trying to scan every server on the internet???
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Running a script in INFINITE LOOP

Hi All, I have a requirement as below. I supposed to get a file from Source system once in a month. But we dont know when the source system will send the file. My script has to wait for that file in LOOP once it gets the file then it has to FTP the file. I thought of scheduling the job... (5 Replies)
Discussion started by: Raamc
5 Replies

2. Shell Programming and Scripting

Script to run infinite loop

Hi all, I have a script which triggers batch admin manager and gets the top 10 jobs and their status info. the output of this script is the list of all these jobs. I want to run this in infinite loop which will show top 100 jobs' status. the script is as follows #!/bin/sh exec &> capture1.txt... (1 Reply)
Discussion started by: digitalrg
1 Replies

3. Shell Programming and Scripting

Infinite while loop

what is the difference between while:,while true and while false? (6 Replies)
Discussion started by: proactiveaditya
6 Replies

4. UNIX for Advanced & Expert Users

Procmail and infinite loop

I wanted to copy (not forward but copy) all incoming email to another address of mine. It worked, but now I encountered an infinite loop problem: When the second address doesn't like the content and bounces the message back, the bounce message will be sent back and forth. So, what I have in... (1 Reply)
Discussion started by: distill
1 Replies

5. Shell Programming and Scripting

Script with infinite loop stops after sometime

Hi I am working on a server that is set up and maintained by a third party. It seems whenever I run bash scripts in the background (with a &) with while loops in them they seem to me killed in around 2.5 hours. ( I am running them as a normal user with no special privileges ) . Is there a... (3 Replies)
Discussion started by: pkabali
3 Replies

6. Shell Programming and Scripting

My for loop decides to become an infinite loop?

Hi, I was debating if I should put this in the dummies or scripts section, I apologize in advance if I chose poorly. Fairly new to Unix and BASH scripting but I thought I made it fairly well given my limited understanding. However, the output indicates that it's looping and I'm ending up with a... (5 Replies)
Discussion started by: gotreef
5 Replies

7. Shell Programming and Scripting

Infinite while loop script shows more than one process

Hi, I have a script which triggers an infinite loop. #!bin/bash trig=`ls /home/trig.tch |wc -l` function callj { some commands... } while do callj & done The number of process after doing a ps -ef |grep Mon.sh returns processes even after the script is killed by deleting the... (4 Replies)
Discussion started by: chetan.c
4 Replies

8. Shell Programming and Scripting

Select command going to infinite loop after running the script

cd /opt/et/WAS/apps/8.0 find . -name "HostIntegration.properties" -o -name "HostSocket.properties" -o -name "environment.properties" 2> /dev/null | awk -F '' '{print $4}'|awk '!x++' | cat>/home/cbadmin/file1.txt cd /home/cbadmin/ PS3='Please enter a number from list of applications==>:' select... (3 Replies)
Discussion started by: bhas85
3 Replies

9. Shell Programming and Scripting

Calling a script from a shell that needs to cancel out of infinite loop

I am writing a shell script that calls this oracle utility to get some information about the DB that I need for the script https://docs.oracle.com/cd/B16240_01/doc/em.102/e15294/options.htm This is the command that I am running: $ORACLE_HOME/OPatch/opatch lsinventory -details | grep -i... (1 Reply)
Discussion started by: guessingo
1 Replies

10. Shell Programming and Scripting

Read function is going in infinite in another script having while loop

Hello Experts, I have created one user confirmation process that will ask for user input. I have created one func for it. The issue is if i call it as normal then it works fine but if i am calling it in another script(in while loop) . It is going in infinite loop and not asking for user input. ... (8 Replies)
Discussion started by: looney
8 Replies
ZENMAP(1)						      Zenmap Reference Guide							 ZENMAP(1)

NAME
zenmap - Graphical Nmap frontend and results viewer SYNOPSIS
zenmap [options] [results file] DESCRIPTION
Zenmap is a multi-platform graphical Nmap frontend and results viewer. Zenmap aims to make Nmap easy for beginners to use while giving experienced Nmap users advanced features. Frequently used scans can be saved as profiles to make them easy to run repeatedly. A command creator allows interactive creation of Nmap command lines. Scan results can be saved and viewed later. Saved scan results can be compared with one another to see how they differ. The results of recent scans are stored in a searchable database. This man page only describes the few Zenmap command-line options and some critical notes. A much more detailed Zenmap User's Guide is available at http://nmap.org/book/zenmap.html. Other documentation and information is available from the Zenmap web page at http://nmap.org/zenmap/. OPTIONS SUMMARY
-f, --file results file Open the given results file for viewing. The results file may be an Nmap XML output file (.xml, as produced by nmap -oX) or a Umit scan results file (.usr). This option may be given more than once. -h, --help Show a help message and exit. -n, --nmap Nmap command line Run the given Nmap command within the Zenmap interface. After -n or --nmap, every remaining command line argument is read as the command line to execute. This means that -n or --nmap must be given last, after any other options. Note that the command line must include the nmap executable name: zenmap -n nmap -sS target. -p, --profile profile Start with the given profile selected. The profile name is just a string: "Regular scan". If combined with -t, begin a scan with the given profile against the specified target. -t, --target target Start with the given target. If combined with -p, begin a scan with the given profile against the specified target. -v, --verbose Increase verbosity (of Zenmap, not Nmap). This option may be given multiple times to get even more verbosity. Any other arguments are taken to be the names of results files to open. ENVIRONMENT VARIABLES
ZENMAP_DEVELOPMENT Set ZENMAP_DEVELOPMENT to disable automatic crash reporting. BUGS
Like their authors, Nmap and Zenmap aren't perfect. But you can help make them better by sending bug reports or even writing patches. If Nmap or Zenmap doesn't behave the way you expect, first upgrade to the latest version available from http://nmap.org. If the problem persists, do some research to determine whether it has already been discovered and addressed. Try Googling the error message or browsing the nmap-dev archives at http://seclists.org/. Read this full manual page as well. If nothing comes of this, mail a bug report to <dev@nmap.org>. Please include everything you have learned about the problem, as well as what version of Zenmap you are running and what operating system version it is running on. Problem reports and Zenmap usage questions sent to dev@nmap.org are far more likely to be answered than those sent to Fyodor directly. Code patches to fix bugs are even better than bug reports. Basic instructions for creating patch files with your changes are available at https://svn.nmap.org/nmap/HACKING. Patches may be sent to nmap-dev (recommended) or to Fyodor directly. HISTORY
Zenmap was originally derived from Umit, an Nmap GUI created during the Google-sponsored Nmap Summer of Code in 2005 and 2006. The primary author of Umit was Adriano Monteiro Marques. When Umit was modified and integrated into Nmap in 2007, it was renamed Zenmap. AUTHORS
Nmap Fyodor <fyodor@nmap.org> (http://insecure.org) Hundreds of people have made valuable contributions to Nmap over the years. These are detailed in the CHANGELOG file which is distributed with Nmap and also available from http://nmap.org/changelog.html. Umit Zenmap is derived from the Umit Nmap frontend, which was started by Adriano Monteiro Marques as an Nmap/Google Summer of Code project (<py.adriano@gmail.com>, http://www.umitproject.org). Zenmap 07/28/2013 ZENMAP(1)
All times are GMT -4. The time now is 08:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy