![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 | |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
|
Anyone familiar with perl stuff, how do you run this syntax?
Having a brain fart ATM, how the hell do I run this syntax? This is a perl script (rsapi.pl) provided by rapidshare that uploads a file from my server to my premium account, but I can't figure out how to run these commands..
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
|
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Feb 2002
Posts: 720
|
from the commandline
cd to the directory containing rsapi.pl then perl rsapi.pl prem filename login password or /usr/bin/perl /location/to/rsapi.pl prem /location/to/filename login password if you need to run it from within another script then use backticks or an exec call, and make sure you sanitize any inputs |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
|
Quote:
I tried exec("perl rsapi.pl prem archive.rar 334"); Is it supposed to be -perl instead? Not too familiar with this crap lol. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Feb 2002
Posts: 720
|
exec("/usr/bin/perl /location/to/rsapi.pl prem /location/to/archive.rar login password");
should work, check your error logs or try running it from command line to see if there is a problem. make a php file named test.php of just <? echo exec("/usr/bin/perl /location/to/rsapi.pl prem /location/to/archive.rar login password"); ?> and do php test.php from commandline to see if that works for you. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
|
Tried that, with a couple different common perl paths just in case. It just shows a blank page when I run it, no new errors in the error log, and no new files in rapidshare either.
Command line you do from a ssh connection right? I don't have access to that at the moment, will try it later though since I do remember that gives you some actual feedback on what's going on.. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | ||
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
|
Ok I found a PHP alternative, of course it isn't working out the box either
![]() I get this error: Quote:
-The 'line 4' error above is on the "private $maxbuf=64000; // max bytes/packet" line below the commented area, I searched google and there seems to be some kind of problem between PHP 4/5 with the "public/private" stuff but I couldn't find a solution. PHP 4 is what I'm currently working with. Quote:
|
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Too lazy to set a custom title
Join Date: Feb 2005
Posts: 16,753
|
go get google to help my friend
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
Quote:
Any particular reason that you're wrapping Perl in PHP? I suppose you're either wanting to integrate it with some much larger PHP system, or you want to add some gigantic security issues. ;) I'm guessing the former. Anyway, I'd run just the script itself first, before trying to integrate it with the PHP. Rather than checking your error logs as you work with it, add this to the top of the script in order to turn it into a CGI script which will output any error messages to your browser: Code:
#!/usr/bin/perl BEGIN { if ($debug) { print "Content-type: text/html\n\n<html><body><pre>\n"; open (STDERR, ">&STDOUT"); select(STDERR); $| = 1; select(STDOUT); $| = 1; } }
__________________
For historical display only. This information is not current: support@bettercgi.com ICQ 7208627 Strongbox - The next generation in site security Throttlebox - The next generation in bandwidth control Clonebox - Backup and disaster recovery on steroids |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
Oh BTW if you are integrating into into some much larger PHP system, be EXTREMELY
careful to really, really sanitize any variables used in backticks or exec(). You MUST decide which REGEX is allowed and allow only that. Attempting to remove specific bad characters won't cut it at all. So far, I've never seen ANY PHP script whose exec() sanitation couldn't be broken using one particular method, thereby giving the attacker the ability to run arbitrary code, so seriously be careful using exec with PHP. (For those who know enough to think they are doing it right, consider \0 and it's 6 encodings.)
__________________
For historical display only. This information is not current: support@bettercgi.com ICQ 7208627 Strongbox - The next generation in site security Throttlebox - The next generation in bandwidth control Clonebox - Backup and disaster recovery on steroids |
![]() |
![]() ![]() ![]() ![]() ![]() |