Shell script including hping3 commands

Issues related to applications and software problems
Post Reply
LinuxAcemi
Posts: 4
Joined: 2018/01/01 15:44:11

Shell script including hping3 commands

Post by LinuxAcemi » 2018/01/01 15:56:29

Hi guys and thank you for running such a great forum.

I am currently running Windows 10 with VM and CentOS. I also installed hping3 in CentOS to run a few commands, sending test packets to windows (HOST). The problem I am having is, I want to create a shell script, that contains 10 or more hping3 commands in a row, to run them automatically. But after the first command it stops and the other 9 commands wont be executed.

What do I need to write or how do I need to write the commands into the script to run each other?

Here are 2 example commands:
hping3 --flood -a XXX.XXX.X.XX -2 -p 6234 YYY.YYY.Y.YY

hping3 -V -S -p 80 -s 5050 XXX.XXX.X.XX

I am very thankful for any help.

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Shell script including hping3 commands

Post by TrevorH » 2018/01/01 17:13:44

Well... for the first one, you didn't tell it when to stop so it's just going to run until $heatdeathofuniverse or until it gets killed. Perhaps you meant to tell it to send a certain number of packets and then stop? Or some other way to tell it how long to run for?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

LinuxAcemi
Posts: 4
Joined: 2018/01/01 15:44:11

Re: Shell script including hping3 commands

Post by LinuxAcemi » 2018/01/01 17:23:12

Hi,

yep you are right I forgot that, how would you connect those two commands to run ?

Thanking you in advance

LinuxAcemi
Posts: 4
Joined: 2018/01/01 15:44:11

Re: Shell script including hping3 commands

Post by LinuxAcemi » 2018/01/01 18:24:03

I did it with a timeout at the beginning, now it works.

Post Reply