Twitter OSiNT (Ethical Hacking)
Summary
TLDRThis video introduces a Python-based tool called Twint, which allows users to scrape Twitter data without an API, login, or rate limits. The host provides a step-by-step guide on setting up Twint, demonstrating its use via CLI and within Python scripts. Emphasizing ethical hacking, the host explores various commands for collecting tweets, searching by user, keyword, location, and more. The video also delves into advanced features like saving data to JSON files, and using the tool in real-world investigations, encouraging viewers to explore its potential for educational purposes.
Takeaways
- 🔒 Twint is a powerful Python hacking tool used to gather information from Twitter without API, rate limits, or login.
- 💻 The tool works via CLI and can also be imported into Python code for deeper functionality.
- ⚠️ The tool is legal, but intent matters — it should only be used for educational purposes and ethical hacking.
- ⏱️ Setup is quick and can be done in five minutes using any Linux system or the free Google Cloud Console.
- 🛠️ Essential commands for setup include installing Git, Python 3, and Pip, followed by cloning the Twint repository.
- 🔍 Twint can scrape tweets, filter results by username, keyword, date, location, popularity, and more.
- 📂 Results can be exported to JSON files for further analysis or storage.
- 👨💻 Twint can be used programmatically within Python scripts, allowing for advanced search and automation.
- 🌍 The tool supports searching by geolocation, helping find tweets near specific locations or within a defined radius.
- 💡 Twint is a valuable tool for Open-Source Intelligence (OSINT) investigations, making information gathering easier.
Q & A
What is the purpose of the video?
-The video demonstrates how to use a Python hacking tool called Twint to gather information from Twitter without the need for API access, login, or rate limits.
Is Twint an illegal tool?
-No, Twint is not illegal. However, the user's intent when using the tool is important, and the video stresses the importance of using it for educational purposes only.
What does Twint stand for?
-Twint stands for Twitter Intelligence, a powerful Python tool for scraping information from Twitter.
What are the main features of Twint?
-Twint allows users to scrape Twitter data without using the Twitter API, login, or facing rate limits. It can gather tweets based on usernames, search terms, locations, and more. It can also output data in JSON format and be integrated into Python code.
How can Twint be installed?
-Twint can be installed by cloning the tool from GitHub using 'git clone,' navigating to the Twint directory, and installing the required dependencies using 'pip3 install -r requirements.txt'.
What are some common uses of Twint via the command line?
-Some common uses include searching for tweets from a specific user, limiting the number of tweets retrieved, searching by keyword, and exporting results to a file.
Can Twint be used programmatically within Python scripts?
-Yes, Twint can be imported as a Python module, and its functionality can be customized in Python scripts, allowing for more complex and dynamic queries.
How can you search for tweets near a specific location using Twint?
-You can use the '--near' option followed by the name of a city or '--geo' followed by latitude and longitude coordinates, along with a radius, to search for tweets near a specific location.
How can you filter tweets based on their popularity using Twint?
-You can use the '--min-likes' option followed by a number to filter tweets that have received at least that number of likes.
What is one practical use case of Twint demonstrated in the video?
-One practical use case is searching for tweets about coffee near a user's location or for popular tweets about Raspberry Pi in different cities. The video also demonstrates gathering tweets and exporting them to JSON files for further analysis.
Outlines
🔐 Introduction to Ethical Twitter Hacking with Twint
This paragraph introduces the topic of ethical hacking on Twitter using a Python tool called Twint. The narrator clarifies that they won’t be hacking accounts but rather using Twint to gather public information without API limits or logins. A quick disclaimer emphasizes the legal use of the tool, warning viewers to avoid unethical practices. The narrator shares their excitement about the tool's ease of setup and power, explaining that it can be run via the Google Cloud Console for free. The paragraph closes with an appeal to like, subscribe, and interact with the video.
🐍 Using Twint in Python and CLI
The narrator shifts to demonstrating Twint’s use through Python modules and CLI. They highlight the simplicity and versatility of using Twint via command line, showing how to search for specific users and limit the number of tweets returned. They also demonstrate how to search for specific keywords in tweets, output the results in JSON format, and explore the data in files. By showcasing the power of Twint in pulling data, the narrator sets the stage for more advanced use cases in Python.
⚙️ Exploring Advanced Twint Capabilities
The third paragraph delves into more advanced functionalities of Twint. The narrator explains how to search by location, find popular posts based on likes, and even retrieve tweets with images. The demonstration includes searching tweets from specific users like David Bomble and filtering them by date or popularity. These examples emphasize how Twint can be used for deeper exploration and information gathering, showing the practical applications of the tool.
Mindmap
Keywords
💡Twint
💡CLI (Command Line Interface)
💡Python Modules
💡Data Scraping
💡Google Cloud Console
💡JSON
💡Ethical Hacking
Highlights
Introduction to the Twint tool: a Python-based hacking tool to gather Twitter data without API or login requirements.
Twint setup is fast and easy, with no rate limits, making it a powerful tool for data scraping on Twitter.
Quick setup demonstration on Google Cloud Console, where Twint can be used in under five minutes.
Tool allows gathering tweets by username without API restrictions, demonstrating how to scrape all tweets from a specific user.
Example usage of Twint CLI (Command Line Interface), including how to limit the number of tweets retrieved.
Twint can filter tweets based on keywords, like finding all tweets mentioning 'Raspberry Pi' by a specific user.
Outputting scraped data to a JSON file for further analysis, showcasing how to save Twitter data locally.
Advanced search capabilities like filtering tweets based on minimum likes or searching tweets with images only.
Geolocation search feature allows users to search for tweets near specific cities or even based on exact geo-coordinates.
Twint’s Python module can be integrated into Python scripts for automated and customizable data collection.
Demonstration of creating an interactive Python script that searches for popular topics based on user input.
Example Python script that retrieves tweets mentioning a specific topic from a chosen location.
Showcase of a script that collects all Twitter replies to a user's tweets and retrieves recent activity from those users.
Emphasis on the ethical usage of Twint, highlighting the importance of educational and responsible hacking practices.
Encouragement for viewers to explore Twint’s functionalities further by building their own Python scripts.
Transcripts
twitter hacking
kind of because if you think we're going
to be hacking into twitter or hacking
into someone's account we're not doing
that so if you're here for that get out
of here not the video for you but we
will be using this amazing python
hacking tool to gather information from
twitter this tool is crazy powerful no
rate limit no login no api the setup is
super fast it seriously takes seconds
and i'll show you how to use this tool
via cli and even how to import this into
your python code now real quick
disclaimer while the tool we're using is
not illegal and the way it searches
twitter is not illegal your intent does
matter please do not hack anyone without
their permission or use this tool with
any kind of ill intent so be careful use
it for educational purposes only the
hacking tool we're using is called twint
which stands for twitter intelligence
and seriously no joke i've never had
more fun playing with a hacking tool
like i spent way too much time playing
with this so i'm crazy excited to show
you this for real and it's super crazy
easy to set up all you'll need is about
five minutes you can use any linux
computer and of course i'll show you how
to get free access to google cloud
console which is my preferred way to do
all this completely free like you can
start using this tool right now in five
minutes
all you need is your web browser i love
that so much anyways and then last but
certainly not least i need some coffee
man you need some hacking fuel two cups
minimum networkchuck.coffee if you don't
already have some
let's get started oh wait hold on real
quick have you hacked the youtube
algorithm today make sure you do hit
that like button subscribe notification
bell comment let's hack youtube today
ethically of course now again i'll be
demoing this on the google cloud console
which is completely free and amazing you
can do it right now i've got a link
below in the description just click that
sucker and go now of course you can use
your own environment that's fine too the
steps will be the same so i'm gonna get
signed into my google cloud console and
get this party started i'm so excited
once you're logged in click on the cloud
console icon at the very top right here
and that'll launch your cloud shell and
it's so cool again i can't say it enough
thank you google for doing something
like this now real quick if you're not
using google cloud console like me you
will need a few things installed like
apt install git
do that apt install
python 3 do that and apt install python3
dash pip and that should be enough let's
keep going first command we're going to
use git to clone our tool now i will
have all these commands below in the
description feel free to copy and paste
but typing it in feels so much better
just do that anyways git clone
we'll do a dash dash depth equals one
and then the url to the project it'll be
https colon whack whack and the url and
hit enter
it's gonna clone that sucker done so
fast then we're gonna change directories
into the twent directory that we just
downloaded cd twin
there and then last command to get this
going we're gonna install our
requirements so pip three
install we'll do a space then a dot and
then a space dash r
requirements
dot txt and hit enter
coffee break
and while we're all sipping our coffee
i'd like to thank the sponsor of this
video skillshare skillshare is an online
learning community with a ton of classes
like over a thousand thousands now what
i love about skillshare is that it's not
necessarily about i.t it's more about
creative stuff like how to make coffee
yeah there's a course on that or how to
develop my already excellent drawing
skills i mean i think it's pretty
obvious that i don't need any more help
i'm already pretty dang good so i'll
check out that course and see if they
can teach me anything i doubt it so be
watching the channel see if i improve my
drawing skills but seriously i do think
it's important that i.t people like us
explore the soft skills side of our
skill sets learning things like hey how
do i talk in front of people public
speaking how do i teach and get an idea
across how do i stay productive like for
example i'm going through thomas frank's
productivity class for creatives it's
these x factor skills that make you
great in i.t and also i do think it's
important that you have hobbies and
interests outside of technology i know
it's kind of hard to because it's
awesome so explore your creative side a
bit learn how to make a cup of coffee
learn how to draw maybe learn how to
make a ui a user interface the pretty
part of it instead of just the back end
so check it out link below in the
description the first 1 000 people to
click that link will get a free trial of
the skillshare premium membership after
that it's only 10 bucks a month anyways
coffee break over let's keep going and
that's it it's installed ready to go
just like that and honestly it's so
simple and cool to use watch this i'm
gonna clear my screen so let's try this
first type in twent
then we'll do a dash u for a username
and we'll specify a user let's say just
myself network chuck
what this tool is doing is so cool no
api required it's not using the twitter
apis
no twitter login required it's simply
scraping twitter and it's crazy powerful
let's try it out right now ready set go
ah
i'm going to hit ctrl c to stop but look
at all that look at all my tweets that
is so stinking cool but this is just the
beginning here we go
let me clear my screen once more now
first real quick how do you get help if
you don't know what you're doing simply
type in twent and then dash h it'll tell
you all the switches you can use now
this way is cool using the cli we'll go
through a few more examples here in a
moment but the more powerful amazing way
to do this the more fun way
is through python modules
or the python module we can import twins
into our code and use it for some cool
stuff i'll show you here in a moment but
anyways the cli is powerful by itself
let's try a few things so let's do that
same search we just did twins
dash u for user name network chuck now
what if you don't want a million tweets
what if you only want my last 20 tweets
we can do that dash dash limit
to the last 20 tweets that's more
digestible let's try that out real quick
okay there we go not too bad you can
also search through tweets so i can do
twin
u for my username network chuck once
more and then we can do a dash s to
search and this can be any keyword for
example we may want to see all the
raspberry pi tweets i put out
so put raspberry pi between quotes and
let's take a look
it even has my first tweet about
raspberry pi's which was back in 2016.
oh my gosh oh my gosh this is when i put
a unified controller openvpn dynamic dns
all running on my pi 3. that was fun all
right let's keep going let's go deeper
let's get crazier we can also output
these results to a file so we can you
know store them and look at them later
twint will do the same thing network
chuck for my username
i'll search for it every time i've said
right now and then i'll do a dash o
to output it to a file
see right now
dot json and then i'll do a dash dash
json to make sure the data is formatted
to be json now let's check it out
now it'll still output to the terminal
but let's do an ls to see what's inside
my folder here there it is right
now.json let's look inside i'll do a
nano right now.json
and there they all are that is so cool
okay here we go even deeper more cool
things let's pick on david bomble so
twint dash u david bomble
if you don't know who david bomble is go
follow that guy he's amazing we've been
friends for years now i want to see all
david bomble's popular post i'll do dash
dash men dash likes
and i'll do 100 this will return all
tweets that have at least 100 likes if
it doesn't have 100 likes ain't gonna be
there let's try it out
yeah look at david so popular look at
all those
popular tweets let's see all the times
he's talked about me i'll search for
myself
yeah oh it's still going yeah we hang
out a lot we talk a lot
maybe i only want to see his tweets from
today let's try that i'll do dash dash
sense and i'll specify the date 2021
today's april 28th
let's see lil congrats to all these
winners of the contest so just one tweet
today we can also go back and look at
previous stuff like let's specify a year
2016 was david even on twitter yeah he
was wow
[Laughter]
he's talking about sdn and open flow
like crazy now i want to see his
pictures from 2016 so i can actually
specify tweets only with images i'll do
dash dash images here we go oh he's got
one talking about raspberry pi's let's
go take a look at that
oh someone retweeted david and how he's
messing with
a raspberry pi zero that's fun now what
we're doing here might seem silly i'm
just looking at pictures and old tweets
but that's that's hacking gathering
information is a vital part of hacking
now just a few more cli commands before
we go crazy in python so here we go you
don't have to just search by username or
by one account
i can search simply by a search term so
maybe i want to find out all the people
talking about coffee
near where i live here in dallas i can
do that so i'll do dash dash near dallas
and i want to see it for today so i'll
do
sense 2021 blah blah today and these
things have to be popular so i want a
minimum likes
of at least 15 likes let's try it out
that is too cool
six hours straight of drinking coffee
while listening to edm probably not
healthy choice i don't know sounds great
to me maybe i'm in paris and i want to
hang out with people talking about
raspberry pies so let's see if anyone's
talking about raspberry pies today in
paris
and there certainly are let's go check
this guy out real quick raspberry pi
news looks pretty cool and you can also
be more precise so you don't have to do
near
you can actually search by coordinates
by geo coordinates so let's uh specify
some geo coordinates dash g
equals latitude and longitude
i'll do a comma after that and specify
the radius we'll say within like
20 kilometers no one this is austin
texas no one's talking about raspberry
pi's
i bet they're talking about coffee let's
test that out yeah look at all those
coffee people in austin texas
now the cli it's fun but the real power
comes in with python you ready let's do
this this is so cool seriously anyways
here we go i'm going to create a new
python file using nano leave me alone
nano and i'll name this hot topic
nothing to do with the store not
sponsored relax
dot pi
first thing we'll do here is make sure
we got
twint
involved we'll import twint
that's importing that python module so
we can use it in our script so for this
script i want it to be interactive so
here we go i want to be able to launch
this and say hey
this is what i'm searching for and what
city
i'm searching for it in to kind of get
hot topics like maybe raspberry pi's in
dallas coffee in berlin t in england
there you go david let's try it out i'll
name my first variable search
and i'll have that equal
an input it'll ask me for input it'll
ask me what are you searching for
another one i'll name city and equal
that
also an input i'll say where and then
let's get twent set up now this is all
foreign to you that's fine this is a
great opportunity for you to learn a
little bit of python and if you already
know python do you go crazy with this
and have a ton of fun seriously this is
so cool anyways
okay have i said that enough yet so i'll
say c another variable i'll have that
equal
twint.config case being very important
here i'll say c dot search
equals my variable search c dot
near
equals
my variable city i do want to limit my
search so i'll say limit it to 20 tweets
and i only want to see popular tweets
now i can say number of likes like it
has to have 100 likes or i can do
popular
tweets
this is boolean so how they equal
true i believe that is yeah oh wait the
t needs to be lower case
case is important
and yeah you know i think that's good so
now we're going to launch the command
it'll be twint.run.search
and then my variable c which
encapsulates all that business right
here that should be good i'm going to
control x
to get out of there why do you see it
want to save it
easy for me to say and hit enter
cool time to run my script by doing
python3 and then what i name it oh hot
topic hot topic dot pi let's see what
happens
what am i searching for hmm
let's see let's do coffee in berlin
coffee
berlin
how cool is that that's so cool
something about coffee and space i want
to see that tweet let's check it out ooh
a new coffee machine love it okay one
more python thing i want to show you
just to kind of show you the power of
what you can actually do yourself
so on twitter i tweeted two things i
said retweet this and then uh reply to
this that was for right now so i've got
a script let me show you what i'm doing
so here it is let's jump in there real
quick
i called it my people
dot pi and here's the script i'm pulling
in date time to get today's date
now now i'm saying whoever tweets at me
today i want to pull all those tweets
it's going to run that search and then
throw that into a a list a python list
if you don't know what that is we'll
cover some of that stuff later in a new
series i then create a new list just
called my people and that new list with
this command will only have all of your
usernames everyone who replied to me or
or sent me stuff i've got all your
usernames in a nice little list it's
going to print that list
and then it's going to go through all of
your accounts
and pull your last 20 tweets and 20
tweets 10 times fast and then print that
on the terminal
pretty cool right i mean it's kind of
pointless
but if you think about what you can do
for an actual ocean investigation when
you're hacking whatever
so check it out let's try it python3
my people
dot pi here we go ready for this here we
go
there you all are thank you
and then here comes all your tweets
how cool is that
twit a python hacking tool for twitter
it's awesome i can seriously spend hours
just playing with this and creating
scripts in fact i would love to see what
you guys create so let me know below
comment below with what you have that's
awesome anyways let me know you think of
the video in the comments below make
sure you hack youtube today ethically of
course the algorithm so like the video
comment notification bell all that
youtubey stuff and yeah that's all i
have today
i'll catch you next time
[Music]
[Music]
浏览更多相关视频
Cara Mendapatkan Data (Crawl) Twitter X - 30 Maret 2024
Secure Your Microservices with Keycloak | OAuth2 & JWT | Spring Cloud Gateway
Twitter Sentiment Analysis in Python
The Perspectives Method - a BRAND NEW Way to Build in Notion!
Scrape website data without code using Bardeen
10 Ways to Use Harpa AI Tool (Harpa Ai Tool l Harpa AI Tutorial)
5.0 / 5 (0 votes)