0

I work with remotely installed cameras that have a linux build installed in them. Our previous models allowed us to use SSH and run simple commands within their terminal to focus the image, reboot, factory default and the such without having to go to the remote location. We have swapped to a new kind of camera that still has a linux build inside but the previous commands are not as easily accessible if at all. These new cameras have a simple website that can do these actions instead but this can - and has - go wrong with a need for the SSH solution.

There is no way to directly access the camera (that I know of), all of this is through a cat6. I checked the source for the simple website trying to see what the focus button actually runs onclick and found its javascript refers to "/cgi-bin/focus.cgi" (I can provide the chunk of code if needed). I am familiar with programming but not to any pro degree and much less web development but I figure that .cgi might be my ticket to finding out how to activate this stuff from the linux terminal.

I tried making a python script to see if I could read the file in plain text or something but that's a no go. Don't know the first thing about web dev so if there is a neat tech way to open the server on the camera to pick its brains I don't know what it is and don't know where to start. Currently bouncing around all the directories in the camera trying to find some kind of command or clue to where the camera functions are. Double tab doesn't seem to have the commands I'm looking for, and they didn't include a manual with man command. I'm completely lost.

melpomene
  • 84,125
  • 8
  • 85
  • 148
Alfredo
  • 54
  • 7
  • 1
    probably related https://stackoverflow.com/questions/2089271/what-is-common-gateway-interface-cgi and based on the answers there I guess the answer is either No or It depends – rene Jun 08 '19 at 12:10
  • 1
    If "*There is no way to directly access the camera*", how are you "*Currently bouncing around all the directories in the camera*"? – melpomene Jun 08 '19 at 13:11
  • Probably my lack of correct terms Melpomene. I may be incorrect in saying that connection via the cat6 using SSH isn't direct access - I sort of assumed this was indirect access and I would be missing some kind of control over the camera as a whole. – Alfredo Jun 08 '19 at 13:17
  • 1
    Have you found a file called `focus.cgi`? If not, my first attempt would be `find / -name focus.cgi` (and then probably wait a while). – melpomene Jun 08 '19 at 13:19
  • I did initially attempt a find but I had previously attempted to go to a /cgi-bin/ directory and didn't find one so I assumed the find would not fetch anything and quit it (read: got impatient). I will try that right now. – Alfredo Jun 08 '19 at 13:44
  • Sweet, found the CGI and can read it as plain text in the camera. If only I had just let it do its thing. Thank you! Now I need to figure out what the code does. I might make a new question for that since this one is basically answered, though I'm not sure what the cgi itself is written in. Its in a directory labeled apache/htdocs and it reads like a batch file with its variables always preceded by "$". – Alfredo Jun 08 '19 at 15:01

0 Answers0