Esempio n. 1
0
def controlPrinter(mac, port, img):
    try:
        btPrinter = obexftp.client(obexftp.BLUETOOTH)
        btPrinter.connect(mac,port)
        btPrinter.put_file(img)
        print '[+] Printed Image.'
    except:
        print '[-] Failed to print Image.'
Esempio n. 2
0
def print(addr, file):
    try:
        btPrinter = obexftp.client(obexftp.BLUETOOTH)
        btPrinter.connect(addr)
        btPrinter.put_file(file)
        print('[+] Printed file')
    except:
        print('[-] Failed to print file')
Esempio n. 3
0
def imagePrint(mac, port, imageFile): # RFCOMM 프로토콜의 OBEX Object Push 서비스를 제어해 이미지를 프린터로 전송한다.
    try:
        btPrinter=obexftp.client(obexftp.BLUETOOTH)
        btPrinter.connect(mac, port) # Obexftp로 프린터에 연결
        btPrinter.put_file(imageFile) # 공격자의 컴퓨터에서 이미지파일을 프린터로 전송
        print "[+] Printed Image"
    except:    
        print "[-] Failed to print Image"
Esempio n. 4
0
def sendFile(dev, filename):
    if os.path.exists(filename):
        client = obexftp.client(obexftp.BLUETOOTH)
        channel = obexftp.browsebt(dev, obexftp.PUSH)
        print '[>] Sending file to %s@%s' % (dev, str(channel))
        client.connect(dev, channel)
        ret = client.put_file(filename)
        if int(ret) >= 1:
            print '[>] File has been sent.'
        else:
            print '[!] File has not been accepted.'
        client.disconnect()
    else:
        print '[!] Specified file: "%s" does not exists.'
Esempio n. 5
0
#!/usr/bin/env python

import obexftp

try:
    btPrinter = obexftp.client(obexftp.BLUETOOTH)
    # Replace MAC with target MAC
    btPrinter.connect('00:11:22:33:44:55', 2)
    btPrinter.put_file('/tmp/ninja.jpg')
    print '[+] Printed Ninja Image.'
except:
    print '[-] Failed to print Ninja Image.'
Esempio n. 6
0
#!/usr/bin/python

import obexftp

obex = obexftp.client(obexftp.BLUETOOTH)

devs = obex.discover();
print devs;
dev = devs[0]
print "Using %s" % dev
channel = obexftp.browsebt(dev,0)
print "Channel %d" % channel

print obex.connect(dev, channel)

print obex.list("/")

print obex.list("/images")

data = obex.get("/images/some.jpg")
file = open('downloaded.jpg', 'wb')
file.write(data)

print obex.disconnect()

obex.delete

Esempio n. 7
0
 def __init__(self,  address,  port):
     self.client = obexftp.client(obexftp.BLUETOOTH)
     self.address = address
     self.port = port
#!/usr/bin/python
# -*- coding: utf-8 -*-

import obexftp

try:
    btPrinter = obexftp.client(obexftp.BLUETOOTH)
    btPrinter.connect("00:16:38:DE:AD:11", 2)
    btPrinter.put_file("/tmp/ninja.jpg")
    print "[+] Printed Ninja Image."
except:

    print "[-] Failed to print Ninja Image."
Esempio n. 9
0
#!/usr/bin/python

import obexftp

obex = obexftp.client(obexftp.BLUETOOTH)

devs = obex.discover()
print devs
dev = devs[0]
print "Using %s" % dev
channel = obexftp.browsebt(dev, 0)
print "Channel %d" % channel

print obex.connect(dev, channel)

print obex.list("/")

print obex.list("/images")

data = obex.get("/images/some.jpg")
file = open("downloaded.jpg", "wb")
file.write(data)

print obex.disconnect()

obex.delete
Esempio n. 10
0
 def __init__(self, address, port):
     self.client = obexftp.client(obexftp.BLUETOOTH)
     self.address = address
     self.port = port