Author Archives: cyruslab

[python]Simple tcp client

So here’s the simple code: So first create an object client, the attributes are IPV4 (socket.AF_INET) and tcp (socket.SOCK_STREAM). Use the send method to send http request, must send the msg in bytes, hence the b. Advertisements

Posted in Python, Scripting | Tagged , , | Leave a comment

[python]Intrusive python: Reacting with interactive prompt with pexpect

Ok, I am reading some stuffs about brute forcing ssh server. So here is a python module that deals with possible interactive prompts. The target server is a cisco router, I have put in all possible expected prompts.Such as: 1. … Continue reading

Posted in Python, Scripting | Tagged , | Leave a comment

[python]Intrusive python with nmap

So i was trying some simple script to invoke nmap with python. So here is a python command line version. The python script takes in two types of arguments: a. target host b. target port/ports. the port if more than … Continue reading

Posted in Python, Scripting | Tagged , , | Leave a comment

[python]Intrusive python with nmap

Just got a new python-nmap installed, and nmap installed on my mac, did a small try out on manipulating the result. here’s the code: I will be trying out the full scan capability with the codes, the above is just … Continue reading

Posted in Python, Scripting | Tagged , | Leave a comment

[python]Exception handling with pan-python

pan.xapi has its own error handling, so on previous post i updated the code with exception handling. I actually tested with wrong credential, I could see the http 403 forbidden error raised. Which is good, as I would know what … Continue reading

Posted in Python, Scripting | Tagged , , , , | Leave a comment

[python]Working with Palo Alto firewall API with pan-python module

This is another demonstration on the use of pan-python module. The usage documentation can be found in github. This is a simple demonstration on using the pan.xapi module from pan-python. Only changes the device configuration time settings. The demo uses … Continue reading

Posted in Python, Scripting | Tagged , , | Leave a comment

[python]working with pan-python module. Module that calls Palo Alto API

I found the example of usage in here. The code will not work on python3. In fact i am not sure why the print(credentials) in the code is necessary, there is no arg passed into the PanXapi which puzzles me … Continue reading

Posted in Python, Scripting | Tagged | Leave a comment