WhitewidowScanner / whitewidow

SQL Vulnerability Scanner
973 stars 234 forks source link

Refactor/scanner #43

Closed TylerRockwell closed 7 years ago

TylerRockwell commented 7 years ago

Why?

Large methods are hard to read/follow/debug/change

What Changed?

Ekultek commented 7 years ago

What is the purpose of adding pry to this?

TylerRockwell commented 7 years ago

Pry is there for ease of debugging. We don't have to keep it in the Gemfile if you don't want, but I thought it may be easier than adding it whenever we need to step through the code.

Ekultek commented 7 years ago

Okay, just thought you might have some auto debugging tactic that I didn't know about, will this still remove blank lines from files and all white space? For example:

Turn this:

http://example.example.com/php?id=is

        http://example.example.com/php?id=i

  http://example.example.com/php?id=it

Into this:

http://example.example.com/php?id=is
http://example.example.com/php?id=i
http://example.example.com/php?id=it
TylerRockwell commented 7 years ago

Hmm...looks like it's not at the moment. Hold off on merging this, and I'll figure out what's going on.

Blank lines are still getting removed, but leading whitespace is still there.

Ekultek commented 7 years ago

Take your time man

TylerRockwell commented 7 years ago

It's fixed. I was just missing .strip in this block

{ |outfile| outfile.puts(line.strip) unless line.chomp.empty? }
TylerRockwell commented 7 years ago

I'll add a test for that in the near future.

Ekultek commented 7 years ago

Drop pry and I'll test it tomorrow morning

Ekultek commented 7 years ago

You know what actually I have an idea for pry so keep it there and I'll test it tomorrow

Ekultek commented 7 years ago

It won't find the files

 __      __.__    .__  __         __      __.__    .___
/  \    /  \  |__ |__|/  |_  ____/  \    /  \__| __| _/______  _  __
\   \/\/   /  |  \|  \   __\/ __ \   \/\/   /  |/ __ |/  _ \ \/ \/ /
 \        /|   Y  \  ||  | \  ___/\        /|  / /_/ (  <_> )     /
  \__/\  / |___|  /__||__|  \___  >\__/\  / |______ | \____/ \/\_/
       \/       \/              \/      \/           \/    v1.9.5.8(dev)

Clone: https://github.com/WhitewidowScanner/whitewidow.git
Downloads: https://github.com/WhitewidowScanner/whitewidow/releases
[ ! ] Use of this program for malicious intent is illegal. For more information
run the --legal flag

[08:37:37 INFO] Formatting file

Hey now my friend, I know you're eager, I am also, but that file tmp/sites.txt
either doesn't exist, or it's not in the directory you say it's in..

I'm gonna need you to go find that file, move it to the correct directory and th
en
run me again.

Don't worry I'll wait!
Ekultek commented 7 years ago

hahahaha nvm...

Ekultek commented 7 years ago

alright so drop pry from the gem file and i'll merge it