Coder Social home page Coder Social logo

Disable login page about dvwa HOT 20 CLOSED

TeefHennessy avatar TeefHennessy commented on May 17, 2024
Disable login page

from dvwa.

Comments (20)

zyyae avatar zyyae commented on May 17, 2024 3

更改文件:\DVWA\dvwa\includes\dvwaPage.inc.php

更改代码: dvwaIsLoggedIn 函数

原始函数定义:

function dvwaIsLoggedIn() {
$dvwaSession =& dvwaSessionGrab();
return isset( $dvwaSession[ 'username' ] );
}

更改后函数定义:

function dvwaIsLoggedIn() {
$dvwaSession =& dvwaSessionGrab();
$dvwaSession[ 'username' ]='admin';
return isset( $dvwaSession[ 'username' ] );
}

it works!

from dvwa.

uf0o avatar uf0o commented on May 17, 2024 2

to me makes more sense to change https://github.com/ethicalhack3r/DVWA/blob/7ab2e557135d4658b000517f4e49b00b3027812b/index.php#L6
to
dvwaPageStartup( array( 'unauthenticated', 'phpids' ) );

from dvwa.

uf0o avatar uf0o commented on May 17, 2024 2

why make assumpions without any context? :)
I needed a quick way to disable the login page since I have adopted DVWA to banchmark automated vulnerability scanners that lack any HTTP/POST authentication mechanism.
Hence, I left this comment for anyone else having a similar need that I am having right now.
hth

from dvwa.

g0tmi1k avatar g0tmi1k commented on May 17, 2024 1

@TeefHennessy
There is no simple way of disabling the login. You would need to dig about in the code and edit a few lines.

Any 'good' tool would allow you to set a cookie value (or add a custom header field). All you need to put in is the session ID from the cookie in the request (after being logged in). I don't think I know of a single tool that doesn't support cookies in a request...
....and for the record, jSQL does support it (need to press the arrow down on the right hand side):
http://i.imgur.com/TtPmVt4.png

from dvwa.

davidvilla avatar davidvilla commented on May 17, 2024 1

I found some strange behavior using vulnz modifications. I got good responses with:

At index.php (line 6)
dvwaPageStartup( array( 'unauthenticated', 'phpids' ) );

At dvwa/includes/dvwaPage.inc.php (function dvwaPageStartup), comment out the first block:

//      if( in_array( 'authenticated', $pActions ) ) {
//              if( !dvwaIsLoggedIn()) {
//                      dvwaRedirect( DVWA_WEB_PAGE_TO_ROOT . 'login.php' );
//              }
//      }

Cheers

from dvwa.

digininja avatar digininja commented on May 17, 2024

If that is the problem then all you need to do is to log in manually in a
browser and take to cookie and tell whatever tool you are using to send
that with the requests. I don't know jsql but sqlmap works like that.

Robin
On 12 Jan 2016 06:15, "TeefHennessy" [email protected] wrote:

Hi everyone !

First of all, thanks for creating this great learning tool :) I've been
playing with it for some time and had good time

I'd like to use DVWA to learn some tools too I'm able to access DVWA
(which is installed on VM machine) externally, that is from other VM
machines and for manual learning it works fine However when I try to use
for example some SQLi tools (jsql for example) and I'm targeting SQLI
module I get response that it's not possible although security is set to
low I'm guessing the problem may be first login page - correct me if I'm
wrong

Is there a way to disable logging in requirement to make all labs "public"
?

Thanks in advance :)


Reply to this email directly or view it on GitHub
#53.

from dvwa.

TeefHennessy avatar TeefHennessy commented on May 17, 2024

Thank you for response digininja,

However jsql was just an example, I don't think I can tell it to use cookie and there are many more tools that I'd like to try. While workaround with cookie is good idea, this doesn't solve issue.

Does anyone knows how to disable login functionality ?

from dvwa.

digininja avatar digininja commented on May 17, 2024

Any tools worth using will allow you to pass extra parameters, usually
cookies, along with them. If they don't then why not have a look at the
code and learn how to add the feature.

On 13 January 2016 at 14:38, TeefHennessy [email protected] wrote:

Thank you for response digininja,

However jsql was just an example, I don't think I can tell it to use
cookie and there are many more tools that I'd like to try. While workaround
with cookie is good idea, this doesn't solve issue.

Does anyone knows how to disable login functionality ?


Reply to this email directly or view it on GitHub
#53 (comment).

from dvwa.

TeefHennessy avatar TeefHennessy commented on May 17, 2024

Alright, thanks everyone for help

from dvwa.

ron190 avatar ron190 commented on May 17, 2024

As @g0tmi1k stated, jSQL accepts also cookies. In older version there is a dedicated field for cookie and since jSQL v0.74 cookies are merged in the Header field (e.g Cookie:key=value).

What is usually done when cookie is required is that you log in manually into the application with your browser and debugger (F12 in Firefox), and you read the header string similar to PHPSESSID=eb...9d, it's your current active user's session ID.

Then you copy this full key=value in the cookie field of your security tool in order to connect to the application as the current active user. e.g in jSQL v0.74 : Cookie:PHPSESSID=eb...9d

from dvwa.

adamziaja avatar adamziaja commented on May 17, 2024

Most easy is probably change line https://github.com/ethicalhack3r/DVWA/blob/master/login.php#L35 to if( ( $result && mysql_num_rows( $result ) == 1 ) || true ) {

from dvwa.

digininja avatar digininja commented on May 17, 2024

You realise you've dug up a 3 year old issue?

To me it makes more sense to learn how to use the tools correctly. Why dumb down your learning environments when you could instead increase your own skills.

from dvwa.

digininja avatar digininja commented on May 17, 2024

from dvwa.

uf0o avatar uf0o commented on May 17, 2024

appreciate your inputs :) thank you

from dvwa.

vulnz avatar vulnz commented on May 17, 2024

@Avanzo thank you man

from dvwa.

vulnz avatar vulnz commented on May 17, 2024

guys, after you did this:
dvwaPageStartup( array( 'unauthenticated', 'phpids' ) );
at DVWA/index.php

also you need to go to
dvwaPage.inc.php

function dvwaPageStartup( $pActions ) {
if( in_array( 'unauthenticated', $pActions ) ) {
if( dvwaIsLoggedIn()) {

to

function dvwaPageStartup( $pActions ) {
if( in_array( 'authenticated', $pActions ) ) {
if( !dvwaIsLoggedIn()) {

and

if( dvwaIsLoggedIn() ) {
to
if( !dvwaIsLoggedIn() ) {

change few lines.
Here is example of mine that work.
And after make mv index.php instruction.php - replace it.
Easy and sexy.

from dvwa.

vulnz avatar vulnz commented on May 17, 2024

Man use docker. Vulnz/dvwa and modify maybe one line of host

from dvwa.

davidvilla avatar davidvilla commented on May 17, 2024

Thank you, I am using a modified dvwa docker image (arco/dvwa) and it works exactly I want.

from dvwa.

Omniwot avatar Omniwot commented on May 17, 2024

This works

I found some strange behavior using vulnz modifications. I got good responses with:

At index.php (line 6) dvwaPageStartup( array( 'unauthenticated', 'phpids' ) );

At dvwa/includes/dvwaPage.inc.php (function dvwaPageStartup), comment out the first block:

//      if( in_array( 'authenticated', $pActions ) ) {
//              if( !dvwaIsLoggedIn()) {
//                      dvwaRedirect( DVWA_WEB_PAGE_TO_ROOT . 'login.php' );
//              }
//      }

Cheers

from dvwa.

digininja avatar digininja commented on May 17, 2024

from dvwa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.