Метка python

Скрипт для сканирования site-map

#!/usr/bin/env pythonimport sysimport refrom tld import get_tldimport linkGrabberdef get_links(url): links = linkGrabber.Links(url) for link in links.find(): curr_link = link['href'] curr_text = link['text'].encode('ascii', 'ignore').decode('ascii') if curr_link == url: continue if curr_link in scanned_links: continue if in_external_links(curr_link): continue if is_blacklisted(curr_link): continue if…

Python скрипт для сканирования IP на SSH

Зависимость: pip install netaddr pexpect IP должны быть в файле iplist.txt #!/usr/bin/env pythonimport datetimeimport netaddrimport osimport pexpectimport randomimport reimport socketimport sys# Define connection string, user, and passCNNX = 'Are you sure you want to continue connecting'USER = 'root'PASS = 'root'#…

Скан пользователей wordpress

#!/usr/bin/env pythonimport urllib2, urllib, sys, argparsedef uniq(lst): last = object() for item in lst: if item == last: continue yield item last = itemdef sort_and_deduplicate(l): return list(uniq(sorted(l, reverse=False)))def curllib(req, params=None,postdata=None): headers = { 'User-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X…