Ziparchiv&Passwort

CDW

0
Mitarbeiter
Und wieder braucht Habo Deine Hilfe:
Gestern haben wir einen vielversprechenden Plan zur Übernahme der Weltherrschaft herausgearbeitet (und verschlüsselt abgelegt).
Das musste natürlich gefeiert werden - leider kann sich heute keiner mehr an das Passwort erinnern :rolleyes:

Es ist nur bekannt, dass es aus 3 Teilen besteht:
Name eines Admins (Mackz/Throjan/mackz/throjan),
einer laufenden Nummer (2 Stellig),
dem Wort "Plan" oder "plan"
Alle Teile verbunden mit "_".
Die Reihenfolge ist unbekannt.

Beispiele:
"throjan_10_Plan" oder "99_Throjan_plan" oder "throjan_plan_42" oder
"plan_23_Mackz" oder "24_Plan_mackz" usw.

Aufgabe:
An den Inhalt des ZIP Archivs kommen.

Belohnung (gibt es nur, wenn der Plan auch funktioniert ;)) :
Für Passwort samt Lösungsweg+Code:
Terceira oder Guadalupe oder Ni'ihau
Für Passwort ohne Lösungsweg:
Beaufort-Insel oder Bouvetinsel oder Shag-Rocks


Tipp:
man kann externe Unzipper aufrufen:
unter Linux z.B "unzip -P password manpage unzip"
für Windows bietet z.B 7Zip Kommandozeilenoptionen:
"7z.exe e -y -ppasswort hello.zip"
und am Rückgabewert feststellen, ob der Entpackvorgang erfolgreich war.

Optional (einfacher): nur ein Worterbuch generieren lassen und anschließend irgendein Bruteforcetool einsetzen.
 
Vielleicht ist es nicht so gut, den geheimen Plan offen hier aufzudecken, ich habe ihn sicherheitshalber verschlüsselt... ;)
Code:
#!/usr/bin/python
import os
pwPart = [
        ["throjan", "Throjan", "Mackz", "mackz"],
        ["Plan", "plan"],
        range(10, 100)
     ]

perm = [[0, 1, 2], [0, 2, 1], [1, 0, 2], [1, 2, 0], [2, 0, 1], [2, 1, 0]]
print pwPart

for p in perm:
    for t1 in pwPart[p[0]]:
        for t2 in pwPart[p[1]]:
            for t3 in pwPart[p[2]]:
                pw = str(t1)+'_'+str(t2)+'_'+str(t3)
                print pw
                if os.system("unzip -q -o -P "+pw+" weltherrschaft.zip") == 0:
                    print "Password found!"
                    exit(0)
Passwort: 86_Cyna_znpxm (Gut, dass die Länge nichts verrät ;))
Code:
jrygureefpunsg.gkg:

1.pbzchgreIM teüaqra.
2.pbzchgreIM orxnaag znpura.
3.pbzchgreIM irexnhsra.
4.zvg qrz Tryq Fpuhgmohaxre onhra.
5."Jvaqbjf sbe Fhoznevarf" unpxra, zvaqrfgraf 2 H-obbgr üorearuzra.
6.zruerer Nofpuüffr cebibmvrera.
7.qvr Cnavx ahgmra, Cyägmr vz Fpuhgmohaxre na Zrvfgovrgraqr irexnhsra.
8.zvg qrz Reyöf Tbbtyr nhsxnhsra.
9.abpu zrue servr Qvrafgr naovrgra, Tbbtyr oryvrog znpura.
10.Qngra fnzzrya
11.Nccyr nhsxnhsra
12.tCubar urenhfoevatra:
   12.1: zhff uüofpu nhffrura (fvrur Nccyr Nhsxnhs)
   12.2: frue frue ebohfg frva (zhff rvara Fghem/Jnaqjhes üorefgrura)
   12.3 -> fhoiragvbavreg -> Mvry: 90% Znexgnagrvy!
13.Wnzon nhsxnhsra
14.(Bcgvbany, qraa Chaxg 13 vfg fpuba nhfervpuraq):
   Sbefpuhatfcebwrxg "Gvaahyhf" svanamvrera.
15. Nhs Gnt K jnegra:
15.1 Xbagebyyr üore tCubarf üorearuzra

Snyyf "Gvaahyhf" resbytervpu: Qngra nhs tCubarf üorefcvryra,
irefgrpxgr, ulcabgvfvreraqr Obgfpunsgra va Xyvatrygöara hagreoevatra.
bqre:
creznarag orfbaqref fpuyvzzr, crefbanyvfvregr Xyvatrygöar nofcvryra ynffra
(fvrur Chaxgr 10,13,14). Jvpugvt: Chaxg 12.2 !
15.3 Qvr Cnavx haq qnf Punbf ahgmra haq qvr Jrygureefpunsg üorearuzra.
 
Code:
#!/usr/bin/python
import os

admin = 'Mackz','Throjan','mackz','throjan'
plan = 'Plan','plan'
f=open('loe.sh', 'r+')

for i in range(0,4,1):
    for j in range(10,100,1):
        for k in range(0,2,1):
            pw = admin[i]+"_"+ plan[k]+ "_" + str(j)
            if os.system("unzip -q -o -P "+pw+" weltherrschaft.zip") == 0:
                    print "Password found!"
                    print pw
                    exit(0) 
            pw = admin[i]+"_"+ str(j)+ "_" + plan[k]
            if os.system("unzip -q -o -P "+pw+" weltherrschaft.zip") == 0:
                    print "Password found!"
                    print pw
                    exit(0) 
            pw = plan[k]+"_"+ admin[i]+ "_" + str(j)
            if os.system("unzip -q -o -P "+pw+" weltherrschaft.zip") == 0:
                    print "Password found!"
                    print pw
                    exit(0) 
            pw = plan[k]+"_"+ str(j)+ "_" + admin[i]
            if os.system("unzip -q -o -P "+pw+" weltherrschaft.zip") == 0:
                    print "Password found!"
                    print pw
                    exit(0) 
            pw = str(j)+"_"+ plan[k]+ "_" + admin[i]
            if os.system("unzip -q -o -P "+pw+" weltherrschaft.zip") == 0:
                    print "Password found!"
                    print pw
                    exit(0)    
            pw = str(j)+"_"+ admin[i]+ "_" + plan[k]
            if os.system("unzip -q -o -P "+pw+" weltherrschaft.zip") == 0:
                    print "Password found!"
                    print pw
                    exit(0)

Ich musste ein wenig oben abgucken, weil meine erste Version mit Python und Shellskript nicht wollte.
 
Mal ein bisschen Ruby. ;)
Ich habe mich mit einem Wordlist Generator begnügt, sonst werde ich noch
wegen Verbreitens von Hacker-Tools verhaftet. *fg*

Code:
#!/usr/bin/env ruby
#---------------------------------------------------------------------------#
#                                list_gen.rb                                #
#                                by +++ATH0                                 #
#---------------------------------------------------------------------------#

require 'permutation'

pass = [["Mackz", "mackz", "throjan", "Throjan"],
        ["Plan", "plan"]]

permOrder = Permutation.new(3)
outs = []

permOrder.each do |pOrder|
    pass[0].each do |j|
        pass[1].each do |k|
            0.upto 99  do |i|
                outs[pOrder.value[0]] = j
                outs[pOrder.value[1]] = k
                outs[pOrder.value[2]] = sprintf("%02d",i)
                printf("%s_%s_%s\n",outs[0],outs[1],outs[2])
            end
        end
    end
end

PS: *schauder* In so einer Welt würde ich nicht leben wollen. ;)
 
Keine Ahnung wie diese interessante Aufgabe an mir vorbeigehen konnte...8o

Aber ich habe sie ja doch noch entdeckt und als neugieriger Mensch, wollte ich natürlich wissen um welche Version unseres Masterplans es sich hier handelt - daher habe ich ein kleines Tool gebastelt...;)

Da es sich um einen längst veralteten Ansatz zur Erlangung der Weltherrschaft handelt, stelle ich das Tool einfach mal hier rein:
Code:
import java.io.*;

public class ZipCrackHabo 
{//ZipCrackHabo
    private static void entpacke(String[] perm)throws InterruptedException, IOException
    {//entpacke()
        int laenge;
        String puffer="_", passwd;
        
        for(int i=0; i<3; i++)
        {
            puffer+=perm[i]+"_";
        }
        laenge=puffer.length();
        passwd=puffer.substring(1, laenge-1);
        System.out.println("teste --> "+passwd);
        Process proc=Runtime.getRuntime().exec("unzip -o -q -P "+passwd+" weltherrschaft.zip");
        proc.waitFor();
        if(proc.exitValue()==0)
        {
            System.out.println("***  Passwort gefunden! *** ");
            System.out.println("Passwort: "+passwd);
            System.exit(0);
        }
    }//entpacke()
    private static void tausche(String[]perm, int i, int index)throws IOException
    {//tausche()
        String ablage=perm[i];
        perm[i]=perm[index];
        perm[index]=ablage;
    }//tausche()
    private static void permutiere(String[] perm, int index)throws InterruptedException, IOException
    {//permutiere()
        if(index==0)
        {
            entpacke(perm);
        }
        else
        {
            permutiere(perm, index-1);
            for(int i=0; i<3; i++)
            {
                tausche(perm, i, index);
                permutiere(perm, index-1);
                tausche(perm, i, index);
            }
        }
    }//permutiere()
    private static void crack()throws InterruptedException, IOException
    {//crack()
        int zahl=10, index=2;
        String[] admin={"Mackz", "mackz", "Throjan", "throjan"};
        String[] plan={"Plan", "plan"};
        String[] perm=new String[3];
        
        for(int z=zahl; z<99; z++)
        {
            for(int i=0; i<3; i++)
            {
                for(int j=0; j<2; j++)
                {
                    perm[0]=admin[i];
                    perm[1]=plan[j];
                    perm[2]=String.valueOf(z);
                    permutiere(perm, index);
                }
            }
        }
        
    }//crack()
    public static void main(String[]args)throws InterruptedException, IOException
    {//main()
        crack();
    }//main()
}//ZipCrackHabo

Die Permutation ist vielleicht etwas umständlich realisiert, ist aber auch aus dem Stehgreif gecodet... Vielleicht verschlanke ich den Code noch einmal, wenn mir irgendwann sehr langweilig ist...:rolleyes:
 
Zuletzt bearbeitet:
ich hab jetzt mal ein programm geschrieben dass alle möglichen passwörter in einer datei ausgibt.
nur leider habe ich keine ahnung welches bruteforceprogramm geeignet wäre um passwörter aus einer textdatei zu lesen und damit eine zip-datei zu extrahieren.
hat mir evtl jemand einen tipp?
das mit 7-Zip habe ich auch nicht hinbekommen, habe halt noch nie mit solchen tools bis jetzt zu tun gehabt :)

Code:
import java.io.*;
public class Weltherrschaft {
    public static void main(String[] args) throws IOException {
        String name[] = new String[4];
        name [0] = "Mackz";
        name [1] = "Throjan";
        name [2] = "mackz";
        name [3] = "throjan";
        String wort[] = new String[2];
        wort[0] = "plan";
        wort[1] = "Plan";
        String password = "123456789123456789";
        FileWriter fw = new FileWriter("passwords.txt");
        BufferedWriter bw = new BufferedWriter(fw);    
        for (int i=0; i<4; i++) {
            for (int zahl=0; zahl<100; zahl++) {
                password = name[i] + "_" + zahl + "_" + wort[0];
                System.out.println(password);
                bw.write(password);
                bw.newLine();
                password = name[i] + "_" + zahl + "_" + wort[1];
                System.out.println(password);
                bw.write(password);
                bw.newLine();
                password = name[i] + "_" +  wort[0] + "_" + zahl;
                System.out.println(password);
                bw.write(password);
                bw.newLine();
                password = name[i] + "_" +  wort[1] + "_" + zahl;
                System.out.println(password);
                bw.write(password);
                bw.newLine();
            }
        }
        for (int zahl=0; zahl<100; zahl++) {
            for (int i=0; i<4; i++) {
                password =  zahl + "_" + name[i] + "_" + wort[0];
                System.out.println(password);
                bw.write(password);
                bw.newLine();
                password = zahl + "_" + name[i] + "_" + wort[1];
                System.out.println(password);
                bw.write(password);
                bw.newLine();
                password = zahl + "_" + wort[0] + "_" + name[i];
                System.out.println(password);
                bw.write(password);
                bw.newLine();
                password = zahl + "_" + wort[1] + "_" + name[i];
                System.out.println(password);
                bw.write(password);
                bw.newLine();
            }
        }
        for (int j=0; j<2; j++) {
            for (int i=0; i<4; i++) {
                for (int zahl=0; zahl<100; zahl++) {
                    password = wort[j] + "_" + zahl + "_" + name[i];
                    System.out.println(password);
                    bw.write(password);
                    bw.newLine();
                    password = wort[j] + "_" + name[i] + "_" + zahl;
                    System.out.println(password);
                    bw.write(password);
                    bw.newLine();
                }
            }
        }
        bw.close();        
    }
}
 
Wieso BruteForce Programm?
Das kannst du doch locker selbst schreiben :wink:
Dein Programm gibt alle möglichen Kombinationen aus.
Behalte sie im Programm und rufe für jedes PW ein Zip Programm wie im Eingangspost erwähnt auf. Überprüfe, ob bei dem Versuch der Rückgabewert des Zip Programms ein "Okay" ausgibt.
Wenn nicht, war wohl das PW falsch und du versuchst das nächste PW in deiner "Liste"

Hast du 7-Zip installiert? Wenn ja, dann müsste dazu neben der GUI eben auch das Kommandozeilenprogramm dabei sein.
Dass musst du über dein Java Programm aufrufen.
Wie man mit Java externe Programme aufruft findest du in Massen im Internet.
Ich nutze dazu die Klasse ProcessBuilder
 
Vielen Dank für die Hilfe aber ich habe es immer noch nicht so richtig hinbekommen. Per ProcessBuilder startet zwar 7-Zip, doch passieren tut nichts. Habe auch testweise andere 7z-commands in eine kleine Test-Klasse gepackt um ein Ziparchiv ohne Passwort zu entpacken aber das hat auch nicht funktioniert. Liegt also nicht an den Passwörtern sondern eher an falschen Befehlen :confused:

Falls jemand mal drüberschauen möchte:
Code:
import java.io.*;
public class ZiparchivAufgabe {
    public static void unzip (String pw) throws IOException {
        System.out.println(pw);
        ProcessBuilder zip = new ProcessBuilder("C:\\Program Files (x86)\\7-Zip\\7z.exe", "e -y -p" + pw + " D:\\weltherrschaft.zip");
        zip.start();
    }
    public static void main(String[] args) throws IOException {
        String name[] = new String[4];
        name [0] = "Mackz";
        name [1] = "Throjan";
        name [2] = "mackz";
        name [3] = "throjan";
        String wort[] = new String[2];
        wort[0] = "plan";
        wort[1] = "Plan";
        String password = "123456789123456789";   
        for (int i=0; i<4; i++) {
            for (int zahl=0; zahl<100; zahl++) {
                password = name[i] + "_" + zahl + "_" + wort[0];
                unzip(password);
                password = name[i] + "_" + zahl + "_" + wort[1];
                unzip(password);
                password = name[i] + "_" +  wort[0] + "_" + zahl;
                unzip(password);
                password = name[i] + "_" +  wort[1] + "_" + zahl;
                unzip(password);
            }
        }
        for (int zahl=0; zahl<100; zahl++) {
            for (int i=0; i<4; i++) {
                password =  zahl + "_" + name[i] + "_" + wort[0];
                unzip(password);
                password = zahl + "_" + name[i] + "_" + wort[1];
                unzip(password);
                password = zahl + "_" + wort[0] + "_" + name[i];
                unzip(password);
                password = zahl + "_" + wort[1] + "_" + name[i];
                unzip(password);
            }
        }
        for (int j=0; j<2; j++) {
            for (int i=0; i<4; i++) {
                for (int zahl=0; zahl<100; zahl++) {
                    password = wort[j] + "_" + zahl + "_" + name[i];
                    unzip(password);
                    password = wort[j] + "_" + name[i] + "_" + zahl;
                    unzip(password);
                }
            }
        }       
    }
}
 
Mangelhafter Plan, viel zu monetär fokussiert ihr Kapitalistenschweine!
Code:
import itertools
import sys
import os

firstPart = list(["Mackz", "Throjan", "mackz", "throjan"])
secondPart = list()
thirdPart = list(["Plan", "plan"])

for i in range(0, 99):
	secondPart.append(str(i).zfill(2))
	
parts = [firstPart, secondPart, thirdPart]

for order in itertools.permutations([0, 1, 2]):
	for firstElement in parts[order[0]]:
		for secondElement in parts[order[1]]:
			for thirdElement in parts[order[2]]:
				passwordGuess = firstElement + "_" + secondElement + "_" + thirdElement
				print("trying " + passwordGuess)
				if os.system("unzip -q -o -P " + passwordGuess + " weltherrschaft.zip &>/dev/null") == 0:
					print("correct password: " + passwordGuess)
					sys.exit(0)

mfg benediktibk
 
Vielen Dank für die Hilfe aber ich habe es immer noch nicht so richtig hinbekommen. Per ProcessBuilder startet zwar 7-Zip, doch passieren tut nichts.

Doch es tut sich was, nur erfährt dein Java Programm davon nichts.

ProcessBuilder.start() gibt dir ein Objekt der Klasse Process zurück.
Mit diesem Objekt kannst du dann weiterarbeiten.
Zum Beispiel gibt es da die Methode
public abstract int waitFor() throws InterruptedException

Causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. This method returns immediately if the subprocess has already terminated. If the subprocess has not yet terminated, the calling thread will be blocked until the subprocess exits.

Returns:the exit value of the subprocess represented by this Process object. By convention, the value 0 indicates normal termination.
Evtl. stimmt auch dein command für den ProcessBuilder nicht ganz. Zumindest bei Windows kann man wohl nicht immer den Befehl als einzelnen String übergeben.
Hier wird noch mal genauer auf die Klasse ProcessBuilder eingegangen
Rheinwerk Computing / Java ist auch eine Insel
 
CypherL0rd 1st j3tzt 4uch 31ngew31h7

CypherL0rd ist auch eingeweiht jetzt und schon heiß drauf die world zu pwnen!

hier der c source
Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <windows.h>


int main() {
    char mods[4][8];
    char plans[4][8];
    strcpy(mods[0], "Mackz");
    strcpy(mods[1], "mackz");
    strcpy(mods[2], "Throjan");
    strcpy(mods[3], "throjan");
    strcpy(plans[0], "plan");
    strcpy(plans[1], "Plan");
    for (int i=10; i<100; i++) {
        char number[3];
        strcpy(number, itoa(i, number, 10));
        for (int j=0; j<4; j++) {
            for (int k=0; k<2; k++) {
                for (int l=0; l<6; l++) {
                    char result[20] = {0};
                    if(l == 0) {
                        strcat(result, mods[j]);
                        strcat(result, "_");
                        strcat(result, plans[k]);
                        strcat(result, "_");
                        strcat(result, number);
                    } else if (l == 1) {
                        strcat(result, mods[j]);
                        strcat(result, "_");
                        strcat(result, number);
                        strcat(result, "_");
                        strcat(result, plans[k]);            
                    } else if (l == 2) {
                        strcat(result, number);
                        strcat(result, "_");
                        strcat(result, mods[j]);
                        strcat(result, "_");
                        strcat(result, plans[k]);
                    } else if (l == 3) {
                        strcat(result, number);
                        strcat(result, "_");
                        strcat(result, plans[k]);
                        strcat(result, "_");
                        strcat(result, mods[j]);
                    } else if (l == 4) {
                        strcat(result, plans[k]);
                        strcat(result, "_");
                        strcat(result, number);
                        strcat(result, "_");
                        strcat(result, mods[j]);
                    } else if (l == 5) {
                        strcat(result, plans[k]);
                        strcat(result, "_");
                        strcat(result, mods[j]);
                        strcat(result, "_");
                        strcat(result, number);
                    }
                    printf("%s\n", result);    
                    char command[100] = {0};
                    strcat(command, "D:/7-Zip/7z.exe e -y -p");
                    strcat(command, result);
                    strcat(command, " weltherrschaft.zip");
                    if(system(command) == 0) {
                        printf("Korrektes Passwort: %s\n", result);
                        return 0;
                    }
                }
            }
        }    
    }
    return 1;
}
 
CypherL0rd b3d4nkt s1ch für d3n supp0r7

CypherL0rd hat noch nie was von switch-case gehört?!
natürlich, Lord Cypher kennt einiges ;)

danke für den support du hast recht das ist dann besser programmiert!

da ich noch an meinen skills arbeite (sozusagen am uppercut und dem jab hehe) werde ich noch eine version des programs erstellen das dann more generic ist und switch case nutzen tut.
 
Zuletzt bearbeitet:
Eigentlich ist die Lösung ein simpler Einzeiler ;)
PHP:
echo {Plan,plan}" "{{M,m}ackz,{T,t}hrojan}" "{10..99}"\n"|awk "{print $(echo '$'{1..3},'$'{1..3},'$'{1..3}'\n'|egrep -v '1.*1|2.*2|3.*3'|tr -d ' ' |tr '\n' ' '|sed 's/ /"\\n"/g')}" |tr -s '\n'|tr ' ' '_'| xargs -I{} sh -c "unzip -qoP{} weltherrschaft.zip && echo 'password:' {}"
 
Eigentlich ist die Lösung ein simpler Einzeiler ;)
PHP:
echo {Plan,plan}" "{{M,m}ackz,{T,t}hrojan}" "{10..99}"\n"|awk "{print $(echo '$'{1..3},'$'{1..3},'$'{1..3}'\n'|egrep -v '1.*1|2.*2|3.*3'|tr -d ' ' |tr '\n' ' '|sed 's/ /"\\n"/g')}" |tr -s '\n'|tr ' ' '_'| xargs -I{} sh -c "unzip -qoP{} weltherrschaft.zip && echo 'password:' {}"

wow respect aber schaffst dus auch als einzeiler in C ? :p
 
Meine nicht elegante Python Lösung:
Code:
#!/usr/bin/env python
import time
import os

time1 = time.time()

pwteil1 = ["Mackz","Throjan","mackz","throjan"]
pwteil2 = ["Plan","plan"]
#pwteil 3 --> range(10,100)
pwteil3 = []
for i in range(10,100):
	pwteil3.append(i)

all_pw_and_more = []

pwteile = [pwteil1,pwteil2,pwteil3]

for q1 in range(0,3):
	pwteile = [pwteil1,pwteil2,pwteil3]
	z1 = pwteile[q1]
	del pwteile[q1]
	for q2 in pwteile:
		for i1 in q2:
			for q3 in pwteile:
				for i2 in q3:
					for i3 in z1:
						if str(type(i1)) == "<class 'int'>" and str(type(i2)) == "<class 'int'>" or str(type(i2)) == "<class 'int'>" and str(type(i3)) == "<class 'int'>" or str(type(i3)) == "<class 'int'>" and str(type(i1)) == "<class 'int'>":
							o = 1
						else:
							all_pw_and_more.append(str(i1) + "_" + str(i2) + "_" + str(i3))



for pw in all_pw_and_more:
	print (pw)
	if os.system("unzip -q -o -P "+pw+" weltherrschaft.zip") == 0:
		print("found")
		break
time2=time.time()
timeend=time2-time1
print("Gebrauchte Zeit: "+str(timeend))

Zeit bis ich das pw gefunden hab: 7,4 sec
Zeit bis ich alle generierten pw ausprobiert hab: 35,4 sec
 
Zuletzt bearbeitet von einem Moderator:
Zurück
Oben