Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /home/ift/52_procpy/dataninja/websocket/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : //home/ift/52_procpy/dataninja/websocket/qt5_ui_webso.py

#!/usr/bin/python3
# -*- coding: utf-8 -*-

"""
xueshang nai
"""

import sys
from PyQt5.QtWidgets import QMainWindow, QPushButton, QTextEdit, QAction, QApplication
from PyQt5.QtGui import QIcon
import websocket
import _thread
import time
import json



def on_message(ws, message):
    print (message)

def on_error(ws, error):
    print (error)


def on_open(ws):

    def run(*args):
        time.sleep(1)
        #name = input("Enter the cmd--->> ")
        ws.send(Example.g_msg)
        #time.sleep(1)
        #ws.close()
        print ("thread terminating...")
    _thread.start_new_thread(run, ())

def on_close(ws):
    print ("### closed ###")

class Example(QMainWindow):

    def __init__(self):
        super().__init__()
        self.g_msg=""
        self.initUI()

    def send_msg(self):
        self.g_msg=self.textEdit.toPlainText()
        print(self.g_msg)
        self.textEdit.setText("")
        websocket.enableTrace(True)
        ws = websocket.WebSocketApp(self.connect_addr_port,
                                    on_message=on_message,
                                    on_error=on_error,
                                    on_close=on_close
                                    )

        ws.on_open = on_open
        ws.run_forever()
    def initUI(self):
        with open("web_so_cfg.json", 'r') as load_f:
            load_dict = json.load(load_f)

        ipaddr = load_dict['server_url']
        port = load_dict['server_port']
        data_file = load_dict['data_file']
        print("ipaddr=", ipaddr)
        print("port=", port)
        print("data_file=", data_file)

        self.connect_addr_port = 'ws://' + ipaddr + ':' + port + '/websocket/'
        print("connect_addr_port=", self.connect_addr_port)

        self.textEdit = QTextEdit()
        self.setCentralWidget(self.textEdit)

        exitAct = QAction(QIcon('exit24.png'), 'Exit', self)
        exitAct.setShortcut('Ctrl+Q')
        exitAct.setStatusTip('Exit application')
        exitAct.triggered.connect(self.close)

        self.statusBar()

        menubar = self.menuBar()
        fileMenu = menubar.addMenu('&File')
        fileMenu.addAction(exitAct)

        toolbar = self.addToolBar('Exit')
        toolbar.addAction(exitAct)

        self.setGeometry(300, 300, 350, 250)
        self.setWindowTitle('Main window')

        qbtn = QPushButton('Send', self)
        qbtn.clicked.connect(self.send_msg)
        qbtn.resize(qbtn.sizeHint())
        qbtn.move(50, 50)
        self.show()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = Example()
    sys.exit(app.exec_())

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net