Skip to content

Making A BOT That Changes IP Every Time He Does His Job (Selenium, Python, Psiphon)

Posted in VIDEOS

Hello everyone and welcome back! Today we are taking a break from cybersecurity (kinda, you’ll see useful stuff here too for the cybersec world) and covering the basics of Selenium. In the previous video i’ve shown some simple mouse and keyboard usage without selenium, but now i’ve shown a more real-world-practical example as well as added a little special thing: A VPN. The VPN starts to change your IP and stops after the task is done and it does that for every task. I just wanted to show how easy it would be to make something like this. I hope you like the video

⛔ Disclaimer ⛔

THIS VIDEO IS FOR EDUCATIONAL PURPOSES ONLY. NOTHING IN THIS VIDEO SHOULD BE USED ILLEGALLY, ESPECIALLY NOT FOR LEGITIMATE VOTING. VOTING IS TAKEN AS AN EXAMPLE DUE TO SIMPLICITY OF THE TASK – THIS VIDEO’S PURPOSE IS TEACHING SELENIUM AND BATCH SCRIPT BASICS FOR AUTOMATION AND QUALITY ASSURANCE AUTOMATION. I AM NOT RESPONSIBLE FOR YOUR ACTIONS.

REQUIREMENTS:

You need the Gecko driver (.exe) and the Psiphon VPN (there is a single .exe file available to download – ABSOLUTELY FREE, dont need to pay), as well as selenium module for Python (pip install selenium) – and i think that’s it – as well as : The scripts:

BOT.BAT

:loop

taskkill /IM VPN.exe
taskkill /IM geckodriver.exe

echo "STARTING..."
cmd.exe /c "start C:\Users\filip\Desktop\VPN.exe"

timeout 6 

echo "[!] Starting the Voting process..."
cmd.exe /c "python C:\Users\filip\Desktop\vote.py"

timeout 6

echo "[+] Voting done."
taskkill /IM geckodriver.exe

timeout 3

echo " Killing the VPN"
taskkill /IM VPN.exe

goto loop

And

VOTE.PY

from selenium import webdriver


browser = webdriver.Firefox()
url = 'http://localhost/voting.php'


browser.get(url)
XPATH_X = "/html/body/div/div/div[1]/div[1]/div[2]/form[1]/input"


next_button = browser.find_element_by_xpath(XPATH_X)
print("Trying to click the button to vote.")
next_button.click()
print("Button clicked.")

exit()

That would be all 🙂 Thank you so much for visiting. Have a nice day !

Oh yes if anyone wants my voting site (YOU DONT NEED THIS YOU CAN MAKE YOUR OWN – i made this with PHP and ran a XAMPP server for it – but you can set up locally whatever you want)

<!DOCTYPE html>
<html>
<title>W3.CSS Template</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
<style>
body,h1,h2,h3,h4,h5 {font-family: "Raleway", sans-serif}
</style>
<body class="w3-light-grey">

<!-- w3-content defines a container for fixed size centered content, 
and is wrapped around the whole page content, except for the footer in this example -->
<div class="w3-content" style="max-width:1400px">

<!-- Header -->
<header class="w3-container w3-center w3-padding-32"> 
  <h1><b>MY BLOG</b></h1>
  <p>Your vote <?php 
  if(isset($_GET['jcd'])){
      echo ": " . $_GET['jcd'];
  } elseif (isset($_GET['aj'])){
    echo ": " . $_GET['aj'];
  } else {}
  
  ?></p>
</header>

<!-- Grid -->
<div class="w3-row">

<!-- Blog entries -->
<div class="w3-col l8 s12">
  <!-- Blog entry -->
  <div class="w3-card-4 w3-margin w3-white">

    <div class="w3-container">
      <h3><b>VOTING AREA</b></h3>
      <h5>Vote for the best Presidental candidate <span class="w3-opacity"> ,Click to vote:</span></h5>
    </div>

    <div class="w3-container">
    <br/>
      <form method="GET" action="voting.php">
        <input type="submit" value="JC Denton" name="jcd"/>
      </form>
      <br/>
      <form method="GET" action="voting.php">
        <input type="submit" value="Adam Jensen" name="aj"/>
      </form>
      
      <br/> <br/>
      Your vote will be submitted onto the next page.
      <div class="w3-row">

      </div>
    </div>
  </div>
  <hr>

  <!-- Blog entry -->
  <div class="w3-card-4 w3-margin w3-white">
  <img src="/w3images/bridge.jpg" alt="Norway" style="width:100%">
    <div class="w3-container">
      <h3><b>BLOG ENTRY</b></h3>
      <h5>Title description, <span class="w3-opacity">April 2, 2014</span></h5>
    </div>

    <div class="w3-container">
      <p>Mauris neque quam, fermentum ut nisl vitae, convallis maximus nisl. Sed mattis nunc id lorem euismod placerat. Vivamus porttitor magna enim, ac accumsan tortor cursus at. Phasellus sed ultricies mi non congue ullam corper. Praesent tincidunt sed
        tellus ut rutrum. Sed vitae justo condimentum, porta lectus vitae, ultricies congue gravida diam non fringilla.</p>
      <div class="w3-row">
        <div class="w3-col m8 s12">
          <p><button class="w3-button w3-padding-large w3-white w3-border"><b>READ MORE »</b></button></p>
        </div>
        <div class="w3-col m4 w3-hide-small">
          <p><span class="w3-padding-large w3-right"><b>Comments  </b> <span class="w3-badge">2</span></span></p>
        </div>
      </div>
    </div>
  </div>
<!-- END BLOG ENTRIES -->
</div>

<!-- Introduction menu -->
<div class="w3-col l4">
  <!-- About Card -->
  <div class="w3-card w3-margin w3-margin-top">
  <img src="/w3images/avatar_g.jpg" style="width:100%">
    <div class="w3-container w3-white">
      <h4><b>My Name</b></h4>
      <p>Just me, myself and I, exploring the universe of uknownment. I have a heart of love and a interest of lorem ipsum and mauris neque quam blog. I want to share my world with you.</p>
    </div>
  </div><hr>
  
  <!-- Posts -->
  <div class="w3-card w3-margin">
    <div class="w3-container w3-padding">
      <h4>Popular Posts</h4>
    </div>
    <ul class="w3-ul w3-hoverable w3-white">
      <li class="w3-padding-16">
        <img src="/w3images/workshop.jpg" alt="Image" class="w3-left w3-margin-right" style="width:50px">
        <span class="w3-large">Lorem</span><br>
        <span>Sed mattis nunc</span>
      </li>
      <li class="w3-padding-16">
        <img src="/w3images/gondol.jpg" alt="Image" class="w3-left w3-margin-right" style="width:50px">
        <span class="w3-large">Ipsum</span><br>
        <span>Praes tinci sed</span>
      </li> 
      <li class="w3-padding-16">
        <img src="/w3images/skies.jpg" alt="Image" class="w3-left w3-margin-right" style="width:50px">
        <span class="w3-large">Dorum</span><br>
        <span>Ultricies congue</span>
      </li>   
      <li class="w3-padding-16 w3-hide-medium w3-hide-small">
        <img src="/w3images/rock.jpg" alt="Image" class="w3-left w3-margin-right" style="width:50px">
        <span class="w3-large">Mingsum</span><br>
        <span>Lorem ipsum dipsum</span>
      </li>  
    </ul>
  </div>
  <hr> 
 
  <!-- Labels / tags -->
  <div class="w3-card w3-margin">
    <div class="w3-container w3-padding">
      <h4>Tags</h4>
    </div>
    <div class="w3-container w3-white">
    <p><span class="w3-tag w3-black w3-margin-bottom">Travel</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">New York</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">London</span>
      <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">IKEA</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">NORWAY</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">DIY</span>
      <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Ideas</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Baby</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Family</span>
      <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">News</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Clothing</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Shopping</span>
      <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Sports</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Games</span>
    </p>
    </div>
  </div>
  
<!-- END Introduction Menu -->
</div>

<!-- END GRID -->
</div><br>

<!-- END w3-content -->
</div>

<!-- Footer -->
<footer class="w3-container w3-dark-grey w3-padding-32 w3-margin-top">
  <button class="w3-button w3-black w3-disabled w3-padding-large w3-margin-bottom">Previous</button>
  <button class="w3-button w3-black w3-padding-large w3-margin-bottom">Next »</button>
  <p>Powered by <a href="https://www.w3schools.com/w3css/default.asp" target="_blank">w3.css</a></p>
</footer>

</body>
</html>

That would be all!

⛔ Disclaimer ⛔

THIS CONTENT IS FOR EDUCATIONAL PURPOSES ONLY. NOTHING IN THIS SITE SHOULD BE USED ILLEGALLY, ESPECIALLY NOT FOR LEGITIMATE VOTING. VOTING IS TAKEN AS AN EXAMPLE DUE TO SIMPLICITY OF THE TASK – THIS CONTENT’S PURPOSE IS TEACHING SELENIUM AND BATCH SCRIPT BASICS FOR AUTOMATION AND QUALITY ASSURANCE AUTOMATION. I AM NOT RESPONSIBLE FOR YOUR ACTIONS.