Skip to content

This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.

Add files via upload

Abdul Wahab Junaid7275f3bf1a95
diff --git a/Python Tools/Http Client/httpx_asyncio.py b/Python Tools/Http Client/httpx_asyncio.py
new file mode 100644
index 0000000..a1dd38e
--- /dev/null
+++ b/Python Tools/Http Client/httpx_asyncio.py
@@ -0,0 +1,11 @@
+import httpx
+import asyncio
+
+async def request_http1():
+ async with httpx.AsyncClient() as client:
+ response = await client.get("http://www.google.es")
+ print(response)
+ print(response.text)
+ print(response.http_version)
+
+asyncio.run(request_http1())
diff --git a/Python Tools/Http Client/httpx_asyncio_http2.py b/Python Tools/Http Client/httpx_asyncio_http2.py
new file mode 100644
index 0000000..1843aa2
--- /dev/null
+++ b/Python Tools/Http Client/httpx_asyncio_http2.py
@@ -0,0 +1,10 @@
+import httpx
+import asyncio
+
+async def resquest_http2():
+ async with httpx.AsyncClient(http2=True) as client:
+ response = await client.get("https://www.google.es")
+ print(response)
+ print(response.http_version)
+
+asyncio.run(resquest_http2())
diff --git a/Python Tools/Http Client/httpx_basic.py b/Python Tools/Http Client/httpx_basic.py
new file mode 100644
index 0000000..040f074
--- /dev/null
+++ b/Python Tools/Http Client/httpx_basic.py
@@ -0,0 +1,7 @@
+import httpx
+
+client = httpx.Client(timeout=10.0)
+response = client.get("http://www.google.es")
+print(response)
+print(response.status_code)
+print(response.text)
diff --git a/Python Tools/Http Client/httpx_http2_trio.py b/Python Tools/Http Client/httpx_http2_trio.py
new file mode 100644
index 0000000..f6b2846
--- /dev/null
+++ b/Python Tools/Http Client/httpx_http2_trio.py
@@ -0,0 +1,18 @@
+import httpx
+import trio
+
+results={}
+
+async def fetch_result(client,url,results):
+ print(url)
+ results[url] = await client.get(url)
+
+async def main_parallel_requests():
+ async with httpx.AsyncClient(http2=True) as client:
+ async with trio.open_nursery() as nursey:
+ for i in range(2000,2020):
+ url = f"https://en.wikipedia.org/wiki/{i}"
+ nursey.start_soon(fetch_result,client,url,results)
+
+trio.run(main_parallel_requests)
+print(results)