Giter Club home page Giter Club logo

blacklist3r's Introduction

Blacklist3r

The goal of this project is to accumulate the secret keys / secret materials related to various web frameworks, that are publicly available and potentially used by developers. These secrets will be utilized by the Blacklist3r tools to audit the target application and verify the usage of these pre-published keys.

We are releasing this project with.Net machine key tool to identify usage of pre-shared Machine Keys in the application for encryption and decryption of forms authentication cookie.

Note: Requires Visual Studio 2019, not 2022. Visual Studio 2022 does not support .NET Framework 4.5, which this repo relies on.

References:

Mention

blacklist3r's People

Contributors

aidan-gibson avatar devsecboy avatar freakazoidile avatar kaimi- avatar mlr0p avatar nirhua avatar random-robbie avatar soffensive avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blacklist3r's Issues

Flags for options list

Hello - thanks for the tool, is there somewhere the specifies all of the flag options for things like "purpose" and the other flags?

System.FormatException: Invalid length for a Base-64 char array or string

I get these errors even on using previous and latest releases.

The command I used is :-
AspDotNetWrapper.exe --keypath MachineKeys.txt --encrypteddata /wEPDwUKLTg0MzcxNzgzNmQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgIFJmN0bDAwJENvbnElbnRQbGFjZUhvbGRicjEkSW1hZ2VCdXR0b24zBSZjdGwwMCRDb2250ZW50UGxhY2Vlb2xkZXlxJEltYWdlQnV0dG9uMU3je+cjx5/7z0zvwlrr8SPmt2y8== --decrypt --purpose=viewstate --modifier=CA0B0334 --macdecode --IISDirPath "/" --TargetPagePath "/Default.aspx/" -f out.txt

And got these errors :-
Unhandled Exception: System.FormatException: Invalid length for a Base-64 char array or string. at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength) at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) at System.Convert.FromBase64String(String s) at NotSoSecure.AspDotNetWrapper.DefinePurpose.GetProtectedData(String strEncryptedText) at NotSoSecure.AspDotNetWrapper.AspDotNetWrapper.Main(String[] args)
Please note that the value of viewstate didn't contained "==". I added them by reading a post on StackOverFlow . But still got no luck with the errors.

Encrypted data is too long for command prompt.

Hi,

My encrypted data is 9359 chars. Command prompt only allows 8191 chars. I think there should be a parameter for --encrypteddata that takes a filepath, such as --encrypteddatapath where the program can take the encrypted data from a text file. Very cool program!

Best,
Alex

Option 'valalgo' is unknown.

Hello,

After compiling the tool in visual studio I don't have the same option as you :

From the readme:
image

On my side:
image

So of course, when I try with a sample command like

`AspDotNetWrapper.exe --keypath MachineKeys.txt --encrypteddata 195A989biBjM_NAqqiie5DnHKfcwrNGDuT-Suumqmw6oVyLSsjCFx9Emhf034TDjcuC9mfwNbi6yD-1QlbhcUAgdTOwY0o0sNbg7bJrNyUEf6ZoyYh2QAZHhmxteN_cMQJI7C1WOBEl0ocihUVhKghdxegwRURcYx2h1uMbijX3jsEf59L8Uco_PpfFLN--RtcLTKUvtZd0fH5Sgc1JQmsvTBr7IJ4Ua01I8uyEPYNXZGYvssSzJ8YN6MXioky3WBXv9NGNxDpgTpIPWGetgZ0iOSaTmqPr6sPu4ndesUV4SKsBroIP6Y38rr8LwFCZBKDK5dli4kKwmy9xeM02qshCoLf8ppeOiK2aMLfb9jqkraoss2BflD3hpDdrYHVGH7ryTWQh4HABYDC7OOMgdld3WJ1CUfJ9pmr0qnVFD4Gc --decrypt --purpose=owin.cookie  --valalgo=hmacsha512 --decalgo=aes

I have this error:

ERROR(S):
  Option 'valalgo' is unknown.
  Option 'decalgo' is unknown.
  Option 'legacy' is unknown.

We use the same version, any idea why I didn't have all options available ?

.

\

Question - How to Contribute

Hey,

I am trying to understand the machine keys file.

is that just the machine keys or is there a way i can provide a big list of validation key and decryption keys to add to the system?

I am going through github and pulling what keys i can to help add to potential hits.

is it layed out like.

decryptionKey,validationKey

Not output generated from the AspDotNetWrapper

Hi, I was following the example highlighted on the article below, and I've noticed that the AspDotNetWrapper is not generating any output.

https://www.notsosecure.com/exploiting-viewstate-deserialization-using-blacklist3r-and-ysoserial-net/#PoC

AspDotNetWrapper.exe --keypath MachineKeys.txt --encrypteddata /wEPDwUKLTkyMTY0MDUxMg9kFgICAw8WAh4HZW5jdHlwZQUTbXVsdGlwYXJ0L2Zvcm0tZGF0YWRkbdrqZ4p5EfFa9GPqKfSQRGANwLs= --purpose=viewstate --valalgo=sha1 --decalgo=aes --modifier=CA0B0334 --macdecode --legacy

I downloaded the Github Project, and I built it in VS.net, but the exe is not giving me anything

question

Hello ,,
thank you very much for this software.
Does Blacklist3r for ViewState produced with (.Net < 4.5 and EnableViewStateMac=true/false and ViewStateEncryptionMode=true ) work?
And that legacy is unknown in Blacklist3r.

Compiling

Please explain how you compile this in visual studio code. Would really help alot!

can not found,why?

can not found,why?

.\AspDotNetWrapper.exe  --keypath MachineKeys.txt --encrypteddata "/wEPDwUJMzk1NzA1NjUzDxYIHgtDTElFTlRFTUFJTGUeDENMSUVOVE1PQklMRWUeCUlSRVRSWUNOVGYeDl9Jc0VtYWlsTW9iaWxlZRYCAgMPZBYIAgEPFgIeCWlubmVyaHRtbAUWSUlGTCAtIEZvcmdvdCBQYXNzd29yZGQCAw9kFgJmDxYCHwQFD0ZvcmdvdCBQYXNzd29yZGQCBw9kFggCAw8PFgIeBFRleHRlZGQCCQ8PFgIeB0VuYWJsZWRoZGQCCw8PFgIfBQUBMGRkAg0PDxYCHwUFATBkZAIJD2QWBAIBDxYCHwQFE0VudGVyIE5ldyBQYXNzd29yZC5kAgMPFgIeB1Zpc2libGVoFgJmD2QWBgIBDw8WAh8HaGRkAgMPDxYEHwZoHwdoZGQCBQ8PFgQfB2gfBmhkZGTnxJZ8skNiBSTEHo2z4QrLxX2wbCw3GoCrWrPOnOfJMg==" --decrypt --purpose=viewstate --modifier=ECA7C9A2 --macdecode --TargetPagePath "/OTPGeneration/frmOTPGeneration.aspx?RqtpAs=PM2SLMF5T" -f out.txt --IISDirPath="/"

New key pair found.

Hi,

First thanks a lot for this tool ๐Ÿ’ฏ

I have found the following key pair on this site that is not present into the MachineKeys.txt file of the last release bundle:

image

Keys:

  • Decryption key: EBA4DC83EB95564524FA63DB6D369C9FBAC5F867962EAC39.
  • Validation key: B3C2624FF313478C1E5BB3B3ED7C21A121389C544F3E38F3AA46C51E91E6ED99E1BDD91A70CFB6FCA0AB53E99DD97609571AF6186DE2E4C0E9C09687B6F579B3.

Section of the blog post with the mentioned key pair:

ysoserial.exe -p ViewState -g TypeConfuseDelegate -c "echo 123 > c:\windows\temp\test.txt" \
--path="/site/test.aspx/" \
--apppath="/directory" \
--decryptionalg="AES" \ 
--decryptionkey="EBA4DC83EB95564524FA63DB6D369C9FBAC5F867962EAC39" \
--validationalg="SHA1"  \
--validationkey="B3C2624FF313478C1E5BB3B3ED7C21A121389C544F3E38F3AA46C51E91E6ED99E1BDD91A70CFB6FCA0AB53E99DD97609571AF6186DE2E4C0E9C09687B6F579B3"

Thanks in advance ๐Ÿ˜ƒ

Encryption of Cookie doesn't work

Decryption of cookie is working but again encrypting the same file is not working(even without any modification)
Encrypt: AspDotNetWrapper.exe --keypath MachineKeys.txt -p aspxauth --cookie 490E807FAF8AA1ED00526434900ECBE308314B62C87037458E6F22980208DD7ACAC41DF05D3013D7E91DEE127E4E5A4E2499483B4BD0F5872934BBD5D1C2B81A9054A197 -a SHA1 -b 3DES --decrypt

Decrypt: AspDotNetWrapper.exe -f DecryptedText.txt
Error:
EncryptedData

Unhandled Exception: System.Security.Cryptography.CryptographicException: Specified initialization vector (IV) does not match the block size for this algorithm.
at System.Security.Cryptography.SymmetricAlgorithm.set_IV(Byte[] value)
at System.Web.Security.Cryptography.NetFXCryptoService.Protect(Byte[] clearData)
at System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.HomogenizeErrors(Func`2 func, Byte[] input)
at NotSoSecure.AspDotNetWrapper.EncryptDecrypt.EncryptData(String strDecryptDataFilePath)
at NotSoSecure.AspDotNetWrapper.AspDotNetWrapper.Main(String[] args)

encrypteddata value for AspDotNetWrapper too long for windows command line

The maximum length of the string that you can use in command prompt is 8191 characters. I am trying to use AspDotNetWrapper, however the viewstate is over 50,000 characters long. In the case that the encrypteddata is longer than the maximum allowed length I don't know of any way to run the executable other than changing it so that a file path is accepted in place of the value itself

Option 'valalgo,decalgo,legacy' is unknown

Hello,

Following this https://www.notsosecure.com/exploiting-viewstate-deserialization-using-blacklist3r-and-ysoserial-net/ the command are not working anymore

AspDotNetWrapper.exe --keypath MachineKeys.txt --encrypteddata /wEPDwUKLTkyMTY0MDUxMg9kFgICAw8WAh4HZW5jdHlwZQUTbXVsdGlwYXJ0L2Zvcm0tZGF0YWRkbdrqZ4p5EfFa9GPqKfSQRGANwLs= --purpose=viewstate  --valalgo=sha1 --decalgo=aes --modifier=CA0B0334 --macdecode --legacy

AspDotNetWrapper 2.0.0.0
Copyright c  2019
ERROR(S):
Option 'valalgo' is unknown.
Option 'decalgo' is unknown.
Option 'legacy' is unknown.

 -r, --keypath                Machine keys file path.

 -c, --encrypteddata          Encrypted data value to decrypt.

 -d, --decrypt                (Default: false) To decrypt the encrypted data.

 -f, --decryptDataFilePath    file path where the decrypted information stored

 -p, --purpose                purpose

 -m, --modifier               Modifier used to encode the viewstate

 -s, --macdecode              Used to decide whether viewstate is MAC enabled or not

 -o, --outputFile             Output file path

 -i, --IISDirPath             Application dir path in IIS tree

 -t, --TargetPagePath         Target page path

 -v, --antiCSRFToken          Anti CSRF token

 --help                       Display this help screen.

 --version                    Display version information.

Required option missing!!
-------------------------
-f, --decryptDataFilePath    file path where the decrpted information stored
--help Display this help screen.
--version Display version information.

I think the new version test everything, this issue is more related to the article itself :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.