Follow us on Twitter!
Become the change you seek in the world. - Gandhi
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 23
Guests Online: 20
Members Online: 3

Registered Members: 82889
Newest Member: Geriztul
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

Problem with .htaccess

testmuch
Member

Your avatar

Posts: 1
Location:
Joined: 03.09.12
Rank:
Newbie
Posted on 13-04-13 15:29
Hello everyone

Im having some troubles with setting up htaccess... i tried it on my own "virtual server" (wamp)
and i also tried it on a hosted website at work, i got the same error so i must be doing something wrong..

heres the code of my .htacces file:
AuthUserFile Images/.htpasswd
AuthGroupFile /dev/null
AuthName /Images
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>

and heres the .htpasswd file

boka:XkdilJR2Or4JU

i used this http://aspirine.org/htpasswd_en.html


i have them both files in the "Images" which is in my "www" directory

the login windows pops up but when i try i get a "500 internal server error"

any word on what im doing wrong here? Grin
Author

RE: Problem with .htaccess

Mordak
Evil Sorcerer



Posts: 571
Location: England
Joined: 01.01.70
Rank:
Elite
Posted on 13-04-13 15:48
Which version of apache are you using ?


http://developers.hellboundhackers.org
Author

RE: Problem with .htaccess

lolly
Member



Posts: 24
Location:
Joined: 02.08.12
Rank:
Wiseman
Warn Level: 30
Posted on 13-04-13 19:46
you're running wamp (windows) and you have the group file pointing to /dev/null?
Author

RE: Problem with .htaccess

elmiguel
Member



Posts: 161
Location: Your Computer
Joined: 12.12.07
Rank:
God
Posted on 13-04-13 20:33
Well it depends on how your web page is marked up and or coded. For instance a 500 internal error is very generic and doesn't fully explain the error. Are you trying to render the page in php, asp(x), jsp(x), etc.?

If you are using a server side programming language such as those mentioned above and you have a syntax error, this will occur. For example,

PHP
  1.  
  2. <?php
  3.     //..... 
  4.     function renderIMG($path, $alt){
  5.      /** $path = santized path from within class..
  6.       ** $alt = sanitized alt text from within class
  7.       **/                 
  8.       return "<img src='$path' alt='$alt'>";
  9.     }//notice below
  10.     }//</==== Syntax error 
  11.     
  12.     echo renderIMG('./imgs/image1.png', 'Image One');
  13.     //.....
  14. ?>
  15.  


Now, either php will try to throw an fatal error, or Apache will try to handle it first from your .htaccess file. If handling from your .htaccess, this will generate a 500 internal server error. Meaning it tried to render but an error has occurred.

You could also have a typo in the .htaccess file itself, sometimes when copying and pasting you can pick up non-rendering characters and then depending on what encoding you save it as compared to what the it should be, this could cause errors as well.


This is just one instance of this error as I had this happen to me yesterday when I accidentally added an extra } at the end of my class.


The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

www.hellboundhackers.org/sig/r/24963.png

www.hellboundhackers.org/sig/hbh2.png
<script>alert('XSS');</script>
Author

RE: Problem with .htaccess

elmiguel
Member



Posts: 161
Location: Your Computer
Joined: 12.12.07
Rank:
God
Posted on 15-04-13 18:02
Another thing came to mind, depending on how your displaying your Content-Type in your header could confuse your .htaccess file.

PHP
  1.  
  2. <?php
  3.   header("Content-type: application/json; charset=utf-8");</== could cause an error if page fails
  4.   include_once('./database_config.php');
  5.   include_once('./VideoPortal.php');  
  6.   $video_portal = new VideoPortal($host, $database, $user, $pass);
  7.   //create our sql var with a preset to search from...
  8.   $sql = $video_portal->getQuery("SELECT TOP(100) PERCENT ");
  9.   
  10.   //echo $sql;
  11.   if (isset($_GET) && !empty($_GET)){
  12.     //Get all the get variables into an array
  13.     $getVars = $_GET;    
  14.     //builds the query if the params are met and are not empty or null
  15.     $sql .= $video_portal->buildQuery($getVars);
  16.     //echo "$sql\n";
  17.     //commit the query and print the json object
  18.     echo $video_portal->testQuery3($sql);   
  19.   } else {
  20.     //search terms are non existent -> create default search...
  21.     $sql =  $video_portal->getQuery("SELECT TOP 50 ");
  22.     $sql.= " ORDER BY [video_dateCreated] desc;--";
  23.     echo $video_portal->testQuery3($sql); 
  24.   }
  25.   //kill the connection after the process  
  26.   $video_portal->killConn();   
  27. ?>
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  



The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

www.hellboundhackers.org/sig/r/24963.png

www.hellboundhackers.org/sig/hbh2.png
<script>alert('XSS');</script>