Example #1
0
class App(QWidget):
    def __init__(self):
        super().__init__()
        self.title = 'VAPT Report Generator'
        self.left = 10
        self.top = 10
        self.width = 1280
        self.height = 720
        self.__Img = None
        self.__doc = None
        self.doc = Print_document()
        self.doc.start_doc()
        self.doc.initialize_doc()
        self.initUI()

    def initUI(self):
        self.setWindowTitle(self.title)
        self.setWindowIcon(QIcon("Prinstine.png"))
        self.setGeometry(self.left, self.top, self.width, self.height)

        self.font = QFont()
        self.font.setFamily('Helvetica')
        self.font.setPointSize(16)

        self.Vname = QLabel('Vulnerabilty Name:', self)
        self.Vname.move(20, 5)
        self.Vname.resize(250, 50)
        self.Vname.setFont(self.font)

        self.Vnamebox = QLineEdit(self)
        self.Vnamebox.move(260, 10)
        self.Vnamebox.resize(600, 30)
        self.Vnamebox.setFont(self.font)

        self.VDesc = QLabel('Vulnerabilty Description:', self)
        self.VDesc.move(20, 80)
        self.VDesc.resize(250, 50)
        self.VDesc.setFont(self.font)

        self.VDescbox = QPlainTextEdit(self)
        self.VDescbox.move(260, 50)
        self.VDescbox.resize(600, 100)

        self.Vurl = QLabel('Vulnearable URL:', self)
        self.Vurl.move(20, 155)
        self.Vurl.resize(250, 50)
        self.Vurl.setFont(self.font)

        self.Vurlbox = QLineEdit(self)
        self.Vurlbox.move(260, 160)
        self.Vurlbox.resize(600, 30)

        self.VSeverity = QLabel('Severity:', self)
        self.VSeverity.move(20, 205)
        self.VSeverity.resize(250, 50)
        self.VSeverity.setFont(self.font)

        self.VSeveritybox = QComboBox(self)
        self.VSeveritybox.addItem('Critical', 1)
        self.VSeveritybox.addItem('High', 2)
        self.VSeveritybox.addItem('Medium', 3)
        self.VSeveritybox.addItem('Low', 4)
        self.VSeveritybox.addItem('Informational', 5)
        self.VSeveritybox.move(260, 210)
        self.VSeveritybox.resize(600, 30)

        self.VImpact = QLabel('Impact:', self)
        self.VImpact.move(20, 280)
        self.VImpact.resize(250, 80)
        self.VImpact.setFont(self.font)

        self.VImpactBox = QPlainTextEdit(self)
        self.VImpactBox.move(260, 250)
        self.VImpactBox.resize(600, 130)

        self.VRemediation = QLabel('Remediation:', self)
        self.VRemediation.move(20, 425)
        self.VRemediation.resize(250, 50)
        self.VRemediation.setFont(self.font)

        self.VRemediationBox = QPlainTextEdit(self)
        self.VRemediationBox.move(260, 400)
        self.VRemediationBox.resize(600, 100)

        self.SaveButton = QPushButton('Back', self)
        self.SaveButton.move(480, 580)
        self.SaveButton.clicked.connect(self.back)
        self.SaveButton.setFont(self.font)

        self.saveReport = QPushButton('Add Vulnerabilty', self)
        self.saveReport.move(560, 580)
        self.saveReport.clicked.connect(self.on_report)
        self.saveReport.setFont(self.font)

        self.ImgButton = QPushButton('Browse', self)
        self.ImgButton.move(400, 580)
        self.ImgButton.clicked.connect(self.on_browse)
        self.ImgButton.setFont(self.font)

        self.show()

    @pyqtSlot()
    def on_report(self):

        vname = self.Vnamebox.text()
        print(vname)
        self.doc.setVname(vname)

        severity = self.VSeveritybox.currentText()
        self.doc.setVSeverity(severity)
        print(severity)

        VDesc = self.VDescbox.toPlainText()
        self.doc.SetVdesc(VDesc)

        Vurl = self.Vurlbox.text()
        self.doc.setVurl(Vurl)

        self.doc.setImg(self.__Img)

        VImpact = self.VImpactBox.toPlainText()
        self.doc.setImpact(VImpact)

        Vrem = self.VRemediationBox.toPlainText()
        self.doc.setVremed(Vrem)

        self.doc.pageBreak()

    @pyqtSlot()
    def on_browse(self):
        self.__Img = QFileDialog.getOpenFileNames(self, 'Open Files', '/',
                                                  ("Images(*.png)"))

    @pyqtSlot()
    def on_click(self):
        self.doc.Savereport()

    @pyqtSlot()
    def back(self):
        #self.window = QtWidgets.QMainWindow()
        self.doc.Savereport()
        self.ui = MainWindow.App1()
        self.ui.initUI()
        App.hide(self)
Example #2
0
class NonTech(QWidget):

	def __init__(self):
		super().__init__()
		self.title = 'VAPT Report Generator'
		self.left = 10
		self.top = 10
		self.width = 1280
		self.height = 720
		self.__Img = None
		self.__doc = None
		self.doc = Print_document()
		self.doc.start_doc()
		self.doc.initialize_doc()

	def NonTechUI(self):
		self.setWindowTitle(self.title)
		self.setWindowIcon(QIcon("Pristine.png"))
		self.setGeometry(self.left, self.top, self.width, self.height)

		self.font = QFont()
		self.font.setFamily('Helvetica')
		self.font.setPointSize(16)

		self.VCompany = QLabel('Client Name:',self)
		self.VCompany.move(20, 5)
		self.VCompany.resize(250,50)
		self.VCompany.setFont(self.font)

		self.VCompanyBox = QLineEdit(self)
		self.VCompanyBox.move(260, 10)
		self.VCompanyBox.resize(600,30)
		self.VCompanyBox.setFont(self.font)
		self.VCompanyBox.setText('')

		self.VDate = QLabel('Start Date:',self)
		self.VDate.move(20, 50)
		self.VDate.resize(250,50)
		self.VDate.setFont(self.font)

		self.VDateBox = QLineEdit(self)
		self.VDateBox.move(260, 50)
		self.VDateBox.resize(600,30)
		self.VDateBox.setFont(self.font)

		self.VTitle = QLabel('Title:',self)
		self.VTitle.move(20, 110)
		self.VTitle.resize(250,50)
		self.VTitle.setFont(self.font)

		self.VTitleBox = QLineEdit(self)
		self.VTitleBox.move(260, 115)
		self.VTitleBox.resize(600,30)
		self.VTitleBox.setFont(self.font)
		self.VTitleBox.setText('')

		self.VAuthor = QLabel('Author:',self)
		self.VAuthor.move(20, 155)
		self.VAuthor.resize(250,50)
		self.VAuthor.setFont(self.font)

		self.VAuthorbox = QLineEdit(self)
		self.VAuthorbox.move(260, 160)
		self.VAuthorbox.resize(600,30)
		self.VAuthorbox.setText('')

		self.VManager = QLabel('Project Manager:',self)
		self.VManager.move(20, 195)
		self.VManager.resize(250,50)
		self.VManager.setFont(self.font)

		self.VManagerbox = QLineEdit(self)
		self.VManagerbox.move(260, 200)
		self.VManagerbox.resize(600,30)
		self.VManagerbox.setText('')

		self.VApproach = QLabel('Approach:',self)
		self.VApproach.move(20, 305)
		self.VApproach.resize(250,50)
		self.VApproach.setFont(self.font)

		self.VApproachbox = QComboBox(self)
		self.VApproachbox.addItem('White-Box',1)
		self.VApproachbox.addItem('Black-Box',2)
		self.VApproachbox.move(260, 310)
		self.VApproachbox.resize(600,30)

		self.Rname = QLabel('Recipient Name:',self)
		self.Rname.move(20, 385)
		self.Rname.resize(250,50)
		self.Rname.setFont(self.font)

		self.Rnamebox = QLineEdit(self)
		self.Rnamebox.move(260, 400)
		self.Rnamebox.resize(600,30)
		self.Rnamebox.setText('')

		self.Rtitle = QLabel('Recipient Title',self)
		self.Rtitle.move(20, 435)
		self.Rtitle.resize(250,50)
		self.Rtitle.setFont(self.font)

		self.Rtitlebox = QLineEdit(self)
		self.Rtitlebox.move(260, 440)
		self.Rtitlebox.resize(600,30)
		self.Rtitlebox.setText('')

		self.VersionC = QLabel('Version:',self)
		self.VersionC.move(20, 355)
		self.VersionC.resize(250,50)
		self.VersionC.setFont(self.font)

		self.VersionCbox = QLineEdit(self)
		self.VersionCbox.move(260, 360)
		self.VersionCbox.resize(600,30)
		self.VersionCbox.setText('')

		self.SaveButton = QPushButton('Back', self)
		self.SaveButton.move(480,580)
		self.SaveButton.clicked.connect(self.back)
		self.SaveButton.setFont(self.font)

		self.saveReport = QPushButton('Add Intro',self)
		self.saveReport.move(560,580)
		self.saveReport.clicked.connect(self.on_report)
		self.saveReport.setFont(self.font)

		self.ImgButton = QPushButton('Browse', self)
		self.ImgButton.move(400,580)
		self.ImgButton.setFont(self.font)

		self.show()

	@pyqtSlot()
	def back(self):
		self.ui = MainWindow.App1()
		self.ui.initUI()
		NonTech.hide(self)

	@pyqtSlot()
	def on_report(self):
		self.doc.setTitle()

		cname = self.VCompanyBox.text()
		rname = self.Rnamebox.text()
		rtitle = self.Rtitlebox.text()
		Author = self.VAuthorbox.text()
		PManager = self.VManagerbox.text()
		Title = self.VTitleBox.text()
		Date= self.VDateBox.text()
		Version = self.VersionCbox.text()
		Approach = self.VApproachbox.currentText()

		self.doc.setCName(cname)

		self.doc.pageBreak()

		self.doc.AuthorTable(Author,Approach,PManager,Title,Version)
		self.doc.RecipientTable(rname,rtitle,cname)
		self.doc.VersionTable(Version,Author,Date)

		self.doc.pageBreak()

		self.doc.setSummary()

		self.doc.pageBreak()

		self.doc.Intro(cname,PManager,Author)
		self.doc.pageBreak()

		self.doc.Savereport()