예제 #1
0
    def __init__(self, verbose=0):
        self.verbose = verbose
        usbproxy.init()
        self.usbproxy_dev = USBProxyDevice(self)
        deviceproxy.init(self.usbproxy_dev)
        self.x = usbproxy.register_deviceproxy(
            connect=deviceproxy.connect,
            disconnect=deviceproxy.disconnect,
            control_request=deviceproxy.control_req,
            send_data=deviceproxy.send_data,
            receive_data=deviceproxy.receive_data)

        usbproxy.lib.enable_logging()
        usbproxy.lib.print_config()
        usbproxy.lib.load_plugins()
예제 #2
0
	def __init__(self, verbose=0):
		self.verbose = verbose
		usbproxy.init()
		self.usbproxy_dev = USBProxyDevice(self)
		deviceproxy.init(self.usbproxy_dev)
		self.x = usbproxy.register_deviceproxy(
			connect=deviceproxy.connect,
			disconnect=deviceproxy.disconnect,
			control_request=deviceproxy.control_req,
			send_data=deviceproxy.send_data,
			receive_data=deviceproxy.receive_data
			)
		
		usbproxy.lib.enable_logging()
		usbproxy.lib.print_config()
		usbproxy.lib.load_plugins()
예제 #3
0
import deviceproxy

callback_strings = [None, 'ubertooth', 'bt_rxtx', '0001']

device_desc = [
    18, 1, 0x00, 0x02, 0xff, 0x00, 0x00, 64, 0x50, 0x1d, 0x02, 0x60, 0x00,
    0x01, 0x00, 0x00, 0x00, 1
    #0x01, 0x01, 0x02, 0x03, 1
]

config_desc = [
    9, 2, 32, 0, 1, 1, 0, 0x80, 0x32, 9, 4, 0, 0, 2, 0xff, 0, 0, 0, 7, 5, 0x82,
    2, 0x40, 0x00, 0, 7, 5, 0x05, 2, 0x40, 0x00, 0
]


class Ubertooth(deviceproxy.DeviceProxy):
    pass


if __name__ == '__main__':
    usbproxy.init()
    device = Ubertooth(device_desc, config_desc)
    deviceproxy.init(device)
    x = usbproxy.register_deviceproxy(connect=deviceproxy.connect,
                                      control_request=deviceproxy.control_req)

    usbproxy.lib.print_config()
    usbproxy.lib.load_plugins()
    usbproxy.run()
예제 #4
0
파일: kbd.py 프로젝트: W12-Rob/USBProxy
                    pkt[0] = mod

            for i in range(len(pkt)):
                dataptr[i] = c_ubyte(pkt[i])
            p_length[0] = len(pkt)

    def get_interface(self, p_ctrl_req, p_nbytes, dataptr, timeout):
        print("USB_REQ_GET_INTERFACE")
        setup_packet = p_ctrl_req[0]
        p_nbytes[0] = 1
        if setup_packet.bRequestType & deviceproxy.USB_DIR_IN:
            dataptr[0] = c_ubyte(0)


if __name__ == "__main__":
    usbproxy.init()
    device = Keyboard(device_desc, config_desc)
    device.set_text("Shmoocon")
    deviceproxy.init(device)
    x = usbproxy.register_deviceproxy(
        connect=deviceproxy.connect,
        control_request=deviceproxy.control_req,
        send_data=deviceproxy.send_data,
        receive_data=deviceproxy.receive_data,
    )

    usbproxy.lib.enable_logging()
    usbproxy.lib.print_config()
    usbproxy.lib.load_plugins()
    usbproxy.run()
예제 #5
0
파일: usb-mitm.py 프로젝트: greso/USBProxy
import usbproxy

def filter_func(p_pkt):
	pkt = p_pkt[0]
	print "Packet:\n\tlength:%d\n\tEP:%02X" % (pkt.wLength, pkt.bEndpoint)
	x = ["%02x" % pkt.data[i] for i in range(pkt.wLength)]
	print x

if __name__ == '__main__':
	usbproxy.init()
	usbproxy.register_packet_filter(filter_func)
	device_desc = usbproxy.USB_Device_Descriptor(
		18, 1, 0x0200, 0xff, 0, 0, 64, 0x1d50, 0x6002, 0x0100, 1, 2, 3, 1
	)
	config_desc = usbproxy.USB_Config_Descriptor(
		9, 2, 32, 1, 1, 0, 0x80
	)
	interface_desc = usbproxy.USB_Interface_Descriptor(
		9, 4, 0, 0, 2, 0xff, 0, 0, 0
	)
	ep_desc = usbproxy.USB_Endpoint_Descriptor(
		7, 5, 0x82, 2, 0x0040, 0
	)

	usbproxy.register_deviceproxy(device_desc, config_desc, interface_desc, ep_desc)
	usbproxy.lib.print_config()
	usbproxy.lib.load_plugins()
	usbproxy.run()

예제 #6
0
파일: kbd.py 프로젝트: zyh329/USBProxy
                if key:
                    pkt[2] = key
                if mod:
                    pkt[0] = mod

            for i in range(len(pkt)):
                dataptr[i] = c_ubyte(pkt[i])
            p_length[0] = len(pkt)

    def get_interface(self, p_ctrl_req, p_nbytes, dataptr, timeout):
        print("USB_REQ_GET_INTERFACE")
        setup_packet = p_ctrl_req[0]
        p_nbytes[0] = 1
        if setup_packet.bRequestType & deviceproxy.USB_DIR_IN:
            dataptr[0] = c_ubyte(0)


if __name__ == '__main__':
    usbproxy.init()
    device = Keyboard(device_desc, config_desc)
    device.set_text("Shmoocon")
    deviceproxy.init(device)
    x = usbproxy.register_deviceproxy(connect=deviceproxy.connect,
                                      control_request=deviceproxy.control_req,
                                      send_data=deviceproxy.send_data,
                                      receive_data=deviceproxy.receive_data)

    usbproxy.lib.enable_logging()
    usbproxy.lib.print_config()
    usbproxy.lib.load_plugins()
    usbproxy.run()
예제 #7
0
device_desc = [
	18, 1, 0x00, 0x02, 0xff, 0x00, 0x00,
	64, 0x50, 0x1d, 0x02, 0x60, 0x00,
	0x01, 0x00, 0x00, 0x00, 1
	#0x01, 0x01, 0x02, 0x03, 1
]

config_desc = [
	9, 2, 32, 0, 1, 1, 0, 0x80, 0x32,
	9, 4, 0, 0, 2, 0xff, 0, 0, 0,
	7, 5, 0x82, 2, 0x40, 0x00, 0,
	7, 5, 0x05, 2, 0x40, 0x00, 0
]

class Ubertooth(deviceproxy.DeviceProxy):
	pass

if __name__ == '__main__':
	usbproxy.init()
	device = Ubertooth(device_desc, config_desc)
	deviceproxy.init(device)
	x = usbproxy.register_deviceproxy(
		connect=deviceproxy.connect,
		control_request=deviceproxy.control_req
		)
	
	usbproxy.lib.print_config()
	usbproxy.lib.load_plugins()
	usbproxy.run()