location ~ ^.*\/([^\/]+)$ {
include uwsgi_params;
uwsgi_buffers 8 128k;
uwsgi_read_timeout 30;
uwsgi_pass unix:///tmp/$1.sock;
uwsgi_param UWSGI_CHDIR /var/www/html/$1;
uwsgi_param UWSGI_PYHOME /var/www/html/$1;
uwsgi_param UWSGI_FILE /var/www/html/$1/$1.py;
}
from itertools import product
s = 'abcdefghijklmnopqrstuvwxyz1234567890.-'
comb = reduce(list.__add__,
(map(''.join,
filter(lambda x: x[0] not in '.-' and x[-1] not in '.-',
product(s, repeat=i))) for i in xrange(1, 5)))
print len(comb)
import itertools
value = 'ABCDEFG'
s = requests.Session()
s.get('https://server.ru')
for val,domain in itertools.product(['val1','val2'],['.aaa','.bbb']):
cookie_val={"name": val, "value": value, "domain":"%s.server.ru"%domain,}
s.cookies.set(**cookie_val)
s.get('https://server.ru/login?login=%s&password=%s' % (login, password))
value='ABCDEFG'
vals=['val1','val2']
domains=['.aaa','.bbb']
import itertools
for val,domain in itertools.product(vals,domains):
cookie_val={"name": val, "value": value, "domain":"%s.server.ru"%domain,}
print cookie_val
{'domain': '.aaa.server.ru', 'name': 'val1', 'value': 'ABCDEFG'}
{'domain': '.bbb.server.ru', 'name': 'val1', 'value': 'ABCDEFG'}
{'domain': '.aaa.server.ru', 'name': 'val2', 'value': 'ABCDEFG'}
{'domain': '.bbb.server.ru', 'name': 'val2', 'value': 'ABCDEFG'}
s.cookies.set(**cookie_val)
и уже вне цикла вызвать s.get('https://server.ru/login?login=%s&password=%s' % (login, password))
import itertools
s = '197.1-10.197.*'
sections = s.split('.')
addresses = []
for i in sections:
if '-' in i:
min,max = i.split('-')
a = [x for x in range(int(min),int(max))]
elif '*' in i:
a = [x for x in range(0,255)]
else:
a = [int(i)]
addresses.append(a)
addresses = itertools.product(*addresses)
for i in addresses:
print i
for num in range(0, 4):
while b[num] <= e[num]:
# yield
b[num] += 1
if b[num] <= e[num]:
b[num + 1] = beggining[num + 1]
gobject.threads_init()
и ps = Thread(target=clam_scan, args=[s])
def extract_string(data):
s = None
if len(data):
s = ''
for d in data:
s += d
return s
''.join(data)
[IPSOURCES]
url1 = http://www.mtc.sri.com/live_data/attackers/
url2 = http://isc.sans.edu/reports.html
url3 = https://zeustracker.abuse.ch/blocklist.php?download=ipblocklist
url4 = https://spyeyetracker.abuse.ch/blocklist.php?download=ipblocklist
url5 = http://www.projecthoneypot.org/list_of_ips.php
url6 = http://intel.martincyber.com/ip
url7 = https://reputation.alienvault.com/reputation.generic
url8 = https://www.openbl.org/lists/base.txt
url9 = http://www.blocklist.de/lists/ssh.txt
url10 = https://palevotracker.abuse.ch/
url11 = http://www.malwaregroup.com/ipaddresses
url12 = http://www.ciarmy.com/list/ci-badguys.txt
url13 = http://rules.emergingthreats.net/blockrules/rbn-malvertisers-ips.txt
[DOMAINSOURCES]
url1 = https://secure.mayhemiclabs.com/malhosts/malhosts.txt
url2 = https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
url3 = https://spyeyetracker.abuse.ch/blocklist.php?download=domainblocklist
url4 = http://mirror1.malwaredomains.com/files/BOOT
url5 = http://www.malwaredomainlist.com/hostslist/hosts.txt
url6 = http://www.malware.com.br/cgi/submit?action=list
url7 = http://www.malwarepatrol.net/cgi/submit?action=list_xml