You are not logged in.
Hi guys I have a problem, I am so lost and I do not know who to talk because it seems there are only
few forums that specialize on this types of software development.
I am hoping you can help me on my problem
Alright here goes:This is my StackOverflow Question https://stackoverflow.com/questions/284 … g-impacket
I realize that my problem is not on the packet making it self but in the Socket.
I use:s = socket.socket(socket.AF_INET6, socket.SOCK_RAW, socket.IPPROTO_ICMPV6)
So in my testing I understand that just by using this socket parameters, all my packets automatically have an Ethernet -> IPv6 -> ICMPv6(partial)
Now I am trying to send the packet as Raw because my Packet Instance starts with an Ethernet that has VLAN that contains IPv6 and ICMPv6.
I came up with this
s = socket.socket(socket.AF_INET6, socket.SOCK_RAW, socket.IPPROTO_RAW)
unfortunately in my test it shows that my IPv6 is malformed and there are no VLAN Layer that has been put.
Can you tell me how you send your VLAN in the socket.socket function?
I need help on this
Well, I'm rusty on my Python, and am totally unfamiliar with this "Impacket" package... But, I can tell you that in C, on Linux, if you were trying to send raw Ethernet frames, you'd want to be using an AF_PACKET socket, not an AF_INET*/SOCK_RAW socket... (Or, alternatively an AF_INET*/SOCK_PACKET socket for older systems...) So, I have to suspect that's your main problem... By using AF_INET6/SOCK_RAW, it's expecting you to send out an IPv6 packet with all its headers; but, it's NOT expecting you to be sending any Ethernet headers!
So normally if you will send a packet with VLAN you should not use (socket.AF_INET6, socket.SOCK_RAW, socket.IPPROTO_ICMPV6) ?
Let say in C, what are the parameters you will need like socket.socket(socket.AF_PACKET...) and what else should I keep in mind.
I can test your proposal solution tomorrow so I'm asking if I need to look out for more errors in my part
It has nothing to do with VLAN specifically, but just sending any packets at the Ethernet level requires a lower level socket than a mere raw IP socket... You can only send IP-level packets over a raw IP socket... If you're on Linux, it has what's called packet sockets to do Ethernet-level packet reading/sending... Other systems often have other similar things, but it's not standarized... If writing portable code, you'd probably want to use a higher level library like libnet or libdnet...
In C, it would be something like:
sock = socket (AF_PACKET, SOCK_RAW, htons(ETH_P_IP));
Or, in your case, probably ETH_P_IPV6 for protocol... Or, you can use ETH_P_ALL and just specify protocol at sendto() time in the sockaddr_ll struct... I'm not sure if all this is all available with the Python package you're working with or not... I don't see much in the way of documentation on the Impacket web sites, but it sounds like it SHOULD support sending out full Ethernet-level packets somehow...