1
0
Fork 0

Documentation added

master
Simon Moser vor 3 Jahren
Ursprung d61b2f4f63
Commit 7c6fdb7d01
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 83765B895FF2CFC6

@ -17,3 +17,15 @@ Then run the python server:
It will only support a flat directory structure in /dir/of/tools
Strongly based on [Uninvited Guest by Pen Test Partners](https://github.com/pentestpartners/Uninvited-Guest)
## Documentation
### Download
1. TXT `$filename.count.$dnsserver` returns the number of parts the file is split into
2. TXT `$filename.$i.$dnsserver` returns the base64-encoded file part #*$i*
### Upload
- TXT `$content.$i-$id.$dnsserver` pushes a file part to the server
- the whole domain MUST NOT be longer than 63 characters, split your file accordingly
- since only alphanumerical characters are allowed, encode your file with base64
- Count up *$i* so you don't get problems with caching (the server only used chronological order, so you can also use random numbers if you prefer that)
- The (base64-encoded) file is saved at *$directory*/*$id*.b64

@ -30,7 +30,7 @@ Function Push-DNSFile {
$content = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes((Get-Content -Path $FileName)))
$i = 0
While ($true) {
$url = ".$i-${id}u.$DnsName"
$url = ".$i-$id.$DnsName"
$len = 63 - $url.Length
$i++
if($len -lt $content.Length) {

@ -13,7 +13,7 @@ then
else
i=0; d=$(base64 -w 0 < "$f"); id=$(sha256sum "$f" | cut -d" " -f1 | base64 -w 0 | cut -c1-6)
while true; do
u=".$i-${id}u.$s"; ((i++)); x=$((63-${#u}))
u=".$i-$id.$s"; ((i++)); x=$((63-${#u}))
if [ $x -lt ${#d} ]
then p=${d:0:$x}; d=${d:$x}; dig +short txt "$p$u"
else dig +short txt "$d$u"; exit 0

@ -84,7 +84,7 @@ class FileResolver(BaseResolver):
pname = '.'.join(parts[:-2])
path = self.directory + "/" + pname
command = ''.join(parts[-2:-1])
if command.endswith("u"):
if "-" in command:
with open(args.directory + command.split('-')[1] + ".b64", 'a') as f:
f.write(str(pname) + "\n")
reply.add_answer(RR(name, QTYPE.TXT, ttl=self.ttl, rdata=TXT("Upload accepted")))

Laden…
Abbrechen
Speichern