Closed Xyntax closed 8 years ago
also occurs in function write_conf(self) (x.py line 108)
@Thanks @Xyntax. If possible, please show the following information:
We'll try to fix it as soon as possible.
Pocsuite Version
sec@lab:~/Downloads/Pocsuite$ pocsuite --version
2.0.4.1
OS Version
sec@lab:~/Downloads/Pocsuite$ uname -a
Linux lab 3.19.0-59-generic #66~14.04.1-Ubuntu SMP Fri May 13 17:27:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Bug details
a demo .pocsuiterc here:
~ cat ~/.pocsuiterc
[zoomeye]
username =
password =
[token]
seebug = Your Seebug Token
[token]
's seebug
item from ~/.pocsuiterc
, and try:>>> import pocsuite.api.x
>>> seebug = pocsuite.api.x.Seebug("/home/sec/.pocsuiterc")
---------------------------------------------------------------------------
NoOptionError Traceback (most recent call last)
<ipython-input-5-8590c243e0d2> in <module>()
----> 1 seebug = pocsuite.api.x.Seebug("/home/sec/.pocsuiterc")
/home/sec/Downloads/Pocsuite/pocsuite/api/x.py in __init__(self, confPath)
84 self.parser = ConfigParser.ConfigParser()
85 self.parser.read(self.confPath)
---> 86 self.token = self.parser.get('token', 'seebug')
87
88 self.headers = {'Authorization': 'Token %s' % self.token}
/usr/lib/python2.7/ConfigParser.pyc in get(self, section, option, raw, vars)
616 value = d[option]
617 except KeyError:
--> 618 raise NoOptionError(option, section)
619
620 if raw or value is None:
NoOptionError: No option 'seebug' in section: 'token'
>>> import pocsuite.api.x
>>> seebug = pocsuite.api.x.Seebug()
>>> seebug.write_conf()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-7-26536c949118> in <module>()
----> 1 seebug.write_conf()
/home/sec/Downloads/Pocsuite/pocsuite/api/x.py in write_conf(self)
105
106 def write_conf(self):
--> 107 if not self.parser.has_section("token"):
108 self.parse.add_section("token")
109
AttributeError: Seebug instance has no attribute 'parser'
self.parse
does not exist.(Pdb) dir(self)
['__doc__', '__init__', '__module__', 'confPath', 'headers', 'parser', 'retrieve', 'seek', 'static', 'token', 'write_conf']
and use
os.path.join(path1,".rc")
instead ofpath1 + "/.rc"