Thank you for looking. I would really like to see if this can work with RN2.20.01. I would like a secure upload module for my site. Thank you for looking. Some of it is in Italian....
Code:
/************************************************************************/
//
// EASYUP-NUKE
//
// module created by HI-Lab based on EasyUp of Amine Ouelhadj *
// Copyright (c) 2002 by cooperativa sociale l'Utopia a r.l.
// released under GPL licence
//
//
Only registered users can see links on this board! Get registered or login to the forums!
// choose directory of upload files
$imagesdir="images/upload";
$downloaddir="images/materiali";
// Allow or not executable files adding an extension - yes="si" no="no"
$execution = "no";
// Allow or not upload of index files - yes="si" no="no"
$index_autorisation = "no";
$alertdimension=array(
// Alert dimension for images files in Kb integer
img=>150,
// Alert dimension for swf files in Kb integer
swf=>150,
// Alert dimension for other files in Kb integer
other=>500
);
// Verifie si le nom ne se nomme pas index.extension
function verif_index($nomfichier_name)
{
$pointeur = strrpos($nomfichier_name, ".");
$nom = substr($nomfichier_name, 0, $pointeur);
if (ereg ("^index$", $nom)) return true;
}
// Verifie si le fichier existe sur le serveur.
function presence_file($nomfichier_name)
{
global $chemin;
if (file_exists("$chemin/$nomfichier_name")) return true;
}
// Calculate dimensions of image and print related html tag
function imagetag($chemin,$nomfichier_name,$alt)
{
global $testotoobig,$alertdimension;
$misura=getimagesize("$chemin/$nomfichier_name");
$htmlimgstring="<img src=\"$chemin/$nomfichier_name\" alt=\"$alt\" ".$misura[3].">";
echo "<center><h2>"._TITLETAG."</h2>\n".
"<i>"._INSTRUCTIONTAG." "._IMAGE.". "._INSTRUCTIONTAG2."</i><br>\n";
echo "<font color=\"#000066\"><h2><blockquote><img src=\"$chemin/$nomfichier_name\" alt=\"$alt\" ".$misura[3]."></h2></font></center><br><br>";
echo "<center><h2>"._TITLEDIMENSION."</h2></center><br>\n";
dimensionefiles($chemin,$nomfichier_name,$testotoobig[0],$testotoobig[1],$alertdimension[img]);
echo "<center><h2><br>"._PREVIEW."</h2>\n".
"<i>"._SUBPREVIEW." "._IMAGE." "._SUBPREVIEW2."</i>:<br><br>\n";
echo "".$htmlimgstring."</center>";
}
// Calculate dimensions of swf file and print related html tag
function swftag ($chemin,$nomfichier_name,$alt,$bgcolorswf)
{
global $testotoobig,$alertdimension;
$misura=getimagesize("$chemin/$nomfichier_name");
$htmlswfstring="<embed ALT=\"$alt\" src=\"$chemin/$nomfichier_name\" quality=high bgcolor=\"#$bgcolorswf\" ".$misura[3]." type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">";
echo "<center><h2>"._TITLETAG."</h2>\n".
"<i>"._INSTRUCTIONTAG." "._MOVIE.". "._INSTRUCTIONTAG2."</i><br>\n";
echo "<font color=\"#000066\"><h2><blockquote><embed ALT=\"$alt\" src=\"$chemin/$nomfichier_name\" quality=high bgcolor=\"#$bgcolorswf\" ".$misura[3]." type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></h2></font></center><br><br>";
echo "<center><h2>"._TITLEDIMENSION."</h2></center><br>\n";
dimensionefiles($chemin,$nomfichier_name,$testotoobig[2],$testotoobig[3],$alertdimension[swf]);
echo "<center><h2><br>"._PREVIEW."</h2>\n".
"<i>"._SUBPREVIEW." "._MOVIE." "._SUBPREVIEW2."</i>:<br><br>\n";
echo "".$htmlswfstring."</center>";
}
// Check dimension of file and print alert message
function otherfiles ($chemin,$nomfichier_name)
{
global $testotoobig,$alertdimension,$nukeurl;
echo "<center><h2>"._TITLEDIMENSION."</h2></center><br>\n";
dimensionefiles($chemin,$nomfichier_name,$testotoobig[4],$testotoobig[5],$alertdimension[other]);
echo "<center><h2>"._TITLEDOWNLOAD."</h2></center><br>\n";
echo "<center>"._INSTRUCTIONDOWN."</center><br>".
_FILEURL.": <font color=\"#000066\">$nukeurl/$chemin/$nomfichier_name</font><br>\n";
$dimensione=filesize("$chemin/$nomfichier_name");
echo ""._FILESIZE.": <font color=\"#000066\">$dimensione</font> "._BYTES."<br>\n";
echo ""._HOMEPAGE.": <font color=\"#000066\">$nukeurl</font><br>";
}
// Chmod le fichier pour en 644 pour le rendre non executable.
function chmod_no_execution($nomfichier_name)
{
global $chemin;
chmod ("$chemin/$nomfichier_name", 0644);
}
echo "<p align=\"right\"><A href=\"http://www.hi-lab.net\"><img src='modules/Easyup/hilab.gif' width='70' height='30' alt='HI-Lab - The Social Technology'></A><p>";
CloseTable();
include ("footer.php");
Hi blith. Have you tried it with RN? I'm assuming it's a module, though it appears to use some specific functions that might need to be added to mainfile (or to this file).
Hello, I have not tried it with RN, I was worried about the security of it, not the uploading part but the coding, since the wording is different at the opening if statement. Does the code look secure? I will try and install it and see what happens. Thanks!
That will at least tell you what it's checking for and may shed some light on the issue.
As for this being secure - I'd be wary of allowing users to upload anything, unless it's very limited. I did not something alarming: the $user variable is referenced - but it isn't used to prevent random people (i.e. non-members) from uploading files. IMO, that's not good...
That will at least tell you what it's checking for and may shed some light on the issue.
As for this being secure - I'd be wary of allowing users to upload anything, unless it's very limited. I did not something alarming: the $user variable is referenced - but it isn't used to prevent random people (i.e. non-members) from uploading files. IMO, that's not good...
Got returned:
Code:
$chemin = images/materiali
$nomfichier_name =
So it is not finding a file, just not uploading. Additionally, it does not allow any php or .exe extensions.... you could limit any extensions I suppose. My main reason for posting it here is to see if it could be RavenNuked. i.e. made more safe by someone who knows the RN code.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum