-
Notifications
You must be signed in to change notification settings - Fork 1
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
0 parents
commit 7ce0476
Showing
9 changed files
with
239 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.vscode |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 RQ-21-Engineer | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,20 @@ | ||
build : | ||
|
||
mkdir bin | ||
g++ pswdgn.cpp -o pswdgn | ||
mv pswdgn.exe ./bin | ||
|
||
run : | ||
|
||
C:\Users\kiwog\Documents\projects\"hacking projects"\pswdgn\bin\pswdgn.exe -l 256 --all > password.txt | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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,33 @@ | ||
# pswdgn | ||
|
||
**_pswdgn_** is a tool for generate password, public / private key, and other credentials. | ||
|
||
<hr> | ||
|
||
# USAGE | ||
|
||
## Installation | ||
|
||
``` | ||
using g++ : | ||
$ g++ pswdgn.cpp -o pswdgn | ||
using gcc : | ||
$ gcc pswdgn.cpp -o pswdgn -lstdc++ | ||
using clang : | ||
$ clang pswdgn.cpp -o pswdgn -lstdc++ | ||
using clang++ : | ||
$ clang++ pswdgn.cpp -o pswdgn | ||
``` | ||
|
||
## how to use | ||
|
||
``` | ||
docs : | ||
pswdgn [ -L | --length ] [NUMBER] [ -ON | --only-number ] | ||
example : | ||
$ pswdgn -l 256 --all > password.txt | ||
``` |
Binary file not shown.
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,47 @@ | ||
#!/bin/bash | ||
|
||
pswdgn -l 256 --all > password.txt | ||
|
||
# read https://www.howtogeek.com/devops/automate-inputs-to-linux-scripts-with-the-expect-command/ | ||
cat << 'EOF' > expectsh.exp | ||
#!/usr/bin/expect -f | ||
set timeout -1 | ||
spawn ./register | ||
expect "new username : r" | ||
send -- "rootr" | ||
expect "new password : r" | ||
send -- "$(cat password.txt)" | ||
expect eof | ||
EOF | ||
|
||
: ' | ||
Which user? | ||
u user/owner | ||
g group | ||
o other | ||
a all | ||
What to do? | ||
+ add this permission | ||
- remove this permission | ||
= set exactly this permission | ||
Which permissions? | ||
r read | ||
w write | ||
x execute | ||
' | ||
chmod ugo+x expectsh.exp | ||
|
||
|
||
./expectsh.exp | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
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,19 @@ | ||
program powerWIN; | ||
|
||
uses SysUtils, Process; | ||
|
||
begin | ||
ExecuteProcess('cmd','/c pswdgn -l 256 --all > password.txt'); | ||
end. | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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,59 @@ | ||
#include <time.h> | ||
#include <string.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <iostream> | ||
|
||
|
||
|
||
class Generator { | ||
|
||
public : | ||
void key (int lengthKey, bool numberOnlyOption) { | ||
|
||
std::string result = ""; | ||
|
||
std::string numberCharacters = "1234567890"; | ||
std::string lowerCharacters = "abcdefghijklmnopqrstuvwxyz"; | ||
std::string upperCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | ||
std::string allCharacters = ( | ||
|
||
lowerCharacters + | ||
numberCharacters + | ||
upperCharacters | ||
); | ||
|
||
srand ( | ||
time(0) | ||
); | ||
|
||
if ( numberOnlyOption ) { | ||
|
||
for (int i = 0; i < lengthKey; i ++) { | ||
|
||
result += numberCharacters [ | ||
|
||
rand() % numberCharacters.length() | ||
]; | ||
|
||
} | ||
|
||
} else { | ||
|
||
for ( int i = 0; i < lengthKey; i ++) { | ||
|
||
result += allCharacters [ | ||
|
||
rand() % allCharacters.length() | ||
]; | ||
|
||
} | ||
} | ||
|
||
std::cout << result << std::endl; | ||
} | ||
|
||
}; | ||
|
||
|
||
|
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,39 @@ | ||
#include "include/generator.h" | ||
|
||
|
||
int main (int argc, char** argv) { | ||
|
||
Generator gen; | ||
|
||
if( (strcmp(argv[1], "-l") == 0) || (strcmp(argv[1], "--length") == 0) ) { | ||
|
||
|
||
if( (strcmp(argv[3], "-on") == 0) || (strcmp(argv[3], "--only-number") == 0) ) { | ||
|
||
gen.key( | ||
|
||
std::atoi(argv[2]), true | ||
); | ||
|
||
|
||
}else if( (strcmp(argv[3], "-a") == 0) || (strcmp(argv[3], "--all") == 0) ){ | ||
|
||
gen.key( | ||
|
||
std::atoi(argv[2]), false | ||
); | ||
|
||
} | ||
|
||
|
||
} else { | ||
|
||
std::cout << "pswdgn [ -L | --length ] [NUMBER] [ -ON | --only-number ]" << std::endl; | ||
} | ||
|
||
|
||
return 0; | ||
|
||
} | ||
|
||
|