Compare commits
2 Commits
850d48b07e
...
v1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e51fa1454 | |||
| 0fdd5c5fba |
@ -18,27 +18,17 @@ class StealerParser
|
|||||||
*/
|
*/
|
||||||
public function parse(): array{
|
public function parse(): array{
|
||||||
|
|
||||||
$lines = explode("\n", $this->content);
|
$items = explode("===============\n", $this->content);
|
||||||
$credentials = [];
|
$credentials = [];
|
||||||
$current = [];
|
|
||||||
|
|
||||||
foreach ($lines as $line) {
|
foreach ($items as $item) {
|
||||||
if (strpos($line, 'URL:') === 0) {
|
preg_match_all('/URL:\s(.*)\nUsername:\s(.*)\nPassword:\s(.*)\nApplication:\s(.*)\n/m',$item,$matches);
|
||||||
if (!empty($current)) {
|
$credentials[] = [
|
||||||
$credentials[] = $current;
|
'url' => trim($matches[1][0] ?? ''),
|
||||||
}
|
'username' => trim($matches[2][0] ?? ''),
|
||||||
$current = ['url' => trim(substr($line, 4))];
|
'password' => trim($matches[3][0] ?? ''),
|
||||||
} elseif (strpos($line, 'Username:') === 0) {
|
'application' => trim($matches[4][0] ?? '')
|
||||||
$current['username'] = trim(substr($line, 9));
|
];
|
||||||
} elseif (strpos($line, 'Password:') === 0) {
|
|
||||||
$current['password'] = trim(substr($line, 9));
|
|
||||||
} elseif (strpos($line, 'Application:') === 0) {
|
|
||||||
$current['application'] = trim(substr($line, 12));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($current)) {
|
|
||||||
$credentials[] = $current;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $credentials;
|
return $credentials;
|
||||||
|
|||||||
@ -5,7 +5,7 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "8000:8080"
|
- "8000:80"
|
||||||
environment:
|
environment:
|
||||||
- APP_ENV=production
|
- APP_ENV=production
|
||||||
- DB_CONNECTION=sqlite
|
- DB_CONNECTION=sqlite
|
||||||
|
|||||||
Reference in New Issue
Block a user