Add stealer parser

Signed-off-by: Andrea Pavone <info@andreapavone.com>
This commit is contained in:
2024-11-10 19:43:46 +01:00
parent eb0b894e1c
commit 94ec1f888d
3 changed files with 239 additions and 5 deletions

View File

@ -3,14 +3,29 @@
namespace App\Http\Controllers;
use App\Services\StealerParser;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class FileParserController extends Controller
{
/**
* @param Request $request
* @return JsonResponse
* @throws \Exception
*/
public function stealer(Request $request) {
$file = $request->file('stealerFile');
$file = $request->file('file');
if(!$file->isValid()){
throw new \Exception('Invalid file');
}
$content = file_get_contents($file->path());
if(empty($content)) {
throw new \Exception('Empty File');
}
//TODO: Evaluate to deatch this execution from the web request
$credentials = (new StealerParser($content))->parse();