I would like to run the subprocess.check_output method for my python script.
try:
logger.info('Loading URL ' + line)
wp_output = subprocess.checkout(['ruby', PATH + '/wpscan.rb', '--url', line, '--enumerate',
'vp', '--enumerate', 'vt'])
print wp_output
logger.info(wp_output)
return wp_output.strip()
except KeyboardInterrupt:
raise
except subprocess.CalledProcessError, e:
logger.exception('ERROR - Problem occurred while using wpscan.')
the exception:
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '[u'ruby', u'./wpscan/wpscan.rb', u'--url', 'www.website.de', u'--enumerate', u'vp', u'--enumerate', u'vt']' returned non-zero exit status 1
if I run check_output I get a non-zero exception, if I use only "subprocess.call" I get as result "print wp_output" only the int 1??
What I am doing wrong? I would like to get the output as a string (wp_output).
PATHvariable ? - Anand S Kumar