You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to give a run command and get the response programatically in a python script.
I see that Session class has sendAndReceive method session.py#L591 which takes in a Message object. There is also Reflector class's sendAndReceive method reflector.py#L100 which takes in either a Factory such as ReflectionRequestFactory or a Message object. There is no document on it so my guess is that we have to add commands as arguments. Before I dump all my code I want to know if this is the only way or there some one-liner code that I overlooked.
command = 'run app.package.list'
args = Message.Argument(type=Message.Argument.STRING, string=command)
fac = ReflectionRequestFactory(Message.ReflectionRequest.INVOKE).setArguments([args])
res = self.session.reflector.sendAndReceive(fac)
print(res)
Gives error AttributeError: _pb on reflection_request.py:118 request.argument.add().MergeFrom(argument._pb())
The text was updated successfully, but these errors were encountered:
Hey! Full disclosure: it'll take us a while to get back to you on this.
Long story short - there isn't currently an easy/documented way of interacting with drozer programmatically. I agree there should be, and I'll add it to my list.
The methods you identified are used for sending drozer protocol commands between the console and agent - not really relevant to what you're trying to do.
I am trying to give a run command and get the response programatically in a python script.
I see that
Session
class hassendAndReceive
method session.py#L591 which takes in aMessage
object. There is alsoReflector
class'ssendAndReceive
method reflector.py#L100 which takes in either a Factory such asReflectionRequestFactory
or aMessage
object. There is no document on it so my guess is that we have to add commands as arguments. Before I dump all my code I want to know if this is the only way or there some one-liner code that I overlooked.Gives error
AttributeError: _pb
on reflection_request.py:118request.argument.add().MergeFrom(argument._pb())
The text was updated successfully, but these errors were encountered: