Created
August 9, 2015 02:08
-
-
Save adenvt/a0463386592b399bf02f to your computer and use it in GitHub Desktop.
Inject berbasis Python, *Bonus: Payload ISAT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
------------------------------------------------------------ | |
Title : OCS Pyn-ject | |
Author : CyberJutsu | |
Versi : 127.0.0.1 | |
This Project based of Pinhole Project by Simon Foster | |
------------------------------------------------------------ | |
""" | |
from socket import * | |
from threading import Thread | |
LISTEN = 1811 | |
P_HOST = '10.19.19.19' | |
P_PORT = 8080 | |
def log( s ): | |
print ( s ) | |
class PipeThread( Thread ): | |
pipes = [] | |
def __init__( self, source, sink ): | |
Thread.__init__( self ) | |
self.source = source | |
self.sink = sink | |
PipeThread.pipes.append( self ) | |
def run( self ): | |
while 1: | |
try: | |
rawdata = self.source.recv( 1024 ) | |
if not rawdata: break | |
netdata = (rawdata).strip() | |
if netdata.startswith('CONNECT'): | |
log('- Injecting Process. . .') | |
payload = ("[TARGET]\r\n\r\n" | |
"OPTIONS http://202.152.162.124/ HTTP/1.1\r\n" | |
"Host: 202.152.162.124\r\n" | |
"User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:20.0) Gecko/20100101 Firefox/20.0\r\n" | |
"Accept: */*\r\n" | |
"Accept-Language: en-US,en;1=0.5\r\n" | |
"Accept-Encoding: gzip, deflate\r\n" | |
"Connection: Keep-Alive\r\n\r\n\r\n").replace('[TARGET]', netdata) | |
self.sink.send( payload ) | |
else: | |
self.sink.send( rawdata ) | |
except: | |
break | |
PipeThread.pipes.remove( self ) | |
class TCPTunel( Thread ): | |
def __init__( self, port, newhost, newport ): | |
Thread.__init__( self ) | |
log('- 127.0.0.1:%s -> %s:%s' % ( port, newhost, newport )) | |
log('- Waiting For Connection . . .') | |
self.newhost = newhost | |
self.newport = newport | |
self.sock = socket( AF_INET, SOCK_STREAM ) | |
self.sock.bind(( '', port )) | |
self.sock.listen(5) | |
def run( self ): | |
while 1: | |
newsock, address = self.sock.accept() | |
fwd = socket( AF_INET, SOCK_STREAM ) | |
fwd.connect(( self.newhost, self.newport )) | |
PipeThread( newsock, fwd ).start() | |
PipeThread( fwd, newsock ).start() | |
if __name__ == '__main__': | |
log("----------------------------------------") | |
log("* OCS Pyn-Ject (Python Inject) *") | |
log("* versi 127.0.0.1 *") | |
log("* by : Cyber Jutsu *") | |
log("* Special Thank For : Simon Foster *") | |
log("----------------------------------------") | |
TCPTunel(LISTEN, P_HOST, P_PORT).start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment