1

My PHP based webpage populates a set of IP addresses from database. I need to run PING command for any IP address clicked by the user from the local machine. I know its a security issue and browsers may/ should not allow such execution of 'shell commands' BUT there must be some workaround.. to get it done. Suggestions and guidance required from gurus.

Danny Beckett
  • 20,529
  • 24
  • 107
  • 134
Khaled Javeed
  • 355
  • 4
  • 19

1 Answers1

1

You're thinking about this wrongly. You don't need to ping from the client; do it from the server!

This question covers how to do that using PHP.

No more security headaches to worry about!

Community
  • 1
  • 1
Danny Beckett
  • 20,529
  • 24
  • 107
  • 134
  • Thank you for the answer, it will help me to code another section of my project. BUT for the mentioned problem my server would not have access to the IP addresses. – Khaled Javeed Dec 06 '13 at 10:14
  • This is a trouble shooting kind of web-application, which stores different IP address of clients LAN (like printer on 192.168.18.6). Now to trouble shoot printer site will display 'PING Printer' link and clicking it will execute CLI to ping 192.168.18.6..... – Khaled Javeed Dec 06 '13 at 10:20
  • @KhaledJaveed I think you'll need to write a Java applet, or similar. – Danny Beckett Dec 08 '13 at 04:13
  • 2
    So you're asking if a web site can execute a local command on a client machine, without prompting the user? Imagine if the web server wants to delete files instead of ping... – Bill_Stewart Dec 12 '13 at 23:02