Created
June 26, 2019 07:26
-
-
Save Green-m/d7a38c13ad9f2a78d0df3c120d291ac4 to your computer and use it in GitHub Desktop.
enum php web magic chars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list = ("a".."z").to_a + ("A".."Z").to_a | |
chars = "'!@#$%&*()+{}|:\">?<[]\\\';,.`~'," | |
def xor(a, b) | |
(a.ord ^ b.ord).chr | |
end | |
list.each do |l| | |
chars.chars.each do |i| | |
chars.chars.each do |j| | |
if xor(i, j) == l | |
puts "#{l} == #{i} ^ #{j}" | |
break | |
#else | |
#puts "#{l}(#{l.ord}) not found" | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment