Get IPv4() -> Error while resolving : Success

59 views
Skip to first unread message

Kiran Subash

unread,
Aug 13, 2015, 7:28:56 PM8/13/15
to libcrafter
Hello!

When building a new packet, I encounter the error - Get IPv4() -> Error while resolving : Success and the packet goes through with no source IP. The thing is that I don't have DNS on this box (in my lab) and I dont want to resolve the hostnames. I think when I create the packet, there is attempt to resolve the name, and its failing. Is there a way to not do lookup when building the packet? I have searched the Wiki, but I did not find an answer to this. Apologies if its already covered somewhere in the Wiki. Please point me to the right place to look at. 

Kind Regards,
Kiran

Esteban Pellegrino

unread,
Aug 13, 2015, 7:32:28 PM8/13/15
to libcr...@googlegroups.com
can you show me how are you setting the source IP on the packet please? did you tried :

ip_header.SetSourceIP(Crafter::GetMyIp(interface)); // interface = "wlan0", "eth0"

--
You received this message because you are subscribed to the Google Groups "libcrafter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libcrafter+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Esteban Pellegrino | Mobile Team Leader
LinkedIn | Twitter | Zimperium.com


Kiran Subash

unread,
Aug 13, 2015, 7:46:11 PM8/13/15
to libcrafter
Hello Esteban!

Thank you for the response. Here is what I'm doing - 

src_ip = GetMyIP(out_iface);

where out_iface is the interface out of which the packets have to go through. 

Then, when building the packet I do - 

            IP ip_header;
            ip_header.SetSourceIP(src_ip);
            ip_header.SetDestinationIP(dst_ip);

Kind Regards,
Kiran

Esteban Pellegrino

unread,
Aug 13, 2015, 7:47:12 PM8/13/15
to libcr...@googlegroups.com
looks good, can you please print what you get as src_ip?

Kiran Subash

unread,
Aug 13, 2015, 8:24:22 PM8/13/15
to libcrafter
I dont seem to get anything, perhaps that is the problem. The interface does have an IP address, and packets are going out of it. This seems to only happen on my CentOS7 box. When I earlier had CentOS 6.4, the same thing worked just fine. I will investigate further. 

Kind Regards,
Kiran

Esteban Pellegrino

unread,
Aug 13, 2015, 8:29:28 PM8/13/15
to libcr...@googlegroups.com
yes, that's probably why... for some reason GetMyIP is not correctly working on your box. you can try putting your IP directly as a string and it should.

or you can replace GetMyIP with some code to get the IP for a given interface that works on your box.

Kiran Subash

unread,
Aug 13, 2015, 8:32:09 PM8/13/15
to libcrafter
Hello again!

I got the problem. In this new environment, there is a vlan configured, and hence the parent interface (which I used on my previous box) had no IP. Once I switched to the vlan interface, it is working as expected.

Thank you again for helping troubleshoot!!

Kind Regards,
Kiran

Esteban Pellegrino

unread,
Aug 13, 2015, 8:40:57 PM8/13/15
to libcr...@googlegroups.com
no problem, glad it worked!
Reply all
Reply to author
Forward
0 new messages