24
C0D4
6y

Sometimes I want to slap myself.

I’ve been making progress with my voice activated TV remote project - coz you got to use a Google Home and a Raspberry pi for something right? Right??

Anyway, when the API you have written suddenly stops working and you’ve spent hours trying to solve it, it is really soul crushing when you realise you’re using a class variable incorrectly

I’ll just go cry now, while I control my tv 😥😎

Class TVAPI{
Private $tvIP = “192.xxx”;
Private $args = $this->decodeArgs($_GET);

Function of tvVolume(){
exec(“python tvRemote.py {$tvIP} {$this->args}”);
}
}

Comments
  • 3
    Unless your decodeArgs function is well written, expect remote code injection

    $_GET= "&& sudo shutdown"
  • 3
    @ruhe the decodeArgs is a switch with error handling and limits, to split the key combinations before sending to the TV.

    This is the general idea, not quite actual seeing as I typed it on my phone.
Add Comment