-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e31b54
commit 8cab826
Showing
4 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import 'package:panzer_maid/maid_shell/utils.dart'; | ||
import 'bonkers.dart'; | ||
|
||
Future<int> tinyBox(List<String> terminalArgs, String option) async { | ||
final Map tinyBoxCommands = { | ||
'attack.luks': (terminalArgs) => luks_bonkers(terminalArgs), | ||
}; | ||
return commandOption(tinyBoxCommands, terminalArgs, option); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'dart:io'; | ||
import 'package:panzer_maid/maid_shell/utils.dart'; | ||
|
||
Future<int> luks_bonkers(List<String> terminalArgs) async { | ||
try { | ||
String device = searchKeyValue(terminalArgs, key: 'device'); | ||
|
||
final file = File(''); | ||
var contents = await file.readAsLines(); | ||
for (final line in contents) { | ||
var cmd = | ||
"echo '$line' | cryptsetup open --key-file - /dev/$device encrypted_device"; | ||
var out = await flawlessExec(cmd); | ||
if (out == 0) { | ||
puts("Found! key :: $line", color: 'green'); | ||
return out; | ||
} | ||
} | ||
} catch (e) { | ||
return stdint('error'); | ||
} finally { | ||
return stdint('ok'); | ||
} | ||
} |