first dump of github gists, organized files
commit
54bc655d62
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Get public ip
|
||||
curl ipecho.net/plain; echo
|
||||
|
||||
# Check nvidia and nvcc cuda compiler
|
||||
nvidia-smi
|
||||
/usr/local/cuda/bin/nvcc --version
|
||||
|
||||
# Get and unpack the miner
|
||||
wget https://github.com/develsoftware/GMinerRelease/releases/download/2.59/gminer_2_64_linux64.tar.xz
|
||||
tar -xf gminer_2_64_linux64.tar.xz
|
||||
ls
|
||||
|
||||
# Start the miner
|
||||
./miner --algo ethash --server daggerhashimoto.usa.nicehash.com:3353 --user 34PmFZUuXbjraa8YUQ8GKS3YzLgpW9HT9c --proto stratum
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"name": "Nicehash-miner.ipynb",
|
||||
"provenance": [],
|
||||
"collapsed_sections": [],
|
||||
"include_colab_link": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
},
|
||||
"accelerator": "GPU"
|
||||
},
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "view-in-github",
|
||||
"colab_type": "text"
|
||||
},
|
||||
"source": [
|
||||
"<a href=\"https://colab.research.google.com/gist/EmaMaker/296863713437f703ec1aa56ae45b1f8f/nicehash-miner.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "Mwy9CUqfiMwT"
|
||||
},
|
||||
"source": [
|
||||
"This script runs a nicehash session. It needs to be run for a reasonable amount of time (such that the use of this account will not be blocked).\n",
|
||||
"It needs to be controlled from an external Selenium script, rotating multiple Google accounts for different but still reasonable amounts of time\n",
|
||||
"\n",
|
||||
"https://gist.github.com/EmaMaker/f2fffd53bf7568f70b8a58a54c1a85e0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"metadata": {
|
||||
"id": "bbVHW3Uhgt2x"
|
||||
},
|
||||
"source": [
|
||||
"! curl -sSL https://gist.githubusercontent.com/EmaMaker/f2fffd53bf7568f70b8a58a54c1a85e0/raw/ac6769fb92dab162fdacb477088bf1b0dd8da181/miner | /bin/bash\n"
|
||||
],
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,173 @@
|
|||
{
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"name": "Proxy2.ipynb",
|
||||
"provenance": [],
|
||||
"collapsed_sections": [],
|
||||
"include_colab_link": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "view-in-github",
|
||||
"colab_type": "text"
|
||||
},
|
||||
"source": [
|
||||
"<a href=\"https://colab.research.google.com/gist/EmaMaker/79645e7bcec4413ce868e3f9bc4d1939/proxy.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "_biXqPtZMKd7"
|
||||
},
|
||||
"source": [
|
||||
"Use a Colab machine as an Elite Socks Proxy Server using Dante <br>\n",
|
||||
"The IP of the machine changes every time the user clicks Runtime>Factory reset runtime and reconnects to a new hosted runtine.<br>\n",
|
||||
"No HW acceleration is needed for this, which may help in keeping the machine alive for longer<br>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/"
|
||||
},
|
||||
"id": "IdPhwxaAMHG2",
|
||||
"outputId": "dfba190c-c6bc-449e-eac0-ec15e1968654"
|
||||
},
|
||||
"source": [
|
||||
"# Install squid\n",
|
||||
"! apt-get install dante-server net-tools"
|
||||
],
|
||||
"execution_count": null,
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Reading package lists... Done\n",
|
||||
"Building dependency tree \n",
|
||||
"Reading state information... Done\n",
|
||||
"net-tools is already the newest version (1.60+git20161116.90da8a0-1ubuntu1).\n",
|
||||
"dante-server is already the newest version (1.4.2+dfsg-2build1).\n",
|
||||
"0 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.\n"
|
||||
],
|
||||
"name": "stdout"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/"
|
||||
},
|
||||
"id": "GUzt7pUiOyij",
|
||||
"outputId": "c19b599a-17b1-4d3a-cd4a-173592f45e26"
|
||||
},
|
||||
"source": [
|
||||
"# Get squid configuration file\n",
|
||||
"! wget https://gist.githubusercontent.com/EmaMaker/38bc10d6c333c7085efb897f26476dfd/raw/031d198257799102444479dd149d8873b63ed2b3/sockd.conf -O /etc/danted.conf\n",
|
||||
"# Restart squid\n",
|
||||
"! service danted start"
|
||||
],
|
||||
"execution_count": null,
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"--2021-07-05 16:44:48-- https://gist.githubusercontent.com/EmaMaker/38bc10d6c333c7085efb897f26476dfd/raw/031d198257799102444479dd149d8873b63ed2b3/sockd.conf\n",
|
||||
"Resolving gist.githubusercontent.com (gist.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...\n",
|
||||
"Connecting to gist.githubusercontent.com (gist.githubusercontent.com)|185.199.108.133|:443... connected.\n",
|
||||
"HTTP request sent, awaiting response... 200 OK\n",
|
||||
"Length: 1781 (1.7K) [text/plain]\n",
|
||||
"Saving to: ‘/etc/danted.conf’\n",
|
||||
"\n",
|
||||
"\r/etc/danted.conf 0%[ ] 0 --.-KB/s \r/etc/danted.conf 100%[===================>] 1.74K --.-KB/s in 0s \n",
|
||||
"\n",
|
||||
"2021-07-05 16:44:48 (19.9 MB/s) - ‘/etc/danted.conf’ saved [1781/1781]\n",
|
||||
"\n",
|
||||
"Starting Dante SOCKS daemon: "
|
||||
],
|
||||
"name": "stdout"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/"
|
||||
},
|
||||
"id": "PKtRPbJ7QZbX",
|
||||
"outputId": "c2f16cbb-1acb-40fa-b438-4d26eb2eb378"
|
||||
},
|
||||
"source": [
|
||||
"#Setup sshd\n",
|
||||
"! apt-get install -qq -o=Dpkg::Use-Pty=0 openssh-server pwgen > /dev/null\n",
|
||||
"\n",
|
||||
"password = \"hellogoodbye\"\n",
|
||||
"\n",
|
||||
"#Replace with your authtoken\n",
|
||||
"authtoken = \"1xGmdDb5nIPa83yGsSJPWDqytjs_5NbTgprdbkkAbpbHGMr4m\"\n",
|
||||
"\n",
|
||||
"#Set root password\n",
|
||||
"! echo root:$password | chpasswd\n",
|
||||
"! mkdir -p /var/run/sshd\n",
|
||||
"! echo \"PermitRootLogin yes\" >> /etc/ssh/sshd_config\n",
|
||||
"! echo \"PasswordAuthentication yes\" >> /etc/ssh/sshd_config\n",
|
||||
"\n",
|
||||
"print(\"username: root\")\n",
|
||||
"print(\"password: \", password)\n",
|
||||
"\n",
|
||||
"#Run sshd\n",
|
||||
"get_ipython().system_raw('/usr/sbin/sshd -D &')\n",
|
||||
"\n",
|
||||
"# 2 - Download and setup Ngrok\n",
|
||||
"! wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip\n",
|
||||
"! unzip -qq -n ngrok-stable-linux-amd64.zip\n",
|
||||
"\n",
|
||||
"print(\"Proxy server started! Check your ngrok address and port, then connect using ssh port forwarding, using this command: 'ssh -D 1337 -q -C -N root@ip -p port' \")\n",
|
||||
"print(\"You can use the proxy by connecting to the socks5 proxy at localhost:1337 in your application/OS settings\")\n",
|
||||
"\n",
|
||||
"#Create tunnel\n",
|
||||
"! ./ngrok authtoken $authtoken && ./ngrok tcp 22 &"
|
||||
],
|
||||
"execution_count": null,
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"username: root\n",
|
||||
"password: hellogoodbye\n",
|
||||
"--2021-07-05 16:51:37-- https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip\n",
|
||||
"Resolving bin.equinox.io (bin.equinox.io)... 3.219.150.79, 34.226.165.133, 34.194.108.77, ...\n",
|
||||
"Connecting to bin.equinox.io (bin.equinox.io)|3.219.150.79|:443... connected.\n",
|
||||
"HTTP request sent, awaiting response... 200 OK\n",
|
||||
"Length: 13832437 (13M) [application/octet-stream]\n",
|
||||
"Saving to: ‘ngrok-stable-linux-amd64.zip.4’\n",
|
||||
"\n",
|
||||
"ngrok-stable-linux- 100%[===================>] 13.19M 53.2MB/s in 0.2s \n",
|
||||
"\n",
|
||||
"2021-07-05 16:51:37 (53.2 MB/s) - ‘ngrok-stable-linux-amd64.zip.4’ saved [13832437/13832437]\n",
|
||||
"\n",
|
||||
"Proxy server started! Check your ngrok address and port, then connect using ssh port forwarding, using this command: 'ssh -D 1337 -q -C -N root@ip -p port' \n",
|
||||
"Authtoken saved to configuration file: /root/.ngrok2/ngrok.yml\n"
|
||||
],
|
||||
"name": "stdout"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,173 @@
|
|||
{
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"name": "Proxy.ipynb",
|
||||
"provenance": [],
|
||||
"collapsed_sections": [],
|
||||
"include_colab_link": true
|
||||
},
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "view-in-github",
|
||||
"colab_type": "text"
|
||||
},
|
||||
"source": [
|
||||
"<a href=\"https://colab.research.google.com/gist/EmaMaker/4e1478c9913a2df58fc1b8ff422fa161/proxy.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "_biXqPtZMKd7"
|
||||
},
|
||||
"source": [
|
||||
"Use a Colab machine as an Elite Socks Proxy Server using Dante <br>\n",
|
||||
"The IP of the machine changes every time the user clicks Runtime>Factory reset runtime and reconnects to a new hosted runtine.<br>\n",
|
||||
"No HW acceleration is needed for this, which may help in keeping the machine alive for longer<br>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/"
|
||||
},
|
||||
"id": "IdPhwxaAMHG2",
|
||||
"outputId": "dfba190c-c6bc-449e-eac0-ec15e1968654"
|
||||
},
|
||||
"source": [
|
||||
"# Install squid\n",
|
||||
"! apt-get install dante-server net-tools"
|
||||
],
|
||||
"execution_count": null,
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Reading package lists... Done\n",
|
||||
"Building dependency tree \n",
|
||||
"Reading state information... Done\n",
|
||||
"net-tools is already the newest version (1.60+git20161116.90da8a0-1ubuntu1).\n",
|
||||
"dante-server is already the newest version (1.4.2+dfsg-2build1).\n",
|
||||
"0 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.\n"
|
||||
],
|
||||
"name": "stdout"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/"
|
||||
},
|
||||
"id": "GUzt7pUiOyij",
|
||||
"outputId": "c19b599a-17b1-4d3a-cd4a-173592f45e26"
|
||||
},
|
||||
"source": [
|
||||
"# Get squid configuration file\n",
|
||||
"! wget https://gist.githubusercontent.com/EmaMaker/38bc10d6c333c7085efb897f26476dfd/raw/031d198257799102444479dd149d8873b63ed2b3/sockd.conf -O /etc/danted.conf\n",
|
||||
"# Restart squid\n",
|
||||
"! service danted start"
|
||||
],
|
||||
"execution_count": null,
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"--2021-07-05 16:44:48-- https://gist.githubusercontent.com/EmaMaker/38bc10d6c333c7085efb897f26476dfd/raw/031d198257799102444479dd149d8873b63ed2b3/sockd.conf\n",
|
||||
"Resolving gist.githubusercontent.com (gist.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...\n",
|
||||
"Connecting to gist.githubusercontent.com (gist.githubusercontent.com)|185.199.108.133|:443... connected.\n",
|
||||
"HTTP request sent, awaiting response... 200 OK\n",
|
||||
"Length: 1781 (1.7K) [text/plain]\n",
|
||||
"Saving to: ‘/etc/danted.conf’\n",
|
||||
"\n",
|
||||
"\r/etc/danted.conf 0%[ ] 0 --.-KB/s \r/etc/danted.conf 100%[===================>] 1.74K --.-KB/s in 0s \n",
|
||||
"\n",
|
||||
"2021-07-05 16:44:48 (19.9 MB/s) - ‘/etc/danted.conf’ saved [1781/1781]\n",
|
||||
"\n",
|
||||
"Starting Dante SOCKS daemon: "
|
||||
],
|
||||
"name": "stdout"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/"
|
||||
},
|
||||
"id": "PKtRPbJ7QZbX",
|
||||
"outputId": "c2f16cbb-1acb-40fa-b438-4d26eb2eb378"
|
||||
},
|
||||
"source": [
|
||||
"#Setup sshd\n",
|
||||
"! apt-get install -qq -o=Dpkg::Use-Pty=0 openssh-server pwgen > /dev/null\n",
|
||||
"\n",
|
||||
"password = \"hellogoodbye\"\n",
|
||||
"\n",
|
||||
"#Replace with your authtoken\n",
|
||||
"authtoken = \"1x8nAQIAjusAtxjJCuCSls9znOJ_2gaMQ9rkvqDnL62Qecwg7\"\n",
|
||||
"\n",
|
||||
"#Set root password\n",
|
||||
"! echo root:$password | chpasswd\n",
|
||||
"! mkdir -p /var/run/sshd\n",
|
||||
"! echo \"PermitRootLogin yes\" >> /etc/ssh/sshd_config\n",
|
||||
"! echo \"PasswordAuthentication yes\" >> /etc/ssh/sshd_config\n",
|
||||
"\n",
|
||||
"print(\"username: root\")\n",
|
||||
"print(\"password: \", password)\n",
|
||||
"\n",
|
||||
"#Run sshd\n",
|
||||
"get_ipython().system_raw('/usr/sbin/sshd -D &')\n",
|
||||
"\n",
|
||||
"# 2 - Download and setup Ngrok\n",
|
||||
"! wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip\n",
|
||||
"! unzip -qq -n ngrok-stable-linux-amd64.zip\n",
|
||||
"\n",
|
||||
"print(\"Proxy server started! Check your ngrok address and port, then connect using ssh port forwarding, using this command: 'ssh -D 1337 -q -C -N root@ip -p port' \")\n",
|
||||
"print(\"You can use the proxy by connecting to the socks5 proxy at localhost:1337 in your application/OS settings\")\n",
|
||||
"\n",
|
||||
"#Create tunnel\n",
|
||||
"! ./ngrok authtoken $authtoken && ./ngrok tcp 22 &"
|
||||
],
|
||||
"execution_count": null,
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"username: root\n",
|
||||
"password: hellogoodbye\n",
|
||||
"--2021-07-05 16:51:37-- https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip\n",
|
||||
"Resolving bin.equinox.io (bin.equinox.io)... 3.219.150.79, 34.226.165.133, 34.194.108.77, ...\n",
|
||||
"Connecting to bin.equinox.io (bin.equinox.io)|3.219.150.79|:443... connected.\n",
|
||||
"HTTP request sent, awaiting response... 200 OK\n",
|
||||
"Length: 13832437 (13M) [application/octet-stream]\n",
|
||||
"Saving to: ‘ngrok-stable-linux-amd64.zip.4’\n",
|
||||
"\n",
|
||||
"ngrok-stable-linux- 100%[===================>] 13.19M 53.2MB/s in 0.2s \n",
|
||||
"\n",
|
||||
"2021-07-05 16:51:37 (53.2 MB/s) - ‘ngrok-stable-linux-amd64.zip.4’ saved [13832437/13832437]\n",
|
||||
"\n",
|
||||
"Proxy server started! Check your ngrok address and port, then connect using ssh port forwarding, using this command: 'ssh -D 1337 -q -C -N root@ip -p port' \n",
|
||||
"Authtoken saved to configuration file: /root/.ngrok2/ngrok.yml\n"
|
||||
],
|
||||
"name": "stdout"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
# /etc/danted.conf
|
||||
|
||||
logoutput: syslog
|
||||
user.privileged: root
|
||||
user.unprivileged: nobody
|
||||
|
||||
# The listening network interface or address.
|
||||
internal: 0.0.0.0 port=1080
|
||||
|
||||
# The proxying network interface or address.
|
||||
external: eth1@if11
|
||||
|
||||
# socks-rules determine what is proxied through the external interface.
|
||||
# The default of "none" permits anonymous access.
|
||||
socksmethod: none
|
||||
|
||||
# client-rules determine who can connect to the internal interface.
|
||||
# The default of "none" permits anonymous access.
|
||||
clientmethod: none
|
||||
|
||||
client pass {
|
||||
from: 0.0.0.0/0 to: 0.0.0.0/0
|
||||
log: connect disconnect error
|
||||
}
|
||||
|
||||
socks pass {
|
||||
from: 0.0.0.0/0 to: 0.0.0.0/0
|
||||
log: connect disconnect error
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
|
||||
rm -rf ~/*
|
||||
mkdir ~/.cloudshell
|
||||
touch ~/.cloudshell/no-pip-warning
|
||||
touch ~/.cloudshell/no-apt-get-warning
|
||||
|
||||
#set debian frontend to non-interactive
|
||||
sudo echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
|
||||
|
||||
#install xorg and needed packages
|
||||
sudo apt-get install -y xorg xserver-xephyr firefox-esr tigervnc-standalone-server curlftpfs python3 python3-pip chromium chromium-shell chromium-driver --fix-missing
|
||||
|
||||
#start vnc server
|
||||
wget https://gist.githubusercontent.com/EmaMaker/ec886b421359a4c3d3d604e6fc812302/raw/0ced029760b1dff4f78dd086d5cfeebe325764d0/vncpasswd
|
||||
vncserver -passwd vncpasswd -geometry 1280x720 :1
|
||||
|
||||
#install python deps
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install undetected_chromedriver==3.1.0 tbselenium stem
|
||||
|
||||
#download the userbot script and run it
|
||||
curl https://gist.githubusercontent.com/EmaMaker/ec886b421359a4c3d3d604e6fc812302/raw/e23264b75e6d3fbccf60202084f4ff1a81c1f4a1/userbot.py | python3
|
||||
|
||||
sleep 5
|
||||
|
||||
#clear the screen and print program termination character
|
||||
clear
|
||||
echo -
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
# Use undetected-chromedriver together with stem to use the tor network
|
||||
import undetected_chromedriver as uc
|
||||
from tbselenium.utils import launch_tbb_tor_with_stem
|
||||
|
||||
import time
|
||||
import random
|
||||
|
||||
from selenium.webdriver.support.ui import Select
|
||||
import selenium.webdriver as webdriver
|
||||
import selenium.common.exceptions as sexceptions
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
from selenium.webdriver.common.by import By
|
||||
|
||||
import requests
|
||||
|
||||
outside_website_scopes = ["blog.altervista.org", "en.altervista.org", "it.altervista.org", "pinterest",
|
||||
"facebook.com", "instagram.com", "iubenda.com", "twitter.com", "#"]
|
||||
|
||||
ACCEPT_COOKIES_BTN_SEL = ".iubenda-cs-accept-btn"
|
||||
MAX_REDIRECTION = 15
|
||||
LOOK_FOR_ADS = True
|
||||
|
||||
def visit_page(driver, url):
|
||||
|
||||
# go to the page
|
||||
print(f"Visiting: {url}")
|
||||
driver.get(url)
|
||||
|
||||
# time.sleep a little bit to wait for all of the page to be loaded (especially ads) and to simulate a user reading. Keep in mind the profile is preset to accept cookies on this website
|
||||
time.sleep(3)
|
||||
click(driver, By.CSS_SELECTOR, ACCEPT_COOKIES_BTN_SEL, 10)
|
||||
time.sleep(4)
|
||||
|
||||
for i in range(0, MAX_REDIRECTION):
|
||||
time.sleep(6)
|
||||
|
||||
# ads = get_possibile_ads(driver)
|
||||
|
||||
if not LOOK_FOR_ADS or (LOOK_FOR_ADS and random.random() < 0.65): # or len(ads) == 0:
|
||||
# click random element
|
||||
try_to_click_elements(driver, get_possibile_webelements(driver))
|
||||
else:
|
||||
# Look for an iframe, check if there's an "a" element with an href attribute that contains the "ad" word, it will probably we a link of this type: https://adclick.g.doubleclick.net/aclk?sa=l&ai=Cd8zYPwn0Yaa-CriP7_UPn9eL0AH0mNG7Z-jMmOvlDtrZHhABIJn9jhdg_YqihNQSoAGf08b9A8gBCeACAKgDAcgDCqoEpQJP0Bhs9u34Kcc-HNkWqAWhVh3eYt8wWhsYc-x06cQ2rdO9JUopiRUFeFWuf1P0_jg4FVCG7kbS5eit_70Q9c4AcZaJG7QByYKfaWLsVDTGDUJ4t7v3hl2wGTDD-ep5teyxxtCykaypJMuO3jdhE_YA_7pQy63jkTglMnWGCN4sd-6qNNr_vTk1Uv5nqbV6cQSC8PbEd0RaM78kNNz4Z3i8yFWnyav6kfHnSn6kjR_8bCziGQu7NHf8bQoDb0mhIh6BBV-SU2MMM00Tm91QPNqVePZRY3IKNd8EuIhzGGdYA9hSTtnTQGA6Hfe4BUy8ZEAxMDxVr4s2mm-JRZnHVMmvP5_KksicKf4x9BgwLa1p0N_6-s4dtEgTrNv1Bs-bi3Eeqh1Jh8AE3NCrw9gD4AQBoAYugAfJrLkCqAeOzhuoB5PYG6gH7paxAqgH_p6xAqgH1ckbqAemvhuoB_PRG6gHltgbqAeqm7ECqAffn7EC2AcA0ggJCIjhgBAQARgdsQlalI-L2WNNd4AKA5gLAcgLAYAMAbgMAdgTDYgUAtAVAZgWAYAXAQ&ae=1&num=1&sig=AOD64_24Zd3eetdN63hdYcO7O7s5IFwTRw&client=ca-pub-4188807138211503&nb=9&adurl=https://www.avaya.com/it/prodotti/ccaas/public/lots_of_stuff_after
|
||||
# if no iframes are available or none of them contains an ad, this will just skip
|
||||
if try_to_click_elements(driver, get_clickable_ads(driver)):
|
||||
time.sleep(4)
|
||||
break
|
||||
|
||||
driver.quit()
|
||||
|
||||
def try_to_click_elements(driver, clickable_elements):
|
||||
while True:
|
||||
index = random.randint(0, len(clickable_elements) - 1)
|
||||
|
||||
if len(clickable_elements) == 0:
|
||||
print("All the elements weren't clickable!")
|
||||
return False
|
||||
|
||||
try:
|
||||
print("trying to click element", clickable_elements[index])
|
||||
clickable_elements[index].click()
|
||||
return True
|
||||
except:
|
||||
print(clickable_elements[index], "was not clickable, deleting and trying again")
|
||||
clickable_elements.pop(index)
|
||||
|
||||
|
||||
def get_clickable_ads(driver):
|
||||
searchable_ads = [frame for frame in driver.find_elements_by_xpath('.//iframe') ]
|
||||
id_ok_ads = [frame for frame in searchable_ads if ('ad' in frame.get_attribute('id') or 'google_ad' in frame.get_attribute('id')) and frame.is_displayed() ]
|
||||
print(id_ok_ads)
|
||||
|
||||
return id_ok_ads
|
||||
|
||||
|
||||
def get_possibile_webelements(driver):
|
||||
# Fetch all the element with links present on the page and only save the clickable ones
|
||||
clickable_elements = []
|
||||
for el in [x for x in driver.find_elements_by_xpath('.//a') if x.get_attribute('href') != None]:
|
||||
clickable = False
|
||||
try:
|
||||
WebDriverWait(driver, 0.25).until(EC.element_to_be_clickable(el))
|
||||
clickable = True
|
||||
except:
|
||||
clickable = False
|
||||
|
||||
#print(f'{el}, which brings to, {el.get_attribute("href")} is {clickable} ', end="")
|
||||
|
||||
if clickable:
|
||||
broke = False
|
||||
|
||||
for outside_scope in outside_website_scopes:
|
||||
if outside_scope in el.get_attribute('href'):
|
||||
broke = True
|
||||
break
|
||||
|
||||
if not broke:
|
||||
clickable_elements.append(el)
|
||||
|
||||
return clickable_elements
|
||||
|
||||
def click(driver, by, desc, timeout):
|
||||
WebDriverWait(driver, timeout).until(EC.element_to_be_clickable((by, desc))).click()
|
||||
|
||||
def main(use_tor=True, repeats=1):
|
||||
ips = set()
|
||||
|
||||
for i in range(repeats):
|
||||
#todo figure out how to use stem to launch a tor process
|
||||
if use_tor:
|
||||
tor_process = launch_tbb_tor_with_stem(tbb_path='./tor-browser_en-US')
|
||||
#tor_process = subprocess.Popen(['bash','-c', "./tor-browser_en-US/Browser/TorBrowser/Tor/tor"])
|
||||
|
||||
if use_tor:
|
||||
proxies = {'http' : 'socks5://localhost:9250','https' : 'socks5://localhost:9250'}
|
||||
else:
|
||||
proxies = []
|
||||
ip = requests.get("http://httpbin.org/ip", proxies=proxies).json()["origin"]
|
||||
ips.add(ip)
|
||||
print (f'IP is {ip}')
|
||||
|
||||
options = uc.ChromeOptions()
|
||||
options.add_argument('--no-first-run')
|
||||
options.add_argument('--no-service-autorun')
|
||||
options.add_argument('-password-store-basic')
|
||||
if use_tor:
|
||||
options.add_argument('--proxy-server=socks5://localhost:9250')
|
||||
|
||||
try:
|
||||
driver = uc.Chrome(options=options)
|
||||
visit_page(driver, "https://giangillorossi.altervista.org")
|
||||
time.sleep(5)
|
||||
driver.quit()
|
||||
except Exception as e:
|
||||
print("The browser encountered an unknown error, skipping this pass and going on", e)
|
||||
i -= 1
|
||||
|
||||
if use_tor:
|
||||
tor_process.kill()
|
||||
|
||||
print(f'Stats: TOR provided with {len(ips)} different IPs, and those were: {ips}')
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(use_tor=False, repeats=1)
|
|
@ -0,0 +1 @@
|
|||
Quick rfbauth file for VNC, password "hellogoodbye"
|
|
@ -0,0 +1 @@
|
|||
<06><>cf<>
|
Loading…
Reference in New Issue