Skip to content

Instantly share code, notes, and snippets.

View ZephrFish's full-sized avatar
🌐
Building tools and tradecraft to help red and blue

Andy ZephrFish

🌐
Building tools and tradecraft to help red and blue
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ZephrFish on github.
  • I am zephrfish (https://keybase.io/zephrfish) on keybase.
  • I have a public key whose fingerprint is FADA 204E 6BAE 1870 E42F D105 0DD0 B1CC 7DF5 ADC0

To claim this, I am signing this object:

@ZephrFish
ZephrFish / csv_generated_string_escape.py
Last active August 22, 2023 23:44 — forked from seanieb/csv_generated_string_escape.py
Prevent CSV Injection when suing user generated data
def escape_csv(payload):
if payload[0] in ('@','+','-', '=', '|'):
payload = "'" + payload
payload = payload.replace("|", "\|")
return payload
# Example
payload = "@cmd|' /C calc'!A0"
print("The Unescaped version is: " + payload)
print("When passed though escape function the value is: " + escape_csv(payload))
### Keybase proof
I hereby claim:
* I am ZephrFish on github.
* I am zephrfish (https://keybase.io/zephrfish) on keybase.
* I have a public key whose fingerprint is EC67 4DC5 F2F0 87E5 598B B920 ED66 4E92 D071 41CA
To claim this, I am signing this object: