Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***
- ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄
- ▐░░░░░░░░░░▌ ▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
- ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌
- ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌
- ▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄█░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌
- ▐░▌ ▐░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
- ▐░▌ ▐░▌▐░█▀▀▀▀█░█▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀█░█▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀█░█▀▀
- ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌
- ▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌ ▄ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌
- ▐░░░░░░░░░░▌ ▐░▌ ▐░▌▐░▌▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌
- ▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀
- ~~~ :xD: Have Fun. Don't Forget To Bookmark This Website :xD:
- ~~~ https://www.FaceBook.com/Dr.FarFar
- ~~~ http://Dr-FarFar.BlogSpot.com/
- */
- ###################################################################################################
- IIS4 \ IIS5 CGI Environment Block Forged 0day
- About 14 years ago, until now found a 0day
- Is IIS4 \ IIS5 vulnerabilities and corresponding operating system is winnt win2000 system,
- Microsoft no longer supports the software, they want to eliminate these systems strategy,
- after 11 years of reporting Microsoft decided not to repair. Regarded as a very serious flaw,
- but the impact of software usage is now relatively low, but the total lot.
- Specific vulnerability details are as follows:
- IIS CGI environment block forgery vulnerability loaded
- Hazard Class: high-risk
- Hazard Type: Buffer overflow remote code execution, information disclosure
- Impact platform: Winnt \ win2000
- Affected Software: IIS4, IIS5
- The basic situation:
- IIS4, IIS5 loaded CGI, block processing environment when the error "\ n" characters with "\ x00" replaced,
- resulting in an arbitrary environment block can be forged. When IIS CGI-loaded,
- plus his own request "HTTP_" prefix added environment variables and local environment variables to distinguish,
- through the use of "\ n" replaced by "\ 0" loophole you can put these prefixes removed,
- thus any fake environment block variables.
- An attacker can submit http header "a = b \ nPATH_TRANSLATED: var" makes IIS CGI environment
- when loaded block variables become "HTTP_a = b" and "PATH_TRANSLATED = var",
- successfully forged environment block "PATH_TRANSLATED = var", let php.exe execute the script file "var",
- so as to execute arbitrary commands.
- CGI is loaded, there are two ways, one is itself compiled. Exe executable programs, some of these common counter,
- some sites to develop their own applications, there are some broad application of WEB applications, etc.
- There is also a generic script mapped to. EXE interpreted (mapped to. Dll is isapi, unaffected),
- these are common PHP \ PERL scripts.
- Partial results of specific harm to see the specific procedures for handling CGI environment block may result in:
- 1- CGI environment variables when dealing with a local buffer overflow some time to deal with local CGI environment variables,
- because these variables are generally not set or could have been credible,
- without considering the buffer size checks.
- 2- some environment variables affect the processing logic block some of CGI, trust relationships.
- 3- because the fake path environment variable to load the attacker's program or when loading dll loading process.
- Verification steps:
- 1- win2000 + iis5 configuration. Php mapped to php.exe (ie cgi way if alluding to. Dll is isapi way, there is no vulnerability)
- 2- the request is sent:
- "GET / a.php HTTP/1.1 \ r \ na = b \ nPATH_TRANSLATED: c: \ windows \ win.ini \ r \ nHOST: 192.168.0.1 \ r \ n \ r \ n"
- 3- iis will return win.ini content.
- 4- you can also use php iis log file write command
- to exploit this vulnerability allows execution php.exe call iis log file system commands.
- Exploit :
- http://pastebin.com/3GhrRwhA
- 1 April Fool's Day edition:
- http://seclists.org/fulldisclosure/2012/Apr/13
- Usage:
- . iisexp411 127.0.0.1 / AprilFools'Day php PATH_TRANSLATED c: \ windows \ win.ini
- ########################################################################################################################
- https://www.facebook.com/Dr.FarFar
- http://Dr-FarFar.BlogSpot.com/
- ________ __________ __________
- ___ __ \___________ ____/______ ____________ ____/______ _________
- __ / / /__ ___/__ /_ _ __ `/__ ___/__ /_ _ __ `/__ ___/
- _ /_/ / _ /___ _ __/ / /_/ / _ / _ __/ / /_/ / _ /
- /_____/ /_/ _(_)/_/ \__,_/ /_/ /_/ \__,_/ /_/
- ~\ Dr.FarFar /~
Advertisement
Add Comment
Please, Sign In to add comment