-
Notifications
You must be signed in to change notification settings - Fork 0
/
TimestampGenerator.py
53 lines (41 loc) · 1.85 KB
/
TimestampGenerator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from burp import IBurpExtender
from burp import IIntruderPayloadGeneratorFactory
from burp import IIntruderPayloadGenerator
from java.io import PrintWriter
from java.text import SimpleDateFormat
from java.util import Date, TimeZone
class BurpExtender(IBurpExtender, IIntruderPayloadGeneratorFactory):
def registerExtenderCallbacks(self, callbacks):
self._callbacks = callbacks
self._helpers = callbacks.getHelpers()
callbacks.setExtensionName("Timestamp Generator UTC")
callbacks.registerIntruderPayloadGeneratorFactory(self)
callbacks.printOutput(".::Timestamp Generator::.")
callbacks.printOutput("Author: Old Joker")
callbacks.printOutput("Version: 1.0")
callbacks.printOutput(
"""Description:
This Burp Suite extension automates the generation of timestamps, facilitating seamless integration with the Intruder Tools.
It enables the effortless insertion of timestamps into payloads, enhancing the efficiency of various security testing activities."""
)
callbacks.printOutput("GitHub: https://github.com/old-joker/TimestampGenerator")
return
def getGeneratorName(self):
return "Timestamp Generator UTC"
def createNewInstance(self, attack):
return EpochTime(self, attack)
class EpochTime(IIntruderPayloadGenerator):
def __init__(self, extender, attack):
self._extender = extender
self._helpers = extender._helpers
self._attack = attack
return
def hasMorePayloads(self):
return True
def getNextPayload(self, current_payload):
dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'")
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"))
timestampStr = dateFormat.format(Date())
return timestampStr.encode()
def reset(self):
return