13 Years of Service
57%
DPScan : Drupal Security Scanner
The First Security scanner for Drupal CMS has been released by Ali Elouafiq, on his Blog. His team develop a tool that will enumerate at least the modules used by Drupal so we can simulate a White Box audit on our private machines.
This small tool is public and accessible to you for use however you please. It may help other auditors or penetration testers do their job faster, Here is a little demonstration. After downloading the script (in python), you simply type:
> python DPScan.py [website url]

The First Security scanner for Drupal CMS has been released by Ali Elouafiq, on his Blog. His team develop a tool that will enumerate at least the modules used by Drupal so we can simulate a White Box audit on our private machines.
This small tool is public and accessible to you for use however you please. It may help other auditors or penetration testers do their job faster, Here is a little demonstration. After downloading the script (in python), you simply type:
> python DPScan.py [website url]
Code:
>
#!/usr/bin/python
#drupal modules scanner
import os,sys,socket, subprocess
#!/usr/bin/python
#drupal modules scanner
import os,sys,socket, subprocess
__CMD__={
#WGET
"wget":" wget -q -O - ",
"grep":" | grep modules",
"output_file":" cat ",
"help": "DRUPAL Modules Enumerator v0.1beta-- written by Ali Elouafiq 2012"
"\n [filename.txt]"
"\n [url]"
"\n [url] user password // FOR HTTP AUTHORIZATION"
}
__DEBUG_MODE__="off"
def call(command):
p=subprocess.Popen([command], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if ( len(p.stdout.readlines()) + len( p.stderr.readlines()) ) > 0 :
raise CommandFailure(command)
def main():
#check options
Modules_List=[]
command=""
if len(sys.argv)==1:
print __CMD__["help"]
else:
if len(sys.argv) == 2 :
url=sys.argv[1]
if len(url.split(".txt")) > 1:
command=""+__CMD__["output_file"]+url
else: command=""+__CMD__["wget"]+url
if len(sys.argv) == 4 :
url=sys.argv[1]
user=sys.argv[2]
password=sys.argv[3]
command=""+__CMD__["wget"]+url+" --http-user "+user+" --http-password "+password
#Retrieves the Page
command=command+__CMD__["grep"]
#---Command:
p=subprocess.Popen([command], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if __DEBUG_MODE__=="wget": print p.stdout
#SCAN the page
for line in p.stdout:
line=line.split("modules")
if len(line)>1 :
Modules_List.append(line[1].split("/")[1])
#Retrieve Results
Modules_List=list(set(Modules_List))
for module in Modules_List:
print module
if __name__=="__main__":
main()
__CMD__={
#WGET
"wget":" wget -q -O - ",
"grep":" | grep modules",
"output_file":" cat ",
"help": "DRUPAL Modules Enumerator v0.1beta-- written by Ali Elouafiq 2012"
"\n [filename.txt]"
"\n [url]"
"\n [url] user password // FOR HTTP AUTHORIZATION"
}
__DEBUG_MODE__="off"
def call(command):
p=subprocess.Popen([command], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if ( len(p.stdout.readlines()) + len( p.stderr.readlines()) ) > 0 :
raise CommandFailure(command)
def main():
#check options
Modules_List=[]
command=""
if len(sys.argv)==1:
print __CMD__["help"]
else:
if len(sys.argv) == 2 :
url=sys.argv[1]
if len(url.split(".txt")) > 1:
command=""+__CMD__["output_file"]+url
else: command=""+__CMD__["wget"]+url
if len(sys.argv) == 4 :
url=sys.argv[1]
user=sys.argv[2]
password=sys.argv[3]
command=""+__CMD__["wget"]+url+" --http-user "+user+" --http-password "+password
#Retrieves the Page
command=command+__CMD__["grep"]
#---Command:
p=subprocess.Popen([command], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if __DEBUG_MODE__=="wget": print p.stdout
#SCAN the page
for line in p.stdout:
line=line.split("modules")
if len(line)>1 :
Modules_List.append(line[1].split("/")[1])
#Retrieve Results
Modules_List=list(set(Modules_List))
for module in Modules_List:
print module
if __name__=="__main__":
main()
This link is hidden for visitors. Please Log in or register now.