Author Topic: [Source] StreamGrab.py  (Read 3485 times)

0 Members and 2 Guests are viewing this topic.

Offline daxda

  • Peasant
  • *
  • Posts: 114
  • Cookies: 112
  • Not the guy you're looking for
    • View Profile
    • Daxda on Github
[Source] StreamGrab.py
« on: January 23, 2014, 08:44:41 pm »
Had this project planned for some time now, today I've written it and here it is.
It's a stream grabbing script which attempts to extract direct download links from websites that request a movie file.

I was very pumped to try out another new lib, it's called "scapy", read more about it here if you didn't heard about it yet and/or are interested.

In short how the script works - it spawns a thread which sniffs your network packets, the main thread pops the gathered packets from the list(which gets refilled in the sniffer thread) and filters them for URLs ending with a movie file extension.
When the filtering of an URL occurs it gets printed to stdout.

The list of dependencies:

To be able to run this script you must be root!

[gist]Daxda/8585445[/gist]
« Last Edit: April 23, 2014, 08:15:14 pm by daxda »

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: [Source] StreamGrab.py
« Reply #1 on: January 23, 2014, 09:13:01 pm »
That's awesome brah! have a cookie. It only runs on Linux?

Offline kenjoe41

  • Symphorophiliac Programmer
  • Administrator
  • Baron
  • *
  • Posts: 990
  • Cookies: 224
    • View Profile
Re: [Source] StreamGrab.py
« Reply #2 on: January 23, 2014, 09:35:44 pm »
Guess am gonna be saved the pain of always running wireshark to grab the download URL. This is amazing dude.
It should be running on Linux just fine and if i remember @daxda programs from Ubuntu.
+1
If you can't explain it to a 6 year old, you don't understand it yourself.
http://upload.alpha.evilzone.org/index.php?page=img&img=GwkGGneGR7Pl222zVGmNTjerkhkYNGtBuiYXkpyNv4ScOAWQu0-Y8[<NgGw/hsq]>EvbQrOrousk[/img]

Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: [Source] StreamGrab.py
« Reply #3 on: January 23, 2014, 09:40:03 pm »
Cool , I did something similar in the past for watching the news(ripping stream).
Keep 'm coming.
« Last Edit: January 23, 2014, 09:40:14 pm by proxx »
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline daxda

  • Peasant
  • *
  • Posts: 114
  • Cookies: 112
  • Not the guy you're looking for
    • View Profile
    • Daxda on Github
Re: [Source] StreamGrab.py
« Reply #4 on: January 24, 2014, 07:04:55 am »
Thanks for your positive feedback guys, it's appreciated very much!
kenjoe41 is right, I am on ubuntu, the usage of the root check is, afaik for linux only.
I'm not quite sure if it does work on windows when removing the check, it's worth a try.
« Last Edit: January 24, 2014, 07:06:01 am by daxda »

Offline s3my0n

  • Knight
  • **
  • Posts: 276
  • Cookies: 58
    • View Profile
    • ::1
Re: [Source] StreamGrab.py
« Reply #5 on: January 24, 2014, 01:19:34 pm »
Is using list for accessing the packets thread safe? Your thread and the main process access self._packets without locks (as far as I know) so there maybe a problem.
I suggest using queue instead which has inbuilt blocking mechanism.
Easter egg in all *nix systems: E(){ E|E& };E

Offline d4rkcat

  • Knight
  • **
  • Posts: 287
  • Cookies: 115
  • He who controls the past controls the future. He who controls the present controls the past.
    • View Profile
    • Scripts
Re: [Source] StreamGrab.py
« Reply #6 on: February 17, 2014, 09:41:54 am »
This is a great idea,
can't get it to work at all on linux, tested with chrome, chromium, firefox
tested all the extentions listed on line 27, with nothing appearing at all.
My system has ipv6 disabled.

Anyone get this to work?
Jabber (OTR required): thed4rkcat@einfachjabber.de    Email (PGP required): thed4rkcat@yandex.com    PGP Key: here and here     Blog

<sofldan> not asking for anyone to hold my hand uber space shuttle door gunner guy.


Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: [Source] StreamGrab.py
« Reply #7 on: February 17, 2014, 09:59:09 am »
This is a great idea,
can't get it to work at all on linux, tested with chrome, chromium, firefox
tested all the extentions listed on line 27, with nothing appearing at all.
My system has ipv6 disabled.

Anyone get this to work?
Glad to take a look at it but you need to give us something to work with.
Output perhaps ?
First thought that comes to mind is that you have not installed prop. codec's.
« Last Edit: February 17, 2014, 10:00:18 am by proxx »
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline d4rkcat

  • Knight
  • **
  • Posts: 287
  • Cookies: 115
  • He who controls the past controls the future. He who controls the present controls the past.
    • View Profile
    • Scripts
Re: [Source] StreamGrab.py
« Reply #8 on: February 17, 2014, 10:06:08 am »
Glad to take a look at it but you need to give us something to work with.
Output perhaps ?
First thought that comes to mind is that you have not installed prop. codec's.

Ok thanks, well i'm on kali 1.06 64-bit.
The only modification i made to the script was to add #!/usr/bin/python to the top of the script so i can run it without typing python.
The output of the script is:

Code: [Select]
WARNING: No route found for IPv6 destination :: (no default route?)
And thats it. I have scapy installed and when i start scapy from the command line i get:

Code: [Select]
INFO: Can't import python gnuplot wrapper . Won't be able to plot.
INFO: No IPv6 support in kernel
WARNING: No route found for IPv6 destination :: (no default route?)
Welcome to Scapy (2.2.0)

I didn't know we needed to install anything but scapy as that is what is in the dependency list.

Cheers for any help I usually use FlashGot extension to do this but I like the idea of using scapy.
Jabber (OTR required): thed4rkcat@einfachjabber.de    Email (PGP required): thed4rkcat@yandex.com    PGP Key: here and here     Blog

<sofldan> not asking for anyone to hold my hand uber space shuttle door gunner guy.


Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: [Source] StreamGrab.py
« Reply #9 on: February 17, 2014, 10:12:36 am »
Ok thanks, well i'm on kali 1.06 64-bit.
The only modification i made to the script was to add #!/usr/bin/python to the top of the script so i can run it without typing python.
The output of the script is:

Code: [Select]
WARNING: No route found for IPv6 destination :: (no default route?)
And thats it. I have scapy installed and when i start scapy from the command line i get:

Code: [Select]
INFO: Can't import python gnuplot wrapper . Won't be able to plot.
INFO: No IPv6 support in kernel
WARNING: No route found for IPv6 destination :: (no default route?)
Welcome to Scapy (2.2.0)

I didn't know we needed to install anything but scapy as that is what is in the dependency list.

Cheers for any help I usually use FlashGot extension to do this but I like the idea of using scapy.

That can be ignored , scapy loves to be verbose about that.
Does not mean it does not work.

Install this shit just to be sure.
https://wiki.debian.org/MultimediaCodecs
https://packages.debian.org/sid/gnuplot

Those probably won't resolve the issues because those are not errors but warnings.
At least we moved those aside.

What is it with 'Kali'.
Please just move to a proper linux distro :)
« Last Edit: February 17, 2014, 10:16:08 am by proxx »
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline d4rkcat

  • Knight
  • **
  • Posts: 287
  • Cookies: 115
  • He who controls the past controls the future. He who controls the present controls the past.
    • View Profile
    • Scripts
Re: [Source] StreamGrab.py
« Reply #10 on: February 17, 2014, 10:32:28 am »
Yeah i know those warnings don't mean shit i installed the package, (libavcodec-extra-53) still no joy.

I'm going to try it on my ubuntu desktop and yes yes i know ubuntu is shit bla bla bla.
Jabber (OTR required): thed4rkcat@einfachjabber.de    Email (PGP required): thed4rkcat@yandex.com    PGP Key: here and here     Blog

<sofldan> not asking for anyone to hold my hand uber space shuttle door gunner guy.


Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: [Source] StreamGrab.py
« Reply #11 on: February 17, 2014, 10:34:27 am »
Yeah i know those warnings don't mean shit i installed the package, (libavcodec-extra-53) still no joy.

I'm going to try it on my ubuntu desktop and yes yes i know ubuntu is shit bla bla bla.
Its just hogged and too preconfigured but still it is a proper distro compared to kali linux.
« Last Edit: February 17, 2014, 11:13:29 am by proxx »
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline d4rkcat

  • Knight
  • **
  • Posts: 287
  • Cookies: 115
  • He who controls the past controls the future. He who controls the present controls the past.
    • View Profile
    • Scripts
Re: [Source] StreamGrab.py
« Reply #12 on: February 17, 2014, 10:45:32 am »
Not working for me personally on ubuntu :(
maybe I just have bad luck..
Same exact output as on Kali.

By the way, why is Kali not a proper linux distro? Just curious.
I thought them moving it over to the debian filesystem was a step in the right direction.
I use Kali because it has alot of the programs I need pre-installed.
« Last Edit: February 17, 2014, 10:47:36 am by d4rkcat »
Jabber (OTR required): thed4rkcat@einfachjabber.de    Email (PGP required): thed4rkcat@yandex.com    PGP Key: here and here     Blog

<sofldan> not asking for anyone to hold my hand uber space shuttle door gunner guy.


Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: [Source] StreamGrab.py
« Reply #13 on: February 17, 2014, 11:33:57 am »
Not working for me personally on ubuntu :(
maybe I just have bad luck..
Same exact output as on Kali.

By the way, why is Kali not a proper linux distro? Just curious.
I thought them moving it over to the debian filesystem was a step in the right direction.
I use Kali because it has alot of the programs I need pre-installed.
Yeah it is cute they moved  to debian.
But for daily use it is not suitable in many ways.

Look , I dont care helping someone but what do you expect me to do , guess?
Post exact output the running program , dont change anything to the source.
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline d4rkcat

  • Knight
  • **
  • Posts: 287
  • Cookies: 115
  • He who controls the past controls the future. He who controls the present controls the past.
    • View Profile
    • Scripts
Re: [Source] StreamGrab.py
« Reply #14 on: February 17, 2014, 12:10:47 pm »
Um well it's what i said in my last post, exactly the same output as kali.
I don't see that removing the #!/usr/bin/python from the top would make any difference, unless this is written in python3. I did it anyway and it made no difference.
Its not that important thanks for your help anyway.

If daxda has any idea's then that would be great.
Also if anyone has got this to work can you post your OS and if you had to install anything to get it to work.
I will just have to survive another day without this script lmao.
Jabber (OTR required): thed4rkcat@einfachjabber.de    Email (PGP required): thed4rkcat@yandex.com    PGP Key: here and here     Blog

<sofldan> not asking for anyone to hold my hand uber space shuttle door gunner guy.