CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2011
    Posts
    2

    Running netcat with PHP

    I'm trying to execute netcat using PHP. I've been stuck in this for hours, tried many different combination such as passthru, exec, system, and shell_exec. I searched Google but no luck so far. I'm just testing to see if I can do anything with netcat sush as tranfering files and reverse shell. I'm able to execute other commands such as ping, ls, whoami, etc. but not netcat. This is what I have so far:
    Code:
    exec ('nc ip port < file');
    I have shell listening for connections but nothing happens. Any help would be really appreciated, thanks in advance!

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Running netcat with PHP

    I would bet you it's a permissions issue.

    Add the following to your /etc/sudoers

    www-data ALL = NOPASSWD: /bin/nc
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured