Yet another useless script
10 posts
• Page 1 of 1
- OliVier2013
- Posts: 8
- Joined: Wed Mar 13, 2013 1:00
Yet another useless script
Hello,
we were recently talking on the server about how Python is superior to Lua in any way, and i don't know why but i sudently felt the need to produce an useless script.
So here we are: this script runs on a linux terminal and prints colored text according to the formating used in ET.
https://gist.githubusercontent.com/Ododo/32162a34a82177bff76b5e654f402eda/raw/9a0ee9b7a3c7b597169351664ec34175b358cd8e/etprint.py
echo -n ^3Oli^8Vi^@er | ./etprint.py
Plz tell me if you find mistakes or if you can help me improving the script !
You are ofc, encouraged to do the same in Lua
we were recently talking on the server about how Python is superior to Lua in any way, and i don't know why but i sudently felt the need to produce an useless script.
So here we are: this script runs on a linux terminal and prints colored text according to the formating used in ET.
https://gist.githubusercontent.com/Ododo/32162a34a82177bff76b5e654f402eda/raw/9a0ee9b7a3c7b597169351664ec34175b358cd8e/etprint.py
echo -n ^3Oli^8Vi^@er | ./etprint.py
- Enemy Territory Code: Select all
OliVier
Plz tell me if you find mistakes or if you can help me improving the script !
You are ofc, encouraged to do the same in Lua
Re: Yet another useless script
!@#$ LUA. I have a funny one for you.
Compile and pipe.
- Code: Select all
char c[] = "\x48\x83\xec\x08\xe8\x73\x00\x00\x00\xe8\x02\x01\x00\x00\xe8\xed\x01\x00\x00\x48\x83\xc4\x08\xc3\xff\x35\xba\x04\x20\x00\xff\x25\xbc\x04\x20\x00\x0f\x1f\x40\x00\xff\x25\xba\x04\x20\x00\x68\x00\x00\x00\x00\xe9\xe0\xff\xff\xff\xff\x25\xb2\x04\x20\x00\x68\x01\x00\x00\x00\xe9\xd0\xff\xff\xff\x31\xed\x49\x89\xd1\x5e\x48\x89\xe2\x48\x83\xe4\xf0\x50\x54\x49\xc7\xc0\xf0\x04\x40\x00\x48\xc7\xc1\x00\x05\x40\x00\x48\xc7\xc7\xc4\x04\x40\x00\xe8\xaf\xff\xff\xff\xf4\x90\x90\x48\x83\xec\x08\x48\x8b\x05\x41\x04\x20\x00\x48\x85\xc0\x74\x02\xff\xd0\x48\x83\xc4\x08\xc3\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x55\x48\x89\xe5\x53\x48\x83\xec\x08\x80\x3d\x50\x04\x20\x00\x00\x75\x4b\xbb\xb8\x06\x60\x00\x48\x8b\x05\x4a\x04\x20\x00\x48\x81\xeb\xb0\x06\x60\x00\x48\xc1\xfb\x03\x48\x83\xeb\x01\x48\x39\xd8\x73\x24\x66\x0f\x1f\x44\x00\x00\x48\x83\xc0\x01\x48\x89\x05\x25\x04\x20\x00\xff\x14\xc5\xb0\x06\x60\x00\x48\x8b\x05\x17\x04\x20\x00\x48\x39\xd8\x72\xe2\xc6\x05\x03\x04\x20\x00\x01\x48\x83\xc4\x08\x5b\xc9\xc3\x66\x66\x66\x2e\x0f\x1f\x84\x00\x00\x00\x00\x00\x48\x83\x3d\x18\x02\x20\x00\x00\x55\x48\x89\xe5\x74\x12\xb8\x00\x00\x00\x00\x48\x85\xc0\x74\x08\xbf\xc0\x06\x60\x00\xc9\xff\xe0\xc9\xc3\x90\x90\x55\x48\x89\xe5\xb8\x65\x00\x00\x00\x48\x0f\xbe\xc0\xba\x00\x00\x00\x00\x48\x89\xc6\xbf\xe8\x05\x40\x00\xe8\xe5\xfe\xff\xff\x90\xc9\xc3\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\xf3\xc3\x66\x66\x66\x66\x66\x2e\x0f\x1f\x84\x00\x00\x00\x00\x00\x48\x89\x6c\x24\xd8\x4c\x89\x64\x24\xe0\x48\x8d\x2d\x8b\x01\x20\x00\x4c\x8d\x25\x84\x01\x20\x00\x4c\x89\x6c\x24\xe8\x4c\x89\x74\x24\xf0\x4c\x89\x7c\x24\xf8\x48\x89\x5c\x24\xd0\x48\x83\xec\x38\x4c\x29\xe5\x41\x89\xfd\x49\x89\xf6\x48\xc1\xfd\x03\x49\x89\xd7\xe8\x4b\xfe\xff\xff\x48\x85\xed\x74\x1c\x31\xdb\x0f\x1f\x40\x00\x4c\x89\xfa\x4c\x89\xf6\x44\x89\xef\x41\xff\x14\xdc\x48\x83\xc3\x01\x48\x39\xeb\x72\xea\x48\x8b\x5c\x24\x08\x48\x8b\x6c\x24\x10\x4c\x8b\x64\x24\x18\x4c\x8b\x6c\x24\x20\x4c\x8b\x74\x24\x28\x4c\x8b\x7c\x24\x30\x48\x83\xc4\x38\xc3\x90\x90\x90\x90\x90\x90\x90\x55\x48\x89\xe5\x53\x48\x83\xec\x08\x48\x8b\x05\x00\x01\x20\x00\x48\x83\xf8\xff\x74\x19\xbb\xa0\x06\x60\x00\x0f\x1f\x44\x00\x00\x48\x83\xeb\x08\xff\xd0\x48\x8b\x03\x48\x83\xf8\xff\x75\xf1\x48\x83\xc4\x08\x5b\xc9\xc3\x90\x90\x48\x83\xec\x08\xe8\x5f\xfe\xff\xff\x48\x83\xc4\x08\xc3";
void main(void)
{
int (*e)();
e = (int (*)())c;
(int)(*e)();
}
Compile and pipe.
Re: Yet another useless script
"Football is a simple game; 22 men chase a ball for 90 minutes and at the end, the Germans always win." - Gary Lineker
Re: Yet another useless script
lazy-lion wrote:ckEy wrote:speaking of python, http://codepad.org/xaR0xK4n
get rekt , http://codepad.org/606cM9JV
lel, burned!
- OliVier2013
- Posts: 8
- Joined: Wed Mar 13, 2013 1:00
Re: Yet another useless script
empy wrote:Uhhh????!!!
Bumble wrote:what hell is this?????
The string stored in variable c is called a "ShellCode": it's a sequence of bytes that your computer can understand and execute.
To know what it does exactly is a little bit complexe and require time and knowledge in assembly language. (So basically do not run this program \o/)
This kind of strings are mainly used by hackers : for example sometimes a program or a service running with high privileges on a system do not handle users inputs correctly and
can allow malicious code execution from a low priviledge user.
The rest of the code is just a C trick to execute the shellcode.
ckEy wrote:
- Code: Select all
int (*e)(); // We declare a pointer e to a function that returns an integer and accept no argument, the function is not defined here
e = (int (*)())c; // we interpret c (the shellcode) as a pointer to a function (lets say a function whose code is the bytes sequence) and we store that in e.
(int)(*e)(); // we execute our function through the pointer e. or we can do just (*e)() or even e() since i think C ANSI accept calling function pointer like function.
Re: Yet another useless script
OliVier2013 wrote:empy wrote:Uhhh????!!!Bumble wrote:what hell is this?????
The string stored in variable c is called a "ShellCode": it's a sequence of bytes that your computer can understand and execute.
To know what it does exactly is a little bit complexe and require time and knowledge in assembly language. (So basically do not run this program \o/)
This kind of strings are mainly used by hackers : for example sometimes a program or a service running with high privileges on a system do not handle users inputs correctly and
can allow malicious code execution from a low priviledge user.
The rest of the code is just a C trick to execute the shellcode.
what it does is easy when you transform it into opcodes for amd64; basically syscalls to the following effect:
- Code: Select all
execve("/usr/bin/python", *"etprint.py", (char **)NULL);
10 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests