Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS_TXT_Pwnage bug when exfil and no authns especified #96

Open
georgemulder opened this issue Sep 5, 2023 · 1 comment
Open

DNS_TXT_Pwnage bug when exfil and no authns especified #96

georgemulder opened this issue Sep 5, 2023 · 1 comment

Comments

@georgemulder
Copy link

Hi,

When no AuthNS is especified and you choose to exfiltrate data, there is a bug where the value of the exfiloption parameter fills AuthNS one. This is observed in the next screenshot:
image

The parameter webserver is used as the last paremeter of nslookup (AuthNS) This is why "Can't find server address for 'webserver'" message appears.

AuthNs has no default value so it becomes $null. Sentences like "if ($AuthNS -ne $null)" are ok in this context but the way, the script is loaded, in this sentence:

$options = "DNS-TXT-Logic $Startdomain $cmdstring $commanddomain $psstring $psdomain $Arguments $Stopstring $AuthNS $ExfilOption $dev_key $username $password $URL $DomainName $ExfilNS $exfil $LoadFunction"

$AuthNS is not a string so, the written script at temp directory, will have a space instead, leaving the next parameter, ExfilOption as the AuthNS one. All paremeters go to the left leaving $exfil without value, rendering exfiltration unusable.

I thought two solutions:

  1. Before initializing $options variable, check if $AuthNS is $null, if it is, change the value to "null" (String)
  2. Give a default value of "null" (String) and change the if's: if ($AuthNS -ne "null")

I think option 2 is cleaner so i will PR it. Hope you feel good about this and accept it.

@Bluekezhou
Copy link

Bluekezhou commented Sep 5, 2023 via email

georgemulder pushed a commit to georgemulder/nishang that referenced this issue Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants