This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python package | |
import csv | |
import time | |
import random | |
import sys | |
import os | |
# selenium package | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
import time | |
USER_AGENT = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'} | |
def fetch_results(search_term, number_results, language_code): | |
assert isinstance(search_term, str), 'Search term must be a string' | |
assert isinstance(number_results, int), 'Number of results must be an integer' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("button[class='mn-person-card__person-btn-ext button-secondary-medium']").each(function(index, value) { | |
setTimeout(function() { | |
jQuery(value).trigger('click'); | |
}, index * 1000); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dns.resolver | |
import socket | |
import smtplib | |
import re | |
# Set of allowed file extensions | |
ALLOWED_EXTENSIONS = {'txt', 'csv'} | |
# Extract all email addresses from a string with a regular expression |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
search_url_prefix = "https://www.google.com/search?q=" | |
def get_first_result(search_str): | |
search_url = search_url_prefix + search_str | |
r = requests.get(search_url) | |
soup = BeautifulSoup(r.text, "html.parser") | |
return soup.find('cite').text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Script to scrape all links from a site, compile counts of each link, status | |
# codes of access and output the results as a CSV | |
# | |
# There's absolutely no reason this shouldn't be pulled into an OOP paradigm | |
# per se, but I left it functionalized because that can be easier for multitasking. | |
# | |
# Requirements: | |
# requests, bs4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8 -*- | |
import requests | |
from time import sleep | |
from threading import Thread | |
UPDATE_INTERVAL = 0.01 | |
class URLThread(Thread): | |
def __init__(self, url, timeout=10, allow_redirects=True): | |
super(URLThread, self).__init__() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import asyncio | |
from bs4 import BeautifulSoup | |
proxy_list = [] | |
def get_html(URL): | |
r = requests.get(URL) | |
# print(r.request.headers) | |
if(r.status_code == 200): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import requests | |
users_to_attack = ['USER_NAME', ] #list of users to be attacked | |
def sarahah_post(user, msg): | |
s = requests.Session() | |
homeurl = 'https://' + user + '.sarahah.com/' | |
home = s.get(homeurl) |
OlderNewer