Category Archives: Perl

Run suid Perl scripts under Apache without suidperl using a really simple C wrapper

If Perl was installed on your computer without the ‘suidperl’ program, you can’t run suid Perl script.
One situation may be when you want to use your nifty administrative Perl tool from a web interface, i.e. run a script which requires root access.
Anyhow, your Apache server runs as user ‘http’ or ‘nobody’, which makes it impossible to use the Perl script with ‘suidperl’ missing.
Here is where we will use the C wrapper (calm down, you don’t need any C knowledge at all):
Assume that your Perl script is installed as ‘http://www.yourweb.com/cgi-bin/yourniftytool.pl’, but it doesn’t work very well… 🙁

Read More

How To: Perl TCP / UDP Socket Programming using IO::Socket::INET

How To: Perl TCP / UDP Socket Programming using IO::Socket::INET.

Perl socket modules provides an object interface that makes it easier to create and use TCP / UPD sockets.

This article covers the following topics:

  • Perl example code for TCP client and server
  • Perl example code for UDP client and server
  • Read and write descriptor list using Select(IO::Select)

CPAN module IO::Socket::INET is used to perform socket operations such as — creating, binding, connecting, listening and closing the socket.

IO::Select module is used for obtaining the descriptors that are ready for read/write operations.

Read More

Bad Behavior has blocked 333 access attempts in the last 7 days.