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
NMAPFE(1)						      General Commands Manual							 NMAPFE(1)

NAME
nmapfe (xnmap) - GTK+ graphical frontend to the Nmap Security Scanner SYNOPSIS
nmapfe [ any Glib options such as --display ] DESCRIPTION
Nmapfe (also known as xnmap) is a convenient X Window front end for the Nmap Security Scanner. Most of the options correspond directly to Nmap options, which are described in detail in the Nmap man page. We recommend you read that first. There is also limited help available via the NmapFE "Help" menu. AUTHOR
NmapFE was originally written by Zach Smith <key@aye.net> It is now maintained by Fyodor <fyodor@insecure.org> Feel free to write me ( fyodor@insecure.org ) with questions or bug reports. DISTRIBUTION
The newest version of nmapfe can be obtained from http://www.insecure.org/nmap/ nmapfe is (C) 1999, 2000 by Fyodor (fyodor@insecure.org) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; Version 2. This guarantees your right to use, modify, and redistribute Nmap under certain conditions. If this license is unacceptable to you, Insecure.Org may be willing to sell alternative licenses (contact fyodor@insecure.org ). Source is provided to this software because we believe users have a right to know exactly what a program is going to do before they run it. This also allows you to audit the software for security holes (none have been found so far). Source code also allows you to port nmapfe to new platforms, fix bugs, and add new features. You are highly encouraged to send your changes to Fyodor for possible incorporation into the main Nmap distribution. By sending these changes to Fyodor or nmap-hackers, it is assumed that you are offering Fyodor the unlimited, non-exclusive right to reuse, modify, and relicense the code. If you wish to specify special license conditions of your contributions, please state them up front. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details (it is in the COPYING file of the nmap distribution). It should also be noted that Nmap has been known to crash certain poorly written applications, TCP/IP stacks, and even operating systems. Nmap should never be run against mission critical systems unless you are prepared to suffer downtime. We acknowledge here that Nmap may crash your systems or networks and we disclaim all liability for any damage or problems Nmap could cause. NMAPFE(1)
All times are GMT -4. The time now is 03:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy