sascha1887
Newbie
- Registriert
- 27. April 2018
- Beiträge
- 2
- Reaktionspunkte
- 0
- Punkte
- 226
Ja, du liest nicht richtigMache ich irgendetwas falsch?
Wird von mir nicht so passieren, oft genug erlebt, dass dann die Fragerei und das Geheule groß ist, wenn ein Zugang andere Sender als der davor/danach hat etc. etc. etc.jedoch ""geschmeidiger"" wäre es,
wenn nur "maclisten" oder "u&p" listen als txt. geteilt werden würden!!!!
z.b.:
portal xyz.portal:9090
# macliste_.txt
# U&P_.txt
Kannst ja mit nem einzelner per Terminal alles rausfilternhallo boardbrüder,
so, wie Shazgul es allen über "die paste" "mit/teilt", ist das schon mal sehr gut
und andere könnten sich nen beispiel dran nehmen!
jedoch ""geschmeidiger"" wäre es,
wenn nur "maclisten" oder "u&p" listen als txt. geteilt werden würden!!!!
z.b.:
portal xyz.portal:9090
# macliste_.txt
# U&P_.txt
wenn man sich auf diese struktur hier im board einigen könnte, wäre das bestimmt super!!!
sonnigen gruß
So richtig geschmeidig wird's erst wenn für mich jemand alles testet,hallo boardbrüder,
jedoch ""geschmeidiger"" wäre es,
wenn nur "maclisten" oder "u&p" listen als txt. geteilt werden würden!!!!
Senderinfos, warum sollen die nicht notwenig sein.moin clever,
letztendlich doch für alle üblich verdächtigen!!!
warum dann "aufhübschen" mit scannernamen, portal URL, senderinfos, datum, ip, whatever um dann wieder zu"filtern"???
<?php
declare(strict_types=1);
ini_set('memory_limit', '350M');
if ($argc < 3) {
fwrite(STDERR, "Usage: php conv.php <scanfile.txt> <output_base>\n");
fwrite(STDERR, "Example: php conv.php ./scan/scan_123.txt ./scan/done/example\n");
exit(1);
}
$inputFile = $argv[1];
$outputBase = $argv[2];
if (!file_exists($inputFile)) {
fwrite(STDERR, "File not found: $inputFile\n");
exit(1);
}
$outputDir = dirname($outputBase);
if (!is_dir($outputDir)) {
mkdir($outputDir, 0755, true);
}
function loadExistingFileData(string $filePath): array {
$existingUrls = [];
$existingMacs = [];
$existingUserPass = [];
if (file_exists($filePath)) {
$fileContent = file_get_contents($filePath);
preg_match_all('/http:\/\/([a-zA-Z0-9.-]+)(:\d+)?/', $fileContent, $existingUrls);
$existingUrls = isset($existingUrls[0]) ? array_unique($existingUrls[0]) : [];
preg_match_all('/[0-9A-Fa-f]{2}(:[0-9A-Fa-f]{2}){5}/', $fileContent, $existingMacs);
$existingMacs = isset($existingMacs[0]) ? array_unique($existingMacs[0]) : [];
preg_match_all('/get\.php\?username=([a-zA-Z0-9._]+)&password=([a-zA-Z0-9._]+)/', $fileContent, $existingUserPass);
$existingUserPass = (isset($existingUserPass[1], $existingUserPass[2]))
? array_map(fn($u, $p) => "$u/$p", $existingUserPass[1], $existingUserPass[2])
: [];
}
return [
'urls' => $existingUrls,
'macs' => $existingMacs,
'userpass' => $existingUserPass,
];
}
$inputData = file_get_contents($inputFile);
preg_match_all('/http:\/\/([a-zA-Z0-9.-]+)(:\d+)?/', $inputData, $urls);
preg_match_all('/[0-9A-Fa-f]{2}(:[0-9A-Fa-f]{2}){5}/', $inputData, $macs);
preg_match_all('/get\.php\?username=([a-zA-Z0-9._]+)&password=([a-zA-Z0-9._]+)/', $inputData, $userPass);
$outputMacFile = $outputBase . '_mac.txt';
$outputUpFile = $outputBase . '_up.txt';
if (!empty($urls[0])) {
$portalUrl = $urls[0][0];
$existingData = loadExistingFileData($outputMacFile);
$existingUrls = $existingData['urls'];
$existingMacs = $existingData['macs'];
$existingUserPass = loadExistingFileData($outputUpFile)['userpass'];
$newMacs = array_unique(array_diff($macs[0], $existingMacs));
$newUserPassCombos = array_map(fn($u, $p) => "$u/$p", $userPass[1], $userPass[2]);
$newUserPassCombos = array_unique(array_diff($newUserPassCombos, $existingUserPass));
if (!file_exists($outputMacFile) || strpos(file_get_contents($outputMacFile), $portalUrl) === false) {
file_put_contents($outputMacFile, $portalUrl . PHP_EOL, FILE_APPEND);
}
if (!empty($newMacs)) {
$macFileHandle = fopen($outputMacFile, 'a');
foreach ($newMacs as $mac) {
fwrite($macFileHandle, "$mac\n");
}
fclose($macFileHandle);
chmod($outputMacFile, 0755);
echo "MACs saved to $outputMacFile\n";
}
if (!file_exists($outputUpFile) || strpos(file_get_contents($outputUpFile), $portalUrl) === false) {
file_put_contents($outputUpFile, $portalUrl . PHP_EOL, FILE_APPEND);
}
if (!empty($newUserPassCombos)) {
$upFileHandle = fopen($outputUpFile, 'a');
foreach ($newUserPassCombos as $combo) {
fwrite($upFileHandle, "$combo\n");
}
fclose($upFileHandle);
chmod($outputUpFile, 0755);
echo "User/Pass combos saved to $outputUpFile\n";
}
if (empty($newMacs) && empty($newUserPassCombos)) {
echo "Nothing new to add. Files are already up-to-date.\n";
}
} else {
echo "No valid portal URLs found in scan file.\n";
}
Glaube ich gerne.es hat alles einen sinn!
wollte eigentlich nicht so tief rütteln.(aus Portals "geklaut"
Da ist es dann nur mit Copy&Paste zu erledigen. Ohne Terminal)
als beispiel:
portal URL:
portal.geniptv.com:8080
dann ne txt als:
portal_mac.txt
oder
portal_username&password.txt
http://portal.test:8080
00:1A:79:AA:BB:CC
00:1A:79:DD:EE:FF
...
Wir verwenden Cookies und ähnliche Technologien für folgende Zwecke:
Akzeptieren Sie Cookies und diese Technologien?
Wir verwenden Cookies und ähnliche Technologien für folgende Zwecke:
Akzeptieren Sie Cookies und diese Technologien?