Ejemplo n.º 1
0
    def __init__(self):
        Input.__init__(self, CAPABILITIES)
        self.dv_src = gst.element_factory_make("dv1394src", "video_src")
        self.dv_src.set_property("use-avc", False)
        self.add(self.dv_src)
        self.capsfilter = gst.element_factory_make("capsfilter",
                                                   "dv_capsfilter")
        self.add(self.capsfilter)
        self.tee = gst.element_factory_make("tee", "dv_tee")
        self.add(self.tee)
        self.queue_src = gst.element_factory_make("queue", "dv_src_queue")
        self.add(self.queue_src)
        self.dvdemux = gst.element_factory_make("ffdemux_dv", "dvdemux")
        self.add(self.dvdemux)
        self.dvdemux.connect("pad-added", self.on_pad_added)
        self.video_queue = gst.element_factory_make("multiqueue",
                                                    "video_demux_queue")
        self.add(self.video_queue)

        self.colorspc = gst.element_factory_make("ffmpegcolorspace",
                                                 "video_dv_colorspace")

        self.add(self.colorspc)

        self.dvdec = gst.element_factory_make("dvdec", "dvdec")
        self.add(self.dvdec)
        self.videoscale = gst.element_factory_make("videoscale",
                                                   "dv_videoscale")
        self.add(self.videoscale)
        gst.element_link_many(self.dv_src, self.capsfilter, self.tee,
                              self.queue_src, self.dvdemux)
        gst.element_link_many(self.dvdec, self.colorspc, self.videoscale)
        self.video_pad.set_target(self.videoscale.src_pads().next())
        index = 1
Ejemplo n.º 2
0
    def __init__(self):
        Input.__init__(self, CAPABILITIES)
        self.dv_src = gst.element_factory_make("dv1394src", "video_src")
        self.dv_src.set_property("use-avc", False)
        self.add(self.dv_src)
        self.capsfilter = gst.element_factory_make("capsfilter", "dv_capsfilter")
        self.add(self.capsfilter)
        self.tee = gst.element_factory_make("tee", "dv_tee")
        self.add(self.tee)
        self.queue_src = gst.element_factory_make("queue", "dv_src_queue")
        self.add(self.queue_src)
        self.dvdemux = gst.element_factory_make("dvdemux", "dvdemux")
        self.add(self.dvdemux)
        self.dvdemux.connect("pad-added", self.on_pad_added)
        self.video_queue = gst.element_factory_make("multiqueue", "video_demux_queue")
        self.add(self.video_queue)

        self.colorspc = gst.element_factory_make("ffmpegcolorspace", "video_dv_colorspace")

        self.add(self.colorspc)

        self.dvdec = gst.element_factory_make("dvdec", "dvdec")
        self.add(self.dvdec)
        self.videoscale = gst.element_factory_make("videoscale", "dv_videoscale")
        self.add(self.videoscale)
        gst.element_link_many(self.dv_src, self.capsfilter, self.tee, self.queue_src, self.dvdemux)
        gst.element_link_many(self.dvdec, self.colorspc, self.videoscale)
        self.video_pad.set_target(self.videoscale.src_pads().next())
        index = 1
Ejemplo n.º 3
0
 def __init__(self):
     Input.__init__(self, CAPABILITIES)
     self.file_src = gst.element_factory_make("filesrc", "src")
     self.add(self.file_src)
     self.decode_bin = gst.element_factory_make("decodebin", "decoder")
     self.add(self.decode_bin)
     self.decode_bin.connect("new-decoded-pad", self.on_dynamic_pad)
     gst.element_link_many(self.file_src, self.decode_bin)
Ejemplo n.º 4
0
    def __init__(self):
        Input.__init__(self, CAPABILITIES)

        self.video_src = gst.element_factory_make("v4l2src", "video_src")
        self.add(self.video_src)

        self.capsfilter = gst.element_factory_make("capsfilter", "capsfilter")
        self.add(self.capsfilter)

        gst.element_link_many(self.video_src, self.capsfilter)

        self.video_pad.set_target(self.capsfilter.src_pads().next())
Ejemplo n.º 5
0
    def __init__(self):
        Input.__init__(self, CAPABILITIES)

        self.video_src = gst.element_factory_make("v4l2src", "video_src")
        self.add(self.video_src)

        self.capsfilter = gst.element_factory_make("capsfilter", "capsfilter")
        self.add(self.capsfilter)

        gst.element_link_many(self.video_src, self.capsfilter)

        self.video_pad.set_target(self.capsfilter.src_pads().next())
Ejemplo n.º 6
0
 def __init__(self):
     Input.__init__(self, CAPABILITIES)
     self.http_src = gst.element_factory_make("souphttpsrc", "src")
     self.http_src.set_property("is-live", True)
     self.add(self.http_src)
     self.decode_bin = gst.element_factory_make("decodebin2", "decoder")
     self.add(self.decode_bin)
     self.decode_bin.connect("new-decoded-pad", self.on_dynamic_pad)
     self.lkv = gst.element_factory_make("livekeeper", "lkv")
     self.add(self.lkv)
     self.lka = gst.element_factory_make("livekeeper", "lka")
     self.add(self.lka)
     gst.element_link_many(self.http_src, self.decode_bin)
     self.video_pad.set_target(self.lkv.src_pads().next())
     self.audio_pad.set_target(self.lka.src_pads().next())
Ejemplo n.º 7
0
 def __init__(self):
     Input.__init__(self, CAPABILITIES)
     self.http_src = gst.element_factory_make("souphttpsrc", "src")
     self.http_src.set_property("is-live", True)
     self.add(self.http_src)
     self.decode_bin = gst.element_factory_make("decodebin2", "decoder")
     self.add(self.decode_bin)
     self.decode_bin.connect("new-decoded-pad", self.on_dynamic_pad)
     self.lkv = gst.element_factory_make("livekeeper", "lkv")
     self.add(self.lkv)
     self.lka = gst.element_factory_make("livekeeper", "lka")
     self.add(self.lka)
     gst.element_link_many(self.http_src, self.decode_bin)
     self.video_pad.set_target(self.lkv.src_pads().next())
     self.audio_pad.set_target(self.lka.src_pads().next())
Ejemplo n.º 8
0
    def load(self):
        if not self.cfg.load():
            print >> sys.stderr, "Unable to load InputDB configuration!"
            return False

        if self.inputprops is not None:
            # not .props as Properties!
            self.props = inputprops.InputPropsCfg(self.inputprops, self)
            if not self.props.load():
                print >> sys.stderr, "Unable to load InputProps"
                return False

            # add any new properties specified by inputprops into the
            # correct inputs
            inputprops.apply_props(self.cfg.objects.itervalues(), self.props)

        # get all inputs specified by inputdb and wrap into an Input
        # object
        self.inputdb = [Input(i, self) for i in self.cfg]
        self.inpnames = set([i.get_id() for i in self.inputdb])

        # setup the name -> Input map; note an input can have multiple
        # formats...
        self.n2i = dict([(n, list()) for n in self.inpnames])
        for i in self.inputdb:
            self.n2i[i.get_id()].append(i)

        return True
Ejemplo n.º 9
0
    def __init__(self):
        Input.__init__(self, CAPABILITIES)
        self.video_src = gst.element_factory_make("ximagesrc", "video_src")

        # Setting format to time, to work with input-selector, since they're
        # were not working together in version 0.10.18-1 from Debian.
        # This should be fixed in ximagesrc's code and input-selector should
        # also be fixed to work with byte format.

        self.video_src.set_format(gst.FORMAT_TIME)
        self.video_src.set_property("use-damage", False)

        self.add(self.video_src)
        self.capsfilter = gst.element_factory_make("capsfilter", "capsfilter")
        self.add(self.capsfilter)

        gst.element_link_many(self.video_src, self.capsfilter)

        self.video_pad.set_target(self.capsfilter.src_pads().next())
Ejemplo n.º 10
0
    def __init__(self):

        # initialize the pygame display and OpenGL context
        pygame.display.init()
        pygame.font.init()

        # load a custom icon
        pygame.display.set_icon(pygame.image.load("images/icon.png"))

        # initialize buffers to perform antialiasing
        pygame.display.gl_set_attribute(pygame.GL_MULTISAMPLEBUFFERS, 1)
        pygame.display.gl_set_attribute(pygame.GL_MULTISAMPLESAMPLES, 4)

        self.setWindowTitle("   ")
        self.setWindowSize(640, 640)

        self.clock = pygame.time.Clock()
        self.deltaTime = 0
        self.input = Input()
        self.running = True
Ejemplo n.º 11
0
 def __init__(self):
     Input.__init__(self, CAPABILITIES)
     self.audio_src = gst.element_factory_make("alsasrc", "audio_src")
     self.add(self.audio_src)
     self.audio_pad.set_target(self.audio_src.src_pads().next())
Ejemplo n.º 12
0
def main():
    if not len(sys.argv):
        print("[!] Not Enough Arguments!")
        # TODO: Add usage
        sys.exit(0)

    parser = argparse.ArgumentParser()
    parser.add_argument("url", help="URL to test for LFI")
    parser.add_argument("-d", "--data", help="Use data:// technique", action="store_true")
    parser.add_argument("-i", "--input", help="Use input:// technique", action="store_true")
    parser.add_argument("-e", "--expect", help="Use expect:// technique", action="store_true")
    parser.add_argument("-f", "--filter", help="Use filter:// technique", action="store_true")
    parser.add_argument("-p", "--proc", help="Use /proc/self/environ technique", action="store_true")
    parser.add_argument("-a", "--access", help="Apache access logs technique", action="store_true")
    parser.add_argument("-ns", "--nostager", help="execute payload directly, do not use stager", action="store_true")
    parser.add_argument("-r", "--relative", help="use path traversal sequences for attack", action="store_true")
    parser.add_argument("--ssh", help="SSH auth log poisoning", action="store_true")
    parser.add_argument("-l", "--location", help="path to target file (access log, auth log, etc.)")
    parser.add_argument("--cookies", help="session cookies for authentication")

    args = parser.parse_args()

    url = args.url
    nostager = args.nostager
    relative = args.relative
    cookies = args.cookies

    parsed = urllib.parse.urlsplit(url)

    print(colors("[~] Checking Target: {0}".format(parsed.netloc), 93))

    # if ping(parsed.netloc):
    #     print(colors("[+] Target looks alive ", 92))
    # else:
    #     print(colors("[!] Target irresponsive ", 91))
    #     sys.exit(1)

    if not parsed.query:
        print(colors("[!] No GET parameter Provided ", 91))

    # TODO: Find a better way to do these checks
    if args.data:
        print(colors("[~] Testing with data:// ", 93))
        d = data.Data(url, nostager, cookies)
        d.execute_data()
    elif args.input:
        print(colors("[~] Testing with input:// ", 93))
        i = Input.Input(url, nostager, cookies)
        i.execute_input()
    elif args.expect:
        print(colors("[~] Testing with expect:// ", 93))
        e = Expect.Expect(url, nostager, cookies)
        e.execute_expect()
    elif args.proc:
        print(colors("[~] /proc/self/environ Technique Selected!", 93))
        i = proc.Environ(url, nostager, relative, cookies)
        i.execute_environ()
    elif args.access:
        print(colors("[~] Testing for Apache access.log poisoning", 93))
        if not args.location:
            print(colors("[~] Log Location Not Provided! Using Default", 93))
            l = '/var/log/apache2/access.log'
        else:
            l = args.location
        a = accesslog(url, l, nostager, relative, cookies)
        a.execute_logs()
    elif args.ssh:
        print(colors("[~] Testing for SSH log poisoning ", 93))
        if not args.location:
            print(colors("[~] Log Location Not Provided! Using Default", 93))
            l = '/var/log/auth.log'
        else:
            l = args.location
        a = sshlog.SSHLogs(url, l, relative, cookies)
        a.execute_ssh()
    elif args.filter:
        print(colors("[~] Testing with expect://", 93))
        f = Filter.Filter(url, cookies)
        f.execute_filter()
    else:
        print(colors("[!] Please select atleast one technique to test", 91))
        sys.exit(0)
Ejemplo n.º 13
0
 def __init__(self):
     Input.__init__(self, CAPABILITIES)
     self.audio_src = gst.element_factory_make("audiotestsrc", "audio_src")
     self.audio_src.set_property("is-live", True)
     self.add(self.audio_src)
     self.audio_pad.set_target(self.audio_src.src_pads().next())
Ejemplo n.º 14
0
from core import GraphicsController
from core import GameController
from core import Input

#internal variables
sys_graphicsController = GraphicsController()
sys_gameController = GameController()
sys_inputController = Input()

def drawRectangle(x, y, width, height):
	global sys_graphicsController
	sys_graphicsController.drawRectangle(x, y, width, height)

def drawCircle(x, y, radius):
	global sys_graphicsController
	sys_graphicsController.drawCircle(x, y, radius)

def drawLine(x1, y1, x2, y2):
	global sys_graphicsController
	sys_graphicsController.drawLine(x1, y1, x2, y2)

def drawPoint(x, y):
	global sys_graphicsController
	sys_graphicsController.drawPoint(x, y)

def drawString(x, y, string):
	global sys_graphicsController
	sys_graphicsController.drawString(x, y, string)

def useColour(r, g, b, a):
	global sys_graphicsController
Ejemplo n.º 15
0
class Base(object):
    def __init__(self):

        # initialize the pygame display and OpenGL context
        pygame.display.init()
        pygame.font.init()

        # load a custom icon
        pygame.display.set_icon(pygame.image.load("images/icon.png"))

        # initialize buffers to perform antialiasing
        pygame.display.gl_set_attribute(pygame.GL_MULTISAMPLEBUFFERS, 1)
        pygame.display.gl_set_attribute(pygame.GL_MULTISAMPLESAMPLES, 4)

        self.setWindowTitle("   ")
        self.setWindowSize(640, 640)

        self.clock = pygame.time.Clock()
        self.deltaTime = 0
        self.input = Input()
        self.running = True

    # set window title
    def setWindowTitle(self, text):
        pygame.display.set_caption(text)

    # WARNING: calling this method loses the original OpenGL context;
    #   only use before calling OpenGL functions
    def setWindowSize(self, width, height):
        self.screenSize = (width, height)
        self.displayFlags = pygame.DOUBLEBUF | pygame.OPENGL | pygame.RESIZABLE
        self.screen = pygame.display.set_mode(self.screenSize,
                                              self.displayFlags)

    # implement by extending class
    def initialize(self):
        pass

    # implement by extending class
    def update(self):
        pass

    def run(self):

        self.initialize()

        while self.running:

            # update input state (down, pressed, up)
            self.input.update()

            if self.input.quit():
                self.running = False

            # debug tools

            # print FPS (Ctrl+F)
            if (self.input.isKeyPressed(pygame.K_LCTRL)
                    or self.input.isKeyPressed(
                        pygame.K_RCTRL)) and self.input.isKeyDown(pygame.K_f):
                fps = self.clock.get_fps()
                print("FPS: " + str(int(fps)))

            # save screenshot (Ctrl+S)
            if (self.input.isKeyPressed(pygame.K_LCTRL)
                    or self.input.isKeyPressed(
                        pygame.K_RCTRL)) and self.input.isKeyDown(pygame.K_s):
                timeString = str(int(1000 * time.time()))
                fileName = "image-" + timeString + ".png"
                pygame.image.save(self.screen, fileName)

            self.deltaTime = self.clock.get_time() / 1000.0

            self.update()

            # display image on screen
            pygame.display.flip()

            # limit to 60 FPS
            self.clock.tick(60)

        # end of program
        pygame.quit()
        sys.exit()
Ejemplo n.º 16
0
 def __init__(self):
     Input.__init__(self, CAPABILITIES)
     self.audio_src = gst.element_factory_make("audiotestsrc", "audio_src")
     self.audio_src.set_property("is-live", True)
     self.add(self.audio_src)
     self.audio_pad.set_target(self.audio_src.src_pads().next())
Ejemplo n.º 17
0
import geopandas as gpd
from datetime import datetime as dt

# configure server
app = Wrapper(__name__, meta_tags=const.meta_tags)
app.config["suppress_callback_exceptions"] = True
app.title = const.title
server = app.server

# credentials
mapbox_access_token = const.credentials['mapbox']

app.layout = Div([Location(id='url', refresh=False), Div(id='page-content')])


@app.callback(Output('page-content', 'children'), [Input('url', 'pathname')])
def display_page(pathname):
    if pathname == '/abi':
        return build_abi_page()
    elif pathname == '/aquisition':
        return build_download_page()
    else:
        return build_glm_page(app)


@app.callback(
    [
        Output("states-mapview", "figure"),
        Output("histogram", "figure"),
        Output("lightnings", "figure"),
        Output("lightning-by-state", "figure"),