Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (1)

Powered by Vanilla. Made with Bootstrap.
Simple Client/Server Socket
  • Sh3llc0d3
    Posts: 1,910
    Just been pissing about/experimenting with perl sockets... here's a little program i've made that connects to a local server and you can send messages back to the server.

    Client
    #!/usr/bin/perl
    use IO::Socket;
    my $sock = new IO::Socket::INET (
    PeerAddr => 'netbook1-linux',
    PeerPort => '8880',
    Proto => 'tcp',
    );
    die \"Could not create socket: $!\n\" unless $sock;
    print $sock \"Connected!!\n\";
    while ($sock) {
    print \"Connected, here's your choices\n\";
    print \"1. Say Hello\n\";
    print \"2. quit\n\";
    print \">> \";
    $choice = <STDIN>;
    chomp ($choice);
    if ($choice eq \"1\") {
    print \"What is your msg?\n\";
    print \">> \";
    $msg = <STDIN>;
    chomp($msg);
    print $sock (\"$msg \n\");
    system(\"clear\");
    } elsif ($choice eq \"2\") {
    close($sock);
    exit
    }
    }

    Server:
    #!/usr/bin/perl
    use IO::Socket;
    my $sock = new IO::Socket::INET (
    LocalHost => 'Netbook1-Linux',
    LocalPort => '8880',
    Proto => 'tcp',
    Listen => 1,
    Reuse => 1,
    );
    die \"Could not create socket: $!\n\" unless $sock;
    my $new_sock = $sock->accept();
    while (<$new_sock>) {
    print $_;
    }
    close($sock);


    Going to mess about with this a bit more and then report back on how far I get. Going to hopefully take this a lot further as i'm trying to avoid an assignment. But hopefully this might help anyone who wants to learn perl sockets.
  • Nice Share bro ...:)...
  • Xin
    Posts: 3,251
    You could make backdoors like this, you could have it send commands and then carry out instructions
    Xin
  • Sh3llc0d3
    Posts: 1,910
    said:


    You could make backdoors like this, you could have it send commands and then carry out instructions



    It's what i'm kinda hoping to do, I've also got an idea involving ftp servers but it's still spinning around my head and I need to put it down in code.
  • Sh3llc0d3
    Posts: 1,910
    Just out of curiosity, if I was to make this into a backdoor/rat/exploitation program what views do people have to the starting of the server... I had originally thought about a manually started server but I think it may be more practical to go with an automated one. Everyone agree? I'll do a manual one for you all to use as a POC program.
  • D4rk357
    Posts: 34
    Nice work Semtex prime .. I am a python Fanboy but stil i must concede this code looks slick .. you can make a IRC bot using it which will greet ppl when they visit iexploit irc .. :D .. That would be cool :D ..
  • Sh3llc0d3
    Posts: 1,910
    said:


    Nice work Semtex prime .. I am a python Fanboy but stil i must concede this code looks slick .. you can make a IRC bot using it which will greet ppl when they visit iexploit irc .. :D .. That would be cool :D ..



    Never got into python really, never bothered to be honest. If you check out my other thread in this section 'Exploiter project', you'll see what I'm trying to achieve at the moment with perl sockets. The code needs rewriting thought to make it more efficient. Hopefully I may get round to it tonight.

    Thanks though :)
  • D4rk357
    Posts: 34
    Yes i understand :) .. One tends to be inclined towards one of the scripting languages more and your auto rooter plan is good :)you can also add the functionality of "defacing" .. i mean changing the index page with what user wants to be .. I dont support defacing though but that would help a lot of skids though .. What i like about your project is concept of automating the same old shit .. This is what hackers do :) .. Automate the routine steps and turn mind towards bigger problems .. Kudos to ur project
  • Sh3llc0d3
    Posts: 1,910
    said:


    Yes i understand :) .. One tends to be inclined towards one of the scripting languages more and your auto rooter plan is good :)you can also add the functionality of "defacing" .. i mean changing the index page with what user wants to be .. I dont support defacing though but that would help a lot of skids though .. What i like about your project is concept of automating the same old shit .. This is what hackers do :) .. Automate the routine steps and turn mind towards bigger problems .. Kudos to ur project



    Auto-deface is now implemented, it deletes the current index and downloads a deface page (index) to where the old one was. For the greyhats i'm thinking of a greyhat option which moves the old index page instead of deleting it. I love finding different ways of doings things. Exploiter's features could probably be done by 3 or 4 different programs/scripts or manually a lot slower. Nice to bring them all together :)
  • D4rk357
    Posts: 34
    said:


    said:


    Yes i understand :) .. One tends to be inclined towards one of the scripting languages more and your auto rooter plan is good :)you can also add the functionality of "defacing" .. i mean changing the index page with what user wants to be .. I dont support defacing though but that would help a lot of skids though .. What i like about your project is concept of automating the same old shit .. This is what hackers do :) .. Automate the routine steps and turn mind towards bigger problems .. Kudos to ur project



    Auto-deface is now implemented, it deletes the current index and downloads a deface page (index) to where the old one was. For the greyhats i'm thinking of a greyhat option which moves the old index page instead of deleting it. I love finding different ways of doings things. Exploiter's features could probably be done by 3 or 4 different programs/scripts or manually a lot slower. Nice to bring them all together :)


    yes i very much agree with this :)