![]() |
|
Writing a simple python Viewbot - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45) +--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449) +---- Forum: Beginner Hacking (https://hackforums.net/forumdisplay.php?fid=4) +----- Forum: Hacking Tutorials (https://hackforums.net/forumdisplay.php?fid=47) +----- Thread: Writing a simple python Viewbot (/showthread.php?tid=6087025) |
Writing a simple python Viewbot - Variez - Jun 12, 2020 Introduction: Hey, so I've always personally loved bots. Bots are fascinating in the way they interact with webpages, the intricate bypassing, and more importantly the money behind them ✌ . This tutorial will give a brief look into: web requests, python, multi-threading, and web-based botting. Part One [What is a Bot?]: Depending on who you ask this definition may vary however I consider a bot to be something that automates a task. For this we will be using python. For setup I highly recommend using sublime text and installing yourself python3.7 however any text editor will do. Once you've got these installed fire up command prompt and type the following command: Code pip install requestsPart Two [Writing our Bot]: We are going to want to import the three libraries which we are using for this bot, in this case we will be using the random library , threading library, and also the requests library. After we have that imported lets get onto writing our viewbot itself: Code headers = {'user-agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"}next we want to create our function for loading our page, notice how I pass both the argument url,proxy these will be variables which I use in my program itself and MUST be passed whenever you call our function. Another line in this code is: Code s = requests.session()Now onto the fun stuff :) : So if you click f11 and then click head over to the network tab then hit f5 you can reload the page and see whats actually being loaded. So in this example we see 2 pieces of really important information when loading the page itself: 1. Its a get request 2. The Request URL The are both incredibly important when writing your code So the code above is doing something super important first one being we are sending a get request this is written as: Code s.get()Code headers=headerspr Code oxies=proxyThis is so we are sending a new view request, this helps to quickly rack up views, however with some forums its not needed. This code here is written by the wonderful Sheepy, I've just been reusing this code for getting my proxies mainly because of how lazy I am, regardless I'm going to use it in my example. So this code block is getting a random line from your text file which is called proxies.txt. After it grabs your proxy it uses regular expressions and re formats it so it looks something like "https : / / proxyhere" then it attempts to make a request to www[.]google[.]com and if it times out in under 3 seconds then it decides to not use this proxy. If you want to change the timeout time just change the value which happens to be 3 to the number of your choice. Code def getproxy(): So we are sticking our code in a while loop just to keep it running forever since I assume your also like me, lazy. However if you wanted to calculate your views you could tell it just be in a for loop and set the range(100) to range(yourNumber) the for loop is creating multiple threads to view the page. Next in our code we are creating a thread thats target is view_page with the arguments you give, which is the url of your page and also the retrieval of the proxy itself. We end this all with start to tell our code to start view_page code with the following arguments. Part Three [Conclusion]: Bots are incredibly interesting in the ways they can automate tasks that no one is willing to do by hand. I personally love bots all of types, robots, web bots, sex bots, ect. Regardless its considered polite to check out the robots.txt and see what is allowed for interacting with the site itself. I hope you enjoyed this tutorial on creating a simple viewbot. If you enjoyed consider leaving a like, starring it or answering the poll :D Part Five [Final Code]: Since HF is clowning on this HQ post check this pastebin link: www[.]pastebin[.]com/tKFA51yM Here is the finished code for those of you that are to lazy to write it out on your own, I highly encourage for people to write it by hand because otherwise your not retaining the information. RE: Writing a simple python Viewbot - pythonnoob2 - Jun 15, 2020 Is this used for Twitch? Great tutorial by the way! I am trying to learn Python and this will help. |