TheB Posted March 30, 2015 Share Posted March 30, 2015 (edited) Hi all, I'm pulling my hair out to get this working, it's probably something obvious im missing.. So i could use some extra eyes! I'm trying to send data from the urlsnarf infusion to an application running on the host machine. The application is made in Open Frameworks and listens to udp data on port 11999. I've copied and altered the urlsnarf infusion to properly work besides the original without conflicting. Now where i'm getting stuck at is creating the connection. $socket = stream_socket_server("udp://172.16.42.42:11999", $errno, $errstr); if (!$socket) { echo "Goddamn no socket! at $connection $errno, $errstr \n"; } else { echo "Socket created $connection \n"; } stream_socket_sendto($socket, $input); The error i get is the following: $errorno = 0 and $errstr = Cannot assign requested address I tried multiple addresses to send the data to, but every adres i try get's the same error. What i tried is 172.16.42.42, 10.211.55.2 (the ip of network interface 1 of my virtual machine), 10.37.129.2 (interface 2). I have the application running inside the virtual machine (Ubuntu) my Pineapple get's it's internet from the virtual machine. Many thanks! Edited March 30, 2015 by TheB Quote Link to comment Share on other sites More sharing options...
newbi3 Posted March 30, 2015 Share Posted March 30, 2015 I am assuming that the server it running on your host machine and that the client is running on your pineapple correct? I also assume that the above code is running on your pineapple? If my assumptions are correct, your issue is that you need a stream_socket_client not stream_socket_server http://php.net/manual/en/function.stream-socket-client.php You can use netcat as your server and you want even have to write any code. If my assumptions above are incorrect then i point you to the stream_socket_server documentation: http://php.net/manual/en/function.stream-socket-server.php Quote Link to comment Share on other sites More sharing options...
TheB Posted March 31, 2015 Author Share Posted March 31, 2015 Thanks for the reply, Your assumptions where completely right! Mixed up the server with the client.. my brain told me that a server would be the "server" of the message and the client the "receiver" Quote Link to comment Share on other sites More sharing options...
newbi3 Posted March 31, 2015 Share Posted March 31, 2015 In a client-server model the server is the one at accepts connections and the client is the one that initially creates them. After the connection is created they can both send and receive data to and from each other. Happy I could help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.