Mark20
Mark20

Reputation: 105

How can I perform IP Address spoofing on Linux (Ubuntu) using JMeter? (JMeter not binding IPs created)

Hie everyone, I am having trouble running my JMeter script where I created IPs (for spoofing) on my system. I use the loop below to assign the IPs with ifconfig:

for each in $(seq 41 50); do ifconfig enp4s0: $each 10.20.30.$each; done

After which I execute the ifconfig command and get the following output:

enp4s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
    ether 14:fe:b0:a0:b0:e0  txqueuelen 1000  (Ethernet)
    RX packets 0  bytes 0 (0.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 0  bytes 0 (0.0 B)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp4s0:: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
    inet 10.20.30.50  netmask 255.0.0.0  broadcast 10.255.255.255
    ether 14:fe:b0:a0:b0:e0  txqueuelen 1000  (Ethernet)

After this, I create a CSV config set for my csv which contains the IPs in the range mentioned above then configure the HTTP requests to use the IPs in the CSV, but when I run the script all the requests fail with the following error:

Response code: Non HTTP response code: java.net.BindException
Response message: Non HTTP response message: Cannot assign requested address (Bind failed)

I am just wondering what may be causing this and how could I resolve it. Any help will be greatly appreciated.

Upvotes: 0

Views: 5295

Answers (1)

Selva
Selva

Reputation: 541

The issue is in the first command. There is an extra space after : which is leading to only address 50 from being added. You should see something like the following. Since the addresses from 41 to 49 were not added, JMeter is throwing an error that it is not able to bind to the given address from your CSV.

Also, ensure that you can ping all the IP addresses after adding them. These are all handled by the OS commands and JMeter expects the IP to be there already.

Additional information: Jmeter: IP spoofing not working

root@instance-2:/home/# for each in $(seq 43 49); do ifconfig ens4:$each 10.168.0.$each; done


root@instance-2:/home/# ifconfig
ens4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1460
        inet 10.168.0.3  netmask 255.255.255.255  broadcast 0.0.0.0
        inet6 fe80::4001:aff:fea8:3  prefixlen 64  scopeid 0x20<link>
        ether 42:01:0a:a8:00:03  txqueuelen 1000  (Ethernet)
        RX packets 6251  bytes 3126754 (3.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2067  bytes 312885 (312.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
ens4:43: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1460
        inet 10.168.0.43  netmask 255.0.0.0  broadcast 10.255.255.255
        ether 42:01:0a:a8:00:03  txqueuelen 1000  (Ethernet)
ens4:44: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1460
        inet 10.168.0.44  netmask 255.0.0.0  broadcast 10.255.255.255
        ether 42:01:0a:a8:00:03  txqueuelen 1000  (Ethernet)
ens4:45: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1460
        inet 10.168.0.45  netmask 255.0.0.0  broadcast 10.255.255.255
        ether 42:01:0a:a8:00:03  txqueuelen 1000  (Ethernet)
ens4:46: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1460
        inet 10.168.0.46  netmask 255.0.0.0  broadcast 10.255.255.255
        ether 42:01:0a:a8:00:03  txqueuelen 1000  (Ethernet)
ens4:47: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1460
        inet 10.168.0.47  netmask 255.0.0.0  broadcast 10.255.255.255
        ether 42:01:0a:a8:00:03  txqueuelen 1000  (Ethernet)
ens4:48: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1460
        inet 10.168.0.48  netmask 255.0.0.0  broadcast 10.255.255.255
        ether 42:01:0a:a8:00:03  txqueuelen 1000  (Ethernet)
ens4:49: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1460
        inet 10.168.0.49  netmask 255.0.0.0  broadcast 10.255.255.255
        ether 42:01:0a:a8:00:03  txqueuelen 1000  (Ethernet)

Upvotes: 1

Related Questions