Met het volgende commando kun je een iPhone wakker maken:
Wie weet wat er dan precies wordt verstuurd? Ik wil eigenlijk via php/python/perl/bash iets doorsturen.
Ik heb al geprobeerd:
En:
[python]DS715> cat t.py
#!/usr/bin/python
from socket import socket, AF_PACKET, SOCK_RAW
s = socket(AF_PACKET, SOCK_RAW)
s.bind(("eth0", 0))
# Set this to your local MAC
src_addr = "\x00\x11\x32\x46\xad\x77"
# Set this to what you want to wake up
dst_addr = "\x54\xe4\x3a\x6b\x4f\xd1"
ethertype = "\x08\x42"
payload = ("\xff"*6)+(dst_addr*16)
s.send(dst_addr+src_addr+ethertype+payload)
DS715>[/python]
hping3 -2 -p 5353 192.168.0.104
Wie weet wat er dan precies wordt verstuurd? Ik wil eigenlijk via php/python/perl/bash iets doorsturen.
Ik heb al geprobeerd:
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| DS715> cat t.php <?php $fp = pfsockopen( "udp://192.168.0.104", 5353, $errno, $errstr ); if (!$fp) { echo "ERROR: $errno - $errstr<br />\n"; } socket_set_timeout ($fp, 10); $write = fwrite( $fp, "iets" ); //$data .= fread($fp,9600); //echo "$data<br>"; fclose($fp); echo "<br>Connection closed ..<br>"; if (!$write) { echo "error writing to port<br/>"; next; } ?> DS715> |
En:
[python]DS715> cat t.py
#!/usr/bin/python
from socket import socket, AF_PACKET, SOCK_RAW
s = socket(AF_PACKET, SOCK_RAW)
s.bind(("eth0", 0))
# Set this to your local MAC
src_addr = "\x00\x11\x32\x46\xad\x77"
# Set this to what you want to wake up
dst_addr = "\x54\xe4\x3a\x6b\x4f\xd1"
ethertype = "\x08\x42"
payload = ("\xff"*6)+(dst_addr*16)
s.send(dst_addr+src_addr+ethertype+payload)
DS715>[/python]