Burp automation with Python

Let's create a simple Python script and call it burp_automate.py. Enter the following code:

import requestsimport jsonfrom urlparse import urljoinimport socketimport astimport timeclass Burp_automate():    def __init__(self):        self.result=""        self.api_key="odTOmUX9mNTV3KRQ4La4J1pov6PEES72"        self.api_url="http://127.0.0.1:1337"        def start(self):        try:                        data='{"application_logins":[{"password":"password","username":"admin"}],"scan_callback":{"url":"http://127.0.0.1:8001"},"scope":{"exclude":[{"rule":"http://192.168.250.1/dvwa/logout.php","type":"SimpleScopeDef"}],"include":[{"rule":"http://192.168.250.1/dvwa/","type":"SimpleScopeDef"}]},"urls":["http://192.168.250.1/dvwa/"]}' request_url=urljoin(self.api_url,self.api_key) ...

Get Hands-On Penetration Testing with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.