UNDERCODE COMMUNITY
2.68K subscribers
1.23K photos
31 videos
2.65K files
80.4K links
πŸ¦‘ Undercode Cyber World!
@UndercodeCommunity


1️⃣ World first platform which Collect & Analyzes every New hacking method.
+ AI Pratice
@Undercode_Testing

2️⃣ Cyber & Tech NEWS:
@Undercode_News

3️⃣ CVE @Daily_CVE

✨ Web & Services:
β†’ Undercode.help
Download Telegram
▁ β–‚ β–„ Uπ•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

πŸ¦‘πŸŒ Using Tor with Python :

1) download https://www.torproject.org/download/tor/

2) Install Python requests
We need Python requests

You can install it using the following commands:

pip install requests
pip install requests [socks]
pip install requests [security]
Python code working with TOR
The following Python code allows you to run TOR and Python together.

We will use the requests library to execute requests.

3) Make sure you have TOR running before running the code.

import requests

domain = "https://itsecforu.ru"
#define your proxies
#the socks5h method allows the socks server to translate the #hostname. So make sure that you add 'socks5h'.
proxies = {
'http': 'socks5h://127.0.0.1:9050',
'https': 'socks5h://127.0.0.1:9050'
}
a = requests.get(domain.strip(), proxies=proxies).text
print(a)
When can you use this
There can be various reasons why you might want to use TOR and Python together.

4) Python itself is just a programming language, and if it works in Python, then most likely the same approach will work in other programming languages ​​as well.

use case 1: crawler
You can use this code to create your own Python crawler via TOR.

Just create a list or dictionary of URLs you want to visit and instruct the tool to use your list.

myurls = ['url1','url2','url3','url4']
for url in myurls:
#dosomething
use case 2: Forensics
In some cases, you may only be interested in the text.

5) The code allows you to load entire pages without viewing visual content.

This can be a big advantage in some use cases.

my_interest = ['keyword1','keyword2','keyword3','keyword4']
for keyword in my_interest:
if keyword in a:
#dosomething

@UndercodeTesting
▁ β–‚ β–„ Uπ•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁
▁ β–‚ β–„ Uπ•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

πŸ¦‘πŸŒ Using Tor with Python:

How to use TOR with Python

1) For this tutorial we need Python and PIP

Additionally, we need the TOR expert package.

2) After this tutorial, you should be able to use TOR and Python together.

3) Download Tor
Download and install the TOR expert package on your system

https://www.torproject.org/download/tor/

4) Install Python requests
We need Python requests

5) You can install it using the following commands:

pip install requests
pip install requests [socks]
pip install requests [security]
Python code working with TOR
The following Python code allows you to run TOR and Python together.

We will use the requests library to execute requests.

Make sure you have TOR running before running the code.

import requests

domain = "https://itsecforu.ru"
#define your proxies
#the socks5h method allows the socks server to translate the #hostname. So make sure that you add 'socks5h'.
proxies = {
'http': 'socks5h://127.0.0.1:9050',
'https': 'socks5h://127.0.0.1:9050'
}
a = requests.get(domain.strip(), proxies=proxies).text
print(a)
When can you use this
There can be various reasons why you might want to use TOR and Python together.

Python itself is just a programming language, and if it works in Python, then most likely the same approach will work in other programming languages ​​as well.

use case 1: crawler
You can use this code to create your own Python crawler via TOR.

Just create a list or dictionary of URLs you want to visit and instruct the tool to use your list.

myurls = ['url1','url2','url3','url4']
for url in myurls:
#dosomething
use case 2: Forensics
In some cases, you may only be interested in the text.

The code allows you to load entire pages without viewing visual content.

This can be a big advantage in some use cases.

my_interest = ['keyword1','keyword2','keyword3','keyword4']
for keyword in my_interest:
if keyword in a:
#dosomething

@UndercodeTesting
▁ β–‚ β–„ Uπ•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁