no more shell hacking via lava uploader!!!!!!!!!!

Started on the old forum in August 2010 · view the original in the archive · old links redirect here

40 replies · 250 views · started 16 years ago · 1 min read

Poll no more shell hacking via lava uploader!!!!!!!!!!

  • nup 12% · 2
  • kinda 29% · 5
  • very good 12% · 2
  • excellent!! 47% · 8
Votes over time · 6 Aug – 7 Mar

Votes are anonymous · 17 voters · Sign in to vote.

22 participants
m4ster_v4 Developer · 125 posts #21

Other..,

Just use func auto rename.. Or one extension allow only.. And make sure link to download file secure.. So.. The public folder can't be define.. Simple ways..

Put on uploader.. $ext = getext($file_name); $name = explode(".",$file_name); $name_a = "".$name[0]."_ejatd29_com.".$ext."";

so, something like this will happen.. Upload haha.php.shtml.html.jpg -> haha.jpg

just take last extension as main extension.. So, no more double or more extension in one name.. Hehe..

Visit my WEBSITE Project: http://www.aspirewap.net

something else Fellow · 2,296 posts #22

The actual renaming of your site name inbetween extension is a really good idea as it also stops url encoding

eg would stop: shell%2Fphp.gif

andyjay33 Developer · 75 posts #23

i personally wouldnt bother having an uploader cos php shell scripts can be binded inside an image easy and cos the header of the image will still have php tags the server will still execute the script i dont even bother with upload script at all

khan Lead · 681 posts #24

2 days before some one called s4udi (ahmed) try to hack one of my client's site.:)) He easily broke my shild to upload shell But He Can't Execute it. Coz I have the perfect .htaccess file on uploaded folder.:D

I think Whatever we use to protect our uploader from uploading shell, it could be broken. we should use .htaccess to prevent it I have used the imageresize option on that uploader. But He somehow escape from it.:(

ewanz Developer · 187 posts #25

it cant s0lve it.. Ive try with 0ther skill.. Hehe..still can run.. Anyway, d0nt h0st upl0ader if y0ur h0st n0t secure..

it still can execute if s0me0ne kn0w t0 escape..

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 
kiLLeR-eyEd_14 Senior · 382 posts #26

Ozzie is right..Try what he had taught us..I also have proven it when i tried it before..I tried uploading with those extensions and returned to an error document page..The thing in it is to remove the handler of those extensions so that it will not be executed and will just return error..The one i did before is ofcourse check extensions when uploading..If still the hacker has passed into it through extensions like .php.jpg then that is the time that removing type or handler of that extension in htaccess should work..I don't know if the hacker can still pass into it..

ozziemale31 Lead · 861 posts #27

anysite on the internett can be hacked if u know how and have the means time and patience. nobody is safe from a pro hacker. the best way not to be hacked is not to have a site at all. then u wont have to worry.but the methods i have shown will stop the majority of script kiddies like huward. and most noob wanabe hackers

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

khan Lead · 681 posts #28

Use these On your .htaccess file that on upload folder and your site will remain safe from uploading malware like shell if a hacker passed from back end code.

<FilesMatch "\.(cgi|py|pl|php|txt|log|sql|bs|asp|ror|swf)">
Deny from all
</FilesMatch>
RemoveType .pl .cgi .php .php3 .php4 .php5 .xml .phtml .html .htm .wml .shtm .shtml .txt
RemoveHandler .pl .cgi .php .php3 .php4 .php5 .xml .phtml .html .htm .wml .shtm .shtml .txt
ozziemale31 Lead · 861 posts #29

thats already on the uploader script study it lol. php gets renamed to imawanabehacker it can be replaced with anything u want so the functions already coded in it

khan89 wrote: Use these On your .htaccess file that on upload folder and your site will remain safe from uploading malware like shell if a hacker passed from back end code.

<FilesMatch "\.(cgi|py|pl|php|txt|log|sql|bs|asp|ror|swf)">
Deny from all
</FilesMatch>
RemoveType .pl .cgi .php .php3 .php4 .php5 .xml .phtml .html .htm .wml .shtm .shtml .txt
RemoveHandler .pl .cgi .php .php3 .php4 .php5 .xml .phtml .html .htm .wml .shtm .shtml .txt

dude look at the damn script b4 posting stuf thats already in it theres a htaccess file with stuff included

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

something else Fellow · 2,296 posts #30

I just found this uploader: Upload Files talk about someone trying to hack it badly they even tried the old %00 trick

amylee Principal · 1,092 posts #31

ive gotten into peoples servers by renaming a shell scripts extension to some **** like file.nth/.sisx/.rb/.pl/.asp etc etc as long as the webservers mime-types recognizes these extensions as executables it will process the file as a php script no matter what best protection is having a secure apache.conf/httpd.conf file before implementing any htaccess **** and what not

one way to do that is use mod_security and block the arrays scripts like c99shell and r57 shell use and next method is a simple program called bastille which secures the server be-it in a beginners way

my site is exploitable but if anyone gets access via a shell script they cant do **** all as i have my hard drives on my server read only so no downloading, my dirs where my scripts are set to root user access only so the nobody/www-data users cant access my files and i use 15 digit alphanumeric passwords so brute force safe

over the years running lavalair i have learnt so many lessons and this is the reason why my latest script hasn't been released by anyone

anyhow in a nutshell server protection should be sorted from the basics, i.e apache/mysql config files and not solely relying on php workarounds

Wyvern Newbie · 6 posts #32

lol you can easily block all script shells being uploaded to your host like what i did in my site uploaders.all files with php as its file name will be detected and an autopm will be send to any online staffs to inform them that someone is trying to upload a file with php on its file name. The script ive used is manageable and you can add more file name to be block such as html, asp and so on depend on what you may want to

  1. Sharing and helping others will enhance your abilities and capabilities.. For me experience and curiuosity is the best teacher.. 🥳 Join http://friendstag.net !!
Baynix Junior · 10 posts #33

@author thanks for this

giant_hacker Junior · 11 posts #35

Dont Know Why Do People Are So Restless to hack Lavalair lolzz !!!

Wel People Who want to Use a Secure Uploader Can Try The One Given .Its kinda Secure .Good Work ozzie .

Also People Who Really Want tO Secure There Uploaders "DONT VALIDATE FORMS BY JUST LOOKING FILE EXTENSION" instead Validate "BYTE CODES" .Recompile Your PHP with mime_magic extension .This extension will scan the files to let know what really is the extension. Also Use Mod_security Rules To Null route uploading of certain php Shell through HTML FORMS.....Install a Good Anti malware Scanner to scan your uploads directory...Also Place the htaccess gievn in this uploader thats fine.

😉

pain04 Newbie · 1 posts #36

m4ster_v4 wrote: Just use func auto rename.. Or one extension allow only.. And make sure link to download file secure.. So.. The public folder can't be define.. Simple ways..

Put on uploader.. $ext = getext($file_name); $name = explode(".",$file_name); $name_a = "".$name[0]."_ejatd29_com.".$ext."";

so, something like this will happen.. Upload haha.php.shtml.html.jpg -> haha.jpg

just take last extension as main extension.. So, no more double or more extension in one name.. Hehe..

nice 1 n_n

just_m3. Developer · 199 posts #37

i don't get it why you people still bother to replace file tags and so on ..

upload your file via php to a secret folder and serve it via php file stream with headers like so

<?php 
## request.php?id=1234

if (empty($_GET['id'])){die();}
## only digit ids
if (ctype_digit($_GET['id'])){$id=$_GET['id'];}

function fetch_htype($ext){
if($ext=="mp3"){$header='Content-Type:  audio/mpeg';}
else if($ext=="mp4"){$header='Content-Type:  audio/mp4';}
else if($ext=="php"){$header='Content-Type:  text/plain';}
else if($ext=="wav"){$header='Content-Type:  audio/x-wav';}
else if($ext=="aac"){$header='Content-Type:  audio/aac';}
else if($ext=="amr"){$header='Content-Type:  audio/amr';}
else if($ext=="3gp"){$header='Content-Type:  video/3gp';}
else if($ext=="zip"){$header='Content-Type:  application/zip';}
else if($ext=="rar"){$header='Content-Type:  application/rar';}
else if($ext=="gif"){$header='Content-Type:  image/gif';}
else if($ext=="png"){$header='Content-Type:  image/png';}
else if($ext=="bmp"){$header='Content-Type:  image/bmp';}
else if($ext=="jpg"||$ext=="jpeg"){$header='Content-Type:  image/jpeg';}
else if($ext=="mid"||$ext=="midi"){$header='Content-Type:  audio/midi';}
else if($ext=="jad"){$header='Content-Type:  text/vnd.sun.j2me.app-descriptor';}
else if($ext=="jar"){$header='Content-Type:  application/java-archive';}
## return header for unknown extension 
else { $header='Content-Type: application/octet-stream';}
return $header;}

#selecting file path by id // sql query
$open=mysql_fetch_array(mysql_query('SELECT * FROM files WHERE id='.$id.''));

if (empty($open['path'])){die();}

$file = './'.$open['path'].''; 

$path_parts = pathinfo($file); 

$ext=strtolower($path_parts['extension']);

if (file_exists($file)) {
## some browser don't get the file name with space tags so we add this ...
$filename=str_replace(array('?','!','(',')',' ','%20'),'_',basename($file));

header('Content-Disposition: attachment; filename='.$filename.'-'.mt_rand(100,98989).'.'.$ext);
header('Content-Description: File Transfer');
header('Content-Transfer-Encoding: binary');
header('Cache-Control: must-revalidate');
header('Content-Length: ' . filesize($file));
header(fetch_htype($ext));
header('Expires: 0');
readfile($file);
exit;

}

?>
  

#some hint you may upload the file to your server and move it to the folder with other extension like .upload and match+store the real extension in sql database . than use php to stream it like in the upper example ..

This is ten percent luck, twenty percent skill Fifteen percent concentrated power of will Five percent pleasure, fifty percent pain 😂And a hundred percent reason to remember the name!

giant_hacker Junior · 11 posts #38

Uploading to secret folder does not helps or guarantees that ur safe from Shell attack . Instead find a method that will not allow to upload a shell .As i already said validate the bytes of the file

arnage Lead · 811 posts #39

Add htaccess file to upload folder with:

RemoveHandler .php .phtml .php3
RemoveType .php .phtml .php3
php_flag engine off
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
giant_hacker Junior · 11 posts #40

arnage wrote: Add htaccess file to upload folder with:

RemoveHandler .php .phtml .php3
RemoveType .php .phtml .php3
php_flag engine off

Dude No need of all Three Lines

The first Line will do nothing on Cpanel 11.34 versions. The Second Line alone is safe it will make sure .php , .phtml .php3 extensions are treated as a text file The Third line is enough it will turn off php parsing in the directory.

On my sites even if i give u uploader with all extensions allowed U will not be able to upload any type of malware/shell codes . I use mod_security to deal with such hack

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close